linux-stable-rt/include/acpi
Prarit Bhargava 6af8bef14d PCI hotplug: acpiphp: Prevent deadlock on PCI-to-PCI bridge remove
I originally submitted a patch to workaround this by pushing all Ejection
Requests and Device Checks onto the kacpi_hotplug queue.

http://marc.info/?l=linux-acpi&m=131678270930105&w=2

The patch is still insufficient in that Bus Checks also need to be added.

Rather than add all events, including non-PCI-hotplug events, to the
hotplug queue, mjg suggested that a better approach would be to modify
the acpiphp driver so only acpiphp events would be added to the
kacpi_hotplug queue.

It's a longer patch, but at least we maintain the benefit of having separate
queues in ACPI.  This, of course, is still only a workaround the problem.
As Bjorn and mjg pointed out, we have to refactor a lot of this code to do
the right thing but at this point it is a better to have this code working.

The acpi core places all events on the kacpi_notify queue.  When the acpiphp
driver is loaded and a PCI card with a PCI-to-PCI bridge is removed the
following call sequence occurs:

cleanup_p2p_bridge()
	    -> cleanup_bridge()
		    -> acpi_remove_notify_handler()
			    -> acpi_os_wait_events_complete()
				    -> flush_workqueue(kacpi_notify_wq)

which is the queue we are currently executing on and the process will hang.

Move all hotplug acpiphp events onto the kacpi_hotplug workqueue.  In
handle_hotplug_event_bridge() and handle_hotplug_event_func() we can simply
push the rest of the work onto the kacpi_hotplug queue and then avoid the
deadlock.

Signed-off-by: Prarit Bhargava <prarit@redhat.com>
Cc: mjg@redhat.com
Cc: bhelgaas@google.com
Cc: linux-acpi@vger.kernel.org
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
2011-10-14 09:05:31 -07:00
..
platform atomic: use <linux/atomic.h> 2011-07-26 16:49:47 -07:00
acexcep.h
acnames.h
acoutput.h
acpi.h
acpi_bus.h ACPI: Fixes device power states array overflow 2011-07-13 23:53:22 -04:00
acpi_drivers.h ACPI: constify ops structs 2011-07-16 18:36:17 -04:00
acpi_numa.h
acpiosxf.h PCI hotplug: acpiphp: Prevent deadlock on PCI-to-PCI bridge remove 2011-10-14 09:05:31 -07:00
acpixf.h ACPICA: Update to version 20110623 2011-07-13 23:51:51 -04:00
acrestyp.h
actbl.h
actbl1.h
actbl2.h
actypes.h
apei.h ACPI: APEI build fix 2011-08-03 11:15:59 -04:00
atomicio.h
button.h
container.h
hed.h
pdc_intel.h
processor.h ACPI: constify ops structs 2011-07-16 18:36:17 -04:00
reboot.h
video.h