RE: [PATCH v5 7/8] cxl/edac: Add CXL memory device memory sparing control feature

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



>-----Original Message-----
>From: Dave Jiang <dave.jiang@xxxxxxxxx>
>Sent: 19 May 2025 22:16
>To: Alison Schofield <alison.schofield@xxxxxxxxx>; Shiju Jose
><shiju.jose@xxxxxxxxxx>
>Cc: linux-cxl@xxxxxxxxxxxxxxx; dan.j.williams@xxxxxxxxx; Jonathan Cameron
><jonathan.cameron@xxxxxxxxxx>; dave@xxxxxxxxxxxx;
>vishal.l.verma@xxxxxxxxx; ira.weiny@xxxxxxxxx; linux-edac@xxxxxxxxxxxxxxx;
>linux-doc@xxxxxxxxxxxxxxx; bp@xxxxxxxxx; tony.luck@xxxxxxxxx;
>lenb@xxxxxxxxxx; Yazen.Ghannam@xxxxxxx; mchehab@xxxxxxxxxx;
>nifan.cxl@xxxxxxxxx; Linuxarm <linuxarm@xxxxxxxxxx>; tanxiaofei
><tanxiaofei@xxxxxxxxxx>; Zengtao (B) <prime.zeng@xxxxxxxxxxxxx>; Roberto
>Sassu <roberto.sassu@xxxxxxxxxx>; kangkang.shen@xxxxxxxxxxxxx;
>wanghuiqiang <wanghuiqiang@xxxxxxxxxx>
>Subject: Re: [PATCH v5 7/8] cxl/edac: Add CXL memory device memory sparing
>control feature
>
>
>
>On 5/19/25 2:01 PM, Alison Schofield wrote:
>> On Thu, May 15, 2025 at 12:59:23PM +0100, shiju.jose@xxxxxxxxxx wrote:
>>> From: Shiju Jose <shiju.jose@xxxxxxxxxx>
>>>
>>
>> snip
>>
>>> diff --git a/drivers/cxl/core/edac.c b/drivers/cxl/core/edac.c index
>>> 489c9996bfbc..395d56457931 100644
>>> --- a/drivers/cxl/core/edac.c
>>> +++ b/drivers/cxl/core/edac.c
>>> @@ -21,7 +21,17 @@
>>>  #include "core.h"
>>>  #include "trace.h"
>>>
>>> -#define CXL_NR_EDAC_DEV_FEATURES 2
>>> +#define CXL_NR_EDAC_DEV_FEATURES 6
>>> +
>>> +static bool cxl_is_memdev_memory_online(const struct cxl_memdev
>>> +*cxlmd) {
>>> +	struct cxl_port *port = cxlmd->endpoint;
>>> +
>>> +	if (port && cxl_num_decoders_committed(port))
>>> +		return true;
>>> +
>>> +	return false;
>>> +}
>>>
>>
>> Looks like above fcn needs to be inside the below #ifdef.
>> Smatch is warning this when EDAC_SCRUB is off
This warning is with 'EDAC_MEM_REPAIR' is off.
  
>>
>> drivers/cxl/core/edac.c:27:13: warning: ‘cxl_is_memdev_memory_online’
>defined but not used [-Wunused-function]
>>    27 | static bool cxl_is_memdev_memory_online(const struct
>> cxl_memdev *cxlmd)
>>
>>
>>>  #ifdef CONFIG_CXL_EDAC_SCRUB
>
>I think the function can be moved to above cxl_mem_perform_sparing() as that
>is the only function that calls it. I'll do that when I apply if there's nothing else
>major need to be changed.

Yes. Moving under  "#ifdef CONFIG_CXL_EDAC_MEM_REPAIR" which is present
at the start of memory repair features, solved  this warning. 
Presently 'cxl_is_memdev_memory_online' is used in  cxl_mem_perform_sparing() and 
cxl_mem_perform_ppr() only though I thought it will be used in other parts of the CXL code.

>
>DJ
>
>
>>
>> snip to end.
>>
>

Thanks,
Shiju




[Index of Archives]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Linux FS]     [Yosemite Forum]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]     [Linux Resources]

  Powered by Linux