linux-s390.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v5 0/3] PCI/ERR: s390/pci: Use pci_uevent_ers() in PCI recovery
@ 2025-08-07 13:55 Niklas Schnelle
  2025-08-07 13:55 ` [PATCH v5 1/3] PCI/AER: Fix missing uevent on recovery when a reset is requested Niklas Schnelle
                   ` (4 more replies)
  0 siblings, 5 replies; 9+ messages in thread
From: Niklas Schnelle @ 2025-08-07 13:55 UTC (permalink / raw)
  To: Bjorn Helgaas, Lukas Wunner, Mahesh J Salgaonkar
  Cc: Linas Vepstas, Ilpo Järvinen, Manivannan Sadhasivam,
	Gerald Schaefer, Heiko Carstens, Vasily Gorbik, Alexander Gordeev,
	Christian Borntraeger, Sven Schnelle, Peter Oberparleiter,
	Matthew Rosato, Oliver O'Halloran, Sinan Kaya, linuxppc-dev,
	linux-s390, linux-kernel, linux-pci, Niklas Schnelle, Keith Busch

Hi Bjorn, Lukas, Mahesh,

This series adds issuing of uevents during PCI recovery on s390. In
developing this I noticed that pci_uevent_ers() ignores
PCI_ERS_RESULT_NEED_RESET. I think this will result in AER not generating a uevent
at the beginning of recovery if drivers request a reset via the voting
on error_detected() returns. This is fixed in the first patch and relied
upon by the s390 recovery code as it also uses the result of
error_detected() though with one device/driver at a time.

Thanks,
Niklas

Signed-off-by: Niklas Schnelle <schnelle@linux.ibm.com>
---
Changes in v5:
- Add R-b from Lukas Wunner for EEH
- Improve commit message for EEH (Lukas Wunner)
- Move the EEH patch to the end so the reference to s390 relies on the
  as is and not future state ;)
- Link to v4: https://lore.kernel.org/r/20250807-add_err_uevents-v4-0-c624bfd8638d@linux.ibm.com

Changes in v4:
- Add change in EEH to use the return of error_detected() in the uevent
  just like AER and the new s390 code
- Add R-b from Lukas
- Link to v3: https://lore.kernel.org/r/20250730-add_err_uevents-v3-0-540b158c070f@linux.ibm.com

Changes in v3:
- Reworded cover letter
- Rebase on v6.16
- Link to v2: https://lore.kernel.org/r/20250623-add_err_uevents-v2-0-a3a2cf8e711d@linux.ibm.com

Changes in v2:
- Add a patch fixing pci_uevent_ers() mistakenly ignoring PCI_ERS_RESULT_NEED_RESET
- Use the result of error_detected() for initial pci_uevent_ers()
- Drop fixes tag in s390 patch
- Rebase and re-test on current master
- Link to v1: https://lore.kernel.org/r/20250424-add_err_uevents-v1-1-3384d6b779c6@linux.ibm.com

---
Niklas Schnelle (3):
      PCI/AER: Fix missing uevent on recovery when a reset is requested
      PCI/ERR: s390/pci: Use pci_uevent_ers() in PCI recovery
      powerpc/eeh: Use result of error_detected() in uevent

 arch/powerpc/kernel/eeh_driver.c | 2 +-
 arch/s390/pci/pci_event.c        | 3 +++
 drivers/pci/pci-driver.c         | 3 ++-
 include/linux/pci.h              | 2 +-
 4 files changed, 7 insertions(+), 3 deletions(-)
---
base-commit: 038d61fd642278bab63ee8ef722c50d10ab01e8f
change-id: 20250417-add_err_uevents-6f8d4d7ce09c

Best regards,
-- 
Niklas Schnelle


^ permalink raw reply	[flat|nested] 9+ messages in thread

