[Bug 231058] no support for active PS/2 multiplexing results in erratic behaviour of Synaptics touchpad on HP 8560w

2018-09-26 Thread bugzilla-noreply
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=231058

Vladimir Kondratyev  changed:

   What|Removed |Added

   Assignee|b...@freebsd.org|w...@freebsd.org

-- 
You are receiving this mail because:
You are the assignee for the bug.
___
freebsd-bugs@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-bugs
To unsubscribe, send any mail to "freebsd-bugs-unsubscr...@freebsd.org"


[Bug 231058] no support for active PS/2 multiplexing results in erratic behaviour of Synaptics touchpad on HP 8560w

2018-09-26 Thread bugzilla-noreply
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=231058

--- Comment #6 from Vladimir Kondratyev  ---
(In reply to Michael Figiel from comment #3)
> I've attached acpi PS2M section from the HP 8560w, it lists two id
> strings starting with SYN -- maybe both devices are Synaptics' ?
I doubt it. My trackpoint-less HP laptop has exactly the same list of CIDS.

> I can't disable single ports ... so I always get data from both devices.
You can filter out unwanted data inside read_aux_data_no_wait() routine with
dropping read_data() result if previous read_status() invocation has returned
port number of port that should be disabled.

> This amounts to hidden multiplexing -- the data streams of both devices will 
> be interleaved, at the level of three bytes.
Fortunately, according to Synaptics docs, driver could be modified to support
3bytes packets. Bit6 of 1-st byte is always 0 while bit6 of 4-th byte is always
1.  This fact can be used to do a proper assembly of single 6 byte packet from
two 3 byte ones.

> I think, with this special hardware there are only two viable solutions:
3) Switch touchpad to absolute mode with packetsize reduced to 3 bytes and use
hidden multiplexing. I would like to avoid massive psm.c refactoring as it
currently supports only one device at time.

> But if you think that's not worth the effort
Really I hate 0x46 hack. I spent 2 weekends trying to find a proper
initialization way of HP touchpad and did not succeed. :(

> If you want any logs/traces I'd be happy to provide them. 
1. Trackpoint name as it was detected by Linux
2. Short snippets of dmesg or systemlog reflecting both trackpad and trackpoint
touches made with debug.psm.loglevel=5 inserted in to /boot/loader.conf

I'll make 3-byte packetsize patch to test and will post it here than. Note I'll
be AFK for next two weeks so it can take some time.

-- 
You are receiving this mail because:
You are the assignee for the bug.
___
freebsd-bugs@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-bugs
To unsubscribe, send any mail to "freebsd-bugs-unsubscr...@freebsd.org"


[Bug 231058] no support for active PS/2 multiplexing results in erratic behaviour of Synaptics touchpad on HP 8560w

2018-09-25 Thread bugzilla-noreply
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=231058

--- Comment #5 from Michael Figiel  ---
Created attachment 197500
  --> https://bugs.freebsd.org/bugzilla/attachment.cgi?id=197500=edit
trackpoint initialization log

-- 
You are receiving this mail because:
You are the assignee for the bug.
___
freebsd-bugs@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-bugs
To unsubscribe, send any mail to "freebsd-bugs-unsubscr...@freebsd.org"


[Bug 231058] no support for active PS/2 multiplexing results in erratic behaviour of Synaptics touchpad on HP 8560w

2018-09-25 Thread bugzilla-noreply
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=231058

--- Comment #4 from Michael Figiel  ---
Created attachment 197499
  --> https://bugs.freebsd.org/bugzilla/attachment.cgi?id=197499=edit
Synaptics touchpad initialization log

-- 
You are receiving this mail because:
You are the assignee for the bug.
___
freebsd-bugs@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-bugs
To unsubscribe, send any mail to "freebsd-bugs-unsubscr...@freebsd.org"


[Bug 231058] no support for active PS/2 multiplexing results in erratic behaviour of Synaptics touchpad on HP 8560w

2018-09-25 Thread bugzilla-noreply
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=231058

--- Comment #3 from Michael Figiel  ---
(In reply to Vladimir Kondratyev from comment #1)
Hello Vladimir,
sorry for responding late and thank you for looking into it. 

I toyed with the controller and can give you some more info:
the machine (hp 8560w) claims to have following devices attached to aux port of
the i8042:
port 0: the trackpoint, the one returning ext. id 0x46
port 1,2 : nothing
port 3: touchpad, returning id 0x47

I've attached acpi PS2M section from the HP 8560w, it lists two id strings
starting with SYN -- maybe both devices are Synaptics' ?

The active multiplexer implementation on 8560w doesn't work as expected: I
can't disable single ports (that should be possible by sending 0x9[0-3] and
0xA7 sequence), so I always get data from both devices.

I'll attach the log of the initialization of the 0x47 device. It doesn't
advertise passthrough.

The trackpoint is recognized as a generic PS/2 mouse, it reports only two
buttons, but actually all three are working.

I've got two mostly working configurations: 
1) I send all commands to port 3, to the touchpad, and get working Synaptics
touchpad, with occasional device resests if I touch the trackpoint or any of
it's buttons (no passthrough on that machine, at least not advertised by the
touchpad) -- you are right, the trackpoint sends generic ps2 packets, but
additionally there ist the issue of interleaving both data streams.

