Bug 218223

Summary: Ambient light sensor on Framework 13 AMD laptop stops working in Linux 6.7
Product: Drivers Reporter: Michael Marley (michael)
Component: IIOAssignee: Virtual Assignee for Drivers/IIO (drivers_iio)
Status: RESOLVED CODE_FIX    
Severity: normal CC: andy.shevchenko, bagasdotme, chutzpah, gwhite, michael, srinivas.pandruvada
Priority: P3    
Hardware: AMD   
OS: Linux   
Kernel Version: 6.7-rc4 Subsystem:
Regression: Yes Bisected commit-id: 286d528bf0fae9f334fba857825b9701df1675b2
Attachments: Full output of dmesg on an affected kernel
Patch to fix this issue

Description Michael Marley 2023-12-04 23:56:42 UTC
The ambient light sensor on the Framework 13 worked properly with Linux 6.6.  With 6.7 (currently tested with -rc4), the driver fails to load with:

hid_sensor_als HID-SENSOR-200041.1.auto: failed to setup attributes
hid_sensor_als: probe of HID-SENSOR-200041.1.auto failed with error -1

If I revert 286d528bf0fae9f334fba857825b9701df1675b2, 5f05285df691b1e82108eead7165feae238c95ef, and ee3710f39f9d0ae5137a866138d005fe1ad18132, it starts working again.

This has also been reported in the Framework forums at https://community.frame.work/t/tracking-auto-brightness-aka-ambient-light-sensor-in-linux-details/16746.
Comment 1 Bagas Sanjaya 2023-12-06 12:02:16 UTC
(In reply to Michael Marley from comment #0)
> The ambient light sensor on the Framework 13 worked properly with Linux 6.6.
> With 6.7 (currently tested with -rc4), the driver fails to load with:
> 
> hid_sensor_als HID-SENSOR-200041.1.auto: failed to setup attributes
> hid_sensor_als: probe of HID-SENSOR-200041.1.auto failed with error -1
> 
> If I revert 286d528bf0fae9f334fba857825b9701df1675b2,
> 5f05285df691b1e82108eead7165feae238c95ef, and
> ee3710f39f9d0ae5137a866138d005fe1ad18132, it starts working again.
> 
> This has also been reported in the Framework forums at
> https://community.frame.work/t/tracking-auto-brightness-aka-ambient-light-
> sensor-in-linux-details/16746.

What is full dmesg log?
Comment 2 Michael Marley 2023-12-06 12:22:37 UTC
Created attachment 305549 [details]
Full output of dmesg on an affected kernel

I attached the dmesg output.
Comment 3 Srinivas Pandruvada 2023-12-15 16:09:23 UTC
Created attachment 305607 [details]
Patch to fix this issue

Please try the attached patch. I also posted upstream. This issue broke ALS on almost all Intel systems.
Comment 4 Michael Marley 2023-12-15 16:54:15 UTC
With the patch, the light sensor is working again.  Thanks!
Comment 5 Andy Shevchenko 2024-09-09 14:37:48 UTC
AFAIU the commit f2a71ebdf231 ("iio: hid-sensor-als: Assign channels dynamically") has to fix this. Correct me, if I'm wrong.
Comment 6 Srinivas Pandruvada 2024-09-09 15:19:46 UTC
That is correct. This issue should be closed.