From: Betty Dall <betty.dall@hp.com>
To: Bjorn Helgaas <bhelgaas@google.com>
Cc: "Rafael J. Wysocki" <rjw@sisk.pl>,
Huang Ying <ying.huang@intel.com>,
"linux-acpi@vger.kernel.org" <linux-acpi@vger.kernel.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"linux-pci@vger.kernel.org" <linux-pci@vger.kernel.org>,
"Moore, Robert" <robert.moore@intel.com>
Subject: Re: [PATCH v2 1/3] PCI/AER: Fix incorrect return from aer_hest_parse()
Date: Mon, 03 Jun 2013 15:18:12 -0600 [thread overview]
Message-ID: <1370294292.20051.41.camel@ejdallLaptop> (raw)
In-Reply-To: <CAErSpo6KV28p3QRoz-Xx=xMjsFaY7sCho8HN2W_M-DntrNk+Ag@mail.gmail.com>
On Sat, 2013-06-01 at 18:38 -0600, Bjorn Helgaas wrote:
> [+cc Bob for ACPI HEST spec questions]
>
> On Thu, May 30, 2013 at 8:39 AM, Betty Dall <betty.dall@hp.com> wrote:
> > The function aer_hest_parse() is called to determine if the given
> > PCI device is firmware first or not. The code loops through each
> > section of the HEST table to look for a match. The bug is that
> > the function always returns whether the last HEST section is firmware
> > first. The fix stops the iteration once the info.firmware_first
> > variable is set. This is similar to how the function aer_hest_parse_aff()
> > stops the iteration.
> >
> > Signed-off-by: Betty Dall <betty.dall@hp.com>
> > ---
> >
> > drivers/pci/pcie/aer/aerdrv_acpi.c | 3 +++
> > 1 files changed, 3 insertions(+), 0 deletions(-)
> >
> >
> > diff --git a/drivers/pci/pcie/aer/aerdrv_acpi.c b/drivers/pci/pcie/aer/aerdrv_acpi.c
> > index 5194a7d..39b8671 100644
> > --- a/drivers/pci/pcie/aer/aerdrv_acpi.c
> > +++ b/drivers/pci/pcie/aer/aerdrv_acpi.c
> > @@ -42,6 +42,9 @@ static int aer_hest_parse(struct acpi_hest_header *hest_hdr, void *data)
> > u8 bridge = 0;
> > int ff = 0;
> >
> > + if (info->firmware_first)
> > + return 0;
> > +
> > switch (hest_hdr->type) {
> > case ACPI_HEST_TYPE_AER_ROOT_PORT:
> > pcie_type = PCI_EXP_TYPE_ROOT_PORT;
>
> Not related directly to your patch, Betty, but I can't figure out why
> the ACPI spec defines the HEST structures for PCIe as it does. I'm
> looking at ACPI 5.0, sec 18.3.2.3 - 18.3.2.5.
> 1) The PCIe Root Port, PCIe Device, and PCIe/PCI-X Bridge structures
> all include Bus, Device, and Function fields. But there's no Segment.
> The current Linux code (hest_match_pci()) assumes HEST records can
> only apply to PCI domain 0. Is Linux missing something, or is the
> HEST really this limited?
You are right that the HEST table does not have the Segment for the PCIe
sources. The Linux code uses the Generic Source type that points to a
UEFI CPER record. Those do have the Segment. The code in
acpi/apei/ghes.c that parses the HEST and invokes the
aer_recover_queue() is using the segment from the CPER record.
The hest_match_pci() code is only looking at the PCIe error source types
because that is where the flags field is defined to indicate "firmware
first". Flags is not defined in the Generic error source. Firmware
first platforms today must be using GLOBAL error sources because the
code is written in such a way that any specific PCIe match will cause
the entire platform to be firmware first. Linux only supports either AER
or firmware first right now, and it would be an enhancement to do both.
> 2) Doesn't the fact that the HEST structures include a bus number mean
> that the OS cannot reassign bus numbers? I guess maybe we could still
> reassign them if we kept track of the mapping back to the original
> values.
Yes, I think there needs to be a mapping between the HEST/CPER bus
number and the OS assigned bus numbers, if the OS is reassigning bus
numbers.
> 3) It's interesting that the only choices seem to be "global" or "list
> every device." There's no "apply to this device and the subtree under
> it," so I guess if you want HEST to apply to hot-added devices,
> "global" is the only thing that makes sense?
"Global" is the one one that makes sense to me too. The size of the HEST
table is fixed at boot and firmware strives to keep it as small as
possible because firmware memory is a scarce resource.
Betty
> Bjorn
next prev parent reply other threads:[~2013-06-03 21:18 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-05-30 14:39 [PATCH v2 0/3] PCI/ACPI: Fix firmware first error recovery with root port in reset Betty Dall
2013-05-30 14:39 ` [PATCH v2 1/3] PCI/AER: Fix incorrect return from aer_hest_parse() Betty Dall
2013-06-02 0:38 ` Bjorn Helgaas
2013-06-03 21:18 ` Betty Dall [this message]
2013-06-04 17:39 ` Bjorn Helgaas
2013-06-04 7:42 ` Chen Gong
2013-06-04 13:13 ` Bjorn Helgaas
2013-06-05 2:48 ` Chen Gong
2013-06-05 13:38 ` Bjorn Helgaas
2013-05-30 14:39 ` [PATCH v2 2/3] ACPI/APEI: Force fatal AER severity when bus has been reset Betty Dall
2013-06-04 7:53 ` Chen Gong
2013-06-04 16:20 ` Betty Dall
2013-06-04 17:54 ` Bjorn Helgaas
2013-06-05 1:56 ` Chen Gong
2013-05-30 14:39 ` [PATCH v2 3/3] PCI/AER: Provide reset_link for firmware first root port Betty Dall
2013-06-04 8:36 ` Chen Gong
2013-06-04 18:31 ` Bjorn Helgaas
2013-06-04 21:38 ` Betty Dall
2013-06-04 22:15 ` Bjorn Helgaas
2013-06-05 1:56 ` Chen Gong
2013-06-05 13:22 ` Betty Dall
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=1370294292.20051.41.camel@ejdallLaptop \
--to=betty.dall@hp.com \
--cc=bhelgaas@google.com \
--cc=linux-acpi@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pci@vger.kernel.org \
--cc=rjw@sisk.pl \
--cc=robert.moore@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).