[PATCH 8/9] PCI PM: clear IO and MEM when disabling a device

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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 <[email protected]>

---
 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;


-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Stuff]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]     [Linux Resources]
  Powered by Linux