remarkable-linux/drivers/acpi
Lorenzo Pieralisi 5331d9cab3 ACPI / drivers: replace acpi_probe_lock spinlock with mutex
Commit e647b53227 ("ACPI: Add early device probing infrastructure")
introduced code that allows inserting driver specific
struct acpi_probe_entry probe entries into ACPI linker sections
(one per-subsystem, eg irqchip, clocksource) that are then walked
to retrieve the data and function hooks required to probe the
respective kernel components.

Probing for all entries in a section is triggered through
the __acpi_probe_device_table() function, that in turn, according
to the table ID a given probe entry reports parses the table
with the function retrieved from the respective section structures
(ie struct acpi_probe_entry). Owing to the current ACPI table
parsing implementation, the __acpi_probe_device_table() function
has to share global variables with the acpi_match_madt() function, so
in order to guarantee mutual exclusion locking is required
between the two functions.

Current kernel code implements the locking through the acpi_probe_lock
spinlock; this has the side effect of requiring all code called
within the lock (ie struct acpi_probe_entry.probe_{table/subtbl} hooks)
not to sleep.

However, kernel subsystems that make use of the early probing
infrastructure are relying on kernel APIs that may sleep (eg
irq_domain_alloc_fwnode(), among others) in the function calls
pointed at by struct acpi_probe_entry.{probe_table/subtbl} entries
(eg gic_v2_acpi_init()), which is a bug.

Since __acpi_probe_device_table() is called from context
that is allowed to sleep the acpi_probe_lock spinlock can be replaced
with a mutex; this fixes the issue whilst still guaranteeing
mutual exclusion.

