Touchpad sometimes not working upon system startup
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
udev (Ubuntu) |
Fix Released
|
High
|
Unassigned | ||
Oneiric |
Fix Released
|
High
|
Eric Miao | ||
Precise |
Fix Released
|
High
|
Eric Miao |
Bug Description
SRU Justification
=================
[Impact]
Sometimes the notebook touchpad is non-functional upon system boot or resuming from suspend. OEMs that we work with consider this bug as very bad user experience.
[Test Case]
This bug happens infrequently, but on machines that are affected by this bug, one can prove this fix empirically by rebooting the machine many times (e.g. >50) and make sure the touchpad is working after each reboot.
[Regression Potential]
This bug is fixed by adding a new udev rule, and this rule is to modprobe the kernel module when serio event is received. This does not have adverse effect on unaffected systems, and I can't see how it will lead to regressions.
--
Original description:
This happens very infrequently. The symptom is touchpad not working after boot up unless a reboot is made, or a manual "modprobe psmouse" is performed on the command line. Movement or click activities on the touchpad during system startup will increase the chance of happening of this issue.
The root cause is a race condition upon system startup, that the serio1 device (i.e. the AUX port) could be temporarily binded to the keyboard driver, and thus udev rule will ignore the event by not loading psmouse at all. A detailed explanation of the theory is as follows:
1. serio ports (e.g. AUX port for touchpad) are different than other devices that:
- the kernel is using a dedicated kernel thread kseriod to handle the events
- interrupts on serio port will trigger connect attempt, as the OS has no idea when a keyboard/mouse could be plugged into the computer
2. The AT keyboard driver atkbd.c is built-in to the kernel for speed up as there will be normally an AT keyboard present, however, as on a normal PC, the keyboard can be connected to either the keyboard PS/2 port (i.e. KBD port), or the mouse PS/2 port (i.e. AUX port), the atkbd driver will be probed each time an interrupt is generated on the AUX port, in case there is a plug
3. When doing the probing, the serio1 device will be temporarily binded with atkbd, and this is in the context of kseriod
4. udev has the chance of being launched at the same time, the time that udev is launched, there will be a trigger to replay all uevents
5. that trigger will request uevents to be generated from the kernel, and if serio1 happens to be in the middle of a probing (most likely with atkbd), the uevent generated will have DRIVER=atkbd with it
6. psmouse is being built as a module, udev is following the rule below to load psmouse ondemand:
/lib/
...
DRIVER!="?*", ENV{MODALIAS}
7. So if uevent for serio1 happens to be with DRIVER entry, this rule will _not_ be performed as DRIVER!="?*" is _not_ matched, thus modprobe will not load psmouse on demand
8. One simple fix is to add one additional rule to 80-drivers.rules, so that serio events are treated special that modprobe will anyway be performed, e.g.
SUBSYSTEM=
Changed in udev (Ubuntu): | |
importance: | Undecided → High |
tags: | added: rls-q-incoming |
Changed in udev (Ubuntu): | |
status: | Triaged → Fix Committed |
Changed in udev (Ubuntu Oneiric): | |
status: | New → Triaged |
Changed in udev (Ubuntu Precise): | |
status: | New → Triaged |
Changed in udev (Ubuntu Oneiric): | |
importance: | Undecided → High |
Changed in udev (Ubuntu Precise): | |
importance: | Undecided → High |
Changed in udev (Ubuntu Precise): | |
assignee: | nobody → Eric Miao (eric.y.miao) |
Changed in udev (Ubuntu Oneiric): | |
assignee: | nobody → Eric Miao (eric.y.miao) |
The attachment "fix-race- condition- of-serio- driver- module- not-loading. patch" of this bug report has been identified as being a patch. The ubuntu-reviewers team has been subscribed to the bug report so that they can review the patch. In the event that this is in fact not a patch you can resolve this situation by removing the tag 'patch' from the bug report and editing the attachment so that it is not flagged as a patch. Additionally, if you are member of the ubuntu-reviewers team please also unsubscribe the team from this bug report.
[This is an automated message performed by a Launchpad user owned by Brian Murray. Please contact him regarding any issues with the action taken in this bug report.]