Message ID | 20230519200342.30817-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 b10csp1515119vqo; Fri, 19 May 2023 13:56:25 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ72iWi7snFMw0f7DMWzJR5PZhRl68IhYN8x8gZN5kPu5dUx3FXD+6tfB+B00+NMJS3fHn3W X-Received: by 2002:a17:902:684c:b0:1ae:1237:8754 with SMTP id f12-20020a170902684c00b001ae12378754mr3337811pln.68.1684529785011; Fri, 19 May 2023 13:56:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1684529784; cv=none; d=google.com; s=arc-20160816; b=B7OMkdv2WRwtNPY7KR8y7h5Z0G5MgCbjx7G9c5WpYmhIvxppvfyDPK9bleqx8WvCZw GtLeofvjROe51HR4vY5+9xshcEaQi4ZJFekqeHLQr3Wey8pl1G12/MIDvW7S9fT6wci5 aKdcnXUKMFZ0xlrLHjujQei3jhZrH87d76UPy41YNiY5XSGpqf+w2ytwJGNr+Fi3Bx1g Z+KcE9H+p4janGVYRPSM9Yil7d7hc4EqHUbA4dNVHd1CX2Rqrmjqu111oZwGYIcBXwi8 7uF69wiwgNDcYN02TXMx54LEFku3unkxbvej4lQv6v/ogQwvlRaCBZVlAYJg9POoF36D Mj2g== 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=mbtl22Wdwues4CCIsCdSWgk/KB4Ycm+oaUpaelL5WAA=; b=uZZSahqouTtIkKlBdYvZL+f4azfVFR6N+S+1IuYd5ay/yKWiocmVEOKWMlp5AekXzv mTLUEd9Udt3uYvyd8CEU/IZfT6/QlzMpz9Klu4wJYshVAIc2kJPaMe7mZHRyljov1LCe YuyjBV5T3kzl1gELmMPrf9aI23KUR2+hwLauH/omk1BstUVhsdIqaRQjR6PpukLzyJPG mOlXHxddWn8HzyYuvANicurLStlXdI5XeNKT0jHHj1eVCcf5Cg+zTiCFFkyXb0lBpN0j 1VmNWFShLT6qj49O8+6YyJZKSkg/Xnwcp/6icbejAqzjefImfdD80t/sMYofvziR0VpQ 8CQg== 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 r12-20020a170902be0c00b0019f2cd99ddfsi91900pls.380.2023.05.19.13.56.10; Fri, 19 May 2023 13:56:24 -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 S229795AbjESUXF (ORCPT <rfc822;wlfightup@gmail.com> + 99 others); Fri, 19 May 2023 16:23:05 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56626 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229508AbjESUXE (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Fri, 19 May 2023 16:23:04 -0400 Received: from inva020.nxp.com (inva020.nxp.com [92.121.34.13]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0E4881A8; Fri, 19 May 2023 13:23:02 -0700 (PDT) Received: from inva020.nxp.com (localhost [127.0.0.1]) by inva020.eu-rdc02.nxp.com (Postfix) with ESMTP id 606AF1A1941; Fri, 19 May 2023 22:04:41 +0200 (CEST) Received: from smtp.na-rdc02.nxp.com (usphx01srsp001v.us-phx01.nxp.com [134.27.49.11]) by inva020.eu-rdc02.nxp.com (Postfix) with ESMTP id 26D6D1A1936; Fri, 19 May 2023 22:04:41 +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 A9AEC405E0; Fri, 19 May 2023 13:04:39 -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] apei/ghes: correctly return NULL for ghes_get_devices() Date: Fri, 19 May 2023 15:03:41 -0500 Message-Id: <20230519200342.30817-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?1766357503770955045?= |
Series |
apei/ghes: correctly return NULL for ghes_get_devices()
|
|
Commit Message
Li Yang
May 19, 2023, 8:03 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>
---
drivers/acpi/apei/ghes.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
Comments
Hi Li, kernel test robot noticed the following build errors: [auto build test ERROR on rafael-pm/linux-next] [also build test ERROR on linus/master v6.4-rc2 next-20230519] [If your patch is applied to the wrong git tree, kindly drop us a note. And when submitting patch, we suggest to use '--base' as documented in https://git-scm.com/docs/git-format-patch#_base_tree_information] url: https://github.com/intel-lab-lkp/linux/commits/Li-Yang/apei-ghes-correctly-return-NULL-for-ghes_get_devices/20230520-043046 base: https://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm.git linux-next patch link: https://lore.kernel.org/r/20230519200342.30817-1-leoyang.li%40nxp.com patch subject: [PATCH] apei/ghes: correctly return NULL for ghes_get_devices() config: x86_64-randconfig-a016 compiler: clang version 14.0.6 (https://github.com/llvm/llvm-project f28c006a5895fc0e329fe15fead81e37457cb1d1) reproduce (this is a W=1 build): wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross chmod +x ~/bin/make.cross # https://github.com/intel-lab-lkp/linux/commit/4964167d53fd894284d9954a8ae85ad0515fc112 git remote add linux-review https://github.com/intel-lab-lkp/linux git fetch --no-tags linux-review Li-Yang/apei-ghes-correctly-return-NULL-for-ghes_get_devices/20230520-043046 git checkout 4964167d53fd894284d9954a8ae85ad0515fc112 # save the config file mkdir build_dir && cp config build_dir/.config COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 O=build_dir ARCH=x86_64 olddefconfig COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 O=build_dir ARCH=x86_64 SHELL=/bin/bash If you fix the issue, kindly add following tag where applicable | Reported-by: kernel test robot <lkp@intel.com> | Closes: https://lore.kernel.org/oe-kbuild-all/202305201059.WgkHUmM0-lkp@intel.com/ All errors (new ones prefixed by >>): >> drivers/acpi/apei/ghes.c:1552:1: error: non-void function does not return a value in all control paths [-Werror,-Wreturn-type] } ^ 1 error generated. vim +1552 drivers/acpi/apei/ghes.c 1534 1535 struct list_head *ghes_get_devices(void) 1536 { 1537 int idx = -1; 1538 1539 if (IS_ENABLED(CONFIG_X86)) { 1540 idx = acpi_match_platform_list(plat_list); 1541 if (idx < 0) { 1542 if (!ghes_edac_force_enable) 1543 return NULL; 1544 1545 pr_warn_once("Force-loading ghes_edac on an unsupported platform. You're on your own!\n"); 1546 } 1547 } else if (list_empty(&ghes_devs)) { 1548 return NULL; 1549 } else { 1550 return &ghes_devs; 1551 } > 1552 } 1553 EXPORT_SYMBOL_GPL(ghes_get_devices); 1554
diff --git a/drivers/acpi/apei/ghes.c b/drivers/acpi/apei/ghes.c index 34ad071a64e9..da1a712f370b 100644 --- a/drivers/acpi/apei/ghes.c +++ b/drivers/acpi/apei/ghes.c @@ -1544,9 +1544,11 @@ 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; + } else { + return &ghes_devs; } - - return &ghes_devs; } EXPORT_SYMBOL_GPL(ghes_get_devices);