From: Bjorn Helgaas <helgaas@kernel.org>
To: LeoLiu-oc <LeoLiu-oc@zhaoxin.com>
Cc: rafael@kernel.org, lenb@kernel.org, james.morse@arm.com,
tony.luck@intel.com, bp@alien8.de, robert.moore@intel.com,
ying.huang@intel.com, rdunlap@infradead.org, bhelgaas@google.com,
linux-acpi@vger.kernel.org, linux-pci@vger.kernel.org,
linux-kernel@vger.kernel.org, devel@acpica.org,
CobeChen@zhaoxin.com, TonyWWang@zhaoxin.com,
ErosZhang@zhaoxin.com
Subject: Re: [PATCH 1/5] ACPI/APEI: Add apei_hest_parse_aer()
Date: Thu, 27 Oct 2022 17:07:46 -0500 [thread overview]
Message-ID: <20221027220746.GA844491@bhelgaas> (raw)
In-Reply-To: <20221027031518.2855743-1-LeoLiu-oc@zhaoxin.com>
On Thu, Oct 27, 2022 at 11:15:18AM +0800, LeoLiu-oc wrote:
> From: leoliu-oc <leoliu-oc@zhaoxin.com>
>
> apei_hest_parse_aer() is used to parse and record the PCI Express AER
> Structure in the HEST Table.
>
> Signed-off-by: leoliu-oc <leoliu-oc@zhaoxin.com>
> ---
> 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 <linux/platform_device.h>
> #include <acpi/apei.h>
> #include <acpi/ghes.h>
> +#include <linux/pci.h>
>
> #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.
> +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.
> + 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
next prev parent reply other threads:[~2022-10-27 22:07 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-10-27 3:15 [PATCH 1/5] ACPI/APEI: Add apei_hest_parse_aer() LeoLiu-oc
2022-10-27 4:58 ` Sathyanarayanan Kuppuswamy
2022-10-28 11:54 ` LeoLiuoc
2022-10-27 22:07 ` Bjorn Helgaas [this message]
2022-10-28 11:36 ` LeoLiuoc
2022-11-01 6:14 ` Li, Ming
2022-11-01 7:02 ` LeoLiuoc
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=20221027220746.GA844491@bhelgaas \
--to=helgaas@kernel.org \
--cc=CobeChen@zhaoxin.com \
--cc=ErosZhang@zhaoxin.com \
--cc=LeoLiu-oc@zhaoxin.com \
--cc=TonyWWang@zhaoxin.com \
--cc=bhelgaas@google.com \
--cc=bp@alien8.de \
--cc=devel@acpica.org \
--cc=james.morse@arm.com \
--cc=lenb@kernel.org \
--cc=linux-acpi@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pci@vger.kernel.org \
--cc=rafael@kernel.org \
--cc=rdunlap@infradead.org \
--cc=robert.moore@intel.com \
--cc=tony.luck@intel.com \
--cc=ying.huang@intel.com \
/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;
as well as URLs for NNTP newsgroup(s).