Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 45232
b: refs/heads/master
c: 6ae4adf
h: refs/heads/master
v: v3
  • Loading branch information
Ard van Breemen authored and Linus Torvalds committed Jan 6, 2007
1 parent dc7d0f5 commit 6ed7ecb
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: a416aba637dcb4127595c02a59041cd278422f7e
refs/heads/master: 6ae4adf50380d0fc5176a76d98d324f8fa491a8f
24 changes: 24 additions & 0 deletions trunk/drivers/pci/search.c
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,18 @@ static struct pci_dev * pci_find_subsys(unsigned int vendor,
struct pci_dev *dev;

WARN_ON(in_interrupt());

/*
* pci_find_subsys() can be called on the ide_setup() path, super-early
* in boot. But the down_read() will enable local interrupts, which
* can cause some machines to crash. So here we detect and flag that
* situation and bail out early.
*/
if (unlikely(list_empty(&pci_devices))) {
printk(KERN_INFO "pci_find_subsys() called while pci_devices "
"is still empty\n");
return NULL;
}
down_read(&pci_bus_sem);
n = from ? from->global_list.next : pci_devices.next;

Expand Down Expand Up @@ -259,6 +271,18 @@ pci_get_subsys(unsigned int vendor, unsigned int device,
struct pci_dev *dev;

WARN_ON(in_interrupt());

/*
* pci_get_subsys() can potentially be called by drivers super-early
* in boot. But the down_read() will enable local interrupts, which
* can cause some machines to crash. So here we detect and flag that
* situation and bail out early.
*/
if (unlikely(list_empty(&pci_devices))) {
printk(KERN_NOTICE "pci_get_subsys() called while pci_devices "
"is still empty\n");
return NULL;
}
down_read(&pci_bus_sem);
n = from ? from->global_list.next : pci_devices.next;

Expand Down

0 comments on commit 6ed7ecb

Please sign in to comment.