diff --git a/patches.kernel.org/6.2.1-009-platform-x86-nvidia-wmi-ec-backlight-Add-force-.patch b/patches.kernel.org/6.2.1-009-platform-x86-nvidia-wmi-ec-backlight-Add-force-.patch new file mode 100644 index 0000000..3d47992 --- /dev/null +++ b/patches.kernel.org/6.2.1-009-platform-x86-nvidia-wmi-ec-backlight-Add-force-.patch @@ -0,0 +1,65 @@ +From: Hans de Goede +Date: Fri, 17 Feb 2023 15:42:08 +0100 +Subject: [PATCH] platform/x86: nvidia-wmi-ec-backlight: Add force module + parameter +References: bsc#1012628 +Patch-mainline: 6.2.1 +Git-commit: 0d9bdd8a550170306c2021b8d6766c5343b870c2 + +commit 0d9bdd8a550170306c2021b8d6766c5343b870c2 upstream. + +On some Lenovo Legion models, the backlight might be driven by either +one of nvidia_wmi_ec_backlight or amdgpu_bl0 at different times. + +When the Nvidia WMI EC backlight interface reports the backlight is +controlled by the EC, the current backlight handling only registers +nvidia_wmi_ec_backlight (and registers no other backlight interfaces). + +This hides (never registers) the amdgpu_bl0 interface, where as prior +to 6.1.4 users would have both nvidia_wmi_ec_backlight and amdgpu_bl0 +and could work around things in userspace. + +Add a force module parameter which can be used with acpi_backlight=native +to restore the old behavior as a workound (for now) by passing: + +"acpi_backlight=native nvidia-wmi-ec-backlight.force=1" + +Fixes: 8d0ca287fd8c ("platform/x86: nvidia-wmi-ec-backlight: Use acpi_video_get_backlight_type()") +Link: https://bugzilla.kernel.org/show_bug.cgi?id=217026 +Cc: stable@vger.kernel.org +Signed-off-by: Hans de Goede +Reviewed-by: Daniel Dadap +Link: https://lore.kernel.org/r/20230217144208.5721-1-hdegoede@redhat.com +Signed-off-by: Greg Kroah-Hartman +Signed-off-by: Jiri Slaby +--- + drivers/platform/x86/nvidia-wmi-ec-backlight.c | 6 +++++- + 1 file changed, 5 insertions(+), 1 deletion(-) + +diff --git a/drivers/platform/x86/nvidia-wmi-ec-backlight.c b/drivers/platform/x86/nvidia-wmi-ec-backlight.c +index baccdf65..1b572c90 100644 +--- a/drivers/platform/x86/nvidia-wmi-ec-backlight.c ++++ b/drivers/platform/x86/nvidia-wmi-ec-backlight.c +@@ -12,6 +12,10 @@ + #include + #include + ++static bool force; ++module_param(force, bool, 0444); ++MODULE_PARM_DESC(force, "Force loading (disable acpi_backlight=xxx checks"); ++ + /** + * wmi_brightness_notify() - helper function for calling WMI-wrapped ACPI method + * @w: Pointer to the struct wmi_device identified by %WMI_BRIGHTNESS_GUID +@@ -91,7 +95,7 @@ static int nvidia_wmi_ec_backlight_probe(struct wmi_device *wdev, const void *ct + int ret; + + /* drivers/acpi/video_detect.c also checks that SOURCE == EC */ +- if (acpi_video_get_backlight_type() != acpi_backlight_nvidia_wmi_ec) ++ if (!force && acpi_video_get_backlight_type() != acpi_backlight_nvidia_wmi_ec) + return -ENODEV; + + /* +-- +2.35.3 + diff --git a/series.conf b/series.conf index ac493e8..e43418a 100644 --- a/series.conf +++ b/series.conf @@ -35,6 +35,7 @@ patches.kernel.org/6.2.1-006-wifi-mwifiex-Add-missing-compatible-string-for-.patch patches.kernel.org/6.2.1-007-audit-update-the-mailing-list-in-MAINTAINERS.patch patches.kernel.org/6.2.1-008-platform-x86-amd-pmf-Add-depends-on-CONFIG_POWE.patch + patches.kernel.org/6.2.1-009-platform-x86-nvidia-wmi-ec-backlight-Add-force-.patch ######################################################## # Build fixes that apply to the vanilla kernel too.