Linux PCI subsystem development
 help / color / mirror / Atom feed
* [PATCH] PCI: Prevent LS7A Bus Master clearing on kexec
@ 2024-07-26  9:28 Huacai Chen
  2024-08-01 23:12 ` Bjorn Helgaas
  0 siblings, 1 reply; 3+ messages in thread
From: Huacai Chen @ 2024-07-26  9:28 UTC (permalink / raw)
  To: Bjorn Helgaas
  Cc: linux-pci, Jianmin Lv, Xuefeng Li, Huacai Chen, Jiaxun Yang,
	Huacai Chen, Ming Wang

This is similar to commit 62b6dee1b44aa23b39355 ("PCI/portdrv: Prevent
LS7A Bus Master clearing on shutdown"), which prevents LS7A Bus Master
clearing on kexec.

Only skip Bus Master clearing on bridges because endpoint devices still
need it.

Signed-off-by: Ming Wang <wangming01@loongson.cn>
Signed-off-by: Huacai Chen <chenhuacai@loongson.cn>
---
 drivers/pci/pci-driver.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/pci/pci-driver.c b/drivers/pci/pci-driver.c
index f412ef73a6e4..b7d3a4d8532f 100644
--- a/drivers/pci/pci-driver.c
+++ b/drivers/pci/pci-driver.c
@@ -517,7 +517,7 @@ static void pci_device_shutdown(struct device *dev)
 	 * If it is not a kexec reboot, firmware will hit the PCI
 	 * devices with big hammer and stop their DMA any way.
 	 */
-	if (kexec_in_progress && (pci_dev->current_state <= PCI_D3hot))
+	if (kexec_in_progress && !pci_is_bridge(pci_dev) && (pci_dev->current_state <= PCI_D3hot))
 		pci_clear_master(pci_dev);
 }
 
-- 
2.43.5


^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2024-08-04  1:22 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-07-26  9:28 [PATCH] PCI: Prevent LS7A Bus Master clearing on kexec Huacai Chen
2024-08-01 23:12 ` Bjorn Helgaas
2024-08-04  1:22   ` Huacai Chen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox