projects
/
linux.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
7897e60
)
PCI: Catch attempts to disable already-disabled devices
author
Konstantin Khlebnikov
<khlebnikov@openvz.org>
Mon, 4 Feb 2013 11:56:01 +0000
(15:56 +0400)
committer
Bjorn Helgaas
<bhelgaas@google.com>
Tue, 12 Feb 2013 00:25:04 +0000
(17:25 -0700)
Warn when disabling a device that has already been disabled.
[bhelgaas: message wording]
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.c
patch
|
blob
|
history
diff --git
a/drivers/pci/pci.c
b/drivers/pci/pci.c
index 5cb5820fae40147a29c79913cd1ebadcbfba1348..29a09b705f04e6a7da8069db923cd883599b5e36 100644
(file)
--- a/
drivers/pci/pci.c
+++ b/
drivers/pci/pci.c
@@
-1401,6
+1401,9
@@
pci_disable_device(struct pci_dev *dev)
if (dr)
dr->enabled = 0;
+ dev_WARN_ONCE(&dev->dev, atomic_read(&dev->enable_cnt) <= 0,
+ "disabling already-disabled device");
+
if (atomic_sub_return(1, &dev->enable_cnt) != 0)
return;