* [RFC PATCH] PCI/DPC: Fix info->id initialization in dpc_process_error()
@ 2020-10-31 10:01 Saheed Olayemi Bolarinwa
2020-11-05 3:06 ` Kuppuswamy, Sathyanarayanan
0 siblings, 1 reply; 3+ messages in thread
From: Saheed Olayemi Bolarinwa @ 2020-10-31 10:01 UTC (permalink / raw)
To: helgaas, linux-pci; +Cc: Saheed O. Bolarinwa
From: "Saheed O. Bolarinwa" <refactormyself@gmail.com>
In the dpc_process_error() path, the error source ID is obtained
but not stored inside the aer_err_info object. So aer_print_error()
is not aware of the error source if it gets called.
Use the obtained valued to initialise info->id
Signed-off-by: Saheed O. Bolarinwa <refactormyself@gmail.com>
---
drivers/pci/pcie/dpc.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/pci/pcie/dpc.c b/drivers/pci/pcie/dpc.c
index e05aba86a317..9f8698812939 100644
--- a/drivers/pci/pcie/dpc.c
+++ b/drivers/pci/pcie/dpc.c
@@ -223,6 +223,7 @@ void dpc_process_error(struct pci_dev *pdev)
else if (reason == 0 &&
dpc_get_aer_uncorrect_severity(pdev, &info) &&
aer_get_device_error_info(pdev, &info)) {
+ info.id = source;
aer_print_error(pdev, &info);
pci_aer_clear_nonfatal_status(pdev);
pci_aer_clear_fatal_status(pdev);
--
2.18.4
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [RFC PATCH] PCI/DPC: Fix info->id initialization in dpc_process_error()
2020-10-31 10:01 [RFC PATCH] PCI/DPC: Fix info->id initialization in dpc_process_error() Saheed Olayemi Bolarinwa
@ 2020-11-05 3:06 ` Kuppuswamy, Sathyanarayanan
2020-11-18 19:33 ` Bjorn Helgaas
0 siblings, 1 reply; 3+ messages in thread
From: Kuppuswamy, Sathyanarayanan @ 2020-11-05 3:06 UTC (permalink / raw)
To: Saheed Olayemi Bolarinwa, helgaas, linux-pci
On 10/31/20 3:01 AM, Saheed Olayemi Bolarinwa wrote:
> From: "Saheed O. Bolarinwa" <refactormyself@gmail.com>
>
> In the dpc_process_error() path, the error source ID is obtained
> but not stored inside the aer_err_info object. So aer_print_error()
> is not aware of the error source if it gets called.
>
> Use the obtained valued to initialise info->id
Is it useful for DPC case ? I don't think we set info->error_dev_num for
DPC case right ?
if (info->id && info->error_dev_num > 1 && info->id == id)
726 pci_err(dev, " Error of this Agent is reported first\n");
>
> Signed-off-by: Saheed O. Bolarinwa <refactormyself@gmail.com>
> ---
> drivers/pci/pcie/dpc.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/drivers/pci/pcie/dpc.c b/drivers/pci/pcie/dpc.c
> index e05aba86a317..9f8698812939 100644
> --- a/drivers/pci/pcie/dpc.c
> +++ b/drivers/pci/pcie/dpc.c
> @@ -223,6 +223,7 @@ void dpc_process_error(struct pci_dev *pdev)
> else if (reason == 0 &&
> dpc_get_aer_uncorrect_severity(pdev, &info) &&
> aer_get_device_error_info(pdev, &info)) {
> + info.id = source;
> aer_print_error(pdev, &info);
> pci_aer_clear_nonfatal_status(pdev);
> pci_aer_clear_fatal_status(pdev);
>
--
Sathyanarayanan Kuppuswamy
Linux Kernel Developer
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [RFC PATCH] PCI/DPC: Fix info->id initialization in dpc_process_error()
2020-11-05 3:06 ` Kuppuswamy, Sathyanarayanan
@ 2020-11-18 19:33 ` Bjorn Helgaas
0 siblings, 0 replies; 3+ messages in thread
From: Bjorn Helgaas @ 2020-11-18 19:33 UTC (permalink / raw)
To: Kuppuswamy, Sathyanarayanan; +Cc: Saheed Olayemi Bolarinwa, linux-pci
On Wed, Nov 04, 2020 at 07:06:44PM -0800, Kuppuswamy, Sathyanarayanan wrote:
> On 10/31/20 3:01 AM, Saheed Olayemi Bolarinwa wrote:
> > From: "Saheed O. Bolarinwa" <refactormyself@gmail.com>
> >
> > In the dpc_process_error() path, the error source ID is obtained
> > but not stored inside the aer_err_info object. So aer_print_error()
> > is not aware of the error source if it gets called.
> >
> > Use the obtained valued to initialise info->id
> Is it useful for DPC case ? I don't think we set info->error_dev_num for
> DPC case right ?
>
> if (info->id && info->error_dev_num > 1 && info->id == id)
> 726 pci_err(dev, " Error of this Agent is reported first\n");
It's true that we only assign to info->error_dev_num in aer.c. That
looks like another defect.
We're passing "info" to aer_print_error() when both info->id and
info->error_dev_num are stack junk.
> > Signed-off-by: Saheed O. Bolarinwa <refactormyself@gmail.com>
> > ---
> > drivers/pci/pcie/dpc.c | 1 +
> > 1 file changed, 1 insertion(+)
> >
> > diff --git a/drivers/pci/pcie/dpc.c b/drivers/pci/pcie/dpc.c
> > index e05aba86a317..9f8698812939 100644
> > --- a/drivers/pci/pcie/dpc.c
> > +++ b/drivers/pci/pcie/dpc.c
> > @@ -223,6 +223,7 @@ void dpc_process_error(struct pci_dev *pdev)
> > else if (reason == 0 &&
> > dpc_get_aer_uncorrect_severity(pdev, &info) &&
> > aer_get_device_error_info(pdev, &info)) {
> > + info.id = source;
> > aer_print_error(pdev, &info);
> > pci_aer_clear_nonfatal_status(pdev);
> > pci_aer_clear_fatal_status(pdev);
> >
>
> --
> Sathyanarayanan Kuppuswamy
> Linux Kernel Developer
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2020-11-18 19:33 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-10-31 10:01 [RFC PATCH] PCI/DPC: Fix info->id initialization in dpc_process_error() Saheed Olayemi Bolarinwa
2020-11-05 3:06 ` Kuppuswamy, Sathyanarayanan
2020-11-18 19:33 ` Bjorn Helgaas
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).