Skip to contentSkip to conversation

calling pci_find_device in interrupt ?

DISCUSSION [email protected] 2 participants 2 messages Jan 19, 2004

lore
Share & tools
lore
#0 lore raw

Greg,

I was calling pci_find_device() from an interrupt, when I discovered that it has a WARN_ON(in_interrupt()); in it.

Why? If spin_lock(&pci_bus_lock); was changed to spin_lock_irqsave(), it seems like it would be interrupt-safe.

Rather than sending a patch that makes this change, I thought I'd enquire politely first ...

--linas

-------------------------------------------------------
The SF.Net email is sponsored by EclipseCon 2004
Premiere Conference on Open Tools Development and Integration See the breadth of Eclipse activity. February 3-5 in Anaheim, CA.
http://www.eclipsecon.org/osdn
_______________________________________________
Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel

#1 lore raw
Quoted 2 lines · On Mon, Jan 19, 2004 at 03:15:31PM -0600, [email protected] wrote:

Greg,

Hm, this isn't really a hotplug question. This is better asked on linux-kernel.

Quoted 5 lines

I was calling pci_find_device() from an interrupt, when I discovered that it has a WARN_ON(in_interrupt()); in it.

Why? If spin_lock(&pci_bus_lock); was changed to spin_lock_irqsave(), it seems like it would be interrupt-safe.

Because you should not call such a function from an interrupt. It is a waste of time. Just save off your pci device structure properly in your setup functions.

Also, don't use the pci_find_* functions. Use the pci_get_* functions instead, as the pci_find_* functions will be going away in a future kernel version (probably 2.7).

thanks,

greg k-h

-------------------------------------------------------
The SF.Net email is sponsored by EclipseCon 2004
Premiere Conference on Open Tools Development and Integration See the breadth of Eclipse activity. February 3-5 in Anaheim, CA.
http://www.eclipsecon.org/osdn
_______________________________________________
Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel