mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH 8/9] PCI PM: clear IO and MEM when disabling a device
@ 2006-06-05  8:46 Adam Belay
  2006-06-05 16:37 ` Rajesh Shah
  2006-06-06  0:32 ` Benjamin Herrenschmidt
  0 siblings, 2 replies; 4+ messages in thread
From: Adam Belay @ 2006-06-05  8:46 UTC (permalink / raw)
  To: Greg KH, Andrew Morton; +Cc: linux-kernel, linux-pci

This patch modifies pci_disable_device() to clear IO and MEM from the
COMMAND PCI config register.  This is required before entering D3,  but
also probably a good general practice for system suspend.

Signed-off-by: Adam Belay <abelay@novell.com>

---
 pci.c |    8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff -urN a/drivers/pci/pci.c b/drivers/pci/pci.c
--- a/drivers/pci/pci.c	2006-05-31 20:40:25.000000000 -0400
+++ b/drivers/pci/pci.c	2006-06-04 15:09:16.000000000 -0400
@@ -312,8 +312,12 @@
 	u16 pci_command;
 	
 	pci_read_config_word(dev, PCI_COMMAND, &pci_command);
-	if (pci_command & PCI_COMMAND_MASTER) {
-		pci_command &= ~PCI_COMMAND_MASTER;
+	if (pci_command & (PCI_COMMAND_MASTER |
+			   PCI_COMMAND_IO |
+			   PCI_COMMAND_MEMORY)) {
+		pci_command &= ~ (PCI_COMMAND_MASTER |
+				  PCI_COMMAND_IO |
+				  PCI_COMMAND_MEMORY);
 		pci_write_config_word(dev, PCI_COMMAND, pci_command);
 	}
 	dev->is_busmaster = 0;



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

end of thread, other threads:[~2006-06-07  3:04 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-06-05  8:46 [PATCH 8/9] PCI PM: clear IO and MEM when disabling a device Adam Belay
2006-06-05 16:37 ` Rajesh Shah
2006-06-06  0:32 ` Benjamin Herrenschmidt
2006-06-07  3:16   ` Adam Belay

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

Powered by JetHome