Skip to content

Commit

Permalink
PCI: Don't try to disable Bus Master on disconnected PCI devices
Browse files Browse the repository at this point in the history
This is a fix for commit 7897e60 ("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>
  • Loading branch information
Konstantin Khlebnikov authored and Bjorn Helgaas committed Apr 3, 2013
1 parent b8178f1 commit 6e0eda3
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions drivers/pci/pci-driver.c
Original file line number Diff line number Diff line change
Expand Up @@ -390,9 +390,10 @@ static void pci_device_shutdown(struct device *dev)

/*
* Turn off Bus Master bit on the device to tell it to not
* continue to do DMA
* continue to do DMA. Don't touch devices in D3cold or unknown states.
*/
pci_clear_master(pci_dev);
if (pci_dev->current_state <= PCI_D3hot)
pci_clear_master(pci_dev);
}

#ifdef CONFIG_PM
Expand Down

0 comments on commit 6e0eda3

Please sign in to comment.