1
0
Fork 0
alistair23-linux/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 ACPICA: Update all ACPICA copyrights and signons to 2011 2011-01-18 23:48:03 -05:00
acnames.h ACPICA: Update all ACPICA copyrights and signons to 2011 2011-01-18 23:48:03 -05:00
acoutput.h ACPICA: Fix unresolved name issue for no-debug and no-error-msg cases 2011-03-02 19:38:04 -05:00
acpi.h ACPICA: Update all ACPICA copyrights and signons to 2011 2011-01-18 23:48:03 -05:00
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 ACPI: misc cleanups 2008-02-07 03:33:23 -05:00
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 ACPICA: Update all ACPICA copyrights and signons to 2011 2011-01-18 23:48:03 -05:00
actbl.h Fix common misspellings 2011-03-31 11:26:23 -03:00
actbl1.h Merge branch 'acpica' of git://git.kernel.org/pub/scm/linux/kernel/git/lenb/linux-acpi-2.6 2011-01-20 16:28:34 -08:00
actbl2.h ACPICA: Header support for SLIC table 2011-03-23 00:18:18 -04:00
actypes.h Merge branches 'acpica', 'aml-custom', 'bugzilla-16548', 'bugzilla-20242', 'd3-cold', 'ec-asus' and 'thermal-fix' into release 2011-05-29 04:38:48 -04:00
apei.h ACPI: APEI build fix 2011-08-03 11:15:59 -04:00
atomicio.h ACPI, IO memory pre-mapping and atomic accessing 2010-05-19 11:40:03 -04:00
button.h ACPI: make ACPI button funcs no-ops if not built in 2009-09-17 14:48:23 -07:00
container.h [ACPI] Lindent all ACPI files 2005-08-05 00:45:14 -04:00
hed.h ACPI Hardware Error Device (PNP0C33) support 2010-05-19 22:40:24 -04:00
pdc_intel.h ACPI: Enable bit 11 in _PDC to advertise hw coord 2009-02-07 00:41:14 -05:00
processor.h ACPI: constify ops structs 2011-07-16 18:36:17 -04:00
reboot.h Add the ability to reset the machine using the RESET_REG in ACPI's FADT table. 2008-07-16 23:27:08 +02:00
video.h i915: Fix opregion notifications 2011-07-13 11:19:47 -07:00