Touchpad stops working after resuming from s2idle

Bug #1842532 reported by Chih-Hsyuan Ho
10
This bug affects 1 person
Affects Status Importance Assigned to Milestone
HWE Next
Undecided
Unassigned
Linux
Fix Released
Medium
OEM Priority Project
High
You-Sheng Yang
linux (Ubuntu)
Undecided
You-Sheng Yang
Bionic
Undecided
You-Sheng Yang
Disco
Undecided
You-Sheng Yang
Eoan
Undecided
You-Sheng Yang
linux-oem-osp1 (Ubuntu)
Undecided
Unassigned
Bionic
Undecided
You-Sheng Yang
Disco
Undecided
Unassigned
Eoan
Undecided
Unassigned

Bug Description

[Summary]
When enable s2i, found touchpad doesn't work after resuming from suspend(to idle).

[Reproduce Steps]
1. Install Ubuntu image
2. let system enter s2i state
3. press power button to resume the system

[Results]
Expected: System back to work without problem
Actual: Found touchpad doesn't work after resuming

[Additional Information]
Dell Inspiron 5391
Base Image: Ubuntu 18.04.3
BIOS Version: 1.0.1
Kernel Version: 5.0.0-1013-oem
CPU: i5-10210U
GPU: Nvidia(1d13)

Chih-Hsyuan Ho (chih)
Changed in oem-priority:
importance: Undecided → High
assignee: nobody → Shih-Yuan Lee (fourdollars)
Revision history for this message
Ubuntu Kernel Bot (ubuntu-kernel-bot) wrote : Missing required logs.

This bug is missing log files that will aid in diagnosing the problem. While running an Ubuntu kernel (not a mainline or third-party kernel) please enter the following command in a terminal window:

apport-collect 1842532

and then change the status of the bug to 'Confirmed'.

If, due to the nature of the issue you have encountered, you are unable to run this command, please add a comment stating that fact and change the bug status to 'Confirmed'.

This change has been made by an automated script, maintained by the Ubuntu Kernel Team.

Changed in linux (Ubuntu):
status: New → Incomplete
Chih-Hsyuan Ho (chih)
description: updated
tags: added: originate-from-1841723
description: updated
tags: added: oem-priority
tags: added: somerville-dla
Chih-Hsyuan Ho (chih)
Changed in oem-priority:
assignee: Shih-Yuan Lee (fourdollars) → You-Sheng Yang (vicamo)
Revision history for this message
Chih-Hsyuan Ho (chih) wrote :

Vendor(Goodix) suggests to add a (58ms) delay after SET_POWER_ON command after resuming from s2idle.

And here is the cause analysis done by the vendor about this issue:
"
By following Microsoft spec, our IC supports two types of protocol, mouse mode and ptp mode.
When IC powers on, the default mode is mouse mode, host can send command to switch it to ptp mode.
ptp mode (Ubuntu OS only handle this protocol)

Switching to ptp mode fails in Ubuntu's case due to insufficient delay time after the SET_POWER_ON command and results in a loss in touchpad function as it weill be operating in mouse mode when resuming from s2idle.
"

You-Sheng Yang (vicamo)
tags: added: somerville
Changed in oem-priority:
status: New → Confirmed
Revision history for this message
In , vicamo (vicamo-linux-kernel-bugs) wrote :

Created attachment 285163
dmesg, v5.3.1, i2c-hid.debug=1 hid.debug=1

I2C traffic after resume:

[ 275.148083] i2c_hid i2c-CUST0000:00: i2c_hid_set_power
[ 275.148084] i2c_hid i2c-CUST0000:00: __i2c_hid_command: cmd=05 00 01 08
[ 275.312190] i2c_hid i2c-DELL096E:00: i2c_hid_set_power
[ 275.312191] i2c_hid i2c-DELL096E:00: __i2c_hid_command: cmd=05 00 01 08
[ 283.926905] i2c_hid i2c-DELL096E:00: i2c_hid_set_power
[ 283.926910] i2c_hid i2c-DELL096E:00: __i2c_hid_command: cmd=05 00 00 08
[ 283.927146] i2c_hid i2c-DELL096E:00: i2c_hid_set_or_send_report
[ 283.927149] i2c_hid i2c-DELL096E:00: __i2c_hid_command: cmd=05 00 37 03 06 00 05 00 07 00 00
[ 283.927872] i2c_hid i2c-DELL096E:00: i2c_hid_set_or_send_report
[ 283.927874] i2c_hid i2c-DELL096E:00: __i2c_hid_command: cmd=05 00 33 03 06 00 05 00 03 03 00
[ 283.929148] i2c_hid i2c-DELL096E:00: i2c_hid_set_or_send_report
[ 283.929151] i2c_hid i2c-DELL096E:00: __i2c_hid_command: cmd=05 00 35 03 06 00 05 00 05 03 00
[ 284.077891] i2c_hid i2c-CUST0000:00: i2c_hid_set_power
[ 284.077892] i2c_hid i2c-CUST0000:00: __i2c_hid_command: cmd=05 00 00 08

# when touching touchpad:
[ 289.262675] i2c_hid i2c-DELL096E:00: input: 0b 00 01 00 00 00 00 00 00 00 00
[ 289.270314] i2c_hid i2c-DELL096E:00: input: 0b 00 01 00 fe 00 00 00 00 00 00
[ 289.276806] i2c_hid i2c-DELL096E:00: input: 0b 00 01 00 fd 00 00 00 00 00 00
[ 289.283863] i2c_hid i2c-DELL096E:00: input: 0b 00 01 00 fb 01 00 00 00 00 00
[ 289.291213] i2c_hid i2c-DELL096E:00: input: 0b 00 01 00 fa 02 00 00 00 00 00
[ 289.297932] i2c_hid i2c-DELL096E:00: input: 0b 00 01 00 f9 03 00 00 00 00 00
[ 289.304775] i2c_hid i2c-DELL096E:00: input: 0b 00 01 00 f9 03 00 00 00 00 00

