[PATCH] platform/wmi: Allow consumers to load without ACPI

Armin Wolf W_Armin at gmx.de
Tue Nov 10 05:57:13 PST 2026


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.

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