mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] scsi: efct: clear MWI on remove
@ 2026-09-18 18:13 Guangshuo Li
  2026-09-21 12:20 ` Daniel Wagner
  2026-09-21 15:13 ` krzk
  0 siblings, 2 replies; 4+ messages in thread
From: Guangshuo Li @ 2026-09-18 18:13 UTC (permalink / raw)
  To: Ram Vegesna, James E.J. Bottomley, Martin K. Petersen,
	Sebastian Andrzej Siewior, Guangshuo Li, Thomas Gleixner,
	Kees Cook, Daniel Wagner, Hannes Reinecke, James Smart,
	linux-scsi, target-devel, linux-kernel
  Cc: stable

efct_pci_probe() enables PCI Memory-Write-Invalidate with pci_set_mwi().
The probe failure path clears this state with pci_clear_mwi(), but the
normal remove path does not perform the corresponding cleanup.

pci_disable_device() only disables PCI bus mastering and does not clear
the PCI_COMMAND_INVALIDATE bit. As a result, the MWI configuration can
remain enabled after the driver is removed.

Call pci_clear_mwi() in efct_pci_remove(), matching the probe error
path.

This issue was found by manual code inspection.

Fixes: 4df84e8466242 ("scsi: elx: efct: Driver initialization routines")
Cc: stable@vger.kernel.org
Signed-off-by: Guangshuo Li <lgs201920130244@gmail.com>
---
 drivers/scsi/elx/efct/efct_driver.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/scsi/elx/efct/efct_driver.c b/drivers/scsi/elx/efct/efct_driver.c
index 07c2f453459e..720bad7b3517 100644
--- a/drivers/scsi/elx/efct/efct_driver.c
+++ b/drivers/scsi/elx/efct/efct_driver.c
@@ -613,6 +613,7 @@ efct_pci_remove(struct pci_dev *pdev)
 
 	pci_release_regions(pdev);
 
+	pci_clear_mwi(pdev);
 	pci_disable_device(pdev);
 }
 
-- 
2.43.0


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

end of thread, other threads:[~2026-09-22  2:50 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-09-18 18:13 [PATCH] scsi: efct: clear MWI on remove Guangshuo Li
2026-09-21 12:20 ` Daniel Wagner
2026-09-21 15:13 ` krzk
2026-09-22  2:50   ` Guangshuo Li

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

all inboxes | Powered by JetHome®