Skip to content

Commit 94946dc

Browse files
chenhuacaiKexyBiscuit
authored andcommitted
FROMLIST: PCI: Prevent LS7A Bus Master clearing on kexec
This is similar to commit 62b6dee ("PCI/portdrv: Prevent LS7A Bus Master clearing on shutdown"), which prevents LS7A Bus Master clearing on kexec. The key point of this is to work around the LS7A defect that clearing PCI_COMMAND_MASTER prevents MMIO requests from going downstream, and we may need to do that even after .shutdown(), e.g., to print console messages. And in this case we rely on .shutdown() for the downstream devices to disable interrupts and DMA. Only skip Bus Master clearing on bridges because endpoint devices still need it. Cc: [email protected] Signed-off-by: Ming Wang <[email protected]> Signed-off-by: Huacai Chen <[email protected]> Link: https://lore.kernel.org/all/[email protected]/ Signed-off-by: Kexy Biscuit <[email protected]>
1 parent 580911c commit 94946dc

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/pci/pci-driver.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -517,7 +517,7 @@ static void pci_device_shutdown(struct device *dev)
517517
* If it is not a kexec reboot, firmware will hit the PCI
518518
* devices with big hammer and stop their DMA any way.
519519
*/
520-
if (kexec_in_progress && (pci_dev->current_state <= PCI_D3hot))
520+
if (kexec_in_progress && !pci_is_bridge(pci_dev) && (pci_dev->current_state <= PCI_D3hot))
521521
pci_clear_master(pci_dev);
522522
}
523523

0 commit comments

Comments
 (0)