2) I send all commands to port 0, and get a generic PS2 mouse. I removed the id
0x46 from psm.c, so this is the situation before your patch. All buttons work, 
but  it's two times button one, two times two and two times button three,
without any possiblity to tell them apart - not a big deal. I think,
occasionally there are problems with interleaving both streams but generally it
works well. But then there is no point enabling multiplexing in first place...

> The simpler way is to enable multiplexing only for synaptics devices and just 
> > only for configuring/querying stage and return to legacy mode after.
> trackpad/trackpoint packet separation problem should be solved in that case.
This amounts to hidden multiplexing -- the data streams of both devices will be
interleaved, at the level of three bytes. Additionally, the controller might
try to be helpfull, and mangle the data (e.g. using bit 3 of byte one of a
packet to mark the source, a problem with six byte packets). But I haven't
tried it - that's just what this document claims. 

I think, with this special hardware there are only two viable solutions:
1) removing the 0x46 id, leaving i8042 in legacy mode and using the touchpad
and the stick as one generic ps/2 device. One has no gestures, no multi-touch
(two fingers scrolling), but I think it's possible to configure the scrolling
zones on the edges in X11. Actually that sounds like reverting your change :-/

2) to implement a proper multiplexing driver

If you want any logs/traces I'd be happy to provide them. I think it should be
possible to give you access via ssh to the 8560w, at least for a few days.

But if you think that's not worth the effort, it's OK, because solution 1) is
good enough for me, I can maintain a patch locally, there is no point in 
reverting your change if it works well for others.

-- 
You are receiving this mail because:
You are the assignee for the bug.
___
freebsd-bugs@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-bugs
To unsubscribe, send any mail to "freebsd-bugs-unsubscr...@freebsd.org"


[Bug 231058] no support for active PS/2 multiplexing results in erratic behaviour of Synaptics touchpad on HP 8560w

2018-09-25 Thread bugzilla-noreply
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=231058

--- Comment #2 from Michael Figiel  ---
Created attachment 197498
  --> https://bugs.freebsd.org/bugzilla/attachment.cgi?id=197498=edit
acpidump ps2m section

-- 
You are receiving this mail because:
You are the assignee for the bug.
___
freebsd-bugs@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-bugs
To unsubscribe, send any mail to "freebsd-bugs-unsubscr...@freebsd.org"


[Bug 231058] no support for active PS/2 multiplexing results in erratic behaviour of Synaptics touchpad on HP 8560w

2018-09-23 Thread bugzilla-noreply
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=231058

