Re: [PATCH 1/2] pci: Block config access during BIST

Brian King
2004-11-19T23:45:38Z

Benjamin Herrenschmidt wrote:
> On Fri, 2004-11-19 at 16:25 -0600, Brian King wrote:
>
>
>>I thought about that when writing up this patch, but decided against it.
>>I figured it was overkill and was going to make the patch more complicated
>>than it needed to be to solve the main problem I have seen, which is
>>userspace code, usually hotplug/coldplug scripts, reading config space
>>when an adapter is running BIST.
>
>
> How so ? Why would it be more complicated to do the workaround in
> drivers/pci/access.c macros instead and not touch all the wrappers ? It
> would actually make a much smaller patch...

I guess what I was having difficulty with was how to go from bus/devfn
to pci_dev in the bus macros (to access the saved_config_space) and do this
safely at interrupt level. The spinlock protecting the devices list on the
pci_bus struct is never acquired with irqsave and all the existing
functions to search for a given pci device are not callable from
interrupt context.

--
Brian King
eServer Storage I/O
IBM Linux Technology Center