[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <00c0910dab404d8ab72db1e8a6e1b190@huawei.com>
Date: Tue, 11 Mar 2025 09:51:34 +0000
From: Shiju Jose <shiju.jose@...wei.com>
To: Alison Schofield <alison.schofield@...el.com>
CC: "linux-cxl@...r.kernel.org" <linux-cxl@...r.kernel.org>,
"dan.j.williams@...el.com" <dan.j.williams@...el.com>, "dave@...olabs.net"
<dave@...olabs.net>, Jonathan Cameron <jonathan.cameron@...wei.com>,
"dave.jiang@...el.com" <dave.jiang@...el.com>, "vishal.l.verma@...el.com"
<vishal.l.verma@...el.com>, "ira.weiny@...el.com" <ira.weiny@...el.com>,
"david@...hat.com" <david@...hat.com>, "Vilas.Sridharan@....com"
<Vilas.Sridharan@....com>, "linux-edac@...r.kernel.org"
<linux-edac@...r.kernel.org>, "linux-acpi@...r.kernel.org"
<linux-acpi@...r.kernel.org>, "linux-mm@...ck.org" <linux-mm@...ck.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>, "bp@...en8.de"
<bp@...en8.de>, "tony.luck@...el.com" <tony.luck@...el.com>,
"rafael@...nel.org" <rafael@...nel.org>, "lenb@...nel.org" <lenb@...nel.org>,
"mchehab@...nel.org" <mchehab@...nel.org>, "leo.duran@....com"
<leo.duran@....com>, "Yazen.Ghannam@....com" <Yazen.Ghannam@....com>,
"rientjes@...gle.com" <rientjes@...gle.com>, "jiaqiyan@...gle.com"
<jiaqiyan@...gle.com>, "Jon.Grimm@....com" <Jon.Grimm@....com>,
"dave.hansen@...ux.intel.com" <dave.hansen@...ux.intel.com>,
"naoya.horiguchi@....com" <naoya.horiguchi@....com>, "james.morse@....com"
<james.morse@....com>, "jthoughton@...gle.com" <jthoughton@...gle.com>,
"somasundaram.a@....com" <somasundaram.a@....com>, "erdemaktas@...gle.com"
<erdemaktas@...gle.com>, "pgonda@...gle.com" <pgonda@...gle.com>,
"duenwen@...gle.com" <duenwen@...gle.com>, "gthelen@...gle.com"
<gthelen@...gle.com>, "wschwartz@...erecomputing.com"
<wschwartz@...erecomputing.com>, "dferguson@...erecomputing.com"
<dferguson@...erecomputing.com>, "wbs@...amperecomputing.com"
<wbs@...amperecomputing.com>, "nifan.cxl@...il.com" <nifan.cxl@...il.com>,
tanxiaofei <tanxiaofei@...wei.com>, "Zengtao (B)" <prime.zeng@...ilicon.com>,
Roberto Sassu <roberto.sassu@...wei.com>, "kangkang.shen@...urewei.com"
<kangkang.shen@...urewei.com>, wanghuiqiang <wanghuiqiang@...wei.com>,
Linuxarm <linuxarm@...wei.com>
Subject: RE: [PATCH 1/8] cxl: Add helper function to retrieve a feature entry
>-----Original Message-----
>From: Alison Schofield <alison.schofield@...el.com>
>Sent: 10 March 2025 20:29
>To: Shiju Jose <shiju.jose@...wei.com>
>Cc: linux-cxl@...r.kernel.org; dan.j.williams@...el.com; dave@...olabs.net;
>Jonathan Cameron <jonathan.cameron@...wei.com>; dave.jiang@...el.com;
>vishal.l.verma@...el.com; ira.weiny@...el.com; david@...hat.com;
>Vilas.Sridharan@....com; linux-edac@...r.kernel.org; linux-
>acpi@...r.kernel.org; linux-mm@...ck.org; linux-kernel@...r.kernel.org;
>bp@...en8.de; tony.luck@...el.com; rafael@...nel.org; lenb@...nel.org;
>mchehab@...nel.org; leo.duran@....com; Yazen.Ghannam@....com;
>rientjes@...gle.com; jiaqiyan@...gle.com; Jon.Grimm@....com;
>dave.hansen@...ux.intel.com; naoya.horiguchi@....com;
>james.morse@....com; jthoughton@...gle.com; somasundaram.a@....com;
>erdemaktas@...gle.com; pgonda@...gle.com; duenwen@...gle.com;
>gthelen@...gle.com; wschwartz@...erecomputing.com;
>dferguson@...erecomputing.com; wbs@...amperecomputing.com;
>nifan.cxl@...il.com; tanxiaofei <tanxiaofei@...wei.com>; Zengtao (B)
><prime.zeng@...ilicon.com>; Roberto Sassu <roberto.sassu@...wei.com>;
>kangkang.shen@...urewei.com; wanghuiqiang <wanghuiqiang@...wei.com>;
>Linuxarm <linuxarm@...wei.com>
>Subject: Re: [PATCH 1/8] cxl: Add helper function to retrieve a feature entry
>
>On Mon, Mar 10, 2025 at 06:15:38PM +0000, Shiju Jose wrote:
>> >-----Original Message-----
>> >From: Alison Schofield <alison.schofield@...el.com>
>> >Sent: 07 March 2025 19:20
>> >To: Shiju Jose <shiju.jose@...wei.com>
>> [...]
>> >> +struct cxl_feat_entry *cxl_get_feature_entry(struct cxl_dev_state *cxlds,
>> >> + const uuid_t *feat_uuid) {
>> >> + struct cxl_features_state *cxlfs = to_cxlfs(cxlds);
>> >> + struct cxl_feat_entry *feat_entry;
>> >> + int count;
>> >> +
>> >> + /*
>> >> + * Retrieve the feature entry from the supported features list,
>> >> + * if the feature is supported.
>> >> + */
>> >> + feat_entry = cxlfs->entries->ent;
>> >
>> >Do we need some NULL checking here on cxlfs, entries
>>
>> Hi Alison,
>>
>> Thanks for the feedbacks.
>> We had check on cxlfs before
>> https://lore.kernel.org/all/20250122235159.2716036-5-dave.jiang@intel.
>> com/ but removed because of the following comment.
>> https://lore.kernel.org/all/20250124150150.GZ5556@nvidia.com/
>
>Hi Shiju,
Hi Alison,
>
>I have not followed all along, so yeah my questions may be a bit pesky at this
>point. I did see the comment linked above about how the driver must be bound
>at this point. I think my question is a bit different.
The feedback was added to remove defensive checks present in this function.
>
>Are each of these guaranteed not to be NULL here:
>
>to_cxlfs(cxlds)
to_cxlfs(cxlds) cannot be NULL if cxl_get_feature_entry() is called after
devm_cxl_setup_features(), otherwise will be NULL.
>cxlfs->entries
>cxlfs->entries->ent
Both fields will be NULL if the firmware does not support any features.
>
>If these cannot be NULL, then all good.
>
>--Alison
>
[...]
>>
Thanks,
Shiju
Powered by blists - more mailing lists