I'm using a Lenovo X121e which has a touchpad and a trackpoint, both worked fine on 12.0-RELEASE. After upgrading to 12.1-RELEASE (currently patchlevel p1), the trackpoint stopped working completely, and the touchpad only works on every second boot. I have the following in /boot/loader.conf: hw.psm.trackpoint_support="1" hw.psm.synaptics_support="1" hw.psm.synaptics.vscroll_hor_area="1300" scrolling on the touchpad never worked, but everything else was fine. Now on 12.1-RELEASE, I get either the following messages, with nothing working at all: Dec 10 13:26:11 photon kernel: psm0: failed to get status. Dec 10 13:26:11 photon kernel: psm0: <PS/2 Mouse> irq 12 on atkbdc0 Dec 10 13:26:11 photon kernel: psm0: [GIANT-LOCKED] Dec 10 13:26:11 photon kernel: psm0: model Generic PS/2 mouse, device ID 0 [...] Dec 10 13:26:14 photon kernel: psm0: failed to enable the device (doopen). ... or the following, with the touchpad working, but the trackpoint not: Dec 10 13:29:03 photon kernel: psm0: <PS/2 Mouse> irq 12 on atkbdc0 Dec 10 13:29:03 photon kernel: psm0: [GIANT-LOCKED] Dec 10 13:29:03 photon kernel: psm0: model Synaptics Touchpad, device ID 0
Recently, I had both the touchpad and trackpoint work on that notebook once. Could someone give hints what I should analyze to track down the root cause of this issue?
(In reply to Felix Palmen from comment #1) > Could someone give hints what I should analyze to track down > the root cause of this issue? add debug.psm.loglevel=5 to /boot/loader.conf and place dmesg output here after reboot.
Created attachment 214954 [details] dmesg on first boot (complete failure) Ok thanks! I can't reproduce a case where everything works. Here's the dmesg output with psm debugging from the first boot, neither touchpad nor trackpoint working.
Created attachment 214955 [details] dmesg on reboot (partial failure) And this is the dmesg output I get on reboot, result is a working touchpad, but the trackpoint is still "dead".
Created attachment 215015 [details] psm.patch AUX port becomes dead after switching MUX back to legacy mode. Try attached patch. It will show us who is guilty: mode transition or PS/2 commands executed in multiplexed mode P.S. Does your laptop have external PS/2 port or dock station with PS/2 port?
Created attachment 215020 [details] dmesg with patch on reboot (all working) (In reply to Vladimir Kondratyev from comment #5) Thanks! > Try attached patch. Applied it to releng/12.1 and the observable behavior is *almost* the same: touchpad and trackpoint dead on cold start, but this time, both worked fine on reboot. This could however be coincidence as I had them both working once a few weeks ago as well. I'm attaching a dmesg log from the reboot. Please let me know if you also need the log from cold start case when nothing worked. > P.S. Does your laptop have external PS/2 port or dock station with PS/2 port? No, it's a small netbook that doesn't even have a docking station connector, and there are no PS/2 ports, so it's just wired internally.
Created attachment 215024 [details] psm.patch > Applied it to releng/12.1 and the observable behavior is *almost* the same: touchpad and trackpoint dead on cold start, but this time, both worked fine on reboot. Is it always broken on cold start and restores after reboot? > Please let me know if you also need the log from cold start case when nothing worked. I need about 30-40 lines starting from: psm0: current command byte:0067 Try: 1. Attached patch. 2. enable_synaptics_mux() body replaced with return(FALSE);
(In reply to Vladimir Kondratyev from comment #7) > Is it always broken on cold start and restores after reboot? From my observations so far, yes. But normally, only the touchpad works after reboot, a working trackpoint is rare. > I need about 30-40 lines starting from: > psm0: current command byte:0067 psm0: current command byte:0067 psm: ENABLE_DEV return code:00fa psm: DISABLE_DEV return code:00fa psm: SEND_AUX_DEV_STATUS return code:00fa psm: status 00 02 64 psm: SEND_DEV_ID return code:00fa psm: device ID: 0000 psm: SET_RESOLUTION (0) 00fa psm: SET_SCALING11 return code:00fa psm: SET_SCALING11 return code:00fa psm: SET_SCALING11 return code:00fa psm: SEND_AUX_DEV_STATUS return code:00fa psm: status 00 00 64 aux_mux: ping port 0 aux_mux: ping port 1 aux_mux: ping port 2 aux_mux: ping port 3 Active Multiplexing PS/2 controller v1.1 with 0 active port(s) psm: SET_RESOLUTION (3) 00fe psm: SET_RESOLUTION (3) 00fe psm: SET_SCALING11 return code:00fe psm: SET_SAMPLING_RATE (200) 00fe psm: SET_SAMPLING_RATE (200) 00fe psm: SET_SAMPLING_RATE (200) 00fe psm: SEND_DEV_ID return code:00fe synaptics: BEGIN init psm: SET_SCALING11 return code:00fe psm: SET_RESOLUTION (0) 00fe elantech: BEGIN init psm: SET_SCALING11 return code:00fe psm: SET_SCALING11 return code:00fe psm: SET_SCALING11 return code:00fe psm: SEND_AUX_DEV_STATUS return code:00fe psm: SET_SAMPLING_RATE (200) 00fe psm: SET_SAMPLING_RATE (100) 00fe psm: SEND_DEV_ID return code:00fe psm: SET_SAMPLING_RATE (10) 00fe psm: SET_RESOLUTION (2) 00fe psm: SET_SAMPLING_RATE (100) 00fe psm: SET_SCALING11 return code:00fe psm: SET_SCALING11 return code:00fe psm: SET_SCALING11 return code:00fe psm: SET_SCALING11 return code:00fe psm: SEND_AUX_DEV_STATUS return code:00fe psm: SET_RESOLUTION (2) 00fe psm: SET_SAMPLING_RATE (100) 00fe psm: SET_SCALING11 return code:00fe psm: SEND_AUX_DEV_STATUS return code:00fe psm0: failed to get status. psm0: <PS/2 Mouse> irq 12 on atkbdc0 psm0: [GIANT-LOCKED] psm0: model Generic PS/2 mouse, device ID 0-00, 2 buttons psm0: config:00000000, flags:00000008, packet size:3 psm0: syncmask:c0, syncbits:00 > Try: > 1. Attached patch. > 2. enable_synaptics_mux() body replaced with return(FALSE); Thanks again! Will test both soon and report back. Why are there lines added, but commented? Should I also try *with* these lines?
(In reply to Felix Palmen from comment #8) > Why are there lines added, but commented? Should I also try *with* these lines? This is a quirk related to coreboot devices. It is commented out as it requires some additional lines to be added to compile.
With the new patch, the following changes: psm: status 00 00 64 aux_mux: ping port 0 psm: ENABLE_DEV return code:00fe aux_mux: ping port 1 psm: ENABLE_DEV return code:00fe aux_mux: ping port 2 psm: ENABLE_DEV return code:00fe aux_mux: ping port 3 psm: ENABLE_DEV return code:00fa psm: DISABLE_DEV return code:00fa Active Multiplexing PS/2 controller v1.1 with 1 active port(s) psm: ENABLE_DEV return code:00fe psm0: failed to enable the aux device. Now trying the "short-circuit" :)
(In reply to Felix Palmen from comment #10) Did you try touchpad after "psm0: failed to enable the aux device."?
(In reply to Vladimir Kondratyev from comment #11) And what is on the next lines after "psm0: failed to enable the aux device."?
(In reply to Vladimir Kondratyev from comment #12) Yes, nothing was working, and the following lines were exactly the same as in the previous log from comment #8. > 2. enable_synaptics_mux() body replaced with return(FALSE); This however fixes the problem! Both touchpad and trackpoint are working after cold start.
Created attachment 215027 [details] psm.patch Could you try this patch? It contains several commands which can change controller or mouse state. If it helps exact one should be found with commenting out of others.
(In reply to Vladimir Kondratyev from comment #14) > Could you try this patch? > It contains several commands which can change controller or mouse state. Yes! This seems to get the recovery done, I'm getting this (I guess 00fa is good) and both touchpad and trackpoint are working: aux_mux: ping port 0 psm: ENABLE_DEV return code:00fe aux_mux: ping port 1 psm: ENABLE_DEV return code:00fe aux_mux: ping port 2 psm: ENABLE_DEV return code:00fe aux_mux: ping port 3 psm: ENABLE_DEV return code:00fa psm: DISABLE_DEV return code:00fa Active Multiplexing PS/2 controller v1.1 with 1 active port(s) psm: ENABLE_DEV return code:00fe psm0: failed to enable the aux device. psm: SET_RESOLUTION (3) 00fa psm: SET_SCALING11 return code:00fa psm: SET_SCALING11 return code:00fa psm: SET_SCALING11 return code:00fa psm: SEND_AUX_DEV_STATUS return code:00fa psm: status 00 03 64 So, have to leave now, thanks a lot so far. I will test tomorrow which line exactly recovers successfully and post an update.
Ok, I tried only this one: reset_kbd(kbdc); First ran into -Werror for unused local variables :o Well, it works! Did two cold starts with this code just to be sure, both touchpad and trackpoint working flawlessly :) Do you still need me to test the alternative reset/restore functions in isolation as well?
(In reply to Felix Palmen from comment #16) > reset_kbd(kbdc); Reset keyboard to unstuck mouse... It is funny. > Do you still need me to test the alternative reset/restore functions in isolation as well? Yes, test them all, please! Keyboard reset is rather radical solution, but acceptable as a last resort. There are 2 more command used in keyboard driver to bring hung kbd controller back which can be tested: test_controller(kbdc); test_kbd_port(kbdc);
Ok, I don't get how the keyboard is related here (it always worked fine), but as long as it solves the problem… Testing: reset_aux_dev(kbdc); // broken restore_controller(kbdc, command_byte); // broken restore_controller(kbdc, command_byte); reset_aux_dev(kbdc); // broken test_controller(kbdc); // broken test_kbd_port(kbdc); // broken reset_kbd(kbdc); // works I re-tested this last one to be sure it is really reproducible.
Created attachment 215104 [details] psm.patch Here is, hopefully, a final version. It adds loader tunable, manpage changes and extra checks. Only "reset_kbd(kbdc);" command is used to do a recovery.
Created attachment 215105 [details] psm.patch Fix typo.
(In reply to Vladimir Kondratyev from comment #20) Great, thanks :) Applied to releng/12.1 and installed, and as expected, works fine with and without the new setting (so I never see the warning message you added). But verified from debug dmesg output that the mux code is skipped entirely when setting "mux_disabled".
A commit references this bug: Author: wulf Date: Tue Jun 2 01:04:49 UTC 2020 New revision: 361718 URL: https://svnweb.freebsd.org/changeset/base/361718 Log: [psm] Workaround active PS/2 multiplexor hang which happens on some laptops after returning to legacy multiplexing mode at initialization stage. PR: 242542 Reported by: Felix Palmen <felix@palmen-it.de> MFC after: 1 week Changes: head/share/man/man4/psm.4 head/sys/dev/atkbdc/psm.c
A commit references this bug: Author: wulf Date: Mon Jun 15 22:41:28 UTC 2020 New revision: 362208 URL: https://svnweb.freebsd.org/changeset/base/362208 Log: MFC r361715: [psm] Do not disable trackpoint when hw.psm.elantech.touchpad_off is enabled PR: 246117 Reported by: Alexander Sieg <ports@xanderio.de> MFC r361718: [psm] Workaround active PS/2 multiplexor hang which happens on some laptops after returning to legacy multiplexing mode at initialization stage. PR: 242542 Reported by: Felix Palmen <felix@palmen-it.de> Changes: _U stable/12/ stable/12/share/man/man4/psm.4 stable/12/sys/dev/atkbdc/psm.c
A commit references this bug: Author: wulf Date: Mon Jun 15 22:43:46 UTC 2020 New revision: 362209 URL: https://svnweb.freebsd.org/changeset/base/362209 Log: MFC r361715: [psm] Do not disable trackpoint when hw.psm.elantech.touchpad_off is enabled PR: 246117 Reported by: Alexander Sieg <ports@xanderio.de> MFC r361718: [psm] Workaround active PS/2 multiplexor hang which happens on some laptops after returning to legacy multiplexing mode at initialization stage. PR: 242542 Reported by: Felix Palmen <felix@palmen-it.de> Changes: _U stable/11/ stable/11/share/man/man4/psm.4 stable/11/sys/dev/atkbdc/psm.c