Vladimir Kondratyev  changed:

   What|Removed |Added

 CC||w...@freebsd.org

--- Comment #1 from Vladimir Kondratyev  ---
(In reply to Michael Figiel from comment #0)
> I think the root cause of the 0x46 id is that FreeBSD doesn't
> support active PS/2 multiplexing.
Wow! I was not aware of 'active PS/2 multiplexing' when committed 0x46 hack.
Unfortunately, now I do not have access to such a hardware to reimplement it in
a right way.

> multiplexing controller operated in legacy (non-multiplexing)
> mode with more than one aux device might garble some of the
> data passed to the host.
I don`t think so. Trackpoint support code in synaptics driver expects
trackpoint to be attached via special passthrough interface which does
Generic->Synaptics protocol conversion. It (driver) it its current state just
can not decode generic mouse protocol.

> I'm not sure if it is really worth the effort to implement the multiplexing
Proper multiplexing implementation requires a lot of changes in both atkbd and
psm drivers. I think it is overkill. The simpler way is to enable multiplexing
only for synaptics devices and just only for configuring/querying stage and
return to legacy mode after. trackpad/trackpoint packet separation problem
should be solved in that case.

> that the few machines which use it will die of old age pretty soon
0x46 hack was made for 2013 year model. It is not so old to die quickly.

-- 
You are receiving this mail because:
You are the assignee for the bug.
___
freebsd-bugs@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-bugs
To unsubscribe, send any mail to "freebsd-bugs-unsubscr...@freebsd.org"


[Bug 231058] no support for active PS/2 multiplexing results in erratic behaviour of Synaptics touchpad on HP 8560w

2018-08-31 Thread bugzilla-noreply
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=231058

Bug ID: 231058
   Summary: no support for active PS/2 multiplexing results in
erratic behaviour of Synaptics touchpad on HP 8560w
   Product: Base System
   Version: 11.2-RELEASE
  Hardware: amd64
OS: Any
Status: New
  Severity: Affects Some People
  Priority: ---
 Component: kern
  Assignee: b...@freebsd.org
  Reporter: mifig...@gmail.com

Created attachment 196747
  --> https://bugs.freebsd.org/bugzilla/attachment.cgi?id=196747=edit
relevant syslog entries

I've got a HP EliteBook 8560w which is equipped with a Synaptics touchpad and a
trackpoint. The trackpoint doesn't work at all (movements are repoted as button
events or not at all), neither is the touchpad's middle button reported.

This is one of the devices which respond to the special query, which is used to
identify it, with a middle byte of 0x46 instead of 0x47. The same hardware is
properly recognized and works on Linux (Ubuntu 18.04). Linux accepts only 0x47
(I checked the source). I've seen in psm.c that FreeBSD accepts the 0x46 id but
uses conservative defaults for settings, because the devices report garbage.

I think the root cause of the 0x46 id is that FreeBSD doesn't support active
PS/2 multiplexing.
As a PoC I added functions to enable/disable the active multiplexing mode of
the i8042 and in multiplexing mode I queried all four aux ports. I got two
devices, and one of them sends 0x46 but the other sends a 0x47 in the middle
byte.
I attach the relevant portion of syslog messages (line 19: the first device,
line 34 the second device, from 36 on the normal initialization).

I found a document titled "Active PS/2 Multiplexing", version 1.1, from 1999
which describes this mode of operation. It hints on the fact, that a
multiplexing controller operated in legacy (non-multiplexing) mode with more
than one aux device might garble some of the data passed to the host. I think,
that's what happens on my machine. 

I'm not sure if it is really worth the effort to implement the multiplexing, as
I suspect that the few machines which use it will die of old age pretty soon,
but over the weekend I'll try to modify the psm.c to operate in multiplexing
mode with only one enabled device.

-- 
You are receiving this mail because:
You are the assignee for the bug.
___
freebsd-bugs@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-bugs
To unsubscribe, send any mail to "freebsd-bugs-unsubscr...@freebsd.org"