[DragonFlyBSD - Bug #3309] (New) psm0 (Synaptics Touchpad) regularily freezes mouse for 2 seconds

bugtracker-admin at leaf.dragonflybsd.org bugtracker-admin at leaf.dragonflybsd.org
Wed Dec 29 02:21:03 PST 2021

Issue #3309 has been reported by mneumann.

Bug #3309: psm0 (Synaptics Touchpad) regularily freezes mouse for 2 seconds

* Author: mneumann
* Status: New
* Priority: Normal
* Category: Driver
* Target version: 6.2
* Start date: 2021-12-27
* First note: Using an USB mouse exhibits none of the problems reported below!

* moused is enabled (by default).

* I am running from an USB stick with the DragonFly installer (nrelease + gui).

* There are no interrupt storms. Low frequent "psm0: lost interrupt?" messages seem to be fine
  (they happen on FreeBSD too).

* This happens repeatedly and roughly every 3-5 seconds (when moving the mouse).

* This happens when running moused on the terminal (though less likely).

* This happens with X11 (no matter of driver, i915 or scfb). /dev/sysmouse is used.

* It is much more likely to happen when running X11.

* It is less likely to happen on the console when psm debug output is enabled and the
  console is full of debug messages. Note that the debug output does not affect it from
  happending when running X11.

* This does not happen on FreeBSD 13 [1].

* [1] IIRC I could once reproduce this on FreeBSD, but as I switched between
 FreeBSD and DragonFly quite often, I am  not 100% sure that this actually appeared on FreeBSD.

* I reviewed the changes in the psm driver between
  FreeBSD and DragonFly and couldn't find anything that would explain this behaviour.

* On FreeBSD, I disabled psm mux (hw.psm.mux_disabled=1), so that the code paths are mostly identical.
  It still works on FreeBSD!

* I also synced the psm driver a bit, still no luck on DragonFly.

* The 2 seconds "freeze" comes from this piece of code (around line 6554 in psm.c):

     * Drop even good packets if they occur within a timeout
     * period of a sync error.  This allows the detection of
     * a change in the mouse's packet mode without exposing
     * erratic mouse behavior to the user.  Some KVMs forget
     * enhanced mouse modes during switch events.
    if (!timeelapsed(&sc->lastinputerr, psmerrsecs, psmerrusecs,
        &now)) {
      pb->inputbytes = 0;

* It's paired with these messages:

  psmintr: out of sync (0000 != 0080) 106 cmds since last error.
  psmintr: discard a byte (1)

* Normally PSM packets looks like this:

   psmintr: 80 00 00 c0 00 00

* But what I sometimes get are corrupted packets or variations of:

   psmintr: 00 80 00 00 c0 00

* Note that there are various reports of similar problems for FreeBSD (ages ago):


* My assumption is that this is somehow a timing problem. But I'd like to
  understand why this happens on DragonFly but not on FreeBSD.
  The psm code is so similar, except that FreeBSD uses splx locks whereas
  we use lockmgr. I found suggestions to turn of powerd etc... but they all come
  down to the fact that there are timing issues.

* BTW, NetBSD has beautiful and highly understandable psm code (truely amazing)!
  I might want to try if psm works there.

* Running recent DragonFly master (6.1-DEVELOPMENT), i7-8565U CPU @ 1.80GHz, TUXEDO InfinityBook Pro 14 v3 (Clevo "clone").

* Below is my dmesg output for psm0 (just for the record):

psm0: current command byte:0067
Synaptics Touchpad v8.2
  Model information:
   infoRot180: 0
   infoPortrait: 0
   infoSensor: 1
   infoHardware: 113
   infoNewAbs: 1
   capPen: 0
   infoSimplC: 1
   infoGeometry: 1
  Extended capabilities:
   capExtended: 1
   capMiddle: 0
   nExtendedQueries: 7
   capPassthrough: 0
   capLowPower: 0
   capMultiFingerReport: 1
   capSleep: 0
   capFourButtons: 0
   capBallistics: 0
   capMultiFinger: 1
   capPalmDetect: 1
   infoXupmm: 55
   infoYupmm: 102
  Extended model ID:
   verticalScroll: 0
   horizontalScroll: 0
   verticalWheel: 0
   nExtendedButtons: 0
   capEWmode: 1
  Continued capabilities:
   capClickPad: 0
   capDeluxeLEDs: 0
   noAbsoluteFilter: 0
   capReportsV: 1
   capUniformClickPad: 0
   capReportsMin: 1
   capInterTouch: 1
   capReportsMax: 1
   capClearPad: 0
   capAdvancedGestures: 0
   capCoveredPad: 0
   maximumXCoord: 5718
   maximumYCoord: 4908
   minimumXCoord: 1238
   minimumYCoord: 956
  Additional Buttons: 0
psm0: found Synaptics Touchpad
psm0: <PS/2 Mouse> irq 12 on atkbdc0
interrupt uses mplock: psm0
psm0: model Synaptics Touchpad, device ID 0-00, 3 buttons
psm0: config:00004000, flags:00000008, packet size:6
psm0: syncmask:c0, syncbits:00

You have received this notification because you have either subscribed to it, or are involved in it.
To change your notification preferences, please click here: http://bugs.dragonflybsd.org/my/account

More information about the Bugs mailing list