From: Keith Busch <keith.busch@intel.com>
To: Dongdong Liu <liudongdong3@huawei.com>
Cc: helgaas@kernel.org, okaya@kernel.org, linux-pci@vger.kernel.org,
linuxarm@huawei.com, stable@vger.kernel.org,
Bjorn Helgaas <bhelgaas@google.com>
Subject: Re: [PATCH RESEND] PCI/DPC: Fix print AER status in DPC event handling
Date: Mon, 11 Feb 2019 08:46:16 -0700 [thread overview]
Message-ID: <20190211154615.GB4525@localhost.localdomain> (raw)
In-Reply-To: <1549868579-125090-1-git-send-email-liudongdong3@huawei.com>
On Mon, Feb 11, 2019 at 03:02:59PM +0800, Dongdong Liu wrote:
> +static int dpc_get_aer_uncorrect_severity(struct pci_dev *dev,
> + struct aer_err_info *info)
> +{
> + int pos = dev->aer_cap;
> + u32 status, mask, sev;
> +
> + pci_read_config_dword(dev, pos + PCI_ERR_UNCOR_STATUS, &status);
> + pci_read_config_dword(dev, pos + PCI_ERR_UNCOR_MASK, &mask);
> + status &= ~mask;
> + if (!status)
> + return 0;
> +
> + pci_read_config_dword(dev, pos + PCI_ERR_UNCOR_SEVER, &sev);
> + status &= sev;
> + if (status)
> + info->severity = AER_FATAL;
> + else
> + info->severity = AER_NONFATAL;
> +
> + return 1;
> +}
> +
You can set info->severity to AER_FATAL since that's the only type we
enable DPC triggering.
> static irqreturn_t dpc_handler(int irq, void *context)
> {
> struct aer_err_info info;
> @@ -229,9 +251,12 @@ static irqreturn_t dpc_handler(int irq, void *context)
> /* show RP PIO error detail information */
> if (dpc->rp_extensions && reason == 3 && ext_reason == 0)
> dpc_process_rp_pio_error(dpc);
> - else if (reason == 0 && aer_get_device_error_info(pdev, &info)) {
> + else if (reason == 0 &&
> + dpc_get_aer_uncorrect_severity(pdev, &info) &&
> + aer_get_device_error_info(pdev, &info)) {
> aer_print_error(pdev, &info);
> pci_cleanup_aer_uncorrect_error_status(pdev);
> + pci_aer_clear_fatal_status(pdev);
Good catch here, but let's clear the pending bits with a single call
to pci_cleanup_aer_error_status_regs() rather than NONFATAL and
FATAL separately.
next prev parent reply other threads:[~2019-02-11 15:46 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-02-11 7:02 [PATCH RESEND] PCI/DPC: Fix print AER status in DPC event handling Dongdong Liu
2019-02-11 15:46 ` Keith Busch [this message]
2019-02-12 2:46 ` Dongdong Liu
2019-02-15 15:11 ` Keith Busch
2019-02-21 23:16 ` Bjorn Helgaas
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=20190211154615.GB4525@localhost.localdomain \
--to=keith.busch@intel.com \
--cc=bhelgaas@google.com \
--cc=helgaas@kernel.org \
--cc=linux-pci@vger.kernel.org \
--cc=linuxarm@huawei.com \
--cc=liudongdong3@huawei.com \
--cc=okaya@kernel.org \
--cc=stable@vger.kernel.org \
/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).