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

Brian King
2004-11-19T22:28:17Z

Greg KH wrote:
> On Fri, Nov 19, 2004 at 02:23:22PM -0600, brking@us.ibm.com wrote:
>
>>-static inline int pci_read_config_byte(struct pci_dev *dev, int where, u8 *val)
>>-{
>>- return pci_bus_read_config_byte (dev->bus, dev->devfn, where, val);
>>-}
>
>
> Well, as much as I despise this patch, you should at least get it
> correct :)
>
> You need to block the pci_bus_* functions too, otherwise the parts of
> the kernel that use them will stomp all over your device, right?

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.

If you think there are usages of the pci_bus_* functions in the
kernel after the adapter device driver gets loaded, from callers other
than adapter device drivers and userspace APIs, I would have to agree
with you. I was hoping to keep this patch as simple as possible.

Having to protect the pci_bus_* functions requires a lookup in these
functions to find the pci_dev to get the saved_config_space, which
I was hoping to avoid.

Ben - do you have any concerns with this limitation for the use you have
for this set of APIs?

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