Skip to content
Commit 7897e602 authored by Konstantin Khlebnikov's avatar Konstantin Khlebnikov Committed by Bjorn Helgaas
Browse files

PCI: Disable Bus Master unconditionally in pci_device_shutdown()

Commit b566a22c ("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 b566a22c

; 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: default avatarKonstantin Khlebnikov <khlebnikov@openvz.org>
Signed-off-by: default avatarBjorn Helgaas <bhelgaas@google.com>
Acked-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
parent d1c3ed66
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment