mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Krzysztof Kozlowski <krzk@kernel.org>
To: Zhao Qunqin <zhaoqunqin@loongson.cn>
Cc: robh@kernel.org, krzk+dt@kernel.org, conor+dt@kernel.org,
	chenhuacai@kernel.org, linux-edac@vger.kernel.org,
	devicetree@vger.kernel.org, linux-kernel@vger.kernel.org,
	kernel@xen0n.name, bp@alien8.de, tony.luck@intel.com,
	james.morse@arm.com, mchehab@kernel.org, rric@kernel.org,
	loongarch@lists.linux.dev
Subject: Re: [PATCH v2 2/2] Loongarch: EDAC driver for loongson memory controller
Date: Tue, 3 Sep 2024 09:58:48 +0200	[thread overview]
Message-ID: <979d67cc-cbd2-408c-a8ca-a063030bcec2@kernel.org> (raw)
In-Reply-To: <549969b7-26c4-a203-b5a0-2e89ab7e7d79@loongson.cn>

On 03/09/2024 09:24, Zhao Qunqin wrote:
> 
> 在 2024/9/3 下午2:47, Krzysztof Kozlowski 写道:
>> On Tue, Sep 03, 2024 at 09:53:54AM +0800, Zhao Qunqin wrote:
>>> Report single bit errors (CE) only.
>>>
>>> Signed-off-by: Zhao Qunqin <zhaoqunqin@loongson.cn>
>>> ---
>>>   MAINTAINERS                  |   1 +
>>>   arch/loongarch/Kconfig       |   1 +
>>>   drivers/edac/Kconfig         |   8 ++
>>>   drivers/edac/Makefile        |   1 +
>>>   drivers/edac/ls3a5000_edac.c | 187 +++++++++++++++++++++++++++++++++++
>>>   5 files changed, 198 insertions(+)
>>>   create mode 100644 drivers/edac/ls3a5000_edac.c
>>>
>>> diff --git a/MAINTAINERS b/MAINTAINERS
>>> index 6cc8cfc8f..b43f82279 100644
>>> --- a/MAINTAINERS
>>> +++ b/MAINTAINERS
>>> @@ -13242,6 +13242,7 @@ M:	Zhao Qunqin <zhaoqunqin@loongson.cn>
>>>   L:	linux-edac@vger.kernel.org
>>>   S:	Maintained
>>>   F:	Documentation/devicetree/bindings/edac/loongson,ls3a5000-mc-edac.yaml
>>> +F:	drivers/edac/ls3a5000_edac.c
>>>   
>>>   LSILOGIC MPT FUSION DRIVERS (FC/SAS/SPI)
>>>   M:	Sathya Prakash <sathya.prakash@broadcom.com>
>>> diff --git a/arch/loongarch/Kconfig b/arch/loongarch/Kconfig
>>> index 70f169210..348030c24 100644
>>> --- a/arch/loongarch/Kconfig
>>> +++ b/arch/loongarch/Kconfig
>>> @@ -182,6 +182,7 @@ config LOONGARCH
>>>   	select PCI_QUIRKS
>>>   	select PERF_USE_VMALLOC
>>>   	select RTC_LIB
>>> +	select EDAC_SUPPORT
>> I think you got here comment before. How did you address it?
> I just randomly found a spot, and I will put it at the end(next version 
> patch).

No, the comment was different. You must not select user-visible symbols.

>>
>>>   	select SPARSE_IRQ
>>>   	select SYSCTL_ARCH_UNALIGN_ALLOW
>>>   	select SYSCTL_ARCH_UNALIGN_NO_WARN
>>> diff --git a/drivers/edac/Kconfig b/drivers/edac/Kconfig
>>> index 16c8de505..2d10256f0 100644
>>> --- a/drivers/edac/Kconfig
>>> +++ b/drivers/edac/Kconfig
>>> @@ -573,5 +573,13 @@ config EDAC_VERSAL
>>>   	  Support injecting both correctable and uncorrectable errors
>>>   	  for debugging purposes.
>>>   
>> ...
>>
>>   +
>>> +static int loongson_edac_probe(struct platform_device *pdev)
>>> +{
>>> +	struct resource *rs;
>>> +	struct mem_ctl_info *mci;
>>> +	struct edac_mc_layer layers[2];
>>> +	struct loongson_edac_pvt *pvt;
>>> +	u64 *vbase = NULL;
>>> +
>>> +	rs = platform_get_resource(pdev, IORESOURCE_MEM, 0);
>>> +	/* not return if can not find resource or resource start equals NULL */
>> Why?
> 
> Because there are multiple memory controllers in the ls3x soc,
> 
> but the ECC function of some memory controllers cannot be used.

Then what does the driver do for such memory controllers? Your binding
is quite clear here that above code is just bogus. It is not possible to
have node without reg.

Please point us to your DTS and results of dtbs_check.

> 
> But in any case, a node must be created in /sys/devices/system/edac/mc/  
> through edac_mc_add_mc(mci).
> 
> Then if the ECC function of the memory controller cannot be used, set 
> start to NULL or do not pass mem resource,
> 
> which is equivalent to enumeration of memory controller, and the CE 
> count will always be zero.
> 
>>> +	if (rs && rs->start) {
>>> +		vbase = devm_ioremap_resource(&pdev->dev, rs);
>>> +		if (IS_ERR(vbase))
>>> +			return PTR_ERR(vbase);
>>> +	}


Best regards,
Krzysztof


  reply	other threads:[~2024-09-03  7:58 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-09-03  1:53 [PATCH v2 0/2] Add EDAC driver for ls3a5000 " Zhao Qunqin
2024-09-03  1:53 ` [PATCH v2 1/2] dt-bindings: EDAC " Zhao Qunqin
2024-09-03  3:02   ` Huacai Chen
2024-09-03  6:44   ` Krzysztof Kozlowski
2024-09-03  1:53 ` [PATCH v2 2/2] Loongarch: EDAC driver for loongson " Zhao Qunqin
2024-09-03  2:39   ` Huacai Chen
2024-09-03  2:43     ` Huacai Chen
2024-09-03  3:31     ` Mingcong Bai
2024-09-03  6:33   ` Markus Elfring
2024-09-03  7:45     ` Zhao Qunqin
2024-09-03  6:47   ` Krzysztof Kozlowski
2024-09-03  7:24     ` Zhao Qunqin
2024-09-03  7:58       ` Krzysztof Kozlowski [this message]
2024-09-03  8:30         ` Xi Ruoyao
2024-09-03 11:29           ` Krzysztof Kozlowski
2024-09-03 11:31             ` Zhao Qunqin
2024-09-03 11:36               ` Krzysztof Kozlowski
2024-09-03  9:59         ` Zhao Qunqin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=979d67cc-cbd2-408c-a8ca-a063030bcec2@kernel.org \
    --to=krzk@kernel.org \
    --cc=bp@alien8.de \
    --cc=chenhuacai@kernel.org \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=james.morse@arm.com \
    --cc=kernel@xen0n.name \
    --cc=krzk+dt@kernel.org \
    --cc=linux-edac@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=loongarch@lists.linux.dev \
    --cc=mchehab@kernel.org \
    --cc=robh@kernel.org \
    --cc=rric@kernel.org \
    --cc=tony.luck@intel.com \
    --cc=zhaoqunqin@loongson.cn \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®