-
Notifications
You must be signed in to change notification settings - Fork 73
Description
Hi,
currently I am experiencing issues with postmarket OS on my Xiaomi Redmi 5 Plus. I am using a dual-boot configuration with lk2nd flashed to recovery and postmarket OS flashed on an external SD card.
The issues are most likely power management related. When they set in, the phone turns the screen on, shows the lockscreen and then turns off again after a while. The dmesg output (obtained via ssh) shows [ 8324.012680] ltrf216a 0-0053: failed to resume runtime PM: -22
repeatedly (with a frequency of 3 to 5 times per second). Finally the touchscreen becomes unresponsive and cannot be used anymore - hardware buttons still work.
I assume these issues occur because some problems with the power management. At first I suspected the bit banging of the I2C bus might be responsible but idk.
I have tested the kernels 6.6.10 and 6.7.0 (head) both yield the same behavior.
(I am not sure but the issue often occurred after I unplugged the phone from my computer's USB. Yet the issue also occurs after just setting the phone to standby.)
Do you have any clues what the underlying issue might be?
EDIT-1: Added dmesg log on linux 6.7.0. Pattern repeats at regular intervals. Only CPU failure differs.
postmarketos-xiaomi-vince-linux-6.7.0-86d576e1465a5216cb2f1bb420fa39d5f85cf52c.txt
EDIT-2: Added dmesg log on linux 6.7.0. Pattern occurs when standby button is pressed for a short time.
EDIT-3: I have verified that the problems persist in version 6.7.2-r0 (with modification CONFIG_RT_GROUP_SCHED=n).
The line [ 8324.012680] ltrf216a 0-0053: failed to resume runtime PM: -22
now only shows when the device is woken up. Pressing hardware buttons does not seem to result in errors anymore.
There is still the wake up behavior where the display randomly turns on and runs down the battery.
postmarketos-xiaomi-vince-linux-6.7.2-r0__standby_button_on_and_off.txt
EDIT-4: The issues usually start when the phone tries to go into power saving mode (as set up in the energy settings, for me after approx. 15 minutes on battery or connected to mains).
EDIT-5: In the following log the above described issue start [ 1752.862237] PM: suspend entry (s2idle)
.
xiaomi-6.7.2-r0_dmesg_when_auto_standby_kicks_in_after_15min.txt
The most important lines (before the suspend is stopped and then retried again):
[ 1752.899606] wcn36xx: ERROR SMD_EVENT (312) not supported
[ 1753.049071] rmi4_f01 rmi4-00.fn01: Failed to write sleep mode: -6.
[ 1753.049095] rmi4_f01 rmi4-00.fn01: Suspend failed with code -6.
[ 1753.049106] rmi4_physical rmi4-00: Failed to suspend functions: -6
[ 1753.049128] rmi4_i2c 2-0020: Failed to resume device: -6
[ 1753.049147] rmi4_i2c 2-0020: PM: dpm_run_callback(): rmi_i2c_suspend+0x0/0x6c [rmi_i2c] returns -6
[ 1753.049192] rmi4_i2c 2-0020: PM: failed to suspend async: error -6
[ 1753.049494] PM: Some devices failed to suspend, or early wake event detected
Related:
- https://bugzilla.kernel.org/show_bug.cgi?id=217462
- https://bugzilla.redhat.com/show_bug.cgi?id=1480602
EDIT-6: Okay, after digging through the kernel mailing list, this seems to be a long standing issue of the RMI4 driver. It seems not to model parent child relations properly, so that the power management suspends certain parts of the platform that are still needed (as far as I understood the child relationship to the I2C device is modeled properly but there are other undiscovered dependencies).
- The asynchronous suspend mechanism might trigger this issue because RMI4 might be suspended earlier or later than defined by the hardware declaration order.
- Disabling async suspend, might help if the declaration order was working before async suspend was enabled.
Related discussions:
- https://bugzilla.redhat.com/show_bug.cgi?id=1480602
- https://bugzilla.kernel.org/show_bug.cgi?id=217462
- https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1803246
- https://lore.kernel.org/lkml/20230412175311.1.Ieb687047a5b75c7b7ee5dd258207ef5ca9a3b728@changeid/
Kernel discussion
- 2021-01-11: https://lore.kernel.org/linux-pm/alpine.LSU.2.11.2101102010200.25762@eggly.anvils/ ❗ ❗ ❗
- 2022-02-07: https://lore.kernel.org/lkml/89456fcd-a113-4c82-4b10-a9bcaefac68f@google.com/
- 2023-05-19: https://lore.kernel.org/lkml/73883c7d-42db-7ac6-fa43-b9be45cdc795@gmail.com/
Issue related commits:
- 5b6164d ("driver core: Reorder devices on successful probe")
- 172d931 ("i2c: enable async suspend/resume on i2c client devices")
Collection of magical workarounds (mostly hiding the issues with some likelihood):
- Sometimes suggested but ineffective for vince (no psmouse module): Add
psmouse.synaptics_intertouch=0
to kernel boot cmdline - Add
fw_devlink=on
to kernel boot cmdline - Revert ("driver core: Reorder devices on successful probe")
- Revert ("i2c: enable async suspend/resume on i2c client devices")
Workaround for pmos:
- Go to energy settings and disable "automatic suspend after x minutes" for both "on battery" and "connected to AC"
- Locking the device via hardware button seems to work for vince (I guess only the screen is turned off and the screen locked)