* [PATCH v5 1/3] PCI/AER: Fix missing uevent on recovery when a reset is requested
  2025-08-07 13:55 [PATCH v5 0/3] PCI/ERR: s390/pci: Use pci_uevent_ers() in PCI recovery Niklas Schnelle
@ 2025-08-07 13:55 ` Niklas Schnelle
  2025-08-07 13:55 ` [PATCH v5 2/3] PCI/ERR: s390/pci: Use pci_uevent_ers() in PCI recovery Niklas Schnelle
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 9+ messages in thread
From: Niklas Schnelle @ 2025-08-07 13:55 UTC (permalink / raw)
  To: Bjorn Helgaas, Lukas Wunner, Mahesh J Salgaonkar
  Cc: Linas Vepstas, Ilpo Järvinen, Manivannan Sadhasivam,
	Gerald Schaefer, Heiko Carstens, Vasily Gorbik, Alexander Gordeev,
	Christian Borntraeger, Sven Schnelle, Peter Oberparleiter,
	Matthew Rosato, Oliver O'Halloran, Sinan Kaya, linuxppc-dev,
	linux-s390, linux-kernel, linux-pci, Niklas Schnelle, Keith Busch

Since commit 7b42d97e99d3 ("PCI/ERR: Always report current recovery
status for udev") AER uses the result of error_detected() as parameter
to pci_uevent_ers(). As pci_uevent_ers() however does not handle
PCI_ERS_RESULT_NEED_RESET this results in a missing uevent for the
beginning of recovery if drivers request a reset. Fix this by treating
PCI_ERS_RESULT_NEED_RESET as beginning recovery.

Cc: stable@vger.kernel.org
Fixes: 7b42d97e99d3 ("PCI/ERR: Always report current recovery status for udev")
Reviewed-by: Lukas Wunner <lukas@wunner.de>
Signed-off-by: Niklas Schnelle <schnelle@linux.ibm.com>
---
 drivers/pci/pci-driver.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/pci/pci-driver.c b/drivers/pci/pci-driver.c
index 67db34fd10ee7101baeeaae1bb9bec3b13e2fdeb..94ba6938b7c6271b557cc7f17ffb89631d83827e 100644
--- a/drivers/pci/pci-driver.c
+++ b/drivers/pci/pci-driver.c
@@ -1592,6 +1592,7 @@ void pci_uevent_ers(struct pci_dev *pdev, enum pci_ers_result err_type)
 	switch (err_type) {
 	case PCI_ERS_RESULT_NONE:
 	case PCI_ERS_RESULT_CAN_RECOVER:
+	case PCI_ERS_RESULT_NEED_RESET:
 		envp[idx++] = "ERROR_EVENT=BEGIN_RECOVERY";
 		envp[idx++] = "DEVICE_ONLINE=0";
 		break;

-- 
2.48.1


^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [PATCH v5 2/3] PCI/ERR: s390/pci: Use pci_uevent_ers() in PCI recovery
  2025-08-07 13:55 [PATCH v5 0/3] PCI/ERR: s390/pci: Use pci_uevent_ers() in PCI recovery Niklas Schnelle
  2025-08-07 13:55 ` [PATCH v5 1/3] PCI/AER: Fix missing uevent on recovery when a reset is requested Niklas Schnelle
@ 2025-08-07 13:55 ` Niklas Schnelle
  2025-08-07 13:55 ` [PATCH v5 3/3] powerpc/eeh: Use result of error_detected() in uevent Niklas Schnelle
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 9+ messages in thread
From: Niklas Schnelle @ 2025-08-07 13:55 UTC (permalink / raw)
  To: Bjorn Helgaas, Lukas Wunner, Mahesh J Salgaonkar
  Cc: Linas Vepstas, Ilpo Järvinen, Manivannan Sadhasivam,
	Gerald Schaefer, Heiko Carstens, Vasily Gorbik, Alexander Gordeev,
	Christian Borntraeger, Sven Schnelle, Peter Oberparleiter,
	Matthew Rosato, Oliver O'Halloran, Sinan Kaya, linuxppc-dev,
	linux-s390, linux-kernel, linux-pci, Niklas Schnelle, Keith Busch

Issue uevents during PCI recovery using pci_uevent_ers() as done by EEH
and AER PCIe recovery routines.

Reviewed-by: Lukas Wunner <lukas@wunner.de>
Signed-off-by: Niklas Schnelle <schnelle@linux.ibm.com>
---
 arch/s390/pci/pci_event.c | 3 +++
 drivers/pci/pci-driver.c  | 2 +-
 include/linux/pci.h       | 2 +-
 3 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/arch/s390/pci/pci_event.c b/arch/s390/pci/pci_event.c
index d930416d4c903f709764b75fe45fb66e529fcc5b..b95376041501f479eee20705d45fb8c68553da71 100644
--- a/arch/s390/pci/pci_event.c
+++ b/arch/s390/pci/pci_event.c
@@ -88,6 +88,7 @@ static pci_ers_result_t zpci_event_notify_error_detected(struct pci_dev *pdev,
 	pci_ers_result_t ers_res = PCI_ERS_RESULT_DISCONNECT;
 
 	ers_res = driver->err_handler->error_detected(pdev,  pdev->error_state);
+	pci_uevent_ers(pdev, ers_res);
 	if (ers_result_indicates_abort(ers_res))
 		pr_info("%s: Automatic recovery failed after initial reporting\n", pci_name(pdev));
 	else if (ers_res == PCI_ERS_RESULT_NEED_RESET)
@@ -244,6 +245,7 @@ static pci_ers_result_t zpci_event_attempt_error_recovery(struct pci_dev *pdev)
 		ers_res = PCI_ERS_RESULT_RECOVERED;
 
 	if (ers_res != PCI_ERS_RESULT_RECOVERED) {
+		pci_uevent_ers(pdev, PCI_ERS_RESULT_DISCONNECT);
 		pr_err("%s: Automatic recovery failed; operator intervention is required\n",
 		       pci_name(pdev));
 		status_str = "failed (driver can't recover)";
@@ -253,6 +255,7 @@ static pci_ers_result_t zpci_event_attempt_error_recovery(struct pci_dev *pdev)
 	pr_info("%s: The device is ready to resume operations\n", pci_name(pdev));
 	if (driver->err_handler->resume)
 		driver->err_handler->resume(pdev);
+	pci_uevent_ers(pdev, PCI_ERS_RESULT_RECOVERED);
 out_unlock:
 	pci_dev_unlock(pdev);
 	zpci_report_status(zdev, "recovery", status_str);
diff --git a/drivers/pci/pci-driver.c b/drivers/pci/pci-driver.c
index 94ba6938b7c6271b557cc7f17ffb89631d83827e..2f3037050fd011108ef93e39d2d78a5c7e22fd05 100644
--- a/drivers/pci/pci-driver.c
+++ b/drivers/pci/pci-driver.c
@@ -1578,7 +1578,7 @@ static int pci_uevent(const struct device *dev, struct kobj_uevent_env *env)
 	return 0;
 }
 
-#if defined(CONFIG_PCIEAER) || defined(CONFIG_EEH)
+#if defined(CONFIG_PCIEAER) || defined(CONFIG_EEH) || defined(CONFIG_S390)
 /**
  * pci_uevent_ers - emit a uevent during recovery path of PCI device
  * @pdev: PCI device undergoing error recovery
diff --git a/include/linux/pci.h b/include/linux/pci.h
index 05e68f35f39238f8b9ce08df97b384d1c1e89bbe..bcc412a21d93a6dcc566f011258ed39d80d896c2 100644
--- a/include/linux/pci.h
+++ b/include/linux/pci.h
@@ -2737,7 +2737,7 @@ static inline bool pci_is_thunderbolt_attached(struct pci_dev *pdev)
 	return false;
 }
 
-#if defined(CONFIG_PCIEPORTBUS) || defined(CONFIG_EEH)
+#if defined(CONFIG_PCIEPORTBUS) || defined(CONFIG_EEH) || defined(CONFIG_S390)
 void pci_uevent_ers(struct pci_dev *pdev, enum  pci_ers_result err_type);
 #endif
 

-- 
2.48.1


^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [PATCH v5 3/3] powerpc/eeh: Use result of error_detected() in uevent
  2025-08-07 13:55 [PATCH v5 0/3] PCI/ERR: s390/pci: Use pci_uevent_ers() in PCI recovery Niklas Schnelle
  2025-08-07 13:55 ` [PATCH v5 1/3] PCI/AER: Fix missing uevent on recovery when a reset is requested Niklas Schnelle
  2025-08-07 13:55 ` [PATCH v5 2/3] PCI/ERR: s390/pci: Use pci_uevent_ers() in PCI recovery Niklas Schnelle
@ 2025-08-07 13:55 ` Niklas Schnelle
  2025-08-07 14:59   ` Mahesh J Salgaonkar
  2025-08-07 16:17   ` Sathyanarayanan Kuppuswamy
  2025-08-14  8:44 ` [PATCH v5 0/3] PCI/ERR: s390/pci: Use pci_uevent_ers() in PCI recovery Niklas Schnelle
  2025-08-14 21:02 ` Bjorn Helgaas
  4 siblings, 2 replies; 9+ messages in thread
From: Niklas Schnelle @ 2025-08-07 13:55 UTC (permalink / raw)
  To: Bjorn Helgaas, Lukas Wunner, Mahesh J Salgaonkar
  Cc: Linas Vepstas, Ilpo Järvinen, Manivannan Sadhasivam,
	Gerald Schaefer, Heiko Carstens, Vasily Gorbik, Alexander Gordeev,
	Christian Borntraeger, Sven Schnelle, Peter Oberparleiter,
	Matthew Rosato, Oliver O'Halloran, Sinan Kaya, linuxppc-dev,
	linux-s390, linux-kernel, linux-pci, Niklas Schnelle, Keith Busch

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 uevent when recovery begins.

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.

Suggested-by: Lukas Wunner <lukas@wunner.de>
Link: https://lore.kernel.org/linux-pci/aIp6LiKJor9KLVpv@wunner.de/
Reviewed-by: Lukas Wunner <lukas@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


^ permalink raw reply related	[flat|nested] 9+ messages in thread

* Re: [PATCH v5 3/3] powerpc/eeh: Use result of error_detected() in uevent
  2025-08-07 13:55 ` [PATCH v5 3/3] powerpc/eeh: Use result of error_detected() in uevent Niklas Schnelle
@ 2025-08-07 14:59   ` Mahesh J Salgaonkar
  2025-08-07 16:17   ` Sathyanarayanan Kuppuswamy
  1 sibling, 0 replies; 9+ messages in thread
From: Mahesh J Salgaonkar @ 2025-08-07 14:59 UTC (permalink / raw)
  To: Niklas Schnelle
  Cc: Bjorn Helgaas, Lukas Wunner, Linas Vepstas, Ilpo Järvinen,
	Manivannan Sadhasivam, Gerald Schaefer, Heiko Carstens,
	Vasily Gorbik, Alexander Gordeev, Christian Borntraeger,
	Sven Schnelle, Peter Oberparleiter, Matthew Rosato,
	Oliver O'Halloran, Sinan Kaya, linuxppc-dev, linux-s390,
	linux-kernel, linux-pci, Keith Busch

On 2025-08-07 15:55:40 Thu, Niklas Schnelle wrote:
> 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 uevent when recovery begins.
> 
> 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.
> 
> Suggested-by: Lukas Wunner <lukas@wunner.de>
> Link: https://lore.kernel.org/linux-pci/aIp6LiKJor9KLVpv@wunner.de/
> Reviewed-by: Lukas Wunner <lukas@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;
>  }

Thanks for the patch. Looks good to me.

Acked-by: Mahesh Salgaonkar <mahesh@linux.ibm.com>

>  
> 
> -- 
> 2.48.1
> 
> 

-- 
Mahesh J Salgaonkar

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH v5 3/3] powerpc/eeh: Use result of error_detected() in uevent
  2025-08-07 13:55 ` [PATCH v5 3/3] powerpc/eeh: Use result of error_detected() in uevent Niklas Schnelle
  2025-08-07 14:59   ` Mahesh J Salgaonkar
@ 2025-08-07 16:17   ` Sathyanarayanan Kuppuswamy
  1 sibling, 0 replies; 9+ messages in thread
From: Sathyanarayanan Kuppuswamy @ 2025-08-07 16:17 UTC (permalink / raw)
  To: Niklas Schnelle, Bjorn Helgaas, Lukas Wunner, Mahesh J Salgaonkar
  Cc: Linas Vepstas, Ilpo Järvinen, Manivannan Sadhasivam,
	Gerald Schaefer, Heiko Carstens, Vasily Gorbik, Alexander Gordeev,
	Christian Borntraeger, Sven Schnelle, Peter Oberparleiter,
	Matthew Rosato, Oliver O'Halloran, Sinan Kaya, linuxppc-dev,
	linux-s390, linux-kernel, linux-pci, Keith Busch


On 8/7/25 6:55 AM, Niklas Schnelle wrote:
> 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 uevent when recovery begins.
>
> 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.
>
> Suggested-by: Lukas Wunner <lukas@wunner.de>
> Link: https://lore.kernel.org/linux-pci/aIp6LiKJor9KLVpv@wunner.de/
> Reviewed-by: Lukas Wunner <lukas@wunner.de>
> Signed-off-by: Niklas Schnelle <schnelle@linux.ibm.com>
> ---

Reviewed-by: Kuppuswamy Sathyanarayanan <sathyanarayanan.kuppuswamy@linux.intel.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;
>   }
>   
>
-- 
Sathyanarayanan Kuppuswamy
Linux Kernel Developer


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH v5 0/3] PCI/ERR: s390/pci: Use pci_uevent_ers() in PCI recovery
  2025-08-07 13:55 [PATCH v5 0/3] PCI/ERR: s390/pci: Use pci_uevent_ers() in PCI recovery Niklas Schnelle
                   ` (2 preceding siblings ...)
  2025-08-07 13:55 ` [PATCH v5 3/3] powerpc/eeh: Use result of error_detected() in uevent Niklas Schnelle
