kernel-ark/drivers/pci
Matthew Wilcox 7ea7e98fd8 PCI: Block on access to temporarily unavailable pci device
The existing implementation of pci_block_user_cfg_access() was recently
criticised for providing out of date information and for returning errors
on write, which applications won't be expecting.

This reimplementation uses a global wait queue and a bit per device.
I've open-coded prepare_to_wait() / finish_wait() as I could optimise
it significantly by knowing that the pci_lock protected us at all points.

It looked a bit funny to be doing a spin_unlock_irqsave(); schedule(),
so I used spin_lock_irq() for the _user versions of pci_read_config and
pci_write_config.  Not carrying a flags pointer around made the code
much less nasty.

Attempts to block an already blocked device hit a BUG() and attempts to
unblock an already unblocked device hit a WARN().  If we need to block
access to a device from userspace, it's because it's unsafe for even
another bit of the kernel to access the device.  An attempt to block
a device for a second time means we're about to access the device to
perform some other operation, which could provoke undefined behaviour
from the device.

Signed-off-by: Matthew Wilcox <matthew@wil.cx>
Acked-by: Adam Belay <abelay@novell.com>
Acked-by: Alan Cox <alan@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2006-12-01 14:36:58 -08:00
..
hotplug acpiphp: fix missing acpiphp_glue_exit() 2006-12-01 14:36:58 -08:00
pcie
.gitignore
access.c PCI: Block on access to temporarily unavailable pci device 2006-12-01 14:36:58 -08:00
bus.c
hotplug.c
htirq.c
Kconfig PCI: Let PCI_MULTITHREAD_PROBE not be broken 2006-12-01 14:36:55 -08:00
Makefile
msi.c
msi.h PCI: Make some MSI-X #defines generic 2006-12-01 14:36:56 -08:00
pci-acpi.c pci: clear osc support flags if no _OSC method 2006-12-01 14:36:58 -08:00
pci-driver.c pci: fix __pci_register_driver error handling 2006-12-01 14:36:58 -08:00
pci-sysfs.c [PATCH] pci: don't try to remove sysfs files before they are setup. 2006-11-13 07:40:42 -08:00
pci.c PCI: Replace HAVE_ARCH_PCI_MWI with PCI_DISABLE_MWI 2006-12-01 14:36:57 -08:00
pci.h
probe.c PCI: quirks: fix the festering mess that claims to handle IDE quirks 2006-12-01 14:36:56 -08:00
proc.c
quirks.c PCI: quirks: fix the festering mess that claims to handle IDE quirks 2006-12-01 14:36:56 -08:00
remove.c
rom.c Altix: Initial ACPI support - ROM shadowing. 2006-12-01 14:36:58 -08:00
search.c
setup-bus.c
setup-irq.c
setup-res.c
syscall.c