[PATCH] powerpc/eeh: Fix trivial error in eeh_restore_dev_state()

Subsystems: linux for powerpc (32-bit and 64-bit), pci enhanced error handling (eeh) for powerpc, the rest

STALE4081d

2 messages, 2 authors, 2015-06-03 · open the first message on its own page

[PATCH] powerpc/eeh: Fix trivial error in eeh_restore_dev_state()

From: David Gibson <hidden>
Date: 2015-06-03 04:52:58

Commit 28158cd "powerpc/eeh: Enhance pcibios_set_pcie_reset_state()"
introduced a fix for a problem where certain configurations could lead to
pci_reset_function() destroying the state of PCI devices other than the one
specified.

Unfortunately, the fix has a trivial bug - it calls pci_save_state() again,
when it should be calling pci_restore_state().  This corrects the problem.

Cc: Gavin Shan <redacted>
Signed-off-by: David Gibson <redacted>
---
 arch/powerpc/kernel/eeh.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/powerpc/kernel/eeh.c b/arch/powerpc/kernel/eeh.c
index 9ee61d1..ece4181 100644
--- a/arch/powerpc/kernel/eeh.c
+++ b/arch/powerpc/kernel/eeh.c
@@ -719,7 +719,7 @@ static void *eeh_restore_dev_state(void *data, void *userdata)
 
 	/* The caller should restore state for the specified device */
 	if (pdev != dev)
-		pci_save_state(pdev);
+		pci_restore_state(pdev);
 
 	return NULL;
 }
-- 
2.4.2

Re: [PATCH] powerpc/eeh: Fix trivial error in eeh_restore_dev_state()

From: Guo Wen Shan <hidden>
Date: 2015-06-03 04:59:21


David Gibson [off-list ref] wrote on 03/06/2015 14:52:59:
From: David Gibson <redacted>
To: Guo Wen Shan/Australia/IBM@IBMAU, mpe@ellerman.id.au
Cc: benh@kernel.crashing.org, paulus@samba.org, linuxppc-
dev@lists.ozlabs.org, linux-kernel@vger.kernel.org, David Gibson
[off-list ref]
Date: 03/06/2015 14:53
Subject: [PATCH] powerpc/eeh: Fix trivial error in eeh_restore_dev_state
()
Commit 28158cd "powerpc/eeh: Enhance pcibios_set_pcie_reset_state()"
introduced a fix for a problem where certain configurations could lead to
pci_reset_function() destroying the state of PCI devices other than the
one
specified.

Unfortunately, the fix has a trivial bug - it calls pci_save_state()
again,
when it should be calling pci_restore_state().  This corrects the
problem.
Cc: Gavin Shan <redacted>
Signed-off-by: David Gibson <redacted>
Acked-by: Gavin Shan <redacted>

Thanks,
Gavin
quoted hunk
---
 arch/powerpc/kernel/eeh.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/powerpc/kernel/eeh.c b/arch/powerpc/kernel/eeh.c
index 9ee61d1..ece4181 100644
--- a/arch/powerpc/kernel/eeh.c
+++ b/arch/powerpc/kernel/eeh.c
@@ -719,7 +719,7 @@ static void *eeh_restore_dev_state(void *data,
void *userdata)

    /* The caller should restore state for the specified device */
    if (pdev != dev)
-      pci_save_state(pdev);
+      pci_restore_state(pdev);

    return NULL;
 }
--
2.4.2
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help