Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp4198144pxj; Tue, 11 May 2021 23:30:31 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxvIYLNLJIlvquyJ6PLcE7JqvF6EKRejt/SB8bb0hlXKMsKtNPmTZsLZRpG87No5hviBnJv X-Received: by 2002:a92:603:: with SMTP id x3mr29553407ilg.215.1620801031223; Tue, 11 May 2021 23:30:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1620801031; cv=none; d=google.com; s=arc-20160816; b=ko/mZUDxDhIV+ZK702Sxg4VYPffCJSQowwMUQcXpYNNDsVSizjXuRheMtTRiXPJ1cy 2h7as85406qXzIM3/VNpXU+klz6eQo16nNbuf4s4j8p/2+tND5K3taDNNZgb3q9OROM/ k4871rT69cpiXzX6Wp94ZmwS98FNEWI+KtfpsX5LMvBE56aDiglEmmkLAdhJJ1pITU8d tPe0c7JgzwcUnr8Bu5KG9zigvTMsq0Cuxai/6J8Q2RCVBwrf5aX4b7j4fJSstsVXgkj5 I55pNAZR56bp/Gx0DiLOr+2kF1xXeaf6Y/KVVECDpYn6qjpOF44FHI6UCvP7ULyztShy d0xA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=FVKY/8OJFn/AVdYg/I2U6wFa/UltzqiJOYIbxas+wEU=; b=S8HftZKz23eVOrF2IUyfsujWC6VuI1aQiUGWzmYeHsEX7+27NpZsNromx38ZsdktGh rUAZcPIi5EYLc+4vVgPaYGjohJ6uS7uzYXrEBgG23g1cdp0Yd+PwRJCQDp8+3TLfKHEI hX3dqG6p4hhy5jLDmkjRmc1jVAuKH/CAjJ+U4Hxu6Q0DUWKpxxUAcQYsGWV4dpK8acJr uSbmAD8vI2REW9fdODsSfFGdHalvMem+Lfne7iLsOkc2E6Er/QQ40Sl7j/AOlIPfW6Nn qeZkMdkkiAbWYPAYPQXVyEO9oLAa9oRBe7hPHv/MFbMOTEDw/D4Ig1M7+mxVZ+IM3rXk NMxw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel-com.20150623.gappssmtp.com header.s=20150623 header.b=yYdoQ0XO; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id j14si21899908ils.113.2021.05.11.23.30.17; Tue, 11 May 2021 23:30:31 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@intel-com.20150623.gappssmtp.com header.s=20150623 header.b=yYdoQ0XO; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230075AbhELGaw (ORCPT + 99 others); Wed, 12 May 2021 02:30:52 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38710 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229626AbhELGav (ORCPT ); Wed, 12 May 2021 02:30:51 -0400 Received: from mail-ej1-x634.google.com (mail-ej1-x634.google.com [IPv6:2a00:1450:4864:20::634]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 31E71C061574 for ; Tue, 11 May 2021 23:29:44 -0700 (PDT) Received: by mail-ej1-x634.google.com with SMTP id m12so33315248eja.2 for ; Tue, 11 May 2021 23:29:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=intel-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=FVKY/8OJFn/AVdYg/I2U6wFa/UltzqiJOYIbxas+wEU=; b=yYdoQ0XOKaW4HcjPMnq93wc7+gItMahnbROPanX3KqYLjQuDGmimm7lbH816+fbqhn kci5LkuqFtzFZI4hjsKtNQe73fB74qX8p43uQ5/mhHSj1HbkfzNbYcsdDXEWii6tJX3g jiMOqiQeX/XT7ldlFlcutczVHa/kStKJhOdk0RFSBvQeQyne0fkF/DPWR3N+mCF4felH pll/YYLAz87XWt/AE7w8oMIb6FC7rpeJDlTQtJ/qVfHkN5fHWdJuWYfP1GF5jTfL/OFl KTecmwaX5KB7rbu5U0i+nOEZeMBJ1F4gfTgcR9fvKLaDmhYrLK8b+0U3AerOFqEpBaur N16A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=FVKY/8OJFn/AVdYg/I2U6wFa/UltzqiJOYIbxas+wEU=; b=qhscMp0ohCqZylYwqK7DNahl4YAgLE89aYtNOUv98lZSXswmoVoGaxc9WarS8YeVBO PINbQ3B36XSxNTRUClYvZXqTUFlMgeGAPJC1AhfVn4uQn7YyLFpoKuxatxRKBMw+zYgF hSFRxa0qbaIH2izU+SGQITmrGI2jUM/xjFRKpHjG9DhSPnq0lqa4FmDCBuwVgX8Wmud6 0us6ZOyrcVxSQFrOQEljKchtlCMsiWwbRqNlm8c2N+UDffym86j8MYghsksrP62oJ+5l o/A44rDnRPNTQd+U+nomQlFSihT1FkG0SBWbd8UCkFNhpY2zL2dS0/++WxaLsVKEnTM1 23NA== X-Gm-Message-State: AOAM531tPJom2G0MDM53FGa+zdyWrszMs43hE7MAdTTDkkj0+TZgo+O+ CxCrQrxFspRdl0YYtRYZ/hVgo18wmGJxDx5VV5Mqag== X-Received: by 2002:a17:906:bc8e:: with SMTP id lv14mr35714177ejb.418.1620800982974; Tue, 11 May 2021 23:29:42 -0700 (PDT) MIME-Version: 1.0 References: <162042787450.1202325.5718541949681409566.stgit@dwillia2-desk3.amr.corp.intel.com> <162042790793.1202325.13507889482183963289.stgit@dwillia2-desk3.amr.corp.intel.com> <20210510155615.000001fc@Huawei.com> In-Reply-To: <20210510155615.000001fc@Huawei.com> From: Dan Williams Date: Tue, 11 May 2021 23:29:32 -0700 Message-ID: Subject: Re: [PATCH 5/8] cxl/acpi: Introduce ACPI0017 driver and cxl_root To: Jonathan Cameron Cc: linux-cxl@vger.kernel.org, Linux PCI , Linux Kernel Mailing List , Linux ACPI Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, May 10, 2021 at 7:58 AM Jonathan Cameron wrote: > > On Fri, 7 May 2021 15:51:47 -0700 > Dan Williams wrote: > > > While CXL builds upon the PCI software model for dynamic enumeration and > > control, a static platform component is required to bootstrap the CXL > > memory layout. In addition to identifying the host bridges ACPI is > > responsible for enumerating the CXL memory space that can be addressed > > by decoders. This is similar to the requirement for ACPI to publish > > resources reported by _CRS for PCI host bridges. > > > > Introduce the cxl_root object as an abstract "port" into the CXL.mem > > address space described by HDM decoders identified by the ACPI > > CEDT.CHBS. > > > > For now just establish the initial boilerplate and sysfs attributes, to > > be followed by enumeration of the ports within the host bridge. > > > > Note the allocation of CXL core device objects is split into separate > > alloc and add steps in order to separate the alloc error path (kfree()) > > from the device add error path (put_device()). > > > > Signed-off-by: Dan Williams > > Hi Dan > > Just one bit in here that confused me (assuming I'm reading the code correctly). > You have is_visible for the dev_attr_supports_pmem etc to only show them if > the particular space supports that memory type. That's fine. You also have > the actual sysfs function checking the same flag to decide to return "1" or "0" > which would also be fine, but in combination it's rather odd as the sysfs > read function can never return "0" (sysfs attribute isn't visible in that > condition). Probably deserves at least a comment. Ok. That was deliberate since it's trivial to code and allows the visibility policy to change without needing to go audit the attributes that assumed invisibility. However, yes, it deserves a comment to save brain cycles with that "hmm, that's odd" in the future. > This also needs some documentation for the new sysfs ABI > (Documentation/ABI/...) but that can be in a separate patch. True. > > Otherwise looks good to me. Thanks.