On this device, both Precision Touchpad mode and a legacy Mouse mode are supported. When I2C SET_POWER ON is issued, it would take as long as 60ms to complete state transition and is then able to receive and execute further commands. On boot the device is running under Mouse mode for legacy platform support, and will be put to PTP mode with a SET_OR_SEND_REPORT command. If somehow the time gap between the first SET_POWER ON and further SET_OR_SEND_REPORT commands is less than 60ms, the device will still operating under Mouse mode and gives reports like "0b 00 01 00 fe 00 00 00 00 00 00".

On Linux system boot, it may take 500ms from i2c probe (SET_POWER ON) to hid initialization (SET_OR_SEND_REPORT), so it will always be put to PTP mode successfully. But when the device is put under suspend and resumed, the hid reset resume process will be right after i2c resume, so the device won't have enough time to complete its state transition, which fails following SET_OR_SEND_REPORT executing and therefore it operates under Mouse mode instead.

Currently Linux has a at most 5ms sleep in i2c_hid_hwreset(), but according to HID over I2C Specification[1] section 7.2.8 "SET_POWER":

> The DEVICE must ensure that it transitions to the HOST
> specified Power State in under 1 second.

it can take as long as 1 second.

Revision history for this message
In , vicamo (vicamo-linux-kernel-bugs) wrote :
Changed in linux:
importance: Unknown → Medium
status: Unknown → Confirmed
You-Sheng Yang (vicamo)
Changed in linux (Ubuntu):
assignee: nobody → You-Sheng Yang (vicamo)
Changed in linux-oem-osp1 (Ubuntu Bionic):
assignee: nobody → You-Sheng Yang (vicamo)
status: New → In Progress
Changed in linux (Ubuntu Bionic):
assignee: nobody → You-Sheng Yang (vicamo)
status: New → In Progress
Changed in linux (Ubuntu Disco):
assignee: nobody → You-Sheng Yang (vicamo)
status: New → In Progress
Changed in linux (Ubuntu Eoan):
status: Incomplete → In Progress
Revision history for this message
In , vicamo (vicamo-linux-kernel-bugs) wrote :

Proposed changeset: https://<email address hidden>/msg2112500.html

Revision history for this message
CaCO3 (caco3) wrote :

I seem to have the same bug, how ever on a Synaptics TM2668-002 (ThinkPad T440s).
Is there any progress on this bug? I experience this issue since several months (Kubuntu 19.04 and now still on 20.04).

My workaround is to run a `sudo modprobe -r psmouse; sudo modprobe psmouse`

You-Sheng Yang (vicamo)
tags: added: hwe-touchpad
Revision history for this message
You-Sheng Yang (vicamo) wrote :

@CaCO3, like your id but it should be CaCO2 instead.

So the proposed patch was obsoleted because the i2c-hid maintainers prefer to turn off i2c runtime suspend instead, and therefore this should not be reproduced any more. This has been verified on Ubuntu OEM projects, and should have been resolved along with the internal counter part.

Should you have still issue around this, please run `apport-bug` after reproduced that issue in a clean reboot to file a separate bug. Usually I'll be notified with that new bug, but you can also subscribe me and let's find out what can we do next.

Revision history for this message
You-Sheng Yang (vicamo) wrote :

Ah, I need breakfast. It's CaCO3.

Revision history for this message
You-Sheng Yang (vicamo) wrote :

The two commits were backported to generic kernel 5.0.0-38.41, on which oem-osp1-5.0.0-1032 is based, is sufficient for fixing this on s2idle configuration:

  1. [HID: i2c-hid: Remove runtime power management](https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=67b18dfb8cfc6d6c2f45ba8c546088f5c14f5bd5)
  2. [HID: i2c-hid: Send power-on command after reset](https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=43b7029f475e7497da1de1f4a1742241812bf266)

Nothing else to do, marking INVALID.

Changed in oem-priority:
status: Confirmed → Fix Released
Changed in hwe-next:
status: New → Fix Released
Changed in linux-oem-osp1 (Ubuntu Bionic):
status: In Progress → Fix Released
Changed in linux-oem-osp1 (Ubuntu Disco):
status: New → Fix Released
Changed in linux-oem-osp1 (Ubuntu Eoan):
status: New → Invalid
Changed in linux-oem-osp1 (Ubuntu Disco):
status: Fix Released → Invalid
Changed in linux (Ubuntu Disco):
status: In Progress → Fix Released
Changed in linux (Ubuntu Eoan):
status: In Progress → Fix Released
Changed in linux-oem-osp1 (Ubuntu):
status: New → Invalid
Changed in linux (Ubuntu):
status: In Progress → Fix Released
Revision history for this message
In , vicamo (vicamo-linux-kernel-bugs) wrote :

This was obsoleted by following commits that disable runtime pm for i2c-hid:

  1. [HID: i2c-hid: Remove runtime power management](https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=67b18dfb8cfc6d6c2f45ba8c546088f5c14f5bd5)
  2. [HID: i2c-hid: Send power-on command after reset](https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=43b7029f475e7497da1de1f4a1742241812bf266)

Nothing else to do.

Revision history for this message
You-Sheng Yang (vicamo) wrote :

4.15 kernel is out of scope of s2idle support in Ubuntu.

Changed in linux (Ubuntu Bionic):
status: In Progress → Won't Fix
Changed in linux:
status: Confirmed → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.