@ 2025-08-14  8:44 ` Niklas Schnelle
  2025-08-14 21:02 ` Bjorn Helgaas
  4 siblings, 0 replies; 9+ messages in thread
From: Niklas Schnelle @ 2025-08-14  8:44 UTC (permalink / raw)
  To: Bjorn Helgaas, Lukas Wunner, Mahesh J Salgaonkar
  Cc: Linas Vepstas, Ilpo Järvinen, Manivannan Sadhasivam,
	Gerald Schaefer, Heiko Carstens, Vasily Gorbik, Alexander Gordeev,
	Christian Borntraeger, Sven Schnelle, Peter Oberparleiter,
	Matthew Rosato, Oliver O'Halloran, Sinan Kaya, linuxppc-dev,
	linux-s390, linux-kernel, linux-pci, Keith Busch

On Thu, 2025-08-07 at 15:55 +0200, Niklas Schnelle wrote:
> Hi Bjorn, Lukas, Mahesh,
> 
> This series adds issuing of uevents during PCI recovery on s390. In
> developing this I noticed that pci_uevent_ers() ignores
> PCI_ERS_RESULT_NEED_RESET. I think this will result in AER not generating a uevent
> at the beginning of recovery if drivers request a reset via the voting
> on error_detected() returns. This is fixed in the first patch and relied
> upon by the s390 recovery code as it also uses the result of
> error_detected() though with one device/driver at a time.
> 
> Thanks,
> Niklas
> 
> Signed-off-by: Niklas Schnelle <schnelle@linux.ibm.com>
> ---