Signed-off-by: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
Fixes: e647b53227 (ACPI: Add early device probing infrastructure)
Cc: 4.4+ <stable@vger.kernel.org> # 4.4+
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2016-09-02 22:22:21 +02:00
..
acpica Revert "ACPICA: Namespace: Fix deadlock triggered by MLC support in dynamic table loading" 2016-07-11 16:18:18 +02:00
apei pstore subsystem updates for v4.8 2016-07-26 18:48:23 -07:00
dptf ACPI / DPTF: move int340x_thermal.c to the DPTF folder 2016-07-21 13:42:46 +02:00
nfit libnvdimm, nd_blk: mask off reserved status bits 2016-08-08 09:26:13 -07:00
pmic ACPI / PMIC: remove modular references from non-modular code 2016-07-16 03:03:14 +02:00
ac.c ACPI: Remove FSF mailing addresses 2015-07-08 02:27:32 +02:00
acpi_amba.c ACPI / amba: Remove CLK_IS_ROOT 2016-04-27 23:42:57 +02:00
acpi_apd.c ACPI / APD: Remove CLK_IS_ROOT 2016-04-27 23:42:57 +02:00
acpi_cmos_rtc.c char/genrtc: x86: remove remnants of asm/rtc.h 2016-06-04 00:20:07 +02:00
acpi_configfs.c ACPI: Rename configfs.c to acpi_configfs.c to prevent link error 2016-07-11 15:13:36 +02:00
acpi_dbg.c ACPI / debugger: Fix regression introduced by IS_ERR_VALUE() removal 2016-07-05 23:02:34 +02:00
acpi_extlog.c ACPI and power management updates for 3.17-rc1 2014-08-06 20:34:19 -07:00
acpi_ipmi.c ACPI: Remove FSF mailing addresses 2015-07-08 02:27:32 +02:00
acpi_lpat.c ACPI / lpat: make it explicitly non-modular 2016-07-16 03:08:10 +02:00
acpi_lpss.c x86/acpi/lss: Use Intel family name macros for the acpi_lpss driver 2016-06-08 13:03:26 +02:00
acpi_memhotplug.c ACPI: Remove FSF mailing addresses 2015-07-08 02:27:32 +02:00
acpi_pad.c ACPI / PAD: power_saving_thread() is not freezable 2015-10-26 04:42:54 +01:00
acpi_platform.c Power management and ACPI material for v4.6-rc1, part 1 2016-03-16 14:10:53 -07:00
acpi_pnp.c ACPI / PNP: constify device IDs 2016-01-04 22:10:30 +01:00
acpi_processor.c ACPI / processor: Avoid reserving IO regions too early 2016-06-02 01:57:50 +02:00
acpi_video.c ACPI / video: skip evaluating _DOD when it does not exist 2016-06-22 02:00:04 +02:00
battery.c ACPI / battery: Correctly serialise with the pending async probe 2016-05-21 01:25:07 +02:00
battery.h ACPI / battery: move some ACPI_BATTERY_* definitions to header 2014-03-19 01:57:46 +01:00
bgrt.c drivers/acpi: make bgrt driver explicitly non-modular 2016-03-09 23:46:07 +01:00
blacklist.c ACPI / osi: Collect _OSI handling into one single file 2016-05-05 00:13:53 +02:00
bus.c Merge branches 'acpi-processor', 'acpi-cppc', 'acpi-apei' and 'acpi-sleep' 2016-07-25 13:42:25 +02:00
button.c ACPI / button: remove pointer to old lid_sysfs on unbind 2016-08-03 01:27:20 +02:00
cm_sbs.c ACPI: Remove FSF mailing addresses 2015-07-08 02:27:32 +02:00
container.c ACPI: Remove FSF mailing addresses 2015-07-08 02:27:32 +02:00
cppc_acpi.c ACPI / CPPC: Prevent cpc_desc_ptr points to the invalid data 2016-06-25 02:53:31 +02:00
custom_method.c ACPI: Clean up inclusions of ACPI header files 2013-12-07 01:03:14 +01:00
debugfs.c ACPI: fix acpi_debugfs_init prototype 2015-08-07 02:55:18 +02:00
device_pm.c ACPI / PM: Export acpi_device_fix_up_power() 2016-05-20 15:54:01 +02:00
device_sysfs.c ACPI / device_sysfs: Clean up checkpatch errors 2016-05-04 23:47:32 +02:00
dock.c ACPI / dock: make dock explicitly non-modular 2016-07-16 03:08:08 +02:00
ec.c Merge branches 'acpi-ec' and 'acpi-button' 2016-08-05 16:04:49 +02:00
ec_sys.c ACPI / EC: Deny write access unless requested by module param 2016-03-09 23:26:15 +01:00
event.c netlink: make nlmsg_end() and genlmsg_end() void 2015-01-18 01:03:45 -05:00
evged.c ACPI / GED: make evged.c explicitly non-modular 2016-05-09 22:59:25 +02:00
fan.c ACPI / fan: Make struct dev_pm_ops const 2016-03-09 23:23:21 +01:00
glue.c Merge branch 'acpi-pci' 2015-11-07 01:30:10 +01:00
gsi.c ACPI: Rename acpi_gsi_get_irq_type to acpi_dev_get_irq_type and export symbol 2016-01-01 03:20:25 +01:00
hed.c ACPI: Remove FSF mailing addresses 2015-07-08 02:27:32 +02:00
internal.h ACPI: add support for ACPI reconfiguration notifiers 2016-07-08 21:52:35 +02:00
ioapic.c x86/irq, ACPI: Implement ACPI driver to support IOAPIC hotplug 2015-02-05 15:09:26 +01:00
Kconfig PCI changes for the v4.8 merge window: 2016-08-02 17:12:29 -04:00
Makefile PCI changes for the v4.8 merge window: 2016-08-02 17:12:29 -04:00
numa.c ACPI / NUMA: Enable ACPI based NUMA on ARM64 2016-06-22 01:36:59 +02:00
nvs.c ACPI: Clean up acpi_os_map/unmap_memory() to eliminate __iomem. 2014-05-27 18:13:08 +02:00
osi.c ACPI / osi: Collect _OSI handling into one single file 2016-05-05 00:13:53 +02:00
osl.c treewide: replace obsolete _refok by __ref 2016-08-02 17:31:41 -04:00
pci_irq.c x86/ACPI/PCI: Recognize that Interrupt Line 255 means "not connected" 2016-03-09 01:23:35 +01:00
pci_link.c ACPI,PCI,IRQ: separate ISA penalty calculation 2016-07-02 01:38:34 +02:00
pci_mcfg.c PCI/ACPI: Add generic MCFG table handling 2016-06-10 18:27:59 -05:00
pci_root.c PCI/ACPI: Support I/O resources when parsing host bridge resources 2016-06-10 16:00:48 -05:00
pci_slot.c ACPI / PCI: make pci_slot explicitly non-modular 2016-07-16 03:05:29 +02:00
power.c Merge branch 'acpi-pm' 2015-09-01 03:38:43 +02:00
proc.c ACPI: change acpi_sleep_proc_init() to return void 2015-09-15 03:03:15 +02:00
processor_core.c ACPI / processor: Add acpi_map_madt_entry() 2016-05-30 14:27:09 +02:00
processor_driver.c Merge branch 'smp-hotplug-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip 2016-07-29 13:55:30 -07:00
processor_idle.c ACPI / processor_idle: Add support for Low Power Idle(LPI) states 2016-07-21 23:25:58 +02:00
processor_pdc.c ACPI / processor: Introduce invalid_logical_cpuid() 2015-05-13 23:28:14 +02:00
processor_perflib.c Merge branch 'pm-cpufreq' 2015-09-01 15:52:35 +02:00
processor_thermal.c ACPI: Remove FSF mailing addresses 2015-07-08 02:27:32 +02:00
processor_throttling.c ACPI / processor: Avoid reserving IO regions too early 2016-06-02 01:57:50 +02:00
property.c ACPI / property: fix data node parsing in acpi_get_next_subnode() 2016-03-17 03:06:38 +01:00
reboot.c Revert "ACPI: ignore FADT reset-reg-sup flag" 2012-04-20 11:19:35 -07:00
resource.c PCI: ACPI: IA64: fix IO port generic range check 2016-03-22 23:07:49 +01:00
sbs.c ACPI / SBS: fix inconsistent indenting inside if statement 2016-01-04 22:14:27 +01:00
sbshc.c Revert "ACPI / SBS: Add 5 us delay to fix SBS hangs on MacBook" 2015-11-16 23:26:45 +01:00
sbshc.h
scan.c ACPI / drivers: replace acpi_probe_lock spinlock with mutex 2016-09-02 22:22:21 +02:00
sleep.c ACPI: Execute _PTS before system reboot 2016-06-29 23:44:02 +02:00
sleep.h ACPICA: Drop Linux-specific waking vector functions 2016-01-04 22:05:20 +01:00
sysfs.c ACPI: add support for ACPI reconfiguration notifiers 2016-07-08 21:52:35 +02:00
tables.c ACPI / tables: move arch-specific symbol to asm/acpi.h 2016-06-22 01:16:14 +02:00
thermal.c ACPI / thermal: Remove create_workqueue() 2016-06-22 02:12:56 +02:00
utils.c nfit: make DIMM DSMs optional 2016-07-19 12:32:39 -07:00
video_detect.c ACPI / video: Thinkpad X201 Tablet needs video_detect_force_video 2016-06-22 01:59:03 +02:00
wakeup.c ACPI: Clean up inclusions of ACPI header files 2013-12-07 01:03:14 +01:00