All of lore.kernel.org
 help / color / mirror / Atom feed
From: Greg KH <greg@kroah.com>
To: linas@austin.ibm.com
Cc: linux-hotplug-devel@lists.sourceforge.net, linux-kernel@vger.kernel.org
Subject: Re: calling pci_find_device in interrupt ?
Date: Mon, 19 Jan 2004 21:41:38 +0000	[thread overview]
Message-ID: <20040119214138.GF4407@kroah.com> (raw)
In-Reply-To: <20040119151531.C22416@forte.austin.ibm.com>

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

WARNING: multiple messages have this Message-ID (diff)
From: Greg KH <greg@kroah.com>
To: linas@austin.ibm.com
Cc: linux-hotplug-devel@lists.sourceforge.net, linux-kernel@vger.kernel.org
Subject: Re: calling pci_find_device in interrupt ?
Date: Mon, 19 Jan 2004 13:41:38 -0800	[thread overview]
Message-ID: <20040119214138.GF4407@kroah.com> (raw)
In-Reply-To: <20040119151531.C22416@forte.austin.ibm.com>

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

  reply	other threads:[~2004-01-19 21:41 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-01-19 21:15 calling pci_find_device in interrupt ? linas
2004-01-19 21:41 ` Greg KH [this message]
2004-01-19 21:41   ` Greg KH

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20040119214138.GF4407@kroah.com \
    --to=greg@kroah.com \
    --cc=linas@austin.ibm.com \
    --cc=linux-hotplug-devel@lists.sourceforge.net \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.