From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id E4BC2C636D7 for ; Fri, 10 Feb 2023 17:30:23 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 6E20A6B0164; Fri, 10 Feb 2023 12:30:23 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 690A36B0165; Fri, 10 Feb 2023 12:30:23 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 581A46B0166; Fri, 10 Feb 2023 12:30:23 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0011.hostedemail.com [216.40.44.11]) by kanga.kvack.org (Postfix) with ESMTP id 48FDC6B0164 for ; Fri, 10 Feb 2023 12:30:23 -0500 (EST) Received: from smtpin19.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay06.hostedemail.com (Postfix) with ESMTP id F19E5AB943 for ; Fri, 10 Feb 2023 17:30:22 +0000 (UTC) X-FDA: 80452071084.19.EACA878 Received: from frasgout.his.huawei.com (frasgout.his.huawei.com [185.176.79.56]) by imf09.hostedemail.com (Postfix) with ESMTP id ED1F014002D for ; Fri, 10 Feb 2023 17:30:20 +0000 (UTC) Authentication-Results: imf09.hostedemail.com; dkim=none; spf=pass (imf09.hostedemail.com: domain of jonathan.cameron@huawei.com designates 185.176.79.56 as permitted sender) smtp.mailfrom=jonathan.cameron@huawei.com; dmarc=pass (policy=quarantine) header.from=huawei.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1676050221; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=QFswVFtgtOMW9lCzE6d9/yFVuaRxvWAbFhtGUfDTPTs=; b=Uonw/I9t8he7R38GZTi4Wm7TRit7UF3peEJbUGf+3kB7Dcoh2r5LVMzoDHUap7XT5bbim3 kLIqpBhIsxdoPZZyGTEeZPV/KRuqwtANyr1/oNddRGlFy6CUT3yo/ThpWd6rbvQSgfgsvm Yjc1MZ6ixGqyUkAmYPnPoHqMCVZeD+s= ARC-Authentication-Results: i=1; imf09.hostedemail.com; dkim=none; spf=pass (imf09.hostedemail.com: domain of jonathan.cameron@huawei.com designates 185.176.79.56 as permitted sender) smtp.mailfrom=jonathan.cameron@huawei.com; dmarc=pass (policy=quarantine) header.from=huawei.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1676050221; a=rsa-sha256; cv=none; b=NKwRRYGfrysLM5ebv7QjwxwDuPI0i0a7jWzxGRXKhc4cEc9zCBvdGk8Fyf0sadRPfIITOg +kYYzbOJQVQ9c+KQBtlBNahr5KqKqF8yhP5A/Ebw2jgyc6WwRbYpA2hy0qP/PBTQI8SsbX ph+HzWuRyW5qma8ZT9EiSDlUpRkHrKY= Received: from lhrpeml500005.china.huawei.com (unknown [172.18.147.207]) by frasgout.his.huawei.com (SkyGuard) with ESMTP id 4PD11D39ltz6J9nd; Sat, 11 Feb 2023 01:28:48 +0800 (CST) Received: from localhost (10.81.210.211) by lhrpeml500005.china.huawei.com (7.191.163.240) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.17; Fri, 10 Feb 2023 17:30:17 +0000 Date: Fri, 10 Feb 2023 17:30:16 +0000 From: Jonathan Cameron To: Dan Williams CC: , Vishal Verma , "Fan Ni" , , , Subject: Re: [PATCH v2 04/20] cxl/region: Support empty uuids for non-pmem regions Message-ID: <20230210173016.000040d2@Huawei.com> In-Reply-To: <167601994558.1924368.12612811533724694444.stgit@dwillia2-xfh.jf.intel.com> References: <167601992097.1924368.18291887895351917895.stgit@dwillia2-xfh.jf.intel.com> <167601994558.1924368.12612811533724694444.stgit@dwillia2-xfh.jf.intel.com> Organization: Huawei Technologies Research and Development (UK) Ltd. X-Mailer: Claws Mail 4.1.0 (GTK 3.24.33; x86_64-w64-mingw32) MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit X-Originating-IP: [10.81.210.211] X-ClientProxiedBy: lhrpeml500001.china.huawei.com (7.191.163.213) To lhrpeml500005.china.huawei.com (7.191.163.240) X-CFilter-Loop: Reflected X-Rspam-User: X-Rspamd-Server: rspam03 X-Stat-Signature: b533pekieipt6xxri4df8w3p4kf6xfgq X-Rspamd-Queue-Id: ED1F014002D X-HE-Tag: 1676050220-268228 X-HE-Meta: U2FsdGVkX18KuofW7weVcG5dHgvXM9wdBXWmoBJlHYy/5UmCKzyG8hPtQRQMxi1iQuOrlPvdDjiqlxfNb0OG3vFY7ajImmn9uU3Xb6jVQnSr/lEpyv8zrhzenZTic8RJkJmECmbp2SI9wz8HYi2DraCrcyBT8BSLXHwUAoZ+XHWuGY2lwIJbzv3W83VePsZiRYmF6tnzjmhlyGyoF5BCX84njHpV1z4g3gzMTWvSX4iFJbQUOf5N+BsS2f6uii3/bZRVj+vI8KIENZUn2JUgr1UTiqMA+QJxhoo7FX6W4DV6IbJ/YZuLzqWM8qsq/trvJxd9qK8nEnWkJmZy8miTfIeg231DEb8vrV2IMYpmqPRCQRTo1JZv2RHEnwqIPwO4uNZKMOU3JiiweLDDPrZ4VLJyhE2230Ev+hollaxPSqfzQ7PlUWdAKPgg8vn2FBHYbFQ4cbapq/Yj1on1Iq0bcKrJF/WwCiTmvpXW0ElWhfH6xYNJC50NPphzXgIkgva80qp+6Htm91lh6VrNdsOKnxDmW+5jcT7xcJklhr8PPd54vaK2i8HHZc30WdjFW5Vyc8u9MOCZ6/reN52arVtevsIvCJ5vqO8t7267qm0NWVFVBiPIKVZkg1S8Ifjltl9q+yWW7rWniKpPHi+F+RIxhikJV3m42B3gr2tWolC7Lfru+iKPT5+EbpQ6A34YxDR6mzX2DxKhLmrblqVU4DAugb0dtGCt1ILkaMl5wPB97hW/DWhZ/SXky1nbNhcyX2gFAy4qVgZGGSjy0dbH4nTyL3zoomnZv19VO4XDa3wcaNH417aq8IJ8XOKTCNt6jFUjUDC/E/jfN7UEaw3tfE+WHRmGiEmnOyE9wSE6qpbGnxvBYdRxmwSVFMe7pcF6M24MV5i8vgu6ePrsdGg85cGg0tENK/RvROVy4ldvM1CpUZoX4fG7igs/WbJxoS/wsufxzlYD6uI2k55/pohRpJR nS1wJ6cw zV457K23EV0N0pmukKyy1DgTbYv2IFHQiJuzbkGxIMW4i3lMReZC0wM+pMvVUkG3rFPCqpoNilLi3gEuComRdSdL8NyGdlHrlVawdBpcJMqYxpGYbfPbHw552rP+ie9ERZuELBtNgAg/iJsDTcUtg9jNWI1DPgKXnQssJBwGwxa7ZPW9avG4rV8yA1dVgO2GxogFESphcSZM+SfaOLAF2bgWe8JdKNA+jpvHE7IJ4b2HbaAXwxm3IVVnNl2Zx2pgwVS15XmyT7O9Or71AXVVlIRxRW3ba7SfDx4+JSXWy1y+9KYFMXVDFFvZiGrCO3CP14440KeYgpNrLpLDftDGc0iE03OmqI6N0a8nIIbqVW1SgRI4VBvWdQwX+xA== X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Fri, 10 Feb 2023 01:05:45 -0800 Dan Williams wrote: > Shipping versions of the cxl-cli utility expect all regions to have a > 'uuid' attribute. In preparation for 'ram' regions, update the 'uuid' > attribute to return an empty string which satisfies the current > expectations of 'cxl list -R'. Otherwise, 'cxl list -R' fails in the > presence of regions with the 'uuid' attribute missing. Force the > attribute to be read-only as there is no facility or expectation for a > 'ram' region to recall its uuid from one boot to the next. > > Reviewed-by: Vishal Verma > Tested-by: Fan Ni > Link: https://lore.kernel.org/r/167564536587.847146.12703125206459604597.stgit@dwillia2-xfh.jf.intel.com > Signed-off-by: Dan Williams After your explanations in v1 thread, I'm fine with this. Just another bit of slightly inelegant ABI that we are stuck with. Reviewed-by: Jonathan Cameron > --- > Documentation/ABI/testing/sysfs-bus-cxl | 3 ++- > drivers/cxl/core/region.c | 11 +++++++++-- > 2 files changed, 11 insertions(+), 3 deletions(-) > > diff --git a/Documentation/ABI/testing/sysfs-bus-cxl b/Documentation/ABI/testing/sysfs-bus-cxl > index 058b0c45001f..4c4e1cbb1169 100644 > --- a/Documentation/ABI/testing/sysfs-bus-cxl > +++ b/Documentation/ABI/testing/sysfs-bus-cxl > @@ -317,7 +317,8 @@ Contact: linux-cxl@vger.kernel.org > Description: > (RW) Write a unique identifier for the region. This field must > be set for persistent regions and it must not conflict with the > - UUID of another region. > + UUID of another region. For volatile ram regions this > + attribute is a read-only empty string. > > > What: /sys/bus/cxl/devices/regionZ/interleave_granularity > diff --git a/drivers/cxl/core/region.c b/drivers/cxl/core/region.c > index 17d2d0c12725..0fc80478ff6b 100644 > --- a/drivers/cxl/core/region.c > +++ b/drivers/cxl/core/region.c > @@ -45,7 +45,10 @@ static ssize_t uuid_show(struct device *dev, struct device_attribute *attr, > rc = down_read_interruptible(&cxl_region_rwsem); > if (rc) > return rc; > - rc = sysfs_emit(buf, "%pUb\n", &p->uuid); > + if (cxlr->mode != CXL_DECODER_PMEM) > + rc = sysfs_emit(buf, "\n"); > + else > + rc = sysfs_emit(buf, "%pUb\n", &p->uuid); > up_read(&cxl_region_rwsem); > > return rc; > @@ -300,8 +303,12 @@ static umode_t cxl_region_visible(struct kobject *kobj, struct attribute *a, > struct device *dev = kobj_to_dev(kobj); > struct cxl_region *cxlr = to_cxl_region(dev); > > + /* > + * Support tooling that expects to find a 'uuid' attribute for all > + * regions regardless of mode. > + */ > if (a == &dev_attr_uuid.attr && cxlr->mode != CXL_DECODER_PMEM) > - return 0; > + return 0444; > return a->mode; > } > > >