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 30B39C636D4 for ; Mon, 6 Feb 2023 15:54:57 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 879566B007D; Mon, 6 Feb 2023 10:54:56 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 828BD6B007E; Mon, 6 Feb 2023 10:54:56 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 717B06B0080; Mon, 6 Feb 2023 10:54:56 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0012.hostedemail.com [216.40.44.12]) by kanga.kvack.org (Postfix) with ESMTP id 628336B007D for ; Mon, 6 Feb 2023 10:54:56 -0500 (EST) Received: from smtpin24.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay06.hostedemail.com (Postfix) with ESMTP id 2F134AABD8 for ; Mon, 6 Feb 2023 15:54:56 +0000 (UTC) X-FDA: 80437315392.24.F2DBD74 Received: from frasgout.his.huawei.com (frasgout.his.huawei.com [185.176.79.56]) by imf24.hostedemail.com (Postfix) with ESMTP id 2392F18001B for ; Mon, 6 Feb 2023 15:54:53 +0000 (UTC) Authentication-Results: imf24.hostedemail.com; dkim=none; spf=pass (imf24.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=1675698894; 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=94Y3jdvAffBefMSzcQ4yTWYRg3k1IOqpXjzW+cScH4M=; b=FAd10ovayXD6hpm4tE4ZoXdE/DAdoyxVhkWoji+7VutJLAjUTI8Kc2wJy2fHs2dSXN2cXz vyJO0rwbFD+BU8Fe5RwlNmHn8sT9kw47Neb7y/jseYKHEC4oEzXBDuf4VEVdtlxRQMCp4e Xv8DKkzzF3Yt5sWDy9YbZn+JT0V077M= ARC-Authentication-Results: i=1; imf24.hostedemail.com; dkim=none; spf=pass (imf24.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=1675698894; a=rsa-sha256; cv=none; b=rkgGulyiyOCoLW1iIj7f/M4OzOhLFqy64OT34F+tZ41BDQRNC8RhlpFljzP4F8kI8csFcD Fph7ah+5WZ+CrGKQxhKNM9DUFckkv0mBJJ9x6H8q4q6FKUpyt/Ips4tHPDIhT1d9C5dXjD ED3RS9MwpQYoId7AEG6/8vfcJ+77s+Y= Received: from lhrpeml500005.china.huawei.com (unknown [172.18.147.207]) by frasgout.his.huawei.com (SkyGuard) with ESMTP id 4P9W1b3GvHz6J7dZ; Mon, 6 Feb 2023 23:50:27 +0800 (CST) Received: from localhost (10.81.207.58) 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; Mon, 6 Feb 2023 15:54:49 +0000 Date: Mon, 6 Feb 2023 15:54:48 +0000 From: Jonathan Cameron To: Dan Williams CC: , , , Subject: Re: [PATCH 03/18] cxl/region: Support empty uuids for non-pmem regions Message-ID: <20230206155448.00007dfe@Huawei.com> In-Reply-To: <167564536587.847146.12703125206459604597.stgit@dwillia2-xfh.jf.intel.com> References: <167564534874.847146.5222419648551436750.stgit@dwillia2-xfh.jf.intel.com> <167564536587.847146.12703125206459604597.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.207.58] X-ClientProxiedBy: lhrpeml500005.china.huawei.com (7.191.163.240) To lhrpeml500005.china.huawei.com (7.191.163.240) X-CFilter-Loop: Reflected X-Stat-Signature: 5czhote5fkwbcfjazzqtm5wygx8eaq7s X-Rspam-User: X-Rspamd-Queue-Id: 2392F18001B X-Rspamd-Server: rspam06 X-HE-Tag: 1675698893-568440 X-HE-Meta: U2FsdGVkX1+50Eh8POBYpYxFazKpLd9tRZRfGL8cqVht64NgU8CUnTLe6MGNbNS9SgOpfGQs7PFr6jiFssunAQGoV+3b1JymSN+bUS7urOnjBGgh89CVAkHQ6cZilyvPhNJbthEpEFWmRZFZkO9uI6I/pmJT8noN6n+bZHgQfIawEbD5GGCs0XPyKHHzAaTtglnY1y4CuGYKJahyr3cvD7jUq0+A8m0fYu0QWqaq+e/C/B93UK2cx2yo/fLqWNXk4VHursvik6oVQfgEee1tqmXOr5nbReE7m+YiVoLshGXPaDe3ezI59DIoP3AahEy7GVqiJ4AUslmkThfU8mnkOc+u1EuANKmErL9WireMSq+1QvxoGdmDYyxO2j90C9xz+w+LgKnax+uxKBECJXfGgvetjihFBKpJK6j+QlTb2sDjJUfVI8pXqWJZPeiOz/ihTMYkV979JLjOI8eUe7FnGTU7A4ORGWE/G3SazqQU7XbZ2+speeV38BSQNkKw+S8G6yoxhiIeARwn0uVB8OSFqk7k9gBWuiyrl7CPS39no4hxzG2Z+oNAW8n3wytssNgjL0eU0j/B+BH1rmEaKxYTPj/ByABASBVEpikXC6+tZycGVz5rxKn02XcUJ7zYfgsfgNfJhOzHNHkMHG8MefCfe9SwUBb8HvhFs5IMzkMLtJ5SMmwK4rfpjfzHqMMXe5mvC9U0xAymTopc0QLxuZd8lLDEuvIDmTaIQFxH8zOBJaxzxIc4+I/NZnJXh7HozlbElc8odjyzKVNnQYkZa4yzsa00xfZVC63TVOtwm1ChcRLznnqPF0SNd7WbnkdnkJkOaV3WxtavEKh5Dwl2gB5H5rzA1t0QckfKPjoowlNC0aF2foZ08DB6px0jxdaD3qCn2bROdPTe2Nv9v862yffzlJmSNUxFao8xzU3a2h0dedh42qcooQFTxiYYbo3+r77lkwPutkpAjs++DUwO4jq csErGcTC s4hrSYazalepNdI3AKtIz+rNdF7ErSdfvskoI3dai28EjVOKnb2pfQN7XPSoq2CXZaxQ5oT1wOTSuTWzVC/ntr8V4GznVRRKciSZ7ybD9zijOfBDkyRbECU3qHzdy8wFGl0DI0qKD+dsv/uwX0gXx2SuEtd5gELA23iYQFWwSDbR6M7J2YgEri2m4aZ37Y7D9xAlpFAbLLvBanRN/JdBLDasNJqKY9tXQnipijUdUnm1kEHE2VerfSrJ7A+XMYs4NHFGcl86UgOVhWkiT196FouL+4FX5RbXSRtdlRp2ImSpIhW4ZuW3hg4ZvymkPphaEeZRYxWtKtf/fQYc= 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 Sun, 05 Feb 2023 17:02: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. This is new functionality, so do we need the backwards compatibility? Or does that cxl list -R not just skip these, but fail hard? It's inelegant to have this visible at all (and it confused me when I was running tests as I assumed I needed to poke something in it). If nothing else, good to have a comment to remind us in the code why there is the oddity of setting it to read only. Jonathan > > Signed-off-by: Dan Williams > --- > Documentation/ABI/testing/sysfs-bus-cxl | 3 ++- > drivers/cxl/core/region.c | 7 +++++-- > 2 files changed, 7 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..c9e7f05caa0f 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; > @@ -301,7 +304,7 @@ static umode_t cxl_region_visible(struct kobject *kobj, struct attribute *a, > struct cxl_region *cxlr = to_cxl_region(dev); > > if (a == &dev_attr_uuid.attr && cxlr->mode != CXL_DECODER_PMEM) > - return 0; > + return 0444; Definitely a comment here as this is very odd and we may forget why it is like this. > return a->mode; > } > >