[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <aIxULlDfQw4yhFDv@wunner.de>
Date: Fri, 1 Aug 2025 07:44:14 +0200
From: Lukas Wunner <lukas@...ner.de>
To: Sathyanarayanan Kuppuswamy <sathyanarayanan.kuppuswamy@...ux.intel.com>
Cc: Niklas Schnelle <schnelle@...ux.ibm.com>,
Bjorn Helgaas <bhelgaas@...gle.com>,
Mahesh J Salgaonkar <mahesh@...ux.ibm.com>,
Linas Vepstas <linasvepstas@...il.com>,
Ilpo Järvinen <ilpo.jarvinen@...ux.intel.com>,
Manivannan Sadhasivam <mani@...nel.org>,
Gerald Schaefer <gerald.schaefer@...ux.ibm.com>,
Heiko Carstens <hca@...ux.ibm.com>,
Vasily Gorbik <gor@...ux.ibm.com>,
Alexander Gordeev <agordeev@...ux.ibm.com>,
Christian Borntraeger <borntraeger@...ux.ibm.com>,
Sven Schnelle <svens@...ux.ibm.com>,
Peter Oberparleiter <oberpar@...ux.ibm.com>,
Matthew Rosato <mjrosato@...ux.ibm.com>,
Oliver O'Halloran <oohall@...il.com>, Sinan Kaya <okaya@...nel.org>,
linuxppc-dev@...ts.ozlabs.org, linux-s390@...r.kernel.org,
linux-kernel@...r.kernel.org, linux-pci@...r.kernel.org,
Keith Busch <kbusch@...nel.org>
Subject: Re: [PATCH v3 1/2] PCI/AER: Fix missing uevent on recovery when a
reset is requested
On Thu, Jul 31, 2025 at 10:04:38AM -0700, Sathyanarayanan Kuppuswamy wrote:
> On 7/31/25 6:01 AM, Lukas Wunner wrote:
> > +++ b/drivers/pci/pcie/err.c
> > @@ -165,6 +165,12 @@ static int report_resume(struct pci_dev *dev, void *data)
> > return 0;
> > }
> > +static int report_disconnect(struct pci_dev *dev, void *data)
> > +{
> > + pci_uevent_ers(dev, PCI_ERS_RESULT_DISCONNECT);
> > + return 0;
> > +}
>
> Since you are notifying the user space, I am wondering whether the drivers
> should be notified about the recovery failure?
The drivers are usually *causing* the recovery failure by returning
PCI_ERS_RESULT_DISCONNECT from their pci_error_handlers callbacks
(or by lacking pci_error_handlers, in particular ->error_detected()).
So in principle the drivers should be aware of recovery failure.
There are cases where multiple drivers are involved. E.g. on GPUs,
there's often a PCIe switch with a graphics device and various sound
or telemetry devices. Typically errors are reported by the Upstream
Port, so the Secondary Bus Reset occurs at the Root or Downstream Port
above the Upstream Port and affects the switch and all subordinate
devices. In cases like this, recovery failure may be caused by a
single driver (e.g. GPU) and the other drivers (e.g. telemetry) may
be unaware of it.
The recovery flow documented in Documentation/PCI/pci-error-recovery.rst
was originally conceived for EEH and indeed EEH does notify all drivers
of recovery failures by invoking the ->error_detected() callback with
channel_state pci_channel_io_perm_failure. See this call ...
eeh_pe_report("error_detected(permanent failure)", pe,
eeh_report_failure, NULL);
... in arch/powerpc/kernel/eeh_driver.c below the recover_failed label
in eeh_handle_normal_event().
I don't know why pcie_do_recovery() doesn't do the same on recovery
failure. This is one of several annoying deviations between AER and
EEH. Ideally the behavior should be the same across all platforms
so that drivers don't have to cope with platform-specific quirks.
However I think that's orthogonal to the pci_uevent_ers() invocation
in pcie_do_recovery().
Thanks,
Lukas
Powered by blists - more mailing lists