提交 fd6dceab 编写于 作者: K Konstantin Khlebnikov 提交者: Bjorn Helgaas

PCI: Catch attempts to disable already-disabled devices

Warn when disabling a device that has already been disabled.

[bhelgaas: message wording]
Signed-off-by: NKonstantin Khlebnikov <khlebnikov@openvz.org>
Signed-off-by: NBjorn Helgaas <bhelgaas@google.com>
Acked-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
上级 7897e602
......@@ -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;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册