]> git.baikalelectronics.ru Git - kernel.git/commit
PCI: Disable Bus Master unconditionally in pci_device_shutdown()
authorKonstantin Khlebnikov <khlebnikov@openvz.org>
Mon, 4 Feb 2013 11:55:58 +0000 (15:55 +0400)
committerBjorn Helgaas <bhelgaas@google.com>
Mon, 11 Feb 2013 23:28:50 +0000 (16:28 -0700)
commite1c5a9dbb9812be7f34cd578578fa683bcd41c33
tree04244374433d2bd91011da0d6eb785ecfe72e24d
parent3488c69bfc958da74cc1a2ebc3b69a93c80b12aa
PCI: Disable Bus Master unconditionally in pci_device_shutdown()

Commit b0c92de797 ("PCI: disable Bus Master on PCI device shutdown")
used pci_disable_device(), but that doesn't disable Bus Mastering
unconditionally; we allow nested enable/disable calls, and only the
last disable call actually does anything.

This uses pci_clear_master() to unconditionally clear the Bus Master
bit.

Matthew Garrett and Alan Cox said (see LKML link below) that clearing Bus
Master for all PCI devices may lead to unpredictable consequences: some
devices ignores this bit and continue DMA, some of them hang after that or
crash the whole system.  But we're already trying to clear Bus Master in
general because of b0c92de797; this merely deals with the cases where
drivers haven't shut down the device correctly.

[bhelgaas: changelog]
Link: https://lkml.org/lkml/2012/6/6/278
Signed-off-by: Konstantin Khlebnikov <khlebnikov@openvz.org>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Acked-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
drivers/pci/pci-driver.c