Hi Bjorn,

as you just picked up Lukas' "PCI: Reduce AER / EEH deviations" series
for pci/aer, I think it would make sense to take this via that tree
also. If you prefer and provide an ack for the first patch this could
also go via s390 of course.

Thanks,
Niklas

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH v5 0/3] PCI/ERR: s390/pci: Use pci_uevent_ers() in PCI recovery
  2025-08-07 13:55 [PATCH v5 0/3] PCI/ERR: s390/pci: Use pci_uevent_ers() in PCI recovery Niklas Schnelle
                   ` (3 preceding siblings ...)
  2025-08-14  8:44 ` [PATCH v5 0/3] PCI/ERR: s390/pci: Use pci_uevent_ers() in PCI recovery Niklas Schnelle
@ 2025-08-14 21:02 ` Bjorn Helgaas
  2025-08-26  6:21   ` Lukas Wunner
  4 siblings, 1 reply; 9+ messages in thread
From: Bjorn Helgaas @ 2025-08-14 21:02 UTC (permalink / raw)
  To: Niklas Schnelle
  Cc: Bjorn Helgaas, Lukas Wunner, Mahesh J Salgaonkar, Linas Vepstas,
	Ilpo Järvinen, Manivannan Sadhasivam, Gerald Schaefer,
	Heiko Carstens, Vasily Gorbik, Alexander Gordeev,
	Christian Borntraeger, Sven Schnelle, Peter Oberparleiter,
	Matthew Rosato, Oliver O'Halloran, Sinan Kaya, linuxppc-dev,
	linux-s390, linux-kernel, linux-pci, Keith Busch

