platform/x86: toshiba_acpi: Stop using acpi_video_set_dmi_backlight_type()
authorHans de Goede <hdegoede@redhat.com>
Sat, 4 Jun 2022 14:18:05 +0000 (16:18 +0200)
committerHans de Goede <hdegoede@redhat.com>
Sat, 3 Sep 2022 10:17:27 +0000 (12:17 +0200)
commita2ed70d0ecb11b7eb3ff14ed897cd0995c86651d
tree622fab9c9395658b379a683c70e7f711355d2188
parent4f04c7dc83fd4339b00421174edc8556b6bac2b1
platform/x86: toshiba_acpi: Stop using acpi_video_set_dmi_backlight_type()

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.

In case of toshiba_acpi there are no DMI quirks to move to
acpi/video_detect.c, but it also (ab)uses it for transflective
displays. Adding transflective display support to video_detect.c would
be quite involved. But luckily there are only 2 known models with
a transflective display, so we can just add DMI quirks for those.

Acked-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
drivers/acpi/video_detect.c
drivers/platform/x86/toshiba_acpi.c