Message ID | 20230519201249.31147-1-leoyang.li@nxp.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp1501240vqo; Fri, 19 May 2023 13:29:07 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4De8RhoKlSxMitFGWkqbkZ5/lapjwpba/SdlIEPmVbo1FQCg4aw/xCY3Tp6+ruf+i8+ZPM X-Received: by 2002:a17:903:32cd:b0:1ac:820e:c348 with SMTP id i13-20020a17090332cd00b001ac820ec348mr4991869plr.0.1684528146744; Fri, 19 May 2023 13:29:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1684528146; cv=none; d=google.com; s=arc-20160816; b=wYGKGuSNTMOlVQ8aEpD3M9+QR1Qn6RPa9pxmzcsbSQB6HuOeWQAKD1FyAXgqsXxn8S CYGPJYNosYZTYrHEeWQ67ss9KDgcx7VUAa2Lcj9UevkXODzn/w5LyREbs34zzME21++d v24ry16tn19AZx1AVuDYmzaai7fSr4ckvXOkrXtb7KEq8I+/9sP+hNTX4zQFIBU9DPJF XBH21hob/agZBAuNof7qeg021yf6WBZb1fxrBFf40+8/PwPvEnhGFqCC7AbRaD15kIGt IRKrfgwFCQNqkJsURwMS2OTYA3LZiqajENKknRbp+7vAuNi6L8UkgcX9YO6IopLjF84o tFaw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=Ecy1a+YVCHr7ue+l+IdX41YKzWrf3EkSdnwFcyLuqnQ=; b=Sx1np/Vg48cFobm4V1ZN1UornhVJeKvHj6Fi3DVIsC5Q9hSsNd6LJwBS2ENH1N7Uyb 1uD5MKj15KimZmiZe4d1Lof1Ra4PEsQoB9MymfpuWwk3d6gOtq/wO3mvJydwDQeNEgHg N1f7Ur9YVeOrhmQIzpTstDVmnDA3VGhyjZLqawLphczuHcB8BQL0Pl+zEhC48oGWviYG aoCGxrTddk079og3CbxIQQSfjm+YEQSxbNXGw+wBuiUMXLHElh114RTsmCz4hhMi5UUy cjreGtrGGgRwL4yudkWSZmKgvVY4txfm3JWEB8BNLc+6KP5uEdADbOXJ8S33cyqLN7/e yB2w== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id a4-20020a1709027d8400b001a8173f468fsi67668plm.314.2023.05.19.13.28.51; Fri, 19 May 2023 13:29:06 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229839AbjESUVQ (ORCPT <rfc822;wlfightup@gmail.com> + 99 others); Fri, 19 May 2023 16:21:16 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55834 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229629AbjESUVP (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Fri, 19 May 2023 16:21:15 -0400 X-Greylist: delayed 490 seconds by postgrey-1.37 at lindbergh.monkeyblade.net; Fri, 19 May 2023 13:21:13 PDT Received: from inva021.nxp.com (inva021.nxp.com [92.121.34.21]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 535AC102; Fri, 19 May 2023 13:21:13 -0700 (PDT) Received: from inva021.nxp.com (localhost [127.0.0.1]) by inva021.eu-rdc02.nxp.com (Postfix) with ESMTP id 7CB0D2011A1; Fri, 19 May 2023 22:13:24 +0200 (CEST) Received: from smtp.na-rdc02.nxp.com (usphx01srsp001v.us-phx01.nxp.com [134.27.49.11]) by inva021.eu-rdc02.nxp.com (Postfix) with ESMTP id 3E2E92009C3; Fri, 19 May 2023 22:13:24 +0200 (CEST) Received: from right.am.freescale.net (right.am.freescale.net [10.81.116.134]) by usphx01srsp001v.us-phx01.nxp.com (Postfix) with ESMTP id 0F921405E0; Fri, 19 May 2023 13:13:22 -0700 (MST) From: Li Yang <leoyang.li@nxp.com> To: "Rafael J. Wysocki" <rafael@kernel.org>, Len Brown <lenb@kernel.org>, James Morse <james.morse@arm.com>, Tony Luck <tony.luck@intel.com>, Borislav Petkov <bp@alien8.de>, Jia He <justin.he@arm.com> Cc: Li Yang <leoyang.li@nxp.com>, linux-acpi@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v2] apei/ghes: correctly return NULL for ghes_get_devices() Date: Fri, 19 May 2023 15:12:49 -0500 Message-Id: <20230519201249.31147-1-leoyang.li@nxp.com> X-Mailer: git-send-email 2.25.1.377.g2d2118b MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Virus-Scanned: ClamAV using ClamSMTP X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_LOW, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1766355785839151645?= X-GMAIL-MSGID: =?utf-8?q?1766355785839151645?= |
Series |
[v2] apei/ghes: correctly return NULL for ghes_get_devices()
|
|
Commit Message
Li Yang
May 19, 2023, 8:12 p.m. UTC
Since 315bada690e0 ("EDAC: Check for GHES preference in the
chipset-specific EDAC drivers"), vendor specific EDAC driver will not
probe correctly when CONFIG_ACPI_APEI_GHES is enabled but no GHES device
is present. Make ghes_get_devices() return NULL when the GHES device
list is empty to fix the problem.
Fixes: 9057a3f7ac36 ("EDAC/ghes: Prepare to make ghes_edac a proper module")
Signed-off-by: Li Yang <leoyang.li@nxp.com>
Cc: Jia He <justin.he@arm.com>
---
V2: fix the fallthrough case in x86 path
drivers/acpi/apei/ghes.c | 2 ++
1 file changed, 2 insertions(+)
Comments
Hi Li, > -----Original Message----- > From: Li Yang <leoyang.li@nxp.com> > Sent: Saturday, May 20, 2023 4:13 AM > To: Rafael J. Wysocki <rafael@kernel.org>; Len Brown <lenb@kernel.org>; > James Morse <James.Morse@arm.com>; Tony Luck <tony.luck@intel.com>; > Borislav Petkov <bp@alien8.de>; Justin He <Justin.He@arm.com> > Cc: Li Yang <leoyang.li@nxp.com>; linux-acpi@vger.kernel.org; > linux-kernel@vger.kernel.org > Subject: [PATCH v2] apei/ghes: correctly return NULL for ghes_get_devices() > > Since 315bada690e0 ("EDAC: Check for GHES preference in the chipset-specific > EDAC drivers"), vendor specific EDAC driver will not probe correctly when > CONFIG_ACPI_APEI_GHES is enabled but no GHES device is present. Make > ghes_get_devices() return NULL when the GHES device list is empty to fix the > problem. > > Fixes: 9057a3f7ac36 ("EDAC/ghes: Prepare to make ghes_edac a proper > module") > Signed-off-by: Li Yang <leoyang.li@nxp.com> > Cc: Jia He <justin.he@arm.com> > --- > > V2: fix the fallthrough case in x86 path > > drivers/acpi/apei/ghes.c | 2 ++ > 1 file changed, 2 insertions(+) > > diff --git a/drivers/acpi/apei/ghes.c b/drivers/acpi/apei/ghes.c index > 34ad071a64e9..4382fe13ee3e 100644 > --- a/drivers/acpi/apei/ghes.c > +++ b/drivers/acpi/apei/ghes.c > @@ -1544,6 +1544,8 @@ struct list_head *ghes_get_devices(void) > > pr_warn_once("Force-loading ghes_edac on an unsupported > platform. You're on your own!\n"); > } > + } else if (list_empty(&ghes_devs)) { > + return NULL; > } I have no major objections to the fix. Just curious about the edac driver in you platform. IIUC, in your case, CONFIG_ACPI_APEI_GHES is enabled and edac_ghes driver is either not loaded or fails to load. Is my understanding correct? I wonder whether ghes_get_devices() can unblock such check condition and let other chipset-specific edac drivers continue with the initialization. @Toshi, What do u think of it? -- Cheers, Justin (Jia He) IMPORTANT NOTICE: The contents of this email and any attachments are confidential and may also be privileged. If you are not the intended recipient, please notify the sender immediately and do not disclose the contents to any other person, use it for any purpose, or store or copy the information in any medium. Thank you.
> -----Original Message----- > From: Justin He <Justin.He@arm.com> > Sent: Thursday, May 25, 2023 10:18 AM > To: Leo Li <leoyang.li@nxp.com>; Toshi Kani <toshi.kani@hpe.com>; Rafael J. > Wysocki <rafael@kernel.org>; Len Brown <lenb@kernel.org>; James Morse > <James.Morse@arm.com>; Tony Luck <tony.luck@intel.com>; Borislav > Petkov <bp@alien8.de> > Cc: linux-acpi@vger.kernel.org; linux-kernel@vger.kernel.org > Subject: RE: [PATCH v2] apei/ghes: correctly return NULL for > ghes_get_devices() > > Hi Li, > > > -----Original Message----- > > From: Li Yang <leoyang.li@nxp.com> > > Sent: Saturday, May 20, 2023 4:13 AM > > To: Rafael J. Wysocki <rafael@kernel.org>; Len Brown > > <lenb@kernel.org>; James Morse <James.Morse@arm.com>; Tony Luck > > <tony.luck@intel.com>; Borislav Petkov <bp@alien8.de>; Justin He > > <Justin.He@arm.com> > > Cc: Li Yang <leoyang.li@nxp.com>; linux-acpi@vger.kernel.org; > > linux-kernel@vger.kernel.org > > Subject: [PATCH v2] apei/ghes: correctly return NULL for > > ghes_get_devices() > > > > Since 315bada690e0 ("EDAC: Check for GHES preference in the > > chipset-specific EDAC drivers"), vendor specific EDAC driver will not > > probe correctly when CONFIG_ACPI_APEI_GHES is enabled but no GHES > > device is present. Make > > ghes_get_devices() return NULL when the GHES device list is empty to > > fix the problem. > > > > Fixes: 9057a3f7ac36 ("EDAC/ghes: Prepare to make ghes_edac a proper > > module") > > Signed-off-by: Li Yang <leoyang.li@nxp.com> > > Cc: Jia He <justin.he@arm.com> > > --- > > > > V2: fix the fallthrough case in x86 path > > > > drivers/acpi/apei/ghes.c | 2 ++ > > 1 file changed, 2 insertions(+) > > > > diff --git a/drivers/acpi/apei/ghes.c b/drivers/acpi/apei/ghes.c index > > 34ad071a64e9..4382fe13ee3e 100644 > > --- a/drivers/acpi/apei/ghes.c > > +++ b/drivers/acpi/apei/ghes.c > > @@ -1544,6 +1544,8 @@ struct list_head *ghes_get_devices(void) > > > > pr_warn_once("Force-loading ghes_edac on an > > unsupported platform. You're on your own!\n"); > > } > > + } else if (list_empty(&ghes_devs)) { > > + return NULL; > > } > I have no major objections to the fix. Just curious about the edac driver in > you platform. > IIUC, in your case, CONFIG_ACPI_APEI_GHES is enabled and edac_ghes > driver is either not loaded or fails to load. Is my understanding correct? Right. ghes_edac is loaded but since ghes_devs is empty due to this platform not using ACPI, it bails out with -ENODEV very quickly. I would expect the original platform EDAC driver should continue to work in this scenario. > I wonder whether ghes_get_devices() can unblock such check condition and > let other chipset-specific edac drivers continue with the initialization. @Toshi, > What do u think of it? > > > -- > Cheers, > Justin (Jia He) > > > IMPORTANT NOTICE: The contents of this email and any attachments are > confidential and may also be privileged. If you are not the intended recipient, > please notify the sender immediately and do not disclose the contents to any > other person, use it for any purpose, or store or copy the information in any > medium. Thank you.
On Fri, May 19, 2023 at 10:13 PM Li Yang <leoyang.li@nxp.com> wrote: > > Since 315bada690e0 ("EDAC: Check for GHES preference in the > chipset-specific EDAC drivers"), vendor specific EDAC driver will not > probe correctly when CONFIG_ACPI_APEI_GHES is enabled but no GHES device > is present. Make ghes_get_devices() return NULL when the GHES device > list is empty to fix the problem. > > Fixes: 9057a3f7ac36 ("EDAC/ghes: Prepare to make ghes_edac a proper module") > Signed-off-by: Li Yang <leoyang.li@nxp.com> > Cc: Jia He <justin.he@arm.com> Boris, Tony, any comments? > --- > > V2: fix the fallthrough case in x86 path > > drivers/acpi/apei/ghes.c | 2 ++ > 1 file changed, 2 insertions(+) > > diff --git a/drivers/acpi/apei/ghes.c b/drivers/acpi/apei/ghes.c > index 34ad071a64e9..4382fe13ee3e 100644 > --- a/drivers/acpi/apei/ghes.c > +++ b/drivers/acpi/apei/ghes.c > @@ -1544,6 +1544,8 @@ struct list_head *ghes_get_devices(void) > > pr_warn_once("Force-loading ghes_edac on an unsupported platform. You're on your own!\n"); > } > + } else if (list_empty(&ghes_devs)) { > + return NULL; > } > > return &ghes_devs; > -- > 2.38.0 >
> > Since 315bada690e0 ("EDAC: Check for GHES preference in the > > chipset-specific EDAC drivers"), vendor specific EDAC driver will not > > probe correctly when CONFIG_ACPI_APEI_GHES is enabled but no GHES device > > is present. Make ghes_get_devices() return NULL when the GHES device > > list is empty to fix the problem. > > > > Fixes: 9057a3f7ac36 ("EDAC/ghes: Prepare to make ghes_edac a proper module") > > Signed-off-by: Li Yang <leoyang.li@nxp.com> > > Cc: Jia He <justin.he@arm.com> > > Boris, Tony, any comments? All of the callers are expecting NULL for a failure, not an empty list. So this looks OK to me. Reviewed-by: Tony Luck <tony.luck@intel.com> -Tony
On Mon, Jun 5, 2023 at 7:26 PM Luck, Tony <tony.luck@intel.com> wrote: > > > > Since 315bada690e0 ("EDAC: Check for GHES preference in the > > > chipset-specific EDAC drivers"), vendor specific EDAC driver will not > > > probe correctly when CONFIG_ACPI_APEI_GHES is enabled but no GHES device > > > is present. Make ghes_get_devices() return NULL when the GHES device > > > list is empty to fix the problem. > > > > > > Fixes: 9057a3f7ac36 ("EDAC/ghes: Prepare to make ghes_edac a proper module") > > > Signed-off-by: Li Yang <leoyang.li@nxp.com> > > > Cc: Jia He <justin.he@arm.com> > > > > Boris, Tony, any comments? > > All of the callers are expecting NULL for a failure, not an empty list. So this looks OK to me. > > Reviewed-by: Tony Luck <tony.luck@intel.com> Applied as 6.5 material, thanks!
diff --git a/drivers/acpi/apei/ghes.c b/drivers/acpi/apei/ghes.c index 34ad071a64e9..4382fe13ee3e 100644 --- a/drivers/acpi/apei/ghes.c +++ b/drivers/acpi/apei/ghes.c @@ -1544,6 +1544,8 @@ struct list_head *ghes_get_devices(void) pr_warn_once("Force-loading ghes_edac on an unsupported platform. You're on your own!\n"); } + } else if (list_empty(&ghes_devs)) { + return NULL; } return &ghes_devs;