On Thu, Aug 07, 2025 at 03:55:37PM +0200, Niklas Schnelle wrote:
> Hi Bjorn, Lukas, Mahesh,
> 
> This series adds issuing of uevents during PCI recovery on s390. In
> developing this I noticed that pci_uevent_ers() ignores
> PCI_ERS_RESULT_NEED_RESET. I think this will result in AER not generating a uevent
> at the beginning of recovery if drivers request a reset via the voting
> on error_detected() returns. This is fixed in the first patch and relied
> upon by the s390 recovery code as it also uses the result of
> error_detected() though with one device/driver at a time.
> 
> Thanks,
> Niklas
> 
> Signed-off-by: Niklas Schnelle <schnelle@linux.ibm.com>
> ---
> Changes in v5:
> - Add R-b from Lukas Wunner for EEH
> - Improve commit message for EEH (Lukas Wunner)
> - Move the EEH patch to the end so the reference to s390 relies on the
>   as is and not future state ;)
> - Link to v4: https://lore.kernel.org/r/20250807-add_err_uevents-v4-0-c624bfd8638d@linux.ibm.com
> 
> Changes in v4:
> - Add change in EEH to use the return of error_detected() in the uevent
>   just like AER and the new s390 code
> - Add R-b from Lukas
> - Link to v3: https://lore.kernel.org/r/20250730-add_err_uevents-v3-0-540b158c070f@linux.ibm.com
> 
> Changes in v3:
> - Reworded cover letter
> - Rebase on v6.16
> - Link to v2: https://lore.kernel.org/r/20250623-add_err_uevents-v2-0-a3a2cf8e711d@linux.ibm.com
> 
> Changes in v2:
> - Add a patch fixing pci_uevent_ers() mistakenly ignoring PCI_ERS_RESULT_NEED_RESET
> - Use the result of error_detected() for initial pci_uevent_ers()
> - Drop fixes tag in s390 patch
> - Rebase and re-test on current master
> - Link to v1: https://lore.kernel.org/r/20250424-add_err_uevents-v1-1-3384d6b779c6@linux.ibm.com
> 
> ---
> Niklas Schnelle (3):
>       PCI/AER: Fix missing uevent on recovery when a reset is requested
>       PCI/ERR: s390/pci: Use pci_uevent_ers() in PCI recovery
>       powerpc/eeh: Use result of error_detected() in uevent
> 
>  arch/powerpc/kernel/eeh_driver.c | 2 +-
>  arch/s390/pci/pci_event.c        | 3 +++
>  drivers/pci/pci-driver.c         | 3 ++-
>  include/linux/pci.h              | 2 +-
>  4 files changed, 7 insertions(+), 3 deletions(-)

