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

From: Adam Belay
Date: Mon Jun 05 2006 - 04:36:36 EST


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@xxxxxxxxxx>

---
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 majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/