JafarAkhondali / acer-predator-turbo-and-rgb-keyboard-linux-module

Linux kernel module to support Turbo mode and RGB Keyboard for Acer Predator notebook series
GNU General Public License v3.0
342 stars 59 forks source link

removing acpi_video_set_dmi_backlight_type #74

Closed Evan-aja closed 1 year ago

Evan-aja commented 1 year ago

Currently, whenever i tried to install this project, whether single use or as a service, it always returns this message which shows on kernel 6.1.1-arch1-1 image

this is my device

System Information
    Manufacturer: Acer
    Product Name: Nitro AN515-57
    Version: V1.19
    Wake-up Type: Power Switch
--
Base Board Information
    Manufacturer: TGL
    Product Name: Scala_TLS
    Version: V1.19
    Asset Tag: Type2 - Board Asset Tag
    Features:

after some research, I have found that acpi_video_set_dmi_backlight_type has been removed and should not be used in production.

acpi_video_set_dmi_backlight_type() is troublesome because it may end
up getting called after other backlight drivers have already called
acpi_video_get_backlight_type() resulting in the other drivers
already being registered even though they should not.

In case of the acpi_video backlight, acpi_video_set_dmi_backlight_type()
actually calls acpi_video_unregister_backlight() since that is often
probed earlier, leading to userspace seeing the acpi_video0 class
device being briefly available, leading to races in userspace where
udev probe-rules try to access the device and it is already gone.

All callers have been fixed to no longer call it, so remove
acpi_video_set_dmi_backlight_type() now.

this is a note from https://lore.kernel.org/all/20220818184302.10051-28-hdegoede@redhat.com which explains why this call should not be used anymore

A simple removal of said line of code is enough to fix the issue. here's a screenshot after the fix have been made image

It should be noted that i have only tested it on my personal device on this specific kernel version. so further testing before merge maybe needed

mmsaeed509 commented 1 year ago

yeah, after the kernel update 6.1.1-arch1-1 module doesn't work anymore

I tested the module with your PR, and it works

jilv220 commented 1 year ago

Thank you so much! I have been wondering why the module suddenly stopped working. It turns out this function is removed under kernel 6.1.1.