[PATCH] platform/wmi: Allow consumers to load without ACPI
johannes.goede at oss.qualcomm.com
johannes.goede at oss.qualcomm.com
Wed Nov 11 05:17:52 PST 2026
Hi,
On 10-Nov-26 14:57, Armin Wolf wrote:
> Am 10.11.26 um 14:43 schrieb Han Gao:
>> Since commit 4ea18e604272 ("ACPI: video: Remove CONFIG_X86 handling from
>> nvidia_wmi_ec_supported()"), the ACPI video module uses WMI on all
>> architectures. When ACPI is disabled, e.g. on a devicetree boot,
>> acpi_wmi_init() returns -ENODEV, so the wmi module fails to load and so
>> do video, amdgpu and radeon, which depend on it.
>>
>> Return 0 without registering the WMI bus instead. The exported helpers
>> then report that no WMI device exists. Skip the teardown on module exit
>> accordingly.
>
> AFAIK wmi_find_device_by_guid() requires that the WMI bus type is initialized, so we should not skip bus_register(). I wonder whether we really need to check acpi_disabled after all, because the platform driver will not bind anyway if ACPI support is disabled.
I developed the same patch in parallel to the original submitter, but did
not get around to submitting this upstream yet.
I just submitted my version, which does keep the bus registration here:
https://lore.kernel.org/platform-driver-x86/20261111131613.6290-1-johannes.goede@oss.qualcomm.com/
Regards,
Hans
>
> Thanks,
> Armin Wolf
>
>> Fixes: 4ea18e604272 ("ACPI: video: Remove CONFIG_X86 handling from nvidia_wmi_ec_supported()")
>> Signed-off-by: Han Gao <gaohan at iscas.ac.cn>
>> ---
>> Tested on a HiFive Premier P550 booted with devicetree and an RX550,
>> with ACPI_WMI, ACPI_VIDEO and DRM_AMDGPU built as modules. Without
>> this patch, wmi fails to load and so do video and amdgpu. With it,
>> wmi, video and amdgpu load and the RX550 is initialized.
>> ---
>> drivers/platform/wmi/core.c | 6 +++++-
>> 1 file changed, 5 insertions(+), 1 deletion(-)
>>
>> diff --git a/drivers/platform/wmi/core.c b/drivers/platform/wmi/core.c
>> index a99da9b7039d787ce3c1e0ece74ffbd79fafd3f7..6668789904a903c8d4e7810976f4e485d7a1b32a 100644
>> --- a/drivers/platform/wmi/core.c
>> +++ b/drivers/platform/wmi/core.c
>> @@ -1598,8 +1598,9 @@ static int __init acpi_wmi_init(void)
>> {
>> int error;
>> + /* ACPI video still needs the exported helpers when ACPI is disabled. */
>> if (acpi_disabled)
>> - return -ENODEV;
>> + return 0;
>> error = class_register(&wmi_bus_class);
>> if (error)
>> @@ -1628,6 +1629,9 @@ static int __init acpi_wmi_init(void)
>> static void __exit acpi_wmi_exit(void)
>> {
>> + if (acpi_disabled)
>> + return;
>> +
>> platform_driver_unregister(&acpi_wmi_driver);
>> bus_unregister(&wmi_bus_type);
>> class_unregister(&wmi_bus_class);
>>
>> ---
>> base-commit: 7475ea8b58616b33c04afb976cf0fbaad9dd63fb
>> change-id: 20261110-wmi-no-acpi-159a4cf19580
>>
>> Best regards,
>
More information about the linux-riscv
mailing list