diff mbox

core/pci: Avoid hreset after freset

Message ID 1483663464-2900-1-git-send-email-gwshan@linux.vnet.ibm.com
State Accepted
Headers show

Commit Message

Gavin Shan Jan. 6, 2017, 12:44 a.m. UTC
Commit 5ac71c9 ("pci: Avoid hot resets at boot time") missed to
avoid hot reset after fundamental reset for PCIe common slots.
This fixes it.

Cc: stable # 5.3.x
Reported-by: Guilherme G. Piccoli <gpiccoli@linux.vnet.ibm.com>
Signed-off-by: Gavin Shan <gwshan@linux.vnet.ibm.com>
---
 core/pcie-slot.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Comments

Russell Currey Jan. 6, 2017, 4:59 a.m. UTC | #1
On Fri, 2017-01-06 at 11:44 +1100, Gavin Shan wrote:
> Commit 5ac71c9 ("pci: Avoid hot resets at boot time") missed to
> avoid hot reset after fundamental reset for PCIe common slots.
> This fixes it.
> 
> Cc: stable # 5.3.x
> Reported-by: Guilherme G. Piccoli <gpiccoli@linux.vnet.ibm.com>
> Signed-off-by: Gavin Shan <gwshan@linux.vnet.ibm.com>

Reviewed-by: Russell Currey <ruscur@russell.cc>
Stewart Smith Feb. 16, 2017, 7:33 a.m. UTC | #2
Gavin Shan <gwshan@linux.vnet.ibm.com> writes:
> Commit 5ac71c9 ("pci: Avoid hot resets at boot time") missed to
> avoid hot reset after fundamental reset for PCIe common slots.
> This fixes it.
>
> Cc: stable # 5.3.x
> Reported-by: Guilherme G. Piccoli <gpiccoli@linux.vnet.ibm.com>
> Signed-off-by: Gavin Shan <gwshan@linux.vnet.ibm.com>

Thanks, merged to master as of 53a08f1
and to 5.4.x as of 5b6a8bc.
diff mbox

Patch

diff --git a/core/pcie-slot.c b/core/pcie-slot.c
index f9bef64..11354ed 100644
--- a/core/pcie-slot.c
+++ b/core/pcie-slot.c
@@ -410,7 +410,8 @@  static int64_t pcie_slot_sm_freset(struct pci_slot *slot)
 	case PCI_SLOT_STATE_FRESET_POWER_OFF:
 		PCIE_SLOT_DBG(slot, "FRESET: Power is off, turn on\n");
 		pcie_slot_set_power_state_ext(slot, PCI_SLOT_POWER_ON, false);
-		pci_slot_set_state(slot, PCI_SLOT_STATE_HRESET_START);
+
+		pci_slot_set_state(slot, PCI_SLOT_STATE_LINK_START_POLL);
 		return pci_slot_set_sm_timeout(slot, msecs_to_tb(50));
 	default:
 		prlog(PR_ERR, PCIE_SLOT_PREFIX