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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6F0E7C4332F for ; Mon, 7 Nov 2022 15:58:35 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232374AbiKGP6d (ORCPT ); Mon, 7 Nov 2022 10:58:33 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52646 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232518AbiKGP6c (ORCPT ); Mon, 7 Nov 2022 10:58:32 -0500 Received: from frasgout.his.huawei.com (frasgout.his.huawei.com [185.176.79.56]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 27B631FFAA for ; Mon, 7 Nov 2022 07:58:28 -0800 (PST) Received: from frapeml500002.china.huawei.com (unknown [172.18.147.226]) by frasgout.his.huawei.com (SkyGuard) with ESMTP id 4N5bSG3Bxbz687Gp; Mon, 7 Nov 2022 23:56:14 +0800 (CST) Received: from lhrpeml500005.china.huawei.com (7.191.163.240) by frapeml500002.china.huawei.com (7.182.85.205) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.31; Mon, 7 Nov 2022 16:58:26 +0100 Received: from localhost (10.202.227.76) 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.2375.31; Mon, 7 Nov 2022 15:58:25 +0000 Date: Mon, 7 Nov 2022 15:58:24 +0000 From: Jonathan Cameron To: Dave Jiang CC: , , , , , , , Subject: Re: [PATCH v2 17/19] cxl/pmem: add provider name to cxl pmem dimm attribute group Message-ID: <20221107155824.000043c5@Huawei.com> In-Reply-To: <166377438921.430546.5550361331475412529.stgit@djiang5-desk3.ch.intel.com> References: <166377414787.430546.3863229455285366312.stgit@djiang5-desk3.ch.intel.com> <166377438921.430546.5550361331475412529.stgit@djiang5-desk3.ch.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.202.227.76] X-ClientProxiedBy: lhrpeml500003.china.huawei.com (7.191.162.67) To lhrpeml500005.china.huawei.com (7.191.163.240) X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-cxl@vger.kernel.org On Wed, 21 Sep 2022 08:33:09 -0700 Dave Jiang wrote: > Add provider name in order to associate cxl test dimm from cxl_test to the > cxl pmem device when going through sysfs for security testing. sysfs ABI docs update? > > Signed-off-by: Dave Jiang > --- > drivers/cxl/pmem.c | 10 ++++++++++ > 1 file changed, 10 insertions(+) > > diff --git a/drivers/cxl/pmem.c b/drivers/cxl/pmem.c > index 9f34f8701b57..cb303edb925d 100644 > --- a/drivers/cxl/pmem.c > +++ b/drivers/cxl/pmem.c > @@ -48,6 +48,15 @@ static void unregister_nvdimm(void *nvdimm) > cxl_nvd->bridge = NULL; > } > > +static ssize_t provider_show(struct device *dev, struct device_attribute *attr, char *buf) > +{ > + struct nvdimm *nvdimm = to_nvdimm(dev); > + struct cxl_nvdimm *cxl_nvd = nvdimm_provider_data(nvdimm); > + > + return sysfs_emit(buf, "%s\n", dev_name(&cxl_nvd->dev)); > +} > +static DEVICE_ATTR_RO(provider); > + > static ssize_t id_show(struct device *dev, struct device_attribute *attr, char *buf) > { > struct nvdimm *nvdimm = to_nvdimm(dev); > @@ -61,6 +70,7 @@ static DEVICE_ATTR_RO(id); > > static struct attribute *cxl_dimm_attributes[] = { > &dev_attr_id.attr, > + &dev_attr_provider.attr, > NULL > }; > > >