From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.ozlabs.org (lists.ozlabs.org [112.213.38.117]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 5BA55CCF9E0 for ; Tue, 28 Oct 2025 15:05:00 +0000 (UTC) Received: from boromir.ozlabs.org (localhost [127.0.0.1]) by lists.ozlabs.org (Postfix) with ESMTP id 4cwtvt6cYsz3dTY; Wed, 29 Oct 2025 02:04:58 +1100 (AEDT) Authentication-Results: lists.ozlabs.org; arc=none smtp.remote-ip=185.176.79.56 ARC-Seal: i=1; a=rsa-sha256; d=lists.ozlabs.org; s=201707; t=1761663898; cv=none; b=nmeb/TKuxSLsFy6d6m1dvC2Qamw1t5vR6htu1PtGrPEcyGgtNlFdxsHH1qFQJ6G7tAGb8B0FNpMH1/6OtQpgq6GCLMZHPrqLGVWAIir21IQCxw9WxUI4aCTXLGEBYVwwfj5TKjljnhlB8r39+hb1NhT1cnJQ7+r8rTACWd17MgHHBJsP5Z5RhQetLCZJVMnMjzPeqOYehTY+i7PBcA2pB5H+rlHRrZUF+XMjoV6vxajsI1q97E0dtv5dbTtR3WXaUcJqN03PwXuSkAa0th3ckeX+5+pNJZSdNaPH+rvvU+vZpiiitX+RUXb3mtLnR7fRY/qrJbjTwabBKG9GMPq9Hg== ARC-Message-Signature: i=1; a=rsa-sha256; d=lists.ozlabs.org; s=201707; t=1761663898; c=relaxed/relaxed; bh=cqqlXzmGT+GUr2ikFVJj6eAEpAWESZgA4aIiSrxBcgI=; h=Date:From:To:CC:Subject:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=WBeNf8sTPOpmQvKOlpuH0UD+usle3BokXQEVADvPBoMiI1d0YSZtetvfqTXulbr0xGTJ+uRGqBundEuVl99pZOuv4IvGwxFtJJF3JFO5KTakr6+TQ0R/Rz0KctrcDAPJaSOU/10KVeU7egIqEcbNEkiE6hFURTub4MCNyEMApydn4/oGK2tt8gNC+xtMjKO0FChu+uFcgCn217vbsiRcMdogelswqQM1t4gKksJ1vZzfxpWBpipjRtLp+AFGucjbaeLo3IHksbmQ5B3LGZ9JEaG5TZwP8ukNKmNwBYTLjjzCq/GVS5HPEtAL4+BbXFAFGkAsjKiIxXjnVaLLd9KP1A== ARC-Authentication-Results: i=1; lists.ozlabs.org; dmarc=pass (p=quarantine dis=none) header.from=huawei.com; spf=pass (client-ip=185.176.79.56; helo=frasgout.his.huawei.com; envelope-from=jonathan.cameron@huawei.com; receiver=lists.ozlabs.org) smtp.mailfrom=huawei.com Authentication-Results: lists.ozlabs.org; dmarc=pass (p=quarantine dis=none) header.from=huawei.com Authentication-Results: lists.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=huawei.com (client-ip=185.176.79.56; helo=frasgout.his.huawei.com; envelope-from=jonathan.cameron@huawei.com; receiver=lists.ozlabs.org) Received: from frasgout.his.huawei.com (frasgout.his.huawei.com [185.176.79.56]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 4cwtvs4zGPz3bjb for ; Wed, 29 Oct 2025 02:04:57 +1100 (AEDT) Received: from mail.maildlp.com (unknown [172.18.186.31]) by frasgout.his.huawei.com (SkyGuard) with ESMTP id 4cwtSH23J8z6M4hV; Tue, 28 Oct 2025 22:44:31 +0800 (CST) Received: from dubpeml100005.china.huawei.com (unknown [7.214.146.113]) by mail.maildlp.com (Postfix) with ESMTPS id 9749D1400D3; Tue, 28 Oct 2025 22:48:20 +0800 (CST) Received: from localhost (10.203.177.15) by dubpeml100005.china.huawei.com (7.214.146.113) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.11; Tue, 28 Oct 2025 14:48:18 +0000 Date: Tue, 28 Oct 2025 14:48:16 +0000 From: Jonathan Cameron To: "Fabio M. De Francesco" CC: , "Rafael J . Wysocki" , "Len Brown" , Tony Luck , Borislav Petkov , Hanjun Guo , Mauro Carvalho Chehab , Shuai Xue , "Davidlohr Bueso" , Dave Jiang , "Alison Schofield" , Vishal Verma , Ira Weiny , Dan Williams , Mahesh J Salgaonkar , Oliver O'Halloran , Bjorn Helgaas , Sunil V L , Xiaofei Tan , Mario Limonciello , Huacai Chen , Heinrich Schuchardt , Arnd Bergmann , "Peter Zijlstra" , Ingo Molnar , "Guo Weikang" , Xin Li , Will Deacon , Huang Yiwei , Gavin Shan , Smita Koralahalli , Uwe =?ISO-8859-1?Q?Kleine-K=F6n?= =?ISO-8859-1?Q?ig?= , Li Ming , Ilpo =?ISO-8859-1?Q?J=E4rvinen?= , Kuppuswamy Sathyanarayanan , Karolina Stolarek , Jon Pan-Doh , "Lukas Wunner" , Shiju Jose , , , , Subject: Re: [PATCH 2/6 v6] ACPI: extlog: Trace CPER PCI Express Error Section Message-ID: <20251028144816.000018a3@huawei.com> In-Reply-To: <20251023122612.1326748-3-fabio.m.de.francesco@linux.intel.com> References: <20251023122612.1326748-1-fabio.m.de.francesco@linux.intel.com> <20251023122612.1326748-3-fabio.m.de.francesco@linux.intel.com> X-Mailer: Claws Mail 4.3.0 (GTK 3.24.42; x86_64-w64-mingw32) X-Mailing-List: linuxppc-dev@lists.ozlabs.org List-Id: List-Help: List-Owner: List-Post: List-Archive: , List-Subscribe: , , List-Unsubscribe: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit X-Originating-IP: [10.203.177.15] X-ClientProxiedBy: lhrpeml500012.china.huawei.com (7.191.174.4) To dubpeml100005.china.huawei.com (7.214.146.113) On Thu, 23 Oct 2025 14:25:37 +0200 "Fabio M. De Francesco" wrote: > I/O Machine Check Architecture events may signal failing PCIe components > or links. The AER event contains details on what was happening on the wire > when the error was signaled. > > Trace the CPER PCIe Error section (UEFI v2.10, Appendix N.2.7) reported > by the I/O MCA. > > Cc: Dan Williams > Reviewed-by: Dave Jiang > Reviewed-by: Jonathan Cameron > Signed-off-by: Fabio M. De Francesco Hi Fabio, Was taking a fresh look at this as a precursor to looking at later patches in series and spotted something that I'm doubtful about. > diff --git a/drivers/acpi/acpi_extlog.c b/drivers/acpi/acpi_extlog.c > index 47d11cb5c912..cefe8d2d8aff 100644 > --- a/drivers/acpi/acpi_extlog.c > +++ b/drivers/acpi/acpi_extlog.c > @@ -132,6 +132,34 @@ static int print_extlog_rcd(const char *pfx, > return 1; > } > > +static void extlog_print_pcie(struct cper_sec_pcie *pcie_err, > + int severity) > +{ > + struct aer_capability_regs *aer; > + struct pci_dev *pdev; > + unsigned int devfn; > + unsigned int bus; > + int aer_severity; > + int domain; > + > + if (!(pcie_err->validation_bits & CPER_PCIE_VALID_DEVICE_ID || > + pcie_err->validation_bits & CPER_PCIE_VALID_AER_INFO)) Looking again, I'm not sure this is as intended. Is the aim to allow for either one of these two? Or check that that are both present? That is should it be !(A && B) rather than !(A || B)? > + return; > + > + aer_severity = cper_severity_to_aer(severity); > + aer = (struct aer_capability_regs *)pcie_err->aer_info; > + domain = pcie_err->device_id.segment; > + bus = pcie_err->device_id.bus; > + devfn = PCI_DEVFN(pcie_err->device_id.device, > + pcie_err->device_id.function); > + pdev = pci_get_domain_bus_and_slot(domain, bus, devfn); > + if (!pdev) > + return; > + > + pci_print_aer(pdev, aer_severity, aer); > + pci_dev_put(pdev); > +}