Applied on pci/aer for v6.18, thanks!  This on top of Lukas's series:

  https://lore.kernel.org/all/cover.1755008151.git.lukas@wunner.de/

Expect the whole branch to be rebased to add Reviewed-by, etc.

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH v5 0/3] PCI/ERR: s390/pci: Use pci_uevent_ers() in PCI recovery
  2025-08-14 21:02 ` Bjorn Helgaas
@ 2025-08-26  6:21   ` Lukas Wunner
  0 siblings, 0 replies; 9+ messages in thread
From: Lukas Wunner @ 2025-08-26  6:21 UTC (permalink / raw)
  To: Bjorn Helgaas
  Cc: Niklas Schnelle, Mahesh J Salgaonkar, Linas Vepstas,
	Ilpo Järvinen, Manivannan Sadhasivam, Gerald Schaefer,
	Heiko Carstens, Vasily Gorbik, Alexander Gordeev,
	Christian Borntraeger, Sven Schnelle, Peter Oberparleiter,
	Matthew Rosato, Oliver O'Halloran, Sinan Kaya, linuxppc-dev,
	linux-s390, linux-kernel, linux-pci, Keith Busch

On Thu, Aug 14, 2025 at 04:02:01PM -0500, Bjorn Helgaas wrote:
> On Thu, Aug 07, 2025 at 03:55:37PM +0200, Niklas Schnelle wrote:
> > Niklas Schnelle (3):
> >       PCI/AER: Fix missing uevent on recovery when a reset is requested
> >       PCI/ERR: s390/pci: Use pci_uevent_ers() in PCI recovery
> >       powerpc/eeh: Use result of error_detected() in uevent
> > 
> >  arch/powerpc/kernel/eeh_driver.c | 2 +-
> >  arch/s390/pci/pci_event.c        | 3 +++
> >  drivers/pci/pci-driver.c         | 3 ++-
> >  include/linux/pci.h              | 2 +-
> >  4 files changed, 7 insertions(+), 3 deletions(-)
> 
> Applied on pci/aer for v6.18, thanks!  This on top of Lukas's series:
> 
>   https://lore.kernel.org/all/cover.1755008151.git.lukas@wunner.de/
> 
> Expect the whole branch to be rebased to add Reviewed-by, etc.

