diff options
author | Konstantin Khlebnikov <khlebnikov@openvz.org> | 2013-03-14 10:49:37 -0400 |
---|---|---|
committer | Bjorn Helgaas <bhelgaas@google.com> | 2013-04-02 20:03:09 -0400 |
commit | 6e0eda3c389887168455b92b6f7b48f552227067 (patch) | |
tree | d3d336d2ab410a895a6f7257ef9b147225c5ee82 /drivers/pci/pci-driver.c | |
parent | b8178f130e25c1bdac1c33e0996f1ff6e20ec08e (diff) |
PCI: Don't try to disable Bus Master on disconnected PCI devices
This is a fix for commit 7897e60227 ("PCI: Disable Bus Master
unconditionally in pci_device_shutdown()"). Vivek reported that
with this commit, kexec failed because none of his SATA disks
came up.
A ->shutdown() callback might put the device in D3cold, which means config
space is no longer available.
[bhelgaas: changelog]
Link: https://lkml.org/lkml/2013/3/12/529
Reported-and-Tested-by: Vivek Goyal <vgoyal@redhat.com>
Signed-off-by: Konstantin Khlebnikov <khlebnikov@openvz.org>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Cc: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Diffstat (limited to 'drivers/pci/pci-driver.c')
-rw-r--r-- | drivers/pci/pci-driver.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/pci/pci-driver.c b/drivers/pci/pci-driver.c index 1fa1e482a999..79277fb36c6b 100644 --- a/drivers/pci/pci-driver.c +++ b/drivers/pci/pci-driver.c | |||
@@ -390,9 +390,10 @@ static void pci_device_shutdown(struct device *dev) | |||
390 | 390 | ||
391 | /* | 391 | /* |
392 | * Turn off Bus Master bit on the device to tell it to not | 392 | * Turn off Bus Master bit on the device to tell it to not |
393 | * continue to do DMA | 393 | * continue to do DMA. Don't touch devices in D3cold or unknown states. |
394 | */ | 394 | */ |
395 | pci_clear_master(pci_dev); | 395 | if (pci_dev->current_state <= PCI_D3hot) |
396 | pci_clear_master(pci_dev); | ||
396 | } | 397 | } |
397 | 398 | ||
398 | #ifdef CONFIG_PM | 399 | #ifdef CONFIG_PM |