Repository navigation
ALS sensor dead after resume #73
Description
Activity
What's your kernel and iio-sensor-proxy version?
Does it work if you directly access it with framework_tool?
https://github.com/FrameworkComputer/framework-system/blob/main/EXAMPLES.md#check-sensorsWhat's your kernel and iio-sensor-proxy version?
iio-sensor-proxy 3.8 (but see the above reproducer with
iio_generic_buffer). Kernel is 6.16.12.Going via
/dev/crosseems to work:$ sudo target/debug/framework_tool --sensors [sudo] password for agx: ALS: 6 Luxwould be good to have the
framework_toolin Debian (and thus its downstreams).Are there any related error messages in dmesg?
The ALS Sensor works by the EC exposing an I2C HID interface.
This is the first time I've seen this issue happen. It's been pretty solid so far
This is the dmesg from a suspend/resume cycle:
[ 6072.081177] lockdown_is_locked_down: 2 callbacks suppressed [ 6072.081180] Lockdown: systemd-logind: hibernation is restricted; see man kernel_lockdown.7 [ 6072.084399] Lockdown: systemd-logind: hibernation is restricted; see man kernel_lockdown.7 [ 6072.085802] Lockdown: systemd-logind: hibernation is restricted; see man kernel_lockdown.7 [ 6072.089682] Lockdown: systemd-logind: hibernation is restricted; see man kernel_lockdown.7 [ 6072.092818] Lockdown: systemd-logind: hibernation is restricted; see man kernel_lockdown.7 [ 6072.093774] Lockdown: systemd-logind: hibernation is restricted; see man kernel_lockdown.7 [ 6072.094705] Lockdown: systemd-logind: hibernation is restricted; see man kernel_lockdown.7 [ 6072.123452] Lockdown: systemd-logind: hibernation is restricted; see man kernel_lockdown.7 [ 6072.124401] Lockdown: systemd-logind: hibernation is restricted; see man kernel_lockdown.7 [ 6072.128275] wlp170s0: deauthenticating from 20:05:b6:ff:a3:27 by local choice (Reason: 3=DEAUTH_LEAVING) [ 6072.129615] Lockdown: systemd-logind: hibernation is restricted; see man kernel_lockdown.7 [ 6072.656936] PM: suspend entry (s2idle) [ 6072.660373] Filesystems sync: 0.003 seconds [ 6072.768711] Freezing user space processes [ 6072.770403] Freezing user space processes completed (elapsed 0.001 seconds) [ 6072.770408] OOM killer disabled. [ 6072.770410] Freezing remaining freezable tasks [ 6072.771644] Freezing remaining freezable tasks completed (elapsed 0.001 seconds) [ 6072.771646] printk: Suspending console(s) (use no_console_suspend to debug) [ 6072.845145] sd 0:0:0:0: [sda] Synchronizing SCSI cache [ 6072.941272] ACPI: EC: interrupt blocked [ 6073.524096] ACPI: EC: interrupt unblocked [ 6073.574871] pci 0000:00:08.0: Setting to D3hot [ 6073.586947] pci 0000:00:0b.0: Setting to D3hot [ 6073.607848] i915 0000:00:02.0: [drm] GT0: GuC firmware i915/mtl_guc_70.bin version 70.44.1 [ 6073.621005] i915 0000:00:02.0: [drm] GT0: GUC: submission enabled [ 6073.621007] i915 0000:00:02.0: [drm] GT0: GUC: SLPC enabled [ 6073.621213] i915 0000:00:02.0: [drm] GT0: GUC: RC enabled [ 6073.621661] i915 0000:00:02.0: [drm] GT1: GuC firmware i915/mtl_guc_70.bin version 70.44.1 [ 6073.621662] i915 0000:00:02.0: [drm] GT1: HuC firmware i915/mtl_huc_gsc.bin version 8.5.4 [ 6073.635461] i915 0000:00:02.0: [drm] GT1: GUC: submission enabled [ 6073.635462] i915 0000:00:02.0: [drm] GT1: GUC: SLPC enabled [ 6073.635579] i915 0000:00:02.0: [drm] GT1: GUC: RC enabled [ 6073.644848] nvme nvme0: 22/0/0 default/read/poll queues [ 6073.770028] mei_gsc_proxy 0000:00:16.0-0f73db04-97ab-4125-b893-e904ad0d5464: bound 0000:00:02.0 (ops i915_gsc_proxy_component_ops [i915]) [ 6073.771319] OOM killer enabled. [ 6073.771321] Restarting tasks: Starting [ 6073.772073] Restarting tasks: Done [ 6073.772110] random: crng reseeded on system resumption [ 6073.776090] PM: suspend exit [ 6075.783856] wlp170s0: authenticate with 20:05:b6:ff:a3:27 (local address=dc:97:ba:b5:91:0e) [ 6075.785409] wlp170s0: send auth to 20:05:b6:ff:a3:27 (try 1/3) [ 6075.819285] wlp170s0: authenticated [ 6075.819681] wlp170s0: associate with 20:05:b6:ff:a3:27 (try 1/3) [ 6075.827116] wlp170s0: RX AssocResp from 20:05:b6:ff:a3:27 (capab=0x11 status=0 aid=2) [ 6075.844053] wlp170s0: associatedThis is the first time I've seen this issue happen. It's been pretty solid so far
Likely because most DEs don't unclaim the sensor. It seems stable if you keep the sensor claimed across suspend/resumed (e.g. have iio-sensor-proxy + monitor-sensor running). If the DE unclaims the sensor on e.g. screen blank (which we do in phosh) and don't have anything else claiming the sensor it seems to break (but works fine on e.g. the SDM845's sensor core on phones which suspends/resumes a ton more often).
The ALS Sensor works by the EC exposing an I2C HID interface.
Interesting, reloading
i2c_hid_acpiunbreaks after resume unbreaks things (until next suspend)Interesting findings!
You're using phosh on the framework laptop?
Why does it unclaim the sensor? Would that help with power consumption?
Have you always seen this or could this be a regression with recent kernels?
You're using phosh on the framework laptop?
Yes
Why does it unclaim the sensor? Would that help with power consumption?
Unclaiming the sensor when the screen is blanked saves battery by reducing wakeups
Have you always seen this or could this be a regression with recent kernels?
I only enabled it recently so I cannot tell.
#!/bin/sh [ "$1" = "post" ] && [ "$2" = "suspend" ] || exit 0 echo "Working around broken ALS after resume on Framework 13" rmmod i2c_hid_acpi modprobe i2c_hid_acpi
in
/usr/lib/systemd/system-sleep/framework13-als-workaroundseems to reliably work around the issue.Can you try to downgrade to an earlier version of iOS sensor proxy?
This seems like your issue
https://gitlab.freedesktop.org/hadess/iio-sensor-proxy/-/issues/404#note_3099601See how I wrote that the iio-buffer tools fail too. iio-sensor-proxy thus can't be at fault here as a suspend/resume must not break unrelated tools. It's a kernel problem (accidentally I'm one of iio-s-p upstreams).
I'm also experiencing this issue on an AMD Framework 13 when using gnome-adaptive-brightness (issue linked above).
@agx's workaround script works for me, but does cause a momentary dip in brightness as the extension reads a zero value a couple times before the module is reloaded. (Note to others: don't forget to make the script executable
chmod ug+x <path>-- that caused me a couple minutes of debugging.)For reference I'm using Debian Unstable with kernel v6.17.9.
Ok I can reproduce this issue, with
iio_generic_bufferno, as well as FrameworkComputer/SoftwareFirmwareIssueTracker#179
I found an issue in the EC firmware and I'm testing a patch.Related report from a Framework 13 AMD (Ryzen 7040 series) running Fedora 44, kernel 6.19.14.
On AMD, the issue manifests differently: the IIO buffer is silent from a fresh boot (not just after resume). The buffer driver in iio-sensor-proxy selects the buffer driver intermittently (sometimes
is_buffer_usable()passes within 0.5s, sometimes not), but even when selected, the buffer produces data only once and then goes silent — causingLightLevelto freeze on the initial value under stable light conditions.Direct sysfs reads work correctly at all times:
$ cat /sys/bus/iio/devices/iio:device0/in_illuminance_raw 172 # updates correctly in real timeBut the IIO buffer (
/dev/iio:device0) never produces continuous data, suggesting the EC firmware on AMD is not pushing buffer updates at regular intervals (only on the initial open, if at all).Workaround applied on our side: patched iio-sensor-proxy to skip the buffer driver for HID sensors and fall back to polling
in_illuminance_rawdirectly. Details at https://gitlab.freedesktop.org/hadess/iio-sensor-proxy/-/work_items/433Mentioned here by the iio-sensor-proxy maintainer. Happy to test a firmware patch if one becomes available for AMD.
On a Intel 13" (Intel(R) Core(TM) Ultra 7 155H) the ALS sensor is dead after the first/suspend resume making it pretty much unusable:
Suspend and resume device:
The same is reproducible with iio-sensor-proxy (I picked
iio_generic_bufferas it requires less indirection)dmidecode reports the Bios as
Release Date: 08/08/2025andfwupdmgrdoesn't report any updates to install.ectool says