Skip to contentSkip to conversation

powerpc/powernv: Escalate reset when IODA reset fails

PATCH Applied Oliver O'Halloran 3 participants 4 messages Feb 1, 2019 – Feb 8, 2019 PowerPC

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 powerpc/powernv: Escalate reset when IODA reset fails

The IODA reset is used to flush out any OS controlled state from the PHB. This reset can fail if a PHB fatal error has occurred in early boot, probably due to a because of a bad device. We already do a fundemental reset of the device in some cases, so this patch just adds a test to force a full reset if firmware reports an error when performing the IODA reset.

---
 arch/powerpc/platforms/powernv/pci-ioda.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)
arch/powerpc/platforms/powernv/pci-ioda.c +5 -2
index 1d6406a..53982f8 100644
@@ -3943,9 +3943,12 @@ static void __init pnv_pci_init_ioda_phb(struct device_node *np,
 	 * shutdown PCI devices correctly. We already got IODA table
 	 * cleaned out. So we have to issue PHB reset to stop all PCI
 	 * transactions from previous kernel. The ppc_pci_reset_phbs
-	 * kernel parameter will force this reset too.
+	 * kernel parameter will force this reset too. Additionally,
+	 * if the IODA reset above failed then use a bigger hammer.
+	 * This can happen if we get a PHB fatal error in very early
+	 * boot.
 	 */
-	if (is_kdump_kernel() || pci_reset_phbs) {
+	if (is_kdump_kernel() || pci_reset_phbs || rc) {
 		pr_info("  Issue PHB reset ...\n");
 		pnv_eeh_phb_reset(hose, EEH_RESET_FUNDAMENTAL);
 		pnv_eeh_phb_reset(hose, EEH_RESET_DEACTIVATE);
Signature · 1 line
2.9.4
Reviewed-by on v1 1/1
#1 lore raw
Quoted 7 lines · Oliver O'Halloran

The IODA reset is used to flush out any OS controlled state from the PHB. This reset can fail if a PHB fatal error has occurred in early boot, probably due to a because of a bad device. We already do a fundemental reset of the device in some cases, so this patch just adds a test to force a full reset if firmware reports an error when performing the IODA reset.

I am pretty sure I already saw this :-/

ah, anyway

Quoted 24 lines
---
 arch/powerpc/platforms/powernv/pci-ioda.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)
arch/powerpc/platforms/powernv/pci-ioda.c +5 -2
index 1d6406a..53982f8 100644
@@ -3943,9 +3943,12 @@ static void __init pnv_pci_init_ioda_phb(struct device_node *np,
 	 * shutdown PCI devices correctly. We already got IODA table
 	 * cleaned out. So we have to issue PHB reset to stop all PCI
 	 * transactions from previous kernel. The ppc_pci_reset_phbs
-	 * kernel parameter will force this reset too.
+	 * kernel parameter will force this reset too. Additionally,
+	 * if the IODA reset above failed then use a bigger hammer.
+	 * This can happen if we get a PHB fatal error in very early
+	 * boot.
 	 */
-	if (is_kdump_kernel() || pci_reset_phbs) {
+	if (is_kdump_kernel() || pci_reset_phbs || rc) {
 		pr_info("  Issue PHB reset ...\n");
 		pnv_eeh_phb_reset(hose, EEH_RESET_FUNDAMENTAL);
 		pnv_eeh_phb_reset(hose, EEH_RESET_DEACTIVATE);
Signature · 1 line
Alexey
author
#2 lore raw
Quoted 10 lines · Alexey Kardashevskiy
Quoted 6 lines · Oliver O'Halloran

The IODA reset is used to flush out any OS controlled state from the PHB. This reset can fail if a PHB fatal error has occurred in early boot, probably due to a because of a bad device. We already do a fundemental reset of the device in some cases, so this patch just adds a test to force a full reset if firmware reports an error when performing the IODA reset.

Quoted 3 lines
Quoted 1 line

I am pretty sure I already saw this :-/

Uh yeah, looks like I posted it a while ago and forgot I did.

Quoted 35 lines

ah, anyway

Quoted 14 lines
---
 arch/powerpc/platforms/powernv/pci-ioda.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)
arch/powerpc/platforms/powernv/pci-ioda.c +0 -1
index 1d6406a..53982f8 100644
@@ -3943,9 +3943,12 @@ static void __init pnv_pci_init_ioda_phb(struct device_node *np,
       * shutdown PCI devices correctly. We already got IODA table
       * cleaned out. So we have to issue PHB reset to stop all PCI
       * transactions from previous kernel. The ppc_pci_reset_phbs
-      * kernel parameter will force this reset too.

arch/powerpc/platforms/powernv/pci-ioda.c static void __init pnv_pci_init_ioda_phb(struct device_node *np, · line 3954

Quoted 10 lines
arch/powerpc/platforms/powernv/pci-ioda.c +5 -1
+      * kernel parameter will force this reset too. Additionally,
+      * if the IODA reset above failed then use a bigger hammer.
+      * This can happen if we get a PHB fatal error in very early
+      * boot.
       */
-     if (is_kdump_kernel() || pci_reset_phbs) {
+     if (is_kdump_kernel() || pci_reset_phbs || rc) {
              pr_info("  Issue PHB reset ...\n");
              pnv_eeh_phb_reset(hose, EEH_RESET_FUNDAMENTAL);
              pnv_eeh_phb_reset(hose, EEH_RESET_DEACTIVATE);

--
Alexey

#3 lore raw
In reply to Oliver O'Halloran
Quoted 8 lines · Oliver O'Halloran

The IODA reset is used to flush out any OS controlled state from the PHB. This reset can fail if a PHB fatal error has occurred in early boot, probably due to a because of a bad device. We already do a fundemental reset of the device in some cases, so this patch just adds a test to force a full reset if firmware reports an error when performing the IODA reset.

Applied to powerpc next, thanks.

https://git.kernel.org/powerpc/c/b174b4fb919d118d9ac546b99a69574d

cheers