Received: by 2002:a05:6358:1087:b0:cb:c9d3:cd90 with SMTP id j7csp2279418rwi; Fri, 28 Oct 2022 05:21:12 -0700 (PDT) X-Google-Smtp-Source: AMsMyM7TwADI59lYtaj9LMgnGj436a7eOFIEQLK78wo79N1pmlKiucDljB0fYyi3F0Tv8odYLsNF X-Received: by 2002:a05:6402:370c:b0:453:9fab:1b53 with SMTP id ek12-20020a056402370c00b004539fab1b53mr52039666edb.28.1666959672594; Fri, 28 Oct 2022 05:21:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666959672; cv=none; d=google.com; s=arc-20160816; b=HleWctvOZNpOVjg/qJ3bZN0xJPYRLQDvDKugB+HEO3lrXzK1p+p3mPuzGGBc0xpEhO E6qlo05SuOsrA/ohYxVzBuF65EgYADUQkiu69fvywYtEzCMc3yhO5dTnjxjX5YSCnBjs B7aDhq5ZsQaAtp3o9jiZC/O0twWTvptERw2O7ZaYoG30SRgzU+OA0md/GV9QLPRJ7PuU zRivEfgk4DhBpA9GewkI26Ik0nwowWDg5Et9fDvO0OpxZ2pWtQmctNxKEjP/xfd7uXjW KRQmbEulMguRFMknZJ3gwRF9z7kRKfxcLlcl3fcaeirWe3dv6fY8EUNzeuG8nmOmUe3O q48Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:subject:user-agent:mime-version:date:message-id; bh=7I9bPBQCVxCEhB/8R2bCUWCyA2NkMdwzNvSk0245q8I=; b=oF2dH1mLTTvrLP2bDcpgpYHt/bdgj6/S9vjBUB4TIkV/NRoQx6YDIXd3YXsOuRKixk XzCQ5pvK98b0nbVzDHcjReNPTmAHUefBq9SvCf8vf7C+n10fXkwajq6IVngtMVWE/KBq /ewABW0W6+d3DQ2Q5MnLPK2UEPOEmcVPsv933veZKqWt3Ks1CW77nvLL/mJPj2XpkZ0m sJcJN7Sm/vvShUUMLg5VUvrrEdyzNKp+fXofpjM9w51/olJlfAyDytPa4lT9N/fJ1ulv ymsg1WmB2NhnoRs4ndPOBfEotC97sCoPmO0o6kAr8jdtYhtOHIv3VUhUwJQ/FB150CiJ BNsA== 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id sb17-20020a1709076d9100b0078d8b6976eesi4286318ejc.140.2022.10.28.05.20.46; Fri, 28 Oct 2022 05:21:12 -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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229587AbiJ1Lgs (ORCPT + 99 others); Fri, 28 Oct 2022 07:36:48 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51700 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229941AbiJ1Lgq (ORCPT ); Fri, 28 Oct 2022 07:36:46 -0400 Received: from mx1.zhaoxin.com (MX1.ZHAOXIN.COM [210.0.225.12]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C33891D1AAA for ; Fri, 28 Oct 2022 04:36:44 -0700 (PDT) X-ASG-Debug-ID: 1666957000-086e23532653f60001-xx1T2L Received: from ZXSHMBX2.zhaoxin.com (ZXSHMBX2.zhaoxin.com [10.28.252.164]) by mx1.zhaoxin.com with ESMTP id mfrDrxpG1r2GxzZG (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NO); Fri, 28 Oct 2022 19:36:40 +0800 (CST) X-Barracuda-Envelope-From: LeoLiu-oc@zhaoxin.com X-Barracuda-RBL-Trusted-Forwarder: 10.28.252.164 Received: from ZXBJMBX03.zhaoxin.com (10.29.252.7) by ZXSHMBX2.zhaoxin.com (10.28.252.164) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.12; Fri, 28 Oct 2022 19:36:40 +0800 Received: from [10.32.56.18] (125.76.214.122) by ZXBJMBX03.zhaoxin.com (10.29.252.7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.12; Fri, 28 Oct 2022 19:36:38 +0800 X-Barracuda-RBL-Trusted-Forwarder: 10.28.252.164 Message-ID: <5a601e85-cd6c-2d42-a2db-d706a64718c9@zhaoxin.com> X-Barracuda-RBL-Trusted-Forwarder: 10.32.56.18 Date: Fri, 28 Oct 2022 19:36:38 +0800 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.4.0 Subject: Re: [PATCH 1/5] ACPI/APEI: Add apei_hest_parse_aer() To: Bjorn Helgaas X-ASG-Orig-Subj: Re: [PATCH 1/5] ACPI/APEI: Add apei_hest_parse_aer() CC: , , , , , , , , , , , , , , , References: <20221027220746.GA844491@bhelgaas> From: LeoLiuoc In-Reply-To: <20221027220746.GA844491@bhelgaas> Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 8bit X-Originating-IP: [125.76.214.122] X-ClientProxiedBy: ZXSHCAS2.zhaoxin.com (10.28.252.162) To ZXBJMBX03.zhaoxin.com (10.29.252.7) X-Barracuda-Connect: ZXSHMBX2.zhaoxin.com[10.28.252.164] X-Barracuda-Start-Time: 1666957000 X-Barracuda-Encrypted: ECDHE-RSA-AES128-GCM-SHA256 X-Barracuda-URL: https://10.28.252.35:4443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at zhaoxin.com X-Barracuda-Scan-Msg-Size: 2739 X-Barracuda-BRTS-Status: 1 X-Barracuda-Bayes: INNOCENT GLOBAL 0.4890 1.0000 0.0000 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using global scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=9.0 tests= X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.101737 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,NICE_REPLY_A, SPF_HELO_NONE,SPF_PASS 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: X-Mailing-List: linux-kernel@vger.kernel.org 在 2022/10/28 6:07, Bjorn Helgaas 写道: > On Thu, Oct 27, 2022 at 11:15:18AM +0800, LeoLiu-oc wrote: >> From: leoliu-oc >> >> apei_hest_parse_aer() is used to parse and record the PCI Express AER >> Structure in the HEST Table. >> >> Signed-off-by: leoliu-oc >> --- >> drivers/acpi/apei/hest.c | 119 ++++++++++++++++++++++++++++++++++++++- >> include/acpi/actbl1.h | 69 +++++++++++++++++++++++ >> include/acpi/apei.h | 7 +++ >> 3 files changed, 194 insertions(+), 1 deletion(-) >> >> diff --git a/drivers/acpi/apei/hest.c b/drivers/acpi/apei/hest.c >> index 6aef1ee5e1bd..0bfdc18758f5 100644 >> --- a/drivers/acpi/apei/hest.c >> +++ b/drivers/acpi/apei/hest.c >> @@ -25,6 +25,7 @@ >> #include >> #include >> #include >> +#include >> >> #include "apei-internal.h" >> >> @@ -86,7 +87,48 @@ static int hest_esrc_len(struct acpi_hest_header *hest_hdr) >> return len; >> }; >> >> -typedef int (*apei_hest_func_t)(struct acpi_hest_header *hest_hdr, void *data); >> +static inline bool hest_source_is_pcie_aer(struct acpi_hest_header *hest_hdr) > > Drop "inline" here and below. This is not a performance path, so it's > more clutter than it's worth. Yes, I agree with it. Will fix it in the next version. Thanks leoliu-oc >> +static inline bool hest_match_pci(struct acpi_hest_header *hest_hdr, >> + struct acpi_hest_aer_common *p, struct pci_dev *pci) >> +{ >> + if (hest_match_type(hest_hdr, pci)) >> + return(hest_match_pci_devfn(p, pci)); > > No need for parens around hest_match_pci_devfn(). > >> + else > > You can drop the else, too. > Yes, Agree with it. I will also fix it in the next version. Thanks leoliu-oc >> + return false; >> +} > >> + * apei_hest_parse_aer - Find the AER structure in the HEST Table and >> + * match it with the PCI device. >> + * >> + * @hest_hdr: To save the acpi aer error source in hest table >> + * >> + * Return 1 if the pci dev matched with the acpi aer error source in >> + * hest table, else return 0. > > In comments and commit logs, > > s/pci/PCI/ > s/aer/AER/ > s/acpi/ACPI/ > s/hest/HEST/ > s/HEST Table/HEST/ (since the "T" in "HEST" stands for "Table") > >> +/* HEST Sub-structure for PCIE EndPoint Structure (6) */ > > PCIe Root Port, if I'm following this correctly. > >> +/* HEST Sub-structure for PCIE EndPoint Structure (7) */ > > PCIe Endpoint. > >> +/* HEST Sub-structure for PCIE/PCI Bridge Structure (8) */ > > PCIe/PCI-X Bridge Got it, will modify it in the next version. Thanks leoliu-oc