Re: [PATCH 1/1] pci: Block config access during BIST (resend)

Alan Cox
2005-01-11T15:47:32Z

On Llu, 2005-01-10 at 22:57, Brian King wrote:
> > For this I would add a semaphore or a lock bit to pci_dev.
> > Probably a simple flag is good enough that is checked by sysfs/proc
> > and return EBUSY when set.
>
> How about something like this... (only compile tested at this point)

User space does not expect to get dumped with -EBUSY randomly on PCI
accesses. Not a viable option in that form _but_ making them sleep would
work - even with a simple global wait queue
for the pci_unblock_.. path

ie add the following (oh and uninlined probably for compatcness)

static int pci_user_wait_access(struct pci_dev *pdev) {
wait_event(&pci_ucfg_wait, dev->block_ucfg_access == 0);
}