Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

mfd: Check ACPI device companion before checking resources

Current code in mfd-core calls into ACPI to check resources even
on a system that booted with a DT (on kernels with both DT and ACPI
support compiled in). This triggers ACPI exceptions since we may
end up calling the ACPI interpreter when it has not been initialized:

"ACPI Exception: AE_BAD_PARAMETER, Thread 2064154624 could not acquire
Mutex [0x1] (20150410/utmutex-285)"

This patch fixes the issues by adding a check for an ACPI companion
device before carrying out ACPI resources checks to avoid calling
the ACPI interpreter if the fwnode representing the device is an OF one.

Cc: Sudeep Holla <sudeep.holla@arm.com>
Signed-off-by: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>

authored by

Lorenzo Pieralisi and committed by
Lee Jones
ec40c606 b64610df

+5 -3
+5 -3
drivers/mfd/mfd-core.c
··· 207 207 } 208 208 209 209 if (!cell->ignore_resource_conflicts) { 210 - ret = acpi_check_resource_conflict(&res[r]); 211 - if (ret) 212 - goto fail_alias; 210 + if (has_acpi_companion(&pdev->dev)) { 211 + ret = acpi_check_resource_conflict(&res[r]); 212 + if (ret) 213 + goto fail_alias; 214 + } 213 215 } 214 216 } 215 217