From: Rafael J. Wysocki Date: Mon, 14 Sep 2009 20:25:11 +0000 (+0200) Subject: PCI / PCIe portdrv: Fix pcie_portdrv_slot_reset() X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=e9d8288871efa0d98a1d1d1f17976b5b00a0234d;p=GitHub%2FLineageOS%2Fandroid_kernel_samsung_universal7580.git PCI / PCIe portdrv: Fix pcie_portdrv_slot_reset() After commit c82f63e411f1b58427c103bd95af2863b1c96dd1 (PCI: check saved state before restore) pcie_portdrv_slot_reset() may not work correctly if dev->error_state is equal to pci_channel_io_frozen, because dev->state_saved need not be set at that time. Fix this issue by setting dev->state_saved before pci_restore_state() is called in pcie_portdrv_slot_reset(). Signed-off-by: Rafael J. Wysocki Signed-off-by: Jesse Barnes --- diff --git a/drivers/pci/pcie/portdrv_pci.c b/drivers/pci/pcie/portdrv_pci.c index 091ce70051e..6df5c984a79 100644 --- a/drivers/pci/pcie/portdrv_pci.c +++ b/drivers/pci/pcie/portdrv_pci.c @@ -205,6 +205,7 @@ static pci_ers_result_t pcie_portdrv_slot_reset(struct pci_dev *dev) /* If fatal, restore cfg space for possible link reset at upstream */ if (dev->error_state == pci_channel_io_frozen) { + dev->state_saved = true; pci_restore_state(dev); pcie_portdrv_restore_config(dev); pci_enable_pcie_error_reporting(dev);