[PATCH v4 2/3] powerpc/eeh: Use result of error_detected() in uevent

Niklas Schnelle posted 3 patches 1 month, 4 weeks ago
There is a newer version of this series
[PATCH v4 2/3] powerpc/eeh: Use result of error_detected() in uevent
Posted by Niklas Schnelle 1 month, 4 weeks ago
With pci_uevent_ers() handling PCI_ERS_RESULT_NEED_RESET the result of
error_detected() can be used in pci_uevent_ers() even if drivers request
a reset. This aligns EEH's behavior with both AER.

Suggested-by: Lukas Wunner <lukas@wunner.de>
Link: https://lore.kernel.org/linux-pci/aIp6LiKJor9KLVpv@wunner.de/
Signed-off-by: Niklas Schnelle <schnelle@linux.ibm.com>
---
 arch/powerpc/kernel/eeh_driver.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/powerpc/kernel/eeh_driver.c b/arch/powerpc/kernel/eeh_driver.c
index 7efe04c68f0fe3fb1c3c13d97d58e79e47cf103b..20ed9685da8b7e6d419a4b02f715b52acfe715d3 100644
--- a/arch/powerpc/kernel/eeh_driver.c
+++ b/arch/powerpc/kernel/eeh_driver.c
@@ -334,7 +334,7 @@ static enum pci_ers_result eeh_report_error(struct eeh_dev *edev,
 	rc = driver->err_handler->error_detected(pdev, pci_channel_io_frozen);
 
 	edev->in_error = true;
-	pci_uevent_ers(pdev, PCI_ERS_RESULT_NONE);
+	pci_uevent_ers(pdev, rc);
 	return rc;
 }
 

-- 
2.48.1
Re: [PATCH v4 2/3] powerpc/eeh: Use result of error_detected() in uevent
Posted by Lukas Wunner 1 month, 4 weeks ago
On Thu, Aug 07, 2025 at 12:15:32PM +0200, Niklas Schnelle wrote:
> With pci_uevent_ers() handling PCI_ERS_RESULT_NEED_RESET the result of
> error_detected() can be used in pci_uevent_ers() even if drivers request
> a reset. This aligns EEH's behavior with both AER.

I guess the sentence is supposed to end with "and s390"?

I would have recounted the history a bit, e.g.:

Ever since uevent support was added for AER and EEH with commit
856e1eb9bdd4 ("PCI/AER: Add uevents in AER and EEH error/resume"), it
reported PCI_ERS_RESULT_NONE as the result of ->error_detected() to
user space.

Commit 7b42d97e99d3 ("PCI/ERR: Always report current recovery status for
udev") subsequently amended AER to report the actual return value of
->error_detected().

Make the same change to EEH to align it with AER (and s390 error
recovery).

> Suggested-by: Lukas Wunner <lukas@wunner.de>
> Link: https://lore.kernel.org/linux-pci/aIp6LiKJor9KLVpv@wunner.de/
> Signed-off-by: Niklas Schnelle <schnelle@linux.ibm.com>

Reviewed-by: Lukas Wunner <lukas@wunner.de>
Re: [PATCH v4 2/3] powerpc/eeh: Use result of error_detected() in uevent
Posted by Niklas Schnelle 1 month, 4 weeks ago
On Thu, 2025-08-07 at 13:34 +0200, Lukas Wunner wrote:
> On Thu, Aug 07, 2025 at 12:15:32PM +0200, Niklas Schnelle wrote:
> > With pci_uevent_ers() handling PCI_ERS_RESULT_NEED_RESET the result of
> > error_detected() can be used in pci_uevent_ers() even if drivers request
> > a reset. This aligns EEH's behavior with both AER.
> 
> I guess the sentence is supposed to end with "and s390"?

Yes had it there and then realized that this is only true after the
last patch, did a bad job of adjusting.

> 
> I would have recounted the history a bit, e.g.:
> 
> Ever since uevent support was added for AER and EEH with commit
> 856e1eb9bdd4 ("PCI/AER: Add uevents in AER and EEH error/resume"), it
> reported PCI_ERS_RESULT_NONE as the result of ->error_detected() to
> user space.
> 
> Commit 7b42d97e99d3 ("PCI/ERR: Always report current recovery status for
> udev") subsequently amended AER to report the actual return value of
> ->error_detected().
> 
> Make the same change to EEH to align it with AER (and s390 error
> recovery).

Thanks for figuring out the history, I'll incorporate this and send a
v5.

> 
> > Suggested-by: Lukas Wunner <lukas@wunner.de>
> > Link: https://lore.kernel.org/linux-pci/aIp6LiKJor9KLVpv@wunner.de/
> > Signed-off-by: Niklas Schnelle <schnelle@linux.ibm.com>
> 
> Reviewed-by: Lukas Wunner <lukas@wunner.de>

Thanks for the R-b.