* calling pci_find_device in interrupt ?
@ 2004-01-19 21:15 linas
2004-01-19 21:41 ` Greg KH
0 siblings, 1 reply; 3+ messages in thread
From: linas @ 2004-01-19 21:15 UTC (permalink / raw)
To: linux-hotplug
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
Linux-hotplug-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: calling pci_find_device in interrupt ?
2004-01-19 21:15 calling pci_find_device in interrupt ? linas
@ 2004-01-19 21:41 ` Greg KH
0 siblings, 0 replies; 3+ messages in thread
From: Greg KH @ 2004-01-19 21:41 UTC (permalink / raw)
To: linas; +Cc: linux-hotplug-devel, linux-kernel
On Mon, Jan 19, 2004 at 03:15:31PM -0600, linas@austin.ibm.com wrote:
>
> Greg,
Hm, this isn't really a hotplug question. This is better asked on
linux-kernel.
> 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
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: calling pci_find_device in interrupt ?
@ 2004-01-19 21:41 ` Greg KH
0 siblings, 0 replies; 3+ messages in thread
From: Greg KH @ 2004-01-19 21:41 UTC (permalink / raw)
To: linas; +Cc: linux-hotplug-devel, linux-kernel
On Mon, Jan 19, 2004 at 03:15:31PM -0600, linas@austin.ibm.com wrote:
>
> Greg,
Hm, this isn't really a hotplug question. This is better asked on
linux-kernel.
> 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
Linux-hotplug-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2004-01-19 22:07 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-01-19 21:15 calling pci_find_device in interrupt ? linas
2004-01-19 21:41 ` Greg KH
2004-01-19 21:41 ` Greg KH
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.