In case it helps, these are all the tags that were offered for my series
and that haven't been added to the pci/aer branch yet:

d0a2dee7d458 PCI/AER: Allow drivers to opt in to Bus Reset on Non-Fatal Errors
  Reviewed-by: Linas Vepstas <linasvepstas@gmail.com>
  https://lore.kernel.org/r/CAHrUA34fVV48MShC4CrXSmveR9i8MC4KAQxtM+XQY_Ao8joBQw@mail.gmail.com/
  Reviewed-by: Kuppuswamy Sathyanarayanan <sathyanarayanan.kuppuswamy@linux.intel.com>
  https://lore.kernel.org/r/8491adbd-d8e8-465a-971e-3fe50e2561b1@linux.intel.com/

1cbc5e25fb70 PCI/ERR: Fix uevent on failure to recover
  Reviewed-by: Kuppuswamy Sathyanarayanan <sathyanarayanan.kuppuswamy@linux.intel.com>
  https://lore.kernel.org/r/f0b59604-ae4d-4afe-8522-a8fbe5568e96@linux.intel.com/
  Reviewed-by: Linas Vepstas <linasvepstas@gmail.com>
  https://lore.kernel.org/r/CAHrUA34fVV48MShC4CrXSmveR9i8MC4KAQxtM+XQY_Ao8joBQw@mail.gmail.com/
  Reviewed-by: Niklas Schnelle <schnelle@linux.ibm.com>
  https://lore.kernel.org/r/a4419480c3d494a5940e87fea0c7b9864dc3e85b.camel@linux.ibm.com/

9011f0667c93 PCI/ERR: Notify drivers on failure to recover
  Reviewed-by: Kuppuswamy Sathyanarayanan <sathyanarayanan.kuppuswamy@linux.intel.com>
  https://lore.kernel.org/r/fa9f42ab-bced-4c7f-9977-c0b611e92e2e@linux.intel.com/
  Reviewed-by: Linas Vepstas <linasvepstas@gmail.com>
  https://lore.kernel.org/r/CAHrUA34fVV48MShC4CrXSmveR9i8MC4KAQxtM+XQY_Ao8joBQw@mail.gmail.com/

45bc82563d55 PCI/ERR: Update device error_state already after reset
  Reviewed-by: Kuppuswamy Sathyanarayanan <sathyanarayanan.kuppuswamy@linux.intel.com>
  https://lore.kernel.org/r/004298f7-ae08-428e-9b98-995fc56e55b1@linux.intel.com/
  Reviewed-by: Linas Vepstas <linasvepstas@gmail.com>
  https://lore.kernel.org/r/CAHrUA34fVV48MShC4CrXSmveR9i8MC4KAQxtM+XQY_Ao8joBQw@mail.gmail.com/

cc4a7a21e815 PCI/ERR: Remove remnants of .link_reset() callback
  Reviewed-by: Linas Vepstas <linasvepstas@gmail.com>
  https://lore.kernel.org/r/CAHrUA34fVV48MShC4CrXSmveR9i8MC4KAQxtM+XQY_Ao8joBQw@mail.gmail.com/
  Reviewed-by: Kuppuswamy Sathyanarayanan <sathyanarayanan.kuppuswamy@linux.intel.com>
  https://lore.kernel.org/r/59308229-24ed-4b8a-b398-cc47c61dfc47@linux.intel.com/
  Reviewed-by: Justin Tee <justin.tee@broadcom.com>
  https://lore.kernel.org/r/CABPRKS_Ut8Z+rvM4+-E0YvEwUKbMb0SDpLBdH+g1sYEh+YcxFA@mail.gmail.com/

Thanks!

Lukas

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2025-08-26  6:27 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-08-07 13:55 [PATCH v5 0/3] PCI/ERR: s390/pci: Use pci_uevent_ers() in PCI recovery Niklas Schnelle
2025-08-07 13:55 ` [PATCH v5 1/3] PCI/AER: Fix missing uevent on recovery when a reset is requested Niklas Schnelle
2025-08-07 13:55 ` [PATCH v5 2/3] PCI/ERR: s390/pci: Use pci_uevent_ers() in PCI recovery Niklas Schnelle
2025-08-07 13:55 ` [PATCH v5 3/3] powerpc/eeh: Use result of error_detected() in uevent Niklas Schnelle
2025-08-07 14:59   ` Mahesh J Salgaonkar
2025-08-07 16:17   ` Sathyanarayanan Kuppuswamy
2025-08-14  8:44 ` [PATCH v5 0/3] PCI/ERR: s390/pci: Use pci_uevent_ers() in PCI recovery Niklas Schnelle
2025-08-14 21:02 ` Bjorn Helgaas
2025-08-26  6:21   ` Lukas Wunner

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).