Re: pci_get_dev_by_id() from interrupt handlers

From: Greg KH
Date: Tue Apr 20 2010 - 12:31:39 EST


On Tue, Apr 20, 2010 at 06:04:24PM +0200, Joerg Roedel wrote:
> Hi Jesse,
>
> I have a question regarding the warning in the pci_get_dev_by_id()
> [search.c] function which triggers when called from interrupt context.
> As far as I have seen this function should be save to be called in
> atomic mode.

Are you sure?

> Is there any other reason it should not be called in interrupt
> handlers?

klist traversal is not safe to be done in interrupt context as the
spinlock is not told to be interrupt safe. Now you could go and change
the klist core to be interrupt safe, but you should probably rethink
your need here first.

> I need to (indirectly) call this function for my IOMMU driver to
> handle events from the IOMMU.

>From interrupt? Why not use an interrupt thread instead if you really
need to do this.

Actually, what are you trying to accomplish here?

thanks,

greg k-h
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/