All of lore.kernel.org
 help / color / mirror / Atom feed
* Re: PROBLEM: Missing events on thinkpad trackpoint buttons
@ 2015-08-20 20:50 Gabor Balla
  2015-08-20 21:35 ` Dmitry Torokhov
  0 siblings, 1 reply; 25+ messages in thread
From: Gabor Balla @ 2015-08-20 20:50 UTC (permalink / raw)
  To: linux-input

Hi,

I could also reproduce this issue using a T450s, but have probably found the
issue behind it.

At some point a new PS/2 mode was introduced by Synaptics, called EWmode. This
can be enabled by setting bit 2 of the mode byte. But previously this bit was
used for 'Disable Gesture', whatever that stands for, and it was reused for
selecting EWmode. Now if plain Wmode is selected, with bit 0 of the mode byte,
than disable gesture is on by default and bit 2 selects EWmode instead.

Reference:
http://www.synaptics.com/sites/default/files/511-000275-01_RevB.pdf

The current implementation of the driver doesn't take EWmode into account, and
enables it, when setting both Wmode and what it thinks to be the disable
gesture bit. It is probably selecting EWmode that causes the glitch.

A quick fix follows:

diff -ru a/drivers/input/mouse/synaptics.c b/drivers/input/mouse/synaptics.c
--- a/drivers/input/mouse/synaptics.c2015-08-20 22:25:05.261546729 +0200
+++ b/drivers/input/mouse/synaptics.c2015-08-20 22:21:28.560038539 +0200
@@ -521,7 +521,7 @@
 priv->mode = 0;
 if (priv->absolute_mode)
 priv->mode |= SYN_BIT_ABSOLUTE_MODE;
-if (priv->disable_gesture && !SYN_CAP_EXTENDED(priv->capabilities))
+if (priv->disable_gesture)
 priv->mode |= SYN_BIT_DISABLE_GESTURE;
 if (psmouse->rate >= 80)
 priv->mode |= SYN_BIT_HIGH_RATE;

Regards,
Gabor

^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: PROBLEM: Missing events on thinkpad trackpoint buttons
  2015-08-20 20:50 PROBLEM: Missing events on thinkpad trackpoint buttons Gabor Balla
@ 2015-08-20 21:35 ` Dmitry Torokhov
  2015-08-20 22:24   ` Gabor Balla
  0 siblings, 1 reply; 25+ messages in thread
From: Dmitry Torokhov @ 2015-08-20 21:35 UTC (permalink / raw)
  To: Gabor Balla
  Cc: linux-input, Benjamin Tissoires, Stephen Chandler Paul,
	Nick Bowler, Andrew Duggan

Hi Gabor,

On Thu, Aug 20, 2015 at 10:50:27PM +0200, Gabor Balla wrote:
> Hi,
> 
> I could also reproduce this issue using a T450s, but have probably found the
> issue behind it.
> 
> At some point a new PS/2 mode was introduced by Synaptics, called EWmode. This
> can be enabled by setting bit 2 of the mode byte. But previously this bit was
> used for 'Disable Gesture', whatever that stands for, and it was reused for
> selecting EWmode. Now if plain Wmode is selected, with bit 0 of the mode byte,
> than disable gesture is on by default and bit 2 selects EWmode instead.
> 
> Reference:
> http://www.synaptics.com/sites/default/files/511-000275-01_RevB.pdf
> 
> The current implementation of the driver doesn't take EWmode into account, and
> enables it, when setting both Wmode and what it thinks to be the disable
> gesture bit. It is probably selecting EWmode that causes the glitch.
> 
> A quick fix follows:
> 
> diff -ru a/drivers/input/mouse/synaptics.c b/drivers/input/mouse/synaptics.c
> --- a/drivers/input/mouse/synaptics.c2015-08-20 22:25:05.261546729 +0200
> +++ b/drivers/input/mouse/synaptics.c2015-08-20 22:21:28.560038539 +0200
> @@ -521,7 +521,7 @@
>  priv->mode = 0;
>  if (priv->absolute_mode)
>  priv->mode |= SYN_BIT_ABSOLUTE_MODE;
> -if (priv->disable_gesture && !SYN_CAP_EXTENDED(priv->capabilities))
> +if (priv->disable_gesture)

It looks like the patch "direction" is reverted. Also, the presence of
extended capabilities is not the indication that gesture mode should not
be used: in relative mode bit 2 disables gesture reporting, in absolute
mode it enables Extended W-mode.

Does the patch below also work for you?

Thanks.

-- 
Dmitry


Input: synaptics - fix handling of disabling gesture mode

Bit 2 of the mode byte only disables gesture reporting when touchpad is in
relative mode, when in absolute mode it activates the so-called Extended
W-mode that confuses driver and causes missing button presses on some
Thinkpads (x250, T450s).

Reported-by: Nick Bowler <nbowler@draconx.ca>
Suggested-by: Gabor Balla <gaborwho@gmail.com>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
---
 drivers/input/mouse/synaptics.c |    7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/drivers/input/mouse/synaptics.c b/drivers/input/mouse/synaptics.c
index 28daca1..97c5dde 100644
--- a/drivers/input/mouse/synaptics.c
+++ b/drivers/input/mouse/synaptics.c
@@ -519,12 +519,15 @@ static int synaptics_set_mode(struct psmouse *psmouse)
 	struct synaptics_data *priv = psmouse->private;
 
 	priv->mode = 0;
+
 	if (priv->absolute_mode)
 		priv->mode |= SYN_BIT_ABSOLUTE_MODE;
-	if (priv->disable_gesture)
+	else if (priv->disable_gesture)
 		priv->mode |= SYN_BIT_DISABLE_GESTURE;
+
 	if (psmouse->rate >= 80)
 		priv->mode |= SYN_BIT_HIGH_RATE;
+
 	if (SYN_CAP_EXTENDED(priv->capabilities))
 		priv->mode |= SYN_BIT_W_MODE;
 
@@ -1482,7 +1485,7 @@ static int __synaptics_init(struct psmouse *psmouse, bool absolute_mode)
 	}
 
 	priv->absolute_mode = absolute_mode;
-	if (SYN_ID_DISGEST_SUPPORTED(priv->identity))
+	if (!absolute_mode && SYN_ID_DISGEST_SUPPORTED(priv->identity))
 		priv->disable_gesture = true;
 
 	/*

^ permalink raw reply related	[flat|nested] 25+ messages in thread

* Re: PROBLEM: Missing events on thinkpad trackpoint buttons
  2015-08-20 21:35 ` Dmitry Torokhov
@ 2015-08-20 22:24   ` Gabor Balla
  2015-08-20 22:42     ` Gabor Balla
  2015-08-20 22:56     ` Dmitry Torokhov
  0 siblings, 2 replies; 25+ messages in thread
From: Gabor Balla @ 2015-08-20 22:24 UTC (permalink / raw)
  To: Dmitry Torokhov
  Cc: linux-input, Benjamin Tissoires, Stephen Chandler Paul,
	Nick Bowler, Andrew Duggan

Hi Dmitry,

On Thu, Aug 20, 2015 at 11:35 PM, Dmitry Torokhov
<dmitry.torokhov@gmail.com> wrote:
> On Thu, Aug 20, 2015 at 10:50:27PM +0200, Gabor Balla wrote:
[...]
>> At some point a new PS/2 mode was introduced by Synaptics, called EWmode. This
>> can be enabled by setting bit 2 of the mode byte. But previously this bit was
>> used for 'Disable Gesture', whatever that stands for, and it was reused for
>> selecting EWmode. Now if plain Wmode is selected, with bit 0 of the mode byte,
>> than disable gesture is on by default and bit 2 selects EWmode instead.
>>
>> Reference:
>> http://www.synaptics.com/sites/default/files/511-000275-01_RevB.pdf
[...]
>> A quick fix follows:
[...]
>
> It looks like the patch "direction" is reverted. Also, the presence of
> extended capabilities is not the indication that gesture mode should not
> be used: in relative mode bit 2 disables gesture reporting, in absolute
> mode it enables Extended W-mode.
>
> Does the patch below also work for you?

If I'm not mistaken, the function of bit 2 depends on the state of W mode rather
than absolute vs relative mode. From page 40 of the PDF:

"If the Wmode bit is not set (0), then Gesture is reported and bit 2 refers to
DisGest. (..) When this bit is 1, the Relative mode mouse packet reports the
true physical button states, and the Absolute mode packet’s Gesture bit always
reports as zero."

So it still has a meaning in absolute mode, when Wmode is disabled.
I've tried the patch, it works, but I don't believe it's correct.

Sorry for the reversed patch, I'm not really experienced with making patches.

Regards,
Gabor
--
To unsubscribe from this list: send the line "unsubscribe linux-input" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: PROBLEM: Missing events on thinkpad trackpoint buttons
  2015-08-20 22:24   ` Gabor Balla
@ 2015-08-20 22:42     ` Gabor Balla
  2015-08-20 22:56     ` Dmitry Torokhov
  1 sibling, 0 replies; 25+ messages in thread
From: Gabor Balla @ 2015-08-20 22:42 UTC (permalink / raw)
  To: Dmitry Torokhov
  Cc: linux-input, Benjamin Tissoires, Stephen Chandler Paul,
	Nick Bowler, Andrew Duggan

Hi Dmitry,

I've prepared another possible fix, that checks the current mode for Wmode bit.

Regards,
Gabor

diff --git a/drivers/input/mouse/synaptics.c b/drivers/input/mouse/synaptics.c
index 6025eb4..7ec72a6 100644
--- a/drivers/input/mouse/synaptics.c
+++ b/drivers/input/mouse/synaptics.c
@@ -519,15 +519,19 @@ static int synaptics_set_mode(struct psmouse *psmouse)
        struct synaptics_data *priv = psmouse->private;

        priv->mode = 0;
+
        if (priv->absolute_mode)
                priv->mode |= SYN_BIT_ABSOLUTE_MODE;
-       if (priv->disable_gesture)
-               priv->mode |= SYN_BIT_DISABLE_GESTURE;
+
        if (psmouse->rate >= 80)
                priv->mode |= SYN_BIT_HIGH_RATE;
+
        if (SYN_CAP_EXTENDED(priv->capabilities))
                priv->mode |= SYN_BIT_W_MODE;

+       if (!SYN_MODE_WMODE(priv->mode) && priv->disable_gesture)
+               priv->mode |= SYN_BIT_DISABLE_GESTURE;
+
        if (synaptics_mode_cmd(psmouse, priv->mode))
                return -1;

@@ -1280,6 +1284,10 @@ static ssize_t
synaptics_set_disable_gesture(struct psmouse *psmouse,
                return len;

        priv->disable_gesture = value;
+
+       if (SYN_MODE_WMODE(priv->mode))
+               return len;
+
        if (value)
                priv->mode |= SYN_BIT_DISABLE_GESTURE;
        else

^ permalink raw reply related	[flat|nested] 25+ messages in thread

* Re: PROBLEM: Missing events on thinkpad trackpoint buttons
  2015-08-20 22:24   ` Gabor Balla
  2015-08-20 22:42     ` Gabor Balla
@ 2015-08-20 22:56     ` Dmitry Torokhov
  2015-08-20 23:01       ` Dmitry Torokhov
  1 sibling, 1 reply; 25+ messages in thread
From: Dmitry Torokhov @ 2015-08-20 22:56 UTC (permalink / raw)
  To: Gabor Balla
  Cc: linux-input, Benjamin Tissoires, Stephen Chandler Paul,
	Nick Bowler, Andrew Duggan

On Fri, Aug 21, 2015 at 12:24:59AM +0200, Gabor Balla wrote:
> Hi Dmitry,
> 
> On Thu, Aug 20, 2015 at 11:35 PM, Dmitry Torokhov
> <dmitry.torokhov@gmail.com> wrote:
> > On Thu, Aug 20, 2015 at 10:50:27PM +0200, Gabor Balla wrote:
> [...]
> >> At some point a new PS/2 mode was introduced by Synaptics, called EWmode. This
> >> can be enabled by setting bit 2 of the mode byte. But previously this bit was
> >> used for 'Disable Gesture', whatever that stands for, and it was reused for
> >> selecting EWmode. Now if plain Wmode is selected, with bit 0 of the mode byte,
> >> than disable gesture is on by default and bit 2 selects EWmode instead.
> >>
> >> Reference:
> >> http://www.synaptics.com/sites/default/files/511-000275-01_RevB.pdf
> [...]
> >> A quick fix follows:
> [...]
> >
> > It looks like the patch "direction" is reverted. Also, the presence of
> > extended capabilities is not the indication that gesture mode should not
> > be used: in relative mode bit 2 disables gesture reporting, in absolute
> > mode it enables Extended W-mode.
> >
> > Does the patch below also work for you?
> 
> If I'm not mistaken, the function of bit 2 depends on the state of W mode rather
> than absolute vs relative mode. From page 40 of the PDF:
> 
> "If the Wmode bit is not set (0), then Gesture is reported and bit 2 refers to
> DisGest. (..) When this bit is 1, the Relative mode mouse packet reports the
> true physical button states, and the Absolute mode packet’s Gesture bit always
> reports as zero."
> 
> So it still has a meaning in absolute mode, when Wmode is disabled.
> I've tried the patch, it works, but I don't believe it's correct.

Yes, you are right, the bot does have meaning on Absolute mode, however
we want to give option to enable gestures only when in relative mode;
I've adjusted the description accordingly.

By the way, I re-read the spec and it says that when in Relative mode we
should not touch W-mode bit at all so I adjusted it as well.

Thanks.

-- 
Dmitry

Input: synaptics - fix handling of disabling gesture mode

From: Dmitry Torokhov <dmitry.torokhov@gmail.com>

Bit 2 of the mode byte has dual meaning: it can disable reporting of
gestures when touchpad works in Relative mode or normal Absolute mode,
or it can enable so called Extended W-Mode when touchpad uses enhanced
Absolute mode (W-mode). The extended W-Mode confuses our driver and
causes missing button presses on some Thinkpads (x250, T450s). Given that
we only want to give option of enabling gestures when touchpad works in
relative mode let's adjust synaptics_set_mode() so that we do not touch
that bit in absolute mode.

Also, according to the spec W mode "... bit is defined only in Absolute
mode on pads whose capExtended capability bit is set. In Relative mode and
in TouchPads without this capability, the bit is reserved and should be
left at 0.", so let's make sure we respect this requirement as well.

Reported-by: Nick Bowler <nbowler@draconx.ca>
Suggested-by: Gabor Balla <gaborwho@gmail.com>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
---
 drivers/input/mouse/synaptics.c |   13 ++++++++-----
 1 file changed, 8 insertions(+), 5 deletions(-)

diff --git a/drivers/input/mouse/synaptics.c b/drivers/input/mouse/synaptics.c
index 28daca1..298f65d 100644
--- a/drivers/input/mouse/synaptics.c
+++ b/drivers/input/mouse/synaptics.c
@@ -519,14 +519,17 @@ static int synaptics_set_mode(struct psmouse *psmouse)
 	struct synaptics_data *priv = psmouse->private;
 
 	priv->mode = 0;
-	if (priv->absolute_mode)
+
+	if (priv->absolute_mode) {
 		priv->mode |= SYN_BIT_ABSOLUTE_MODE;
-	if (priv->disable_gesture)
+		if (SYN_CAP_EXTENDED(priv->capabilities))
+			priv->mode |= SYN_BIT_W_MODE;
+	} else if (priv->disable_gesture) {
 		priv->mode |= SYN_BIT_DISABLE_GESTURE;
+	}
+
 	if (psmouse->rate >= 80)
 		priv->mode |= SYN_BIT_HIGH_RATE;
-	if (SYN_CAP_EXTENDED(priv->capabilities))
-		priv->mode |= SYN_BIT_W_MODE;
 
 	if (synaptics_mode_cmd(psmouse, priv->mode))
 		return -1;
@@ -1482,7 +1485,7 @@ static int __synaptics_init(struct psmouse *psmouse, bool absolute_mode)
 	}
 
 	priv->absolute_mode = absolute_mode;
-	if (SYN_ID_DISGEST_SUPPORTED(priv->identity))
+	if (!absolute_mode && SYN_ID_DISGEST_SUPPORTED(priv->identity))
 		priv->disable_gesture = true;
 
 	/*
--
To unsubscribe from this list: send the line "unsubscribe linux-input" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply related	[flat|nested] 25+ messages in thread

* Re: PROBLEM: Missing events on thinkpad trackpoint buttons
  2015-08-20 22:56     ` Dmitry Torokhov
@ 2015-08-20 23:01       ` Dmitry Torokhov
  2015-08-20 23:05         ` Gabor Balla
  0 siblings, 1 reply; 25+ messages in thread
From: Dmitry Torokhov @ 2015-08-20 23:01 UTC (permalink / raw)
  To: Gabor Balla
  Cc: linux-input, Benjamin Tissoires, Stephen Chandler Paul,
	Nick Bowler, Andrew Duggan

On Thu, Aug 20, 2015 at 3:56 PM, Dmitry Torokhov
<dmitry.torokhov@gmail.com> wrote:
> On Fri, Aug 21, 2015 at 12:24:59AM +0200, Gabor Balla wrote:
>> Hi Dmitry,
>>
>> On Thu, Aug 20, 2015 at 11:35 PM, Dmitry Torokhov
>> <dmitry.torokhov@gmail.com> wrote:
>> > On Thu, Aug 20, 2015 at 10:50:27PM +0200, Gabor Balla wrote:
>> [...]
>> >> At some point a new PS/2 mode was introduced by Synaptics, called EWmode. This
>> >> can be enabled by setting bit 2 of the mode byte. But previously this bit was
>> >> used for 'Disable Gesture', whatever that stands for, and it was reused for
>> >> selecting EWmode. Now if plain Wmode is selected, with bit 0 of the mode byte,
>> >> than disable gesture is on by default and bit 2 selects EWmode instead.
>> >>
>> >> Reference:
>> >> http://www.synaptics.com/sites/default/files/511-000275-01_RevB.pdf
>> [...]
>> >> A quick fix follows:
>> [...]
>> >
>> > It looks like the patch "direction" is reverted. Also, the presence of
>> > extended capabilities is not the indication that gesture mode should not
>> > be used: in relative mode bit 2 disables gesture reporting, in absolute
>> > mode it enables Extended W-mode.
>> >
>> > Does the patch below also work for you?
>>
>> If I'm not mistaken, the function of bit 2 depends on the state of W mode rather
>> than absolute vs relative mode. From page 40 of the PDF:
>>
>> "If the Wmode bit is not set (0), then Gesture is reported and bit 2 refers to
>> DisGest. (..) When this bit is 1, the Relative mode mouse packet reports the
>> true physical button states, and the Absolute mode packet’s Gesture bit always
>> reports as zero."
>>
>> So it still has a meaning in absolute mode, when Wmode is disabled.
>> I've tried the patch, it works, but I don't believe it's correct.
>
> Yes, you are right, the bot does have meaning on Absolute mode, however
> we want to give option to enable gestures only when in relative mode;
> I've adjusted the description accordingly.

Ah, wait, not quite still. So we actually do want to disable gestures
when in Absolute mode (non extended). Although frankly I do not think
we'll ever see pre 4.0 Synaptics device in a wild.

Thanks.

-- 
Dmitry
--
To unsubscribe from this list: send the line "unsubscribe linux-input" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: PROBLEM: Missing events on thinkpad trackpoint buttons
  2015-08-20 23:01       ` Dmitry Torokhov
@ 2015-08-20 23:05         ` Gabor Balla
  2015-08-20 23:08           ` Dmitry Torokhov
  0 siblings, 1 reply; 25+ messages in thread
From: Gabor Balla @ 2015-08-20 23:05 UTC (permalink / raw)
  To: Dmitry Torokhov
  Cc: linux-input, Benjamin Tissoires, Stephen Chandler Paul,
	Nick Bowler, Andrew Duggan

Hi Dmitry,

On Fri, Aug 21, 2015 at 1:01 AM, Dmitry Torokhov
<dmitry.torokhov@gmail.com> wrote:
> On Thu, Aug 20, 2015 at 3:56 PM, Dmitry Torokhov
> <dmitry.torokhov@gmail.com> wrote:
>> On Fri, Aug 21, 2015 at 12:24:59AM +0200, Gabor Balla wrote:
>>> Hi Dmitry,
>>>
>>> On Thu, Aug 20, 2015 at 11:35 PM, Dmitry Torokhov
>>> <dmitry.torokhov@gmail.com> wrote:
>>> > On Thu, Aug 20, 2015 at 10:50:27PM +0200, Gabor Balla wrote:
[...]
> Ah, wait, not quite still. So we actually do want to disable gestures
> when in Absolute mode (non extended). Although frankly I do not think
> we'll ever see pre 4.0 Synaptics device in a wild.

Also notice there is a function called synaptics_set_disable_gesture that can
change that bit regardless of current mode.

Thanks (also for your patience),
Gabor

^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: PROBLEM: Missing events on thinkpad trackpoint buttons
  2015-08-20 23:05         ` Gabor Balla
@ 2015-08-20 23:08           ` Dmitry Torokhov
  2015-08-20 23:13             ` Dmitry Torokhov
  0 siblings, 1 reply; 25+ messages in thread
From: Dmitry Torokhov @ 2015-08-20 23:08 UTC (permalink / raw)
  To: Gabor Balla
  Cc: linux-input, Benjamin Tissoires, Stephen Chandler Paul,
	Nick Bowler, Andrew Duggan

Hi Gabor,

On Fri, Aug 21, 2015 at 01:05:46AM +0200, Gabor Balla wrote:
> Hi Dmitry,
> 
> On Fri, Aug 21, 2015 at 1:01 AM, Dmitry Torokhov
> <dmitry.torokhov@gmail.com> wrote:
> > On Thu, Aug 20, 2015 at 3:56 PM, Dmitry Torokhov
> > <dmitry.torokhov@gmail.com> wrote:
> >> On Fri, Aug 21, 2015 at 12:24:59AM +0200, Gabor Balla wrote:
> >>> Hi Dmitry,
> >>>
> >>> On Thu, Aug 20, 2015 at 11:35 PM, Dmitry Torokhov
> >>> <dmitry.torokhov@gmail.com> wrote:
> >>> > On Thu, Aug 20, 2015 at 10:50:27PM +0200, Gabor Balla wrote:
> [...]
> > Ah, wait, not quite still. So we actually do want to disable gestures
> > when in Absolute mode (non extended). Although frankly I do not think
> > we'll ever see pre 4.0 Synaptics device in a wild.
> 
> Also notice there is a function called synaptics_set_disable_gesture that can
> change that bit regardless of current mode.

That attribute is only created when touchpad is used in relative mode,
so should be OK.

Thanks.

-- 
Dmitry

^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: PROBLEM: Missing events on thinkpad trackpoint buttons
  2015-08-20 23:08           ` Dmitry Torokhov
@ 2015-08-20 23:13             ` Dmitry Torokhov
  2015-08-20 23:35               ` Gabor Balla
                                 ` (2 more replies)
  0 siblings, 3 replies; 25+ messages in thread
From: Dmitry Torokhov @ 2015-08-20 23:13 UTC (permalink / raw)
  To: Gabor Balla
  Cc: linux-input, Benjamin Tissoires, Stephen Chandler Paul,
	Nick Bowler, Andrew Duggan

On Thu, Aug 20, 2015 at 04:08:40PM -0700, Dmitry Torokhov wrote:
> Hi Gabor,
> 
> On Fri, Aug 21, 2015 at 01:05:46AM +0200, Gabor Balla wrote:
> > Hi Dmitry,
> > 
> > On Fri, Aug 21, 2015 at 1:01 AM, Dmitry Torokhov
> > <dmitry.torokhov@gmail.com> wrote:
> > > On Thu, Aug 20, 2015 at 3:56 PM, Dmitry Torokhov
> > > <dmitry.torokhov@gmail.com> wrote:
> > >> On Fri, Aug 21, 2015 at 12:24:59AM +0200, Gabor Balla wrote:
> > >>> Hi Dmitry,
> > >>>
> > >>> On Thu, Aug 20, 2015 at 11:35 PM, Dmitry Torokhov
> > >>> <dmitry.torokhov@gmail.com> wrote:
> > >>> > On Thu, Aug 20, 2015 at 10:50:27PM +0200, Gabor Balla wrote:
> > [...]
> > > Ah, wait, not quite still. So we actually do want to disable gestures
> > > when in Absolute mode (non extended). Although frankly I do not think
> > > we'll ever see pre 4.0 Synaptics device in a wild.
> > 
> > Also notice there is a function called synaptics_set_disable_gesture that can
> > change that bit regardless of current mode.
> 
> That attribute is only created when touchpad is used in relative mode,
> so should be OK.
> 
> Thanks.

How about this one?

Thanks.

-- 
Dmitry


Input: synaptics - fix handling of disabling gesture mode

From: Dmitry Torokhov <dmitry.torokhov@gmail.com>

Bit 2 of the mode byte has dual meaning: it can disable reporting of
gestures when touchpad works in Relative mode or normal Absolute mode,
or it can enable so called Extended W-Mode when touchpad uses enhanced
Absolute mode (W-mode). The extended W-Mode confuses our driver and
causes missing button presses on some Thinkpads (x250, T450s), so let's
make sure we do not enable it.

Also, according to the spec W mode "... bit is defined only in Absolute
mode on pads whose capExtended capability bit is set. In Relative mode and
in TouchPads without this capability, the bit is reserved and should be
left at 0.", so let's make sure we respect this requirement as well.

Reported-by: Nick Bowler <nbowler@draconx.ca>
Suggested-by: Gabor Balla <gaborwho@gmail.com>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
---
 drivers/input/mouse/synaptics.c |   12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)

diff --git a/drivers/input/mouse/synaptics.c b/drivers/input/mouse/synaptics.c
index 28daca1..d9c9e41 100644
--- a/drivers/input/mouse/synaptics.c
+++ b/drivers/input/mouse/synaptics.c
@@ -519,14 +519,18 @@ static int synaptics_set_mode(struct psmouse *psmouse)
 	struct synaptics_data *priv = psmouse->private;
 
 	priv->mode = 0;
-	if (priv->absolute_mode)
+
+	if (priv->absolute_mode) {
 		priv->mode |= SYN_BIT_ABSOLUTE_MODE;
-	if (priv->disable_gesture)
+		if (SYN_CAP_EXTENDED(priv->capabilities))
+			priv->mode |= SYN_BIT_W_MODE;
+	}
+
+	if (!(priv->mode & SYN_BIT_W_MODE) && priv->disable_gesture)
 		priv->mode |= SYN_BIT_DISABLE_GESTURE;
+
 	if (psmouse->rate >= 80)
 		priv->mode |= SYN_BIT_HIGH_RATE;
-	if (SYN_CAP_EXTENDED(priv->capabilities))
-		priv->mode |= SYN_BIT_W_MODE;
 
 	if (synaptics_mode_cmd(psmouse, priv->mode))
 		return -1;

^ permalink raw reply related	[flat|nested] 25+ messages in thread

* Re: PROBLEM: Missing events on thinkpad trackpoint buttons
  2015-08-20 23:13             ` Dmitry Torokhov
@ 2015-08-20 23:35               ` Gabor Balla
  2015-08-21  0:06                 ` Dmitry Torokhov
  2015-08-24 17:57               ` Dmitry Torokhov
       [not found]               ` <CAN+gG=H88uVbRun=Vs1r1b8jM=wpnC1285BquFpDsh8HQdr07Q@mail.gmail.com>
  2 siblings, 1 reply; 25+ messages in thread
From: Gabor Balla @ 2015-08-20 23:35 UTC (permalink / raw)
  To: Dmitry Torokhov
  Cc: linux-input, Benjamin Tissoires, Stephen Chandler Paul,
	Nick Bowler, Andrew Duggan

Hi Dmitry,

> How about this one?

It looks fine for me, I've also tested it and it works.
Still, can we do something about synaptics_set_disable_gesture() function too?
Not sure what it does, but it certainly looks like it could break EWmode.
I've included a possible solution.

Regards,
Gabor

diff --git a/drivers/input/mouse/synaptics.c b/drivers/input/mouse/synaptics.c
index 6025eb4..60ec964 100644
--- a/drivers/input/mouse/synaptics.c
+++ b/drivers/input/mouse/synaptics.c
@@ -519,14 +519,18 @@ static int synaptics_set_mode(struct psmouse *psmouse)
        struct synaptics_data *priv = psmouse->private;

        priv->mode = 0;
-       if (priv->absolute_mode)
+
+       if (priv->absolute_mode) {
                priv->mode |= SYN_BIT_ABSOLUTE_MODE;
-       if (priv->disable_gesture)
+               if (SYN_CAP_EXTENDED(priv->capabilities))
+                       priv->mode |= SYN_BIT_W_MODE;
+       }
+
+       if (!SYN_MODE_WMODE(priv->mode) && priv->disable_gesture)
                priv->mode |= SYN_BIT_DISABLE_GESTURE;
+
        if (psmouse->rate >= 80)
                priv->mode |= SYN_BIT_HIGH_RATE;
-       if (SYN_CAP_EXTENDED(priv->capabilities))
-               priv->mode |= SYN_BIT_W_MODE;

        if (synaptics_mode_cmd(psmouse, priv->mode))
                return -1;
@@ -1280,6 +1284,10 @@ static ssize_t
synaptics_set_disable_gesture(struct psmouse *psmouse,
                return len;

        priv->disable_gesture = value;
+
+       if (SYN_MODE_WMODE(priv->mode))
+               return len;
+
        if (value)
                priv->mode |= SYN_BIT_DISABLE_GESTURE;
        else

^ permalink raw reply related	[flat|nested] 25+ messages in thread

* Re: PROBLEM: Missing events on thinkpad trackpoint buttons
  2015-08-20 23:35               ` Gabor Balla
@ 2015-08-21  0:06                 ` Dmitry Torokhov
  0 siblings, 0 replies; 25+ messages in thread
From: Dmitry Torokhov @ 2015-08-21  0:06 UTC (permalink / raw)
  To: Gabor Balla
  Cc: linux-input, Benjamin Tissoires, Stephen Chandler Paul,
	Nick Bowler, Andrew Duggan

Hi Gabor,

On Thu, Aug 20, 2015 at 4:35 PM, Gabor Balla <gaborwho@gmail.com> wrote:
> Hi Dmitry,
>
>> How about this one?
>
> It looks fine for me, I've also tested it and it works.

Thanks for trying it out!

> Still, can we do something about synaptics_set_disable_gesture() function too?
> Not sure what it does, but it certainly looks like it could break EWmode.
> I've included a possible solution.

As I mentioned this is called from a sysfs attribute and that
attribute is only created when the touchpad is used in relative mode,
so W-bit is guaranteed to be off when this fucntion is running.

Thanks.

-- 
Dmitry

^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: PROBLEM: Missing events on thinkpad trackpoint buttons
  2015-08-20 23:13             ` Dmitry Torokhov
  2015-08-20 23:35               ` Gabor Balla
@ 2015-08-24 17:57               ` Dmitry Torokhov
  2015-08-24 23:44                 ` Nick Bowler
       [not found]               ` <CAN+gG=H88uVbRun=Vs1r1b8jM=wpnC1285BquFpDsh8HQdr07Q@mail.gmail.com>
  2 siblings, 1 reply; 25+ messages in thread
From: Dmitry Torokhov @ 2015-08-24 17:57 UTC (permalink / raw)
  To: Gabor Balla
  Cc: linux-input, Benjamin Tissoires, Stephen Chandler Paul,
	Nick Bowler, Andrew Duggan

On Thu, Aug 20, 2015 at 04:13:39PM -0700, Dmitry Torokhov wrote:
> On Thu, Aug 20, 2015 at 04:08:40PM -0700, Dmitry Torokhov wrote:
> > Hi Gabor,
> > 
> > On Fri, Aug 21, 2015 at 01:05:46AM +0200, Gabor Balla wrote:
> > > Hi Dmitry,
> > > 
> > > On Fri, Aug 21, 2015 at 1:01 AM, Dmitry Torokhov
> > > <dmitry.torokhov@gmail.com> wrote:
> > > > On Thu, Aug 20, 2015 at 3:56 PM, Dmitry Torokhov
> > > > <dmitry.torokhov@gmail.com> wrote:
> > > >> On Fri, Aug 21, 2015 at 12:24:59AM +0200, Gabor Balla wrote:
> > > >>> Hi Dmitry,
> > > >>>
> > > >>> On Thu, Aug 20, 2015 at 11:35 PM, Dmitry Torokhov
> > > >>> <dmitry.torokhov@gmail.com> wrote:
> > > >>> > On Thu, Aug 20, 2015 at 10:50:27PM +0200, Gabor Balla wrote:
> > > [...]
> > > > Ah, wait, not quite still. So we actually do want to disable gestures
> > > > when in Absolute mode (non extended). Although frankly I do not think
> > > > we'll ever see pre 4.0 Synaptics device in a wild.
> > > 
> > > Also notice there is a function called synaptics_set_disable_gesture that can
> > > change that bit regardless of current mode.
> > 
> > That attribute is only created when touchpad is used in relative mode,
> > so should be OK.
> > 
> > Thanks.
> 
> How about this one?

Nick, Benjamin, could you please give this a spin?

> 
> Thanks.
> 
> -- 
> Dmitry
> 
> 
> Input: synaptics - fix handling of disabling gesture mode
> 
> From: Dmitry Torokhov <dmitry.torokhov@gmail.com>
> 
> Bit 2 of the mode byte has dual meaning: it can disable reporting of
> gestures when touchpad works in Relative mode or normal Absolute mode,
> or it can enable so called Extended W-Mode when touchpad uses enhanced
> Absolute mode (W-mode). The extended W-Mode confuses our driver and
> causes missing button presses on some Thinkpads (x250, T450s), so let's
> make sure we do not enable it.
> 
> Also, according to the spec W mode "... bit is defined only in Absolute
> mode on pads whose capExtended capability bit is set. In Relative mode and
> in TouchPads without this capability, the bit is reserved and should be
> left at 0.", so let's make sure we respect this requirement as well.
> 
> Reported-by: Nick Bowler <nbowler@draconx.ca>
> Suggested-by: Gabor Balla <gaborwho@gmail.com>
> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
> ---
>  drivers/input/mouse/synaptics.c |   12 ++++++++----
>  1 file changed, 8 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/input/mouse/synaptics.c b/drivers/input/mouse/synaptics.c
> index 28daca1..d9c9e41 100644
> --- a/drivers/input/mouse/synaptics.c
> +++ b/drivers/input/mouse/synaptics.c
> @@ -519,14 +519,18 @@ static int synaptics_set_mode(struct psmouse *psmouse)
>  	struct synaptics_data *priv = psmouse->private;
>  
>  	priv->mode = 0;
> -	if (priv->absolute_mode)
> +
> +	if (priv->absolute_mode) {
>  		priv->mode |= SYN_BIT_ABSOLUTE_MODE;
> -	if (priv->disable_gesture)
> +		if (SYN_CAP_EXTENDED(priv->capabilities))
> +			priv->mode |= SYN_BIT_W_MODE;
> +	}
> +
> +	if (!(priv->mode & SYN_BIT_W_MODE) && priv->disable_gesture)
>  		priv->mode |= SYN_BIT_DISABLE_GESTURE;
> +
>  	if (psmouse->rate >= 80)
>  		priv->mode |= SYN_BIT_HIGH_RATE;
> -	if (SYN_CAP_EXTENDED(priv->capabilities))
> -		priv->mode |= SYN_BIT_W_MODE;
>  
>  	if (synaptics_mode_cmd(psmouse, priv->mode))
>  		return -1;

-- 
Dmitry

^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: PROBLEM: Missing events on thinkpad trackpoint buttons
  2015-08-24 17:57               ` Dmitry Torokhov
@ 2015-08-24 23:44                 ` Nick Bowler
  0 siblings, 0 replies; 25+ messages in thread
From: Nick Bowler @ 2015-08-24 23:44 UTC (permalink / raw)
  To: Dmitry Torokhov
  Cc: Gabor Balla, linux-input, Benjamin Tissoires,
	Stephen Chandler Paul, Andrew Duggan

On 2015-08-24, Dmitry Torokhov <dmitry.torokhov@gmail.com> wrote:
> On Thu, Aug 20, 2015 at 04:13:39PM -0700, Dmitry Torokhov wrote:
[...]
> > On Fri, Aug 21, 2015 at 1:01 AM, Dmitry Torokhov
> > <dmitry.torokhov@gmail.com> wrote:
[...]
> > > Ah, wait, not quite still. So we actually do want to disable
> > > gestures when in Absolute mode (non extended). Although frankly I
> > > do not think we'll ever see pre 4.0 Synaptics device in a wild.
[...]
> > How about this one?
>
> Nick, Benjamin, could you please give this a spin?
[...]
> > Input: synaptics - fix handling of disabling gesture mode

Applied on top of 4.1.6, appears to fix the trackpoint buttons on my X250.

Thanks,
  Nick

^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: PROBLEM: Missing events on thinkpad trackpoint buttons
       [not found]               ` <CAN+gG=H88uVbRun=Vs1r1b8jM=wpnC1285BquFpDsh8HQdr07Q@mail.gmail.com>
@ 2015-09-27 12:14                 ` Benjamin Tissoires
  2015-09-28 22:52                   ` Dmitry Torokhov
  0 siblings, 1 reply; 25+ messages in thread
From: Benjamin Tissoires @ 2015-09-27 12:14 UTC (permalink / raw)
  To: Dmitry Torokhov
  Cc: Gabor Balla, linux-input, Stephen Chandler Paul, Nick Bowler,
	Andrew Duggan

[re-sending because my gmail client decided to turn on HTML for all
mails I wrote. Sorry for the duplicate ]

On Sun, Sep 27, 2015 at 8:12 AM, Benjamin Tissoires
<benjamin.tissoires@gmail.com> wrote:
>
>
> On Thu, Aug 20, 2015 at 7:13 PM, Dmitry Torokhov <dmitry.torokhov@gmail.com>
> wrote:
>>
>> On Thu, Aug 20, 2015 at 04:08:40PM -0700, Dmitry Torokhov wrote:
>> > Hi Gabor,
>> >
>> > On Fri, Aug 21, 2015 at 01:05:46AM +0200, Gabor Balla wrote:
>> > > Hi Dmitry,
>> > >
>> > > On Fri, Aug 21, 2015 at 1:01 AM, Dmitry Torokhov
>> > > <dmitry.torokhov@gmail.com> wrote:
>> > > > On Thu, Aug 20, 2015 at 3:56 PM, Dmitry Torokhov
>> > > > <dmitry.torokhov@gmail.com> wrote:
>> > > >> On Fri, Aug 21, 2015 at 12:24:59AM +0200, Gabor Balla wrote:
>> > > >>> Hi Dmitry,
>> > > >>>
>> > > >>> On Thu, Aug 20, 2015 at 11:35 PM, Dmitry Torokhov
>> > > >>> <dmitry.torokhov@gmail.com> wrote:
>> > > >>> > On Thu, Aug 20, 2015 at 10:50:27PM +0200, Gabor Balla wrote:
>> > > [...]
>> > > > Ah, wait, not quite still. So we actually do want to disable
>> > > > gestures
>> > > > when in Absolute mode (non extended). Although frankly I do not
>> > > > think
>> > > > we'll ever see pre 4.0 Synaptics device in a wild.
>> > >
>> > > Also notice there is a function called synaptics_set_disable_gesture
>> > > that can
>> > > change that bit regardless of current mode.
>> >
>> > That attribute is only created when touchpad is used in relative mode,
>> > so should be OK.
>> >
>> > Thanks.
>>
>> How about this one?
>

 Hello Dmitry,

 unfortunately, I have been reported a breakage in libinput this week
 following this patch.
 See https://bugs.freedesktop.org/show_bug.cgi?id=92091

 If you look at the evemu recording with 2 fingers scroll, you will see that
 the kernel sends a slot and a tracking ID for the second finger, but it
 never sends the actual coordinates. Libinput ignores such slot (I'll check
 with Peter what we do in such cases when he will be back from his vacations)
 and this kills the 2 fingers scrolling.

 I believe the fix is worse than the original situation given that this also
 removes all gestures support we can have in libinput.

 And of course, with my turtle speed to test it, this patch is already in
 stable too (I am entirely at fault here :( ).

 Cheers,
 Benjamin

>>
>>
>> Thanks.
>>
>> --
>> Dmitry
>>
>>
>> Input: synaptics - fix handling of disabling gesture mode
>>
>> From: Dmitry Torokhov <dmitry.torokhov@gmail.com>
>>
>> Bit 2 of the mode byte has dual meaning: it can disable reporting of
>> gestures when touchpad works in Relative mode or normal Absolute mode,
>> or it can enable so called Extended W-Mode when touchpad uses enhanced
>> Absolute mode (W-mode). The extended W-Mode confuses our driver and
>> causes missing button presses on some Thinkpads (x250, T450s), so let's
>> make sure we do not enable it.
>>
>> Also, according to the spec W mode "... bit is defined only in Absolute
>> mode on pads whose capExtended capability bit is set. In Relative mode and
>> in TouchPads without this capability, the bit is reserved and should be
>> left at 0.", so let's make sure we respect this requirement as well.
>>
>> Reported-by: Nick Bowler <nbowler@draconx.ca>
>> Suggested-by: Gabor Balla <gaborwho@gmail.com>
>> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
>> ---
>>  drivers/input/mouse/synaptics.c |   12 ++++++++----
>>  1 file changed, 8 insertions(+), 4 deletions(-)
>>
>> diff --git a/drivers/input/mouse/synaptics.c
>> b/drivers/input/mouse/synaptics.c
>> index 28daca1..d9c9e41 100644
>> --- a/drivers/input/mouse/synaptics.c
>> +++ b/drivers/input/mouse/synaptics.c
>> @@ -519,14 +519,18 @@ static int synaptics_set_mode(struct psmouse
>> *psmouse)
>>         struct synaptics_data *priv = psmouse->private;
>>
>>         priv->mode = 0;
>> -       if (priv->absolute_mode)
>> +
>> +       if (priv->absolute_mode) {
>>                 priv->mode |= SYN_BIT_ABSOLUTE_MODE;
>> -       if (priv->disable_gesture)
>> +               if (SYN_CAP_EXTENDED(priv->capabilities))
>> +                       priv->mode |= SYN_BIT_W_MODE;
>> +       }
>> +
>> +       if (!(priv->mode & SYN_BIT_W_MODE) && priv->disable_gesture)
>>                 priv->mode |= SYN_BIT_DISABLE_GESTURE;
>> +
>>         if (psmouse->rate >= 80)
>>                 priv->mode |= SYN_BIT_HIGH_RATE;
>> -       if (SYN_CAP_EXTENDED(priv->capabilities))
>> -               priv->mode |= SYN_BIT_W_MODE;
>>
>>         if (synaptics_mode_cmd(psmouse, priv->mode))
>>                 return -1;
>
>

^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: PROBLEM: Missing events on thinkpad trackpoint buttons
  2015-09-27 12:14                 ` Benjamin Tissoires
@ 2015-09-28 22:52                   ` Dmitry Torokhov
  2015-09-29  0:22                     ` Nick Bowler
  0 siblings, 1 reply; 25+ messages in thread
From: Dmitry Torokhov @ 2015-09-28 22:52 UTC (permalink / raw)
  To: Benjamin Tissoires
  Cc: Gabor Balla, linux-input, Stephen Chandler Paul, Nick Bowler,
	Andrew Duggan

On Sun, Sep 27, 2015 at 5:14 AM, Benjamin Tissoires
<benjamin.tissoires@gmail.com> wrote:
> [re-sending because my gmail client decided to turn on HTML for all
> mails I wrote. Sorry for the duplicate ]
>
> On Sun, Sep 27, 2015 at 8:12 AM, Benjamin Tissoires
> <benjamin.tissoires@gmail.com> wrote:
>>
>>
>> On Thu, Aug 20, 2015 at 7:13 PM, Dmitry Torokhov <dmitry.torokhov@gmail.com>
>> wrote:
>>>
>>> On Thu, Aug 20, 2015 at 04:08:40PM -0700, Dmitry Torokhov wrote:
>>> > Hi Gabor,
>>> >
>>> > On Fri, Aug 21, 2015 at 01:05:46AM +0200, Gabor Balla wrote:
>>> > > Hi Dmitry,
>>> > >
>>> > > On Fri, Aug 21, 2015 at 1:01 AM, Dmitry Torokhov
>>> > > <dmitry.torokhov@gmail.com> wrote:
>>> > > > On Thu, Aug 20, 2015 at 3:56 PM, Dmitry Torokhov
>>> > > > <dmitry.torokhov@gmail.com> wrote:
>>> > > >> On Fri, Aug 21, 2015 at 12:24:59AM +0200, Gabor Balla wrote:
>>> > > >>> Hi Dmitry,
>>> > > >>>
>>> > > >>> On Thu, Aug 20, 2015 at 11:35 PM, Dmitry Torokhov
>>> > > >>> <dmitry.torokhov@gmail.com> wrote:
>>> > > >>> > On Thu, Aug 20, 2015 at 10:50:27PM +0200, Gabor Balla wrote:
>>> > > [...]
>>> > > > Ah, wait, not quite still. So we actually do want to disable
>>> > > > gestures
>>> > > > when in Absolute mode (non extended). Although frankly I do not
>>> > > > think
>>> > > > we'll ever see pre 4.0 Synaptics device in a wild.
>>> > >
>>> > > Also notice there is a function called synaptics_set_disable_gesture
>>> > > that can
>>> > > change that bit regardless of current mode.
>>> >
>>> > That attribute is only created when touchpad is used in relative mode,
>>> > so should be OK.
>>> >
>>> > Thanks.
>>>
>>> How about this one?
>>
>
>  Hello Dmitry,
>
>  unfortunately, I have been reported a breakage in libinput this week
>  following this patch.
>  See https://bugs.freedesktop.org/show_bug.cgi?id=92091
>
>  If you look at the evemu recording with 2 fingers scroll, you will see that
>  the kernel sends a slot and a tracking ID for the second finger, but it
>  never sends the actual coordinates. Libinput ignores such slot (I'll check
>  with Peter what we do in such cases when he will be back from his vacations)
>  and this kills the 2 fingers scrolling.
>
>  I believe the fix is worse than the original situation given that this also
>  removes all gestures support we can have in libinput.
>

Umm, I guess I have to claim temporary insanity or something like that
with this one: we do need extended W mode to handle multiple touches
in the driver and  the patch disabled it ;(

Before we revert this, Nick, Gabor, can you tell me what capability
bits your touchpads report (in dmesg)?

Thanks.

-- 
Dmitry

^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: PROBLEM: Missing events on thinkpad trackpoint buttons
  2015-09-28 22:52                   ` Dmitry Torokhov
@ 2015-09-29  0:22                     ` Nick Bowler
  2015-09-29  0:26                       ` Dmitry Torokhov
  0 siblings, 1 reply; 25+ messages in thread
From: Nick Bowler @ 2015-09-29  0:22 UTC (permalink / raw)
  To: Dmitry Torokhov
  Cc: Benjamin Tissoires, Gabor Balla, linux-input,
	Stephen Chandler Paul, Andrew Duggan

On 9/28/15, Dmitry Torokhov <dmitry.torokhov@gmail.com> wrote:
> On Sun, Sep 27, 2015 at 5:14 AM, Benjamin Tissoires <benjamin.tissoires@gmail.com> wrote:
>>  I believe the fix is worse than the original situation given that this
>>  also removes all gestures support we can have in libinput.
>
> Umm, I guess I have to claim temporary insanity or something like that
> with this one: we do need extended W mode to handle multiple touches
> in the driver and  the patch disabled it ;(
>
> Before we revert this, Nick, Gabor, can you tell me what capability
> bits your touchpads report (in dmesg)?

Is this the info you're looking for?

  [    1.225243] psmouse serio1: synaptics: queried max coordinates: x
[..5712], y [..4780]
  [    1.256725] psmouse serio1: synaptics: queried min coordinates: x
[1232..], y [1074..]
  [    1.316644] psmouse serio1: synaptics: Touchpad model: 1, fw:
8.1, id: 0x1e2b1, caps: 0xf002a3/0x943300/0x12e800/0x10000, board id:
3075, fw id: 2560
  [    1.318089] psmouse serio1: synaptics: serio: Synaptics
pass-through port at isa0060/serio1/input0
  [    1.356859] input: SynPS/2 Synaptics TouchPad as
/devices/platform/i8042/serio1/input/input5
  [    5.135450] psmouse serio2: trackpoint: IBM TrackPoint firmware:
0x0e, buttons: 3/3
  [    5.329582] input: TPPS/2 IBM TrackPoint as
/devices/platform/i8042/serio1/serio2/input/input7

Cheers,
  Nick

^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: PROBLEM: Missing events on thinkpad trackpoint buttons
  2015-09-29  0:22                     ` Nick Bowler
@ 2015-09-29  0:26                       ` Dmitry Torokhov
  0 siblings, 0 replies; 25+ messages in thread
From: Dmitry Torokhov @ 2015-09-29  0:26 UTC (permalink / raw)
  To: Nick Bowler
  Cc: Benjamin Tissoires, Gabor Balla, linux-input,
	Stephen Chandler Paul, Andrew Duggan

On Mon, Sep 28, 2015 at 08:22:02PM -0400, Nick Bowler wrote:
> On 9/28/15, Dmitry Torokhov <dmitry.torokhov@gmail.com> wrote:
> > On Sun, Sep 27, 2015 at 5:14 AM, Benjamin Tissoires <benjamin.tissoires@gmail.com> wrote:
> >>  I believe the fix is worse than the original situation given that this
> >>  also removes all gestures support we can have in libinput.
> >
> > Umm, I guess I have to claim temporary insanity or something like that
> > with this one: we do need extended W mode to handle multiple touches
> > in the driver and  the patch disabled it ;(
> >
> > Before we revert this, Nick, Gabor, can you tell me what capability
> > bits your touchpads report (in dmesg)?
> 
> Is this the info you're looking for?

Yep, thanks.

> 
>   [    1.225243] psmouse serio1: synaptics: queried max coordinates: x
> [..5712], y [..4780]
>   [    1.256725] psmouse serio1: synaptics: queried min coordinates: x
> [1232..], y [1074..]
>   [    1.316644] psmouse serio1: synaptics: Touchpad model: 1, fw:
> 8.1, id: 0x1e2b1, caps: 0xf002a3/0x943300/0x12e800/0x10000, board id:
> 3075, fw id: 2560
>   [    1.318089] psmouse serio1: synaptics: serio: Synaptics
> pass-through port at isa0060/serio1/input0
>   [    1.356859] input: SynPS/2 Synaptics TouchPad as
> /devices/platform/i8042/serio1/input/input5
>   [    5.135450] psmouse serio2: trackpoint: IBM TrackPoint firmware:
> 0x0e, buttons: 3/3
>   [    5.329582] input: TPPS/2 IBM TrackPoint as
> /devices/platform/i8042/serio1/serio2/input/input7
> 
> Cheers,
>   Nick

-- 
Dmitry

^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: PROBLEM: Missing events on thinkpad trackpoint buttons
  2015-08-19 21:27     ` Dmitry Torokhov
  2015-08-19 21:33       ` Stephen Chandler Paul
@ 2015-08-19 21:34       ` Benjamin Tissoires
  1 sibling, 0 replies; 25+ messages in thread
From: Benjamin Tissoires @ 2015-08-19 21:34 UTC (permalink / raw)
  To: Dmitry Torokhov
  Cc: Nick Bowler, linux-input, Stephen Chandler Paul, Andrew Duggan

On Wed, Aug 19, 2015 at 5:27 PM, Dmitry Torokhov
<dmitry.torokhov@gmail.com> wrote:
> On Wed, Aug 19, 2015 at 09:52:00AM -0400, Benjamin Tissoires wrote:
>> On Tue, Aug 18, 2015 at 3:06 PM, Benjamin Tissoires
>> <benjamin.tissoires@gmail.com> wrote:
>> > Hi Nick,
>> >
>> > thanks for the report.
>> >
>> > On Mon, Aug 17, 2015 at 10:31 PM, Nick Bowler <nbowler@draconx.ca> wrote:
>> >> Hi,
>> >>
>> >> I'm not sure if this is actually a Linux issue but figured I'd at least
>> >> report it here to start...
>> >>
>> >> I have a Lenovo Thinkpad X250, with the newfangled trackpoint buttons.
>> >> I have a problem with missing button press or release events: sometimes
>> >> pressing a button has no effect, and sometimes releasing a button has no
>> >> effect (the latter is especially annoying, as the button remains depressed
>> >> as far as any applications are concerned).
>> >>
>> >> After some testing, the problem apparently depends on the position of my
>> >> hands over the touchpad.  I can reliably reproduce it as follows: place
>> >> two fingers on the touchpad, then press the button repeatedly.  Watching
>> >> with evtest, several events (could be either press or release) will
>> >> simply be missin, although the kernel never does anything weird like
>> >> send two release events in a row.  There are no problems if there are
>> >> 0 or 1 fingers on the touchpad.
>> >>
>> >> My current kernel version is 4.1.6, although the problem occurs in all
>> >> versions that I tried.
>> >>
>> >> Here is the evtest result from placing two fingers on the touchpad, then
>> >> pressing the left trackpoint button 10 times, counting 1 second between
>> >> each press.  As you can see, only 3 presses and 3 release events total
>> >> were sent by the kernel, sometimes with many physical button presses
>> >> between the press and its corresponding release:
>> >
>> > OK, so this is definitively weird. My first idea would be a firmware
>> > problem. I have asked Chandler to reproduce it on his t450 and see if
>> > we observe it on our laptops too.
>>
>> Update on this one : Chandler reproduced it on the t450, so it's
>> likely that all of these sensors are affected. It is still unclear if
>> it is a firmware bug or a driver problem, but the chances are huge
>> that this is a firmware bug. Anyway, that's one more reason to push
>> towards RMI4 over SMBus for these sensors: the bug is not present with
>> this protocol :)
>
> By the way, how are we going to handle Trackpoint (PS/2 device) with
> touchpads in RMI4 mode? I do not recall anything in RMI4 spec, but I
> looked at it quite some time ago.
>

Yes, there is nothing public in the spec for the RMI4 PS/2
pass-through mode. With a little help of Synaptics, Chandler
implemented it (it's function 03):
https://github.com/bentiss/linux/commit/b0cea92f56db9fc521a3ffaad534d91ef33466c8

This might not be the last version I have on my laptop, but it should
be close enough (if you also add the reporting of the extra buttons
that are sent through the GPIO function - 30).

Basically, I am running this code on a day to day basis, and we have
spotted most of the bugs now I think. It is stable and works better
than the PS/2 implementation because we don't have the bugs inherent
to the "report 2 slots but 5 actually".

Cheers,
Benjamin

PS: looks like Chandler beat me at answering

^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: PROBLEM: Missing events on thinkpad trackpoint buttons
  2015-08-19 21:27     ` Dmitry Torokhov
@ 2015-08-19 21:33       ` Stephen Chandler Paul
  2015-08-19 21:34       ` Benjamin Tissoires
  1 sibling, 0 replies; 25+ messages in thread
From: Stephen Chandler Paul @ 2015-08-19 21:33 UTC (permalink / raw)
  To: Dmitry Torokhov, Benjamin Tissoires
  Cc: Nick Bowler, linux-input, Andrew Duggan

There is support in the spec for PS/2 guests believe it or not, it's
just mostly undocumented. Coincidentally, I was actually the one who
wrote the drivers for this in Benjamin's tree. Using that, we can
actually just create a serio port that goes through the rmi4 driver and
communicate with that using the normal TrackPoint driver. We have a
working implementation of this here: 
https://github.com/bentiss/linux/tree/synaptics-rmi4-smbus-v4.2-rc6%2B

Cheers,
	Stephen Chandler Paul

On Wed, 2015-08-19 at 14:27 -0700, Dmitry Torokhov wrote:
> On Wed, Aug 19, 2015 at 09:52:00AM -0400, Benjamin Tissoires wrote:
> > On Tue, Aug 18, 2015 at 3:06 PM, Benjamin Tissoires
> > <benjamin.tissoires@gmail.com> wrote:
> > > Hi Nick,
> > > 
> > > thanks for the report.
> > > 
> > > On Mon, Aug 17, 2015 at 10:31 PM, Nick Bowler <nbowler@draconx.ca
> > > > wrote:
> > > > Hi,
> > > > 
> > > > I'm not sure if this is actually a Linux issue but figured I'd
> > > > at least
> > > > report it here to start...
> > > > 
> > > > I have a Lenovo Thinkpad X250, with the newfangled trackpoint
> > > > buttons.
> > > > I have a problem with missing button press or release events:
> > > > sometimes
> > > > pressing a button has no effect, and sometimes releasing a
> > > > button has no
> > > > effect (the latter is especially annoying, as the button
> > > > remains depressed
> > > > as far as any applications are concerned).
> > > > 
> > > > After some testing, the problem apparently depends on the
> > > > position of my
> > > > hands over the touchpad.  I can reliably reproduce it as
> > > > follows: place
> > > > two fingers on the touchpad, then press the button repeatedly. 
> > > >  Watching
> > > > with evtest, several events (could be either press or release)
> > > > will
> > > > simply be missin, although the kernel never does anything weird
> > > > like
> > > > send two release events in a row.  There are no problems if
> > > > there are
> > > > 0 or 1 fingers on the touchpad.
> > > > 
> > > > My current kernel version is 4.1.6, although the problem occurs
> > > > in all
> > > > versions that I tried.
> > > > 
> > > > Here is the evtest result from placing two fingers on the
> > > > touchpad, then
> > > > pressing the left trackpoint button 10 times, counting 1 second
> > > > between
> > > > each press.  As you can see, only 3 presses and 3 release
> > > > events total
> > > > were sent by the kernel, sometimes with many physical button
> > > > presses
> > > > between the press and its corresponding release:
> > > 
> > > OK, so this is definitively weird. My first idea would be a
> > > firmware
> > > problem. I have asked Chandler to reproduce it on his t450 and
> > > see if
> > > we observe it on our laptops too.
> > 
> > Update on this one : Chandler reproduced it on the t450, so it's
> > likely that all of these sensors are affected. It is still unclear
> > if
> > it is a firmware bug or a driver problem, but the chances are huge
> > that this is a firmware bug. Anyway, that's one more reason to push
> > towards RMI4 over SMBus for these sensors: the bug is not present
> > with
> > this protocol :)
> 
> By the way, how are we going to handle Trackpoint (PS/2 device) with
> touchpads in RMI4 mode? I do not recall anything in RMI4 spec, but I
> looked at it quite some time ago.
> 
> Thanks.
> 

^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: PROBLEM: Missing events on thinkpad trackpoint buttons
  2015-08-19 13:52   ` Benjamin Tissoires
  2015-08-19 14:10     ` Nick Bowler
@ 2015-08-19 21:27     ` Dmitry Torokhov
  2015-08-19 21:33       ` Stephen Chandler Paul
  2015-08-19 21:34       ` Benjamin Tissoires
  1 sibling, 2 replies; 25+ messages in thread
From: Dmitry Torokhov @ 2015-08-19 21:27 UTC (permalink / raw)
  To: Benjamin Tissoires
  Cc: Nick Bowler, linux-input, Stephen Chandler Paul, Andrew Duggan

On Wed, Aug 19, 2015 at 09:52:00AM -0400, Benjamin Tissoires wrote:
> On Tue, Aug 18, 2015 at 3:06 PM, Benjamin Tissoires
> <benjamin.tissoires@gmail.com> wrote:
> > Hi Nick,
> >
> > thanks for the report.
> >
> > On Mon, Aug 17, 2015 at 10:31 PM, Nick Bowler <nbowler@draconx.ca> wrote:
> >> Hi,
> >>
> >> I'm not sure if this is actually a Linux issue but figured I'd at least
> >> report it here to start...
> >>
> >> I have a Lenovo Thinkpad X250, with the newfangled trackpoint buttons.
> >> I have a problem with missing button press or release events: sometimes
> >> pressing a button has no effect, and sometimes releasing a button has no
> >> effect (the latter is especially annoying, as the button remains depressed
> >> as far as any applications are concerned).
> >>
> >> After some testing, the problem apparently depends on the position of my
> >> hands over the touchpad.  I can reliably reproduce it as follows: place
> >> two fingers on the touchpad, then press the button repeatedly.  Watching
> >> with evtest, several events (could be either press or release) will
> >> simply be missin, although the kernel never does anything weird like
> >> send two release events in a row.  There are no problems if there are
> >> 0 or 1 fingers on the touchpad.
> >>
> >> My current kernel version is 4.1.6, although the problem occurs in all
> >> versions that I tried.
> >>
> >> Here is the evtest result from placing two fingers on the touchpad, then
> >> pressing the left trackpoint button 10 times, counting 1 second between
> >> each press.  As you can see, only 3 presses and 3 release events total
> >> were sent by the kernel, sometimes with many physical button presses
> >> between the press and its corresponding release:
> >
> > OK, so this is definitively weird. My first idea would be a firmware
> > problem. I have asked Chandler to reproduce it on his t450 and see if
> > we observe it on our laptops too.
> 
> Update on this one : Chandler reproduced it on the t450, so it's
> likely that all of these sensors are affected. It is still unclear if
> it is a firmware bug or a driver problem, but the chances are huge
> that this is a firmware bug. Anyway, that's one more reason to push
> towards RMI4 over SMBus for these sensors: the bug is not present with
> this protocol :)

By the way, how are we going to handle Trackpoint (PS/2 device) with
touchpads in RMI4 mode? I do not recall anything in RMI4 spec, but I
looked at it quite some time ago.

Thanks.

-- 
Dmitry

^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: PROBLEM: Missing events on thinkpad trackpoint buttons
  2015-08-19 14:10     ` Nick Bowler
@ 2015-08-19 14:12       ` Benjamin Tissoires
  0 siblings, 0 replies; 25+ messages in thread
From: Benjamin Tissoires @ 2015-08-19 14:12 UTC (permalink / raw)
  To: Nick Bowler
  Cc: linux-input, Stephen Chandler Paul, Dmitry Torokhov, Andrew Duggan

On Wed, Aug 19, 2015 at 10:10 AM, Nick Bowler <nbowler@draconx.ca> wrote:
> On 2015-08-19, Benjamin Tissoires <benjamin.tissoires@gmail.com> wrote:
>> On Tue, Aug 18, 2015 at 3:06 PM, Benjamin Tissoires
>> <benjamin.tissoires@gmail.com> wrote:
> [...]
>>> On Mon, Aug 17, 2015 at 10:31 PM, Nick Bowler <nbowler@draconx.ca> wrote:
>>>> Here is the evtest result from placing two fingers on the touchpad,
>>>> then pressing the left trackpoint button 10 times, counting 1 second
>>>> between each press.  As you can see, only 3 presses and 3 release
>>>> events total were sent by the kernel, sometimes with many physical
>>>> button presses between the press and its corresponding release:
>>>
>>> OK, so this is definitively weird. My first idea would be a firmware
>>> problem. I have asked Chandler to reproduce it on his t450 and see if
>>> we observe it on our laptops too.
>>
>> Update on this one : Chandler reproduced it on the t450, so it's
>> likely that all of these sensors are affected. It is still unclear if
>> it is a firmware bug or a driver problem, but the chances are huge
>> that this is a firmware bug. Anyway, that's one more reason to push
>> towards RMI4 over SMBus for these sensors: the bug is not present with
>> this protocol :)
>
> Well, that sounds fortunate :)
>
> Do you still want the ps2emu-record log?  I didn't have time to run it
> yesterday but should be able to do it this evening.

Yes, I still want it. It is less critical, but the more logs we have,
the better.

Cheers,
Benjamin

>
> Regards,
>   Nick

^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: PROBLEM: Missing events on thinkpad trackpoint buttons
  2015-08-19 13:52   ` Benjamin Tissoires
@ 2015-08-19 14:10     ` Nick Bowler
  2015-08-19 14:12       ` Benjamin Tissoires
  2015-08-19 21:27     ` Dmitry Torokhov
  1 sibling, 1 reply; 25+ messages in thread
From: Nick Bowler @ 2015-08-19 14:10 UTC (permalink / raw)
  To: Benjamin Tissoires
  Cc: linux-input, Stephen Chandler Paul, Dmitry Torokhov, Andrew Duggan

On 2015-08-19, Benjamin Tissoires <benjamin.tissoires@gmail.com> wrote:
> On Tue, Aug 18, 2015 at 3:06 PM, Benjamin Tissoires
> <benjamin.tissoires@gmail.com> wrote:
[...]
>> On Mon, Aug 17, 2015 at 10:31 PM, Nick Bowler <nbowler@draconx.ca> wrote:
>>> Here is the evtest result from placing two fingers on the touchpad,
>>> then pressing the left trackpoint button 10 times, counting 1 second
>>> between each press.  As you can see, only 3 presses and 3 release
>>> events total were sent by the kernel, sometimes with many physical
>>> button presses between the press and its corresponding release:
>>
>> OK, so this is definitively weird. My first idea would be a firmware
>> problem. I have asked Chandler to reproduce it on his t450 and see if
>> we observe it on our laptops too.
>
> Update on this one : Chandler reproduced it on the t450, so it's
> likely that all of these sensors are affected. It is still unclear if
> it is a firmware bug or a driver problem, but the chances are huge
> that this is a firmware bug. Anyway, that's one more reason to push
> towards RMI4 over SMBus for these sensors: the bug is not present with
> this protocol :)

Well, that sounds fortunate :)

Do you still want the ps2emu-record log?  I didn't have time to run it
yesterday but should be able to do it this evening.

Regards,
  Nick

^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: PROBLEM: Missing events on thinkpad trackpoint buttons
  2015-08-18 19:06 ` Benjamin Tissoires
@ 2015-08-19 13:52   ` Benjamin Tissoires
  2015-08-19 14:10     ` Nick Bowler
  2015-08-19 21:27     ` Dmitry Torokhov
  0 siblings, 2 replies; 25+ messages in thread
From: Benjamin Tissoires @ 2015-08-19 13:52 UTC (permalink / raw)
  To: Nick Bowler
  Cc: linux-input, Stephen Chandler Paul, Dmitry Torokhov, Andrew Duggan

On Tue, Aug 18, 2015 at 3:06 PM, Benjamin Tissoires
<benjamin.tissoires@gmail.com> wrote:
> Hi Nick,
>
> thanks for the report.
>
> On Mon, Aug 17, 2015 at 10:31 PM, Nick Bowler <nbowler@draconx.ca> wrote:
>> Hi,
>>
>> I'm not sure if this is actually a Linux issue but figured I'd at least
>> report it here to start...
>>
>> I have a Lenovo Thinkpad X250, with the newfangled trackpoint buttons.
>> I have a problem with missing button press or release events: sometimes
>> pressing a button has no effect, and sometimes releasing a button has no
>> effect (the latter is especially annoying, as the button remains depressed
>> as far as any applications are concerned).
>>
>> After some testing, the problem apparently depends on the position of my
>> hands over the touchpad.  I can reliably reproduce it as follows: place
>> two fingers on the touchpad, then press the button repeatedly.  Watching
>> with evtest, several events (could be either press or release) will
>> simply be missin, although the kernel never does anything weird like
>> send two release events in a row.  There are no problems if there are
>> 0 or 1 fingers on the touchpad.
>>
>> My current kernel version is 4.1.6, although the problem occurs in all
>> versions that I tried.
>>
>> Here is the evtest result from placing two fingers on the touchpad, then
>> pressing the left trackpoint button 10 times, counting 1 second between
>> each press.  As you can see, only 3 presses and 3 release events total
>> were sent by the kernel, sometimes with many physical button presses
>> between the press and its corresponding release:
>
> OK, so this is definitively weird. My first idea would be a firmware
> problem. I have asked Chandler to reproduce it on his t450 and see if
> we observe it on our laptops too.

Update on this one : Chandler reproduced it on the t450, so it's
likely that all of these sensors are affected. It is still unclear if
it is a firmware bug or a driver problem, but the chances are huge
that this is a firmware bug. Anyway, that's one more reason to push
towards RMI4 over SMBus for these sensors: the bug is not present with
this protocol :)

Cheers,
Benjamin

>
> At the same time, could you please make a ps2emu-record log of your
> touchpad when you reproduce the bug?
> You can grab the sources here: https://github.com/Lyude/ps2emu
> Ideally, if you could run evemu or evtest at the same time to record
> what your kernel sees, that would be even better
>
> This should help knowing if the firmware is sending the right packets
> or if the driver is ignoring them.
>
> Cheers,
> Benjamin
>
>>
>>   Input driver version is 1.0.1
>>   Input device ID: bus 0x11 vendor 0x2 product 0xa version 0x0
>>   Input device name: "TPPS/2 IBM TrackPoint"
>>   Supported events:
>>     Event type 0 (EV_SYN)
>>     Event type 1 (EV_KEY)
>>       Event code 272 (BTN_LEFT)
>>       Event code 273 (BTN_RIGHT)
>>       Event code 274 (BTN_MIDDLE)
>>     Event type 2 (EV_REL)
>>       Event code 0 (REL_X)
>>       Event code 1 (REL_Y)
>>   Properties:
>>     Property type 0 (INPUT_PROP_POINTER)
>>     Property type 5 (?)
>>   Testing ... (interrupt to exit)
>>   Event: time 1439863173.241278, type 1 (EV_KEY), code 272 (BTN_LEFT), value 1
>>   Event: time 1439863173.241278, -------------- SYN_REPORT ------------
>>   Event: time 1439863180.610511, type 1 (EV_KEY), code 272 (BTN_LEFT), value 0
>>   Event: time 1439863180.610511, -------------- SYN_REPORT ------------
>>   Event: time 1439863182.162257, type 1 (EV_KEY), code 272 (BTN_LEFT), value 1
>>   Event: time 1439863182.162257, -------------- SYN_REPORT ------------
>>   Event: time 1439863185.749212, type 1 (EV_KEY), code 272 (BTN_LEFT), value 0
>>   Event: time 1439863185.749212, -------------- SYN_REPORT ------------
>>   Event: time 1439863187.145478, type 1 (EV_KEY), code 272 (BTN_LEFT), value 1
>>   Event: time 1439863187.145478, -------------- SYN_REPORT ------------
>>   Event: time 1439863189.162652, type 1 (EV_KEY), code 272 (BTN_LEFT), value 0
>>   Event: time 1439863189.162652, -------------- SYN_REPORT ------------
>>
>> For reference: the same test was repeated with only one finger on the
>> touchpad; all events are delivered properly in this case:
>>
>>   Input driver version is 1.0.1
>>   Input device ID: bus 0x11 vendor 0x2 product 0xa version 0x0
>>   Input device name: "TPPS/2 IBM TrackPoint"
>>   Supported events:
>>     Event type 0 (EV_SYN)
>>     Event type 1 (EV_KEY)
>>       Event code 272 (BTN_LEFT)
>>       Event code 273 (BTN_RIGHT)
>>       Event code 274 (BTN_MIDDLE)
>>     Event type 2 (EV_REL)
>>       Event code 0 (REL_X)
>>       Event code 1 (REL_Y)
>>   Properties:
>>     Property type 0 (INPUT_PROP_POINTER)
>>     Property type 5 (?)
>>   Testing ... (interrupt to exit)
>>   Event: time 1439863147.840979, type 1 (EV_KEY), code 272 (BTN_LEFT), value 1
>>   Event: time 1439863147.840979, -------------- SYN_REPORT ------------
>>   Event: time 1439863147.919313, type 1 (EV_KEY), code 272 (BTN_LEFT), value 0
>>   Event: time 1439863147.919313, -------------- SYN_REPORT ------------
>>   Event: time 1439863149.198783, type 1 (EV_KEY), code 272 (BTN_LEFT), value 1
>>   Event: time 1439863149.198783, -------------- SYN_REPORT ------------
>>   Event: time 1439863149.285873, type 1 (EV_KEY), code 272 (BTN_LEFT), value 0
>>   Event: time 1439863149.285873, -------------- SYN_REPORT ------------
>>   Event: time 1439863150.673035, type 1 (EV_KEY), code 272 (BTN_LEFT), value 1
>>   Event: time 1439863150.673035, -------------- SYN_REPORT ------------
>>   Event: time 1439863150.780064, type 1 (EV_KEY), code 272 (BTN_LEFT), value 0
>>   Event: time 1439863150.780064, -------------- SYN_REPORT ------------
>>   Event: time 1439863152.204741, type 1 (EV_KEY), code 272 (BTN_LEFT), value 1
>>   Event: time 1439863152.204741, -------------- SYN_REPORT ------------
>>   Event: time 1439863152.321820, type 1 (EV_KEY), code 272 (BTN_LEFT), value 0
>>   Event: time 1439863152.321820, -------------- SYN_REPORT ------------
>>   Event: time 1439863153.698388, type 1 (EV_KEY), code 272 (BTN_LEFT), value 1
>>   Event: time 1439863153.698388, -------------- SYN_REPORT ------------
>>   Event: time 1439863153.834195, type 1 (EV_KEY), code 272 (BTN_LEFT), value 0
>>   Event: time 1439863153.834195, -------------- SYN_REPORT ------------
>>   Event: time 1439863155.181776, type 1 (EV_KEY), code 272 (BTN_LEFT), value 1
>>   Event: time 1439863155.181776, -------------- SYN_REPORT ------------
>>   Event: time 1439863155.308142, type 1 (EV_KEY), code 272 (BTN_LEFT), value 0
>>   Event: time 1439863155.308142, -------------- SYN_REPORT ------------
>>   Event: time 1439863156.723367, type 1 (EV_KEY), code 272 (BTN_LEFT), value 1
>>   Event: time 1439863156.723367, -------------- SYN_REPORT ------------
>>   Event: time 1439863156.849475, type 1 (EV_KEY), code 272 (BTN_LEFT), value 0
>>   Event: time 1439863156.849475, -------------- SYN_REPORT ------------
>>   Event: time 1439863158.294692, type 1 (EV_KEY), code 272 (BTN_LEFT), value 1
>>   Event: time 1439863158.294692, -------------- SYN_REPORT ------------
>>   Event: time 1439863158.419989, type 1 (EV_KEY), code 272 (BTN_LEFT), value 0
>>   Event: time 1439863158.419989, -------------- SYN_REPORT ------------
>>   Event: time 1439863159.846138, type 1 (EV_KEY), code 272 (BTN_LEFT), value 1
>>   Event: time 1439863159.846138, -------------- SYN_REPORT ------------
>>   Event: time 1439863159.962375, type 1 (EV_KEY), code 272 (BTN_LEFT), value 0
>>   Event: time 1439863159.962375, -------------- SYN_REPORT ------------
>>   Event: time 1439863161.591024, type 1 (EV_KEY), code 272 (BTN_LEFT), value 1
>>   Event: time 1439863161.591024, -------------- SYN_REPORT ------------
>>   Event: time 1439863161.688792, type 1 (EV_KEY), code 272 (BTN_LEFT), value 0
>>   Event: time 1439863161.688792, -------------- SYN_REPORT ------------
>>
>> Any thoughts?
>>
>> Thanks,
>>   Nick
>> --
>> To unsubscribe from this list: send the line "unsubscribe linux-input" in
>> the body of a message to majordomo@vger.kernel.org
>> More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: PROBLEM: Missing events on thinkpad trackpoint buttons
  2015-08-18  2:31 Nick Bowler
@ 2015-08-18 19:06 ` Benjamin Tissoires
  2015-08-19 13:52   ` Benjamin Tissoires
  0 siblings, 1 reply; 25+ messages in thread
From: Benjamin Tissoires @ 2015-08-18 19:06 UTC (permalink / raw)
  To: Nick Bowler; +Cc: linux-input, Stephen Chandler Paul

Hi Nick,

thanks for the report.

On Mon, Aug 17, 2015 at 10:31 PM, Nick Bowler <nbowler@draconx.ca> wrote:
> Hi,
>
> I'm not sure if this is actually a Linux issue but figured I'd at least
> report it here to start...
>
> I have a Lenovo Thinkpad X250, with the newfangled trackpoint buttons.
> I have a problem with missing button press or release events: sometimes
> pressing a button has no effect, and sometimes releasing a button has no
> effect (the latter is especially annoying, as the button remains depressed
> as far as any applications are concerned).
>
> After some testing, the problem apparently depends on the position of my
> hands over the touchpad.  I can reliably reproduce it as follows: place
> two fingers on the touchpad, then press the button repeatedly.  Watching
> with evtest, several events (could be either press or release) will
> simply be missin, although the kernel never does anything weird like
> send two release events in a row.  There are no problems if there are
> 0 or 1 fingers on the touchpad.
>
> My current kernel version is 4.1.6, although the problem occurs in all
> versions that I tried.
>
> Here is the evtest result from placing two fingers on the touchpad, then
> pressing the left trackpoint button 10 times, counting 1 second between
> each press.  As you can see, only 3 presses and 3 release events total
> were sent by the kernel, sometimes with many physical button presses
> between the press and its corresponding release:

OK, so this is definitively weird. My first idea would be a firmware
problem. I have asked Chandler to reproduce it on his t450 and see if
we observe it on our laptops too.

At the same time, could you please make a ps2emu-record log of your
touchpad when you reproduce the bug?
You can grab the sources here: https://github.com/Lyude/ps2emu
Ideally, if you could run evemu or evtest at the same time to record
what your kernel sees, that would be even better

This should help knowing if the firmware is sending the right packets
or if the driver is ignoring them.

Cheers,
Benjamin

>
>   Input driver version is 1.0.1
>   Input device ID: bus 0x11 vendor 0x2 product 0xa version 0x0
>   Input device name: "TPPS/2 IBM TrackPoint"
>   Supported events:
>     Event type 0 (EV_SYN)
>     Event type 1 (EV_KEY)
>       Event code 272 (BTN_LEFT)
>       Event code 273 (BTN_RIGHT)
>       Event code 274 (BTN_MIDDLE)
>     Event type 2 (EV_REL)
>       Event code 0 (REL_X)
>       Event code 1 (REL_Y)
>   Properties:
>     Property type 0 (INPUT_PROP_POINTER)
>     Property type 5 (?)
>   Testing ... (interrupt to exit)
>   Event: time 1439863173.241278, type 1 (EV_KEY), code 272 (BTN_LEFT), value 1
>   Event: time 1439863173.241278, -------------- SYN_REPORT ------------
>   Event: time 1439863180.610511, type 1 (EV_KEY), code 272 (BTN_LEFT), value 0
>   Event: time 1439863180.610511, -------------- SYN_REPORT ------------
>   Event: time 1439863182.162257, type 1 (EV_KEY), code 272 (BTN_LEFT), value 1
>   Event: time 1439863182.162257, -------------- SYN_REPORT ------------
>   Event: time 1439863185.749212, type 1 (EV_KEY), code 272 (BTN_LEFT), value 0
>   Event: time 1439863185.749212, -------------- SYN_REPORT ------------
>   Event: time 1439863187.145478, type 1 (EV_KEY), code 272 (BTN_LEFT), value 1
>   Event: time 1439863187.145478, -------------- SYN_REPORT ------------
>   Event: time 1439863189.162652, type 1 (EV_KEY), code 272 (BTN_LEFT), value 0
>   Event: time 1439863189.162652, -------------- SYN_REPORT ------------
>
> For reference: the same test was repeated with only one finger on the
> touchpad; all events are delivered properly in this case:
>
>   Input driver version is 1.0.1
>   Input device ID: bus 0x11 vendor 0x2 product 0xa version 0x0
>   Input device name: "TPPS/2 IBM TrackPoint"
>   Supported events:
>     Event type 0 (EV_SYN)
>     Event type 1 (EV_KEY)
>       Event code 272 (BTN_LEFT)
>       Event code 273 (BTN_RIGHT)
>       Event code 274 (BTN_MIDDLE)
>     Event type 2 (EV_REL)
>       Event code 0 (REL_X)
>       Event code 1 (REL_Y)
>   Properties:
>     Property type 0 (INPUT_PROP_POINTER)
>     Property type 5 (?)
>   Testing ... (interrupt to exit)
>   Event: time 1439863147.840979, type 1 (EV_KEY), code 272 (BTN_LEFT), value 1
>   Event: time 1439863147.840979, -------------- SYN_REPORT ------------
>   Event: time 1439863147.919313, type 1 (EV_KEY), code 272 (BTN_LEFT), value 0
>   Event: time 1439863147.919313, -------------- SYN_REPORT ------------
>   Event: time 1439863149.198783, type 1 (EV_KEY), code 272 (BTN_LEFT), value 1
>   Event: time 1439863149.198783, -------------- SYN_REPORT ------------
>   Event: time 1439863149.285873, type 1 (EV_KEY), code 272 (BTN_LEFT), value 0
>   Event: time 1439863149.285873, -------------- SYN_REPORT ------------
>   Event: time 1439863150.673035, type 1 (EV_KEY), code 272 (BTN_LEFT), value 1
>   Event: time 1439863150.673035, -------------- SYN_REPORT ------------
>   Event: time 1439863150.780064, type 1 (EV_KEY), code 272 (BTN_LEFT), value 0
>   Event: time 1439863150.780064, -------------- SYN_REPORT ------------
>   Event: time 1439863152.204741, type 1 (EV_KEY), code 272 (BTN_LEFT), value 1
>   Event: time 1439863152.204741, -------------- SYN_REPORT ------------
>   Event: time 1439863152.321820, type 1 (EV_KEY), code 272 (BTN_LEFT), value 0
>   Event: time 1439863152.321820, -------------- SYN_REPORT ------------
>   Event: time 1439863153.698388, type 1 (EV_KEY), code 272 (BTN_LEFT), value 1
>   Event: time 1439863153.698388, -------------- SYN_REPORT ------------
>   Event: time 1439863153.834195, type 1 (EV_KEY), code 272 (BTN_LEFT), value 0
>   Event: time 1439863153.834195, -------------- SYN_REPORT ------------
>   Event: time 1439863155.181776, type 1 (EV_KEY), code 272 (BTN_LEFT), value 1
>   Event: time 1439863155.181776, -------------- SYN_REPORT ------------
>   Event: time 1439863155.308142, type 1 (EV_KEY), code 272 (BTN_LEFT), value 0
>   Event: time 1439863155.308142, -------------- SYN_REPORT ------------
>   Event: time 1439863156.723367, type 1 (EV_KEY), code 272 (BTN_LEFT), value 1
>   Event: time 1439863156.723367, -------------- SYN_REPORT ------------
>   Event: time 1439863156.849475, type 1 (EV_KEY), code 272 (BTN_LEFT), value 0
>   Event: time 1439863156.849475, -------------- SYN_REPORT ------------
>   Event: time 1439863158.294692, type 1 (EV_KEY), code 272 (BTN_LEFT), value 1
>   Event: time 1439863158.294692, -------------- SYN_REPORT ------------
>   Event: time 1439863158.419989, type 1 (EV_KEY), code 272 (BTN_LEFT), value 0
>   Event: time 1439863158.419989, -------------- SYN_REPORT ------------
>   Event: time 1439863159.846138, type 1 (EV_KEY), code 272 (BTN_LEFT), value 1
>   Event: time 1439863159.846138, -------------- SYN_REPORT ------------
>   Event: time 1439863159.962375, type 1 (EV_KEY), code 272 (BTN_LEFT), value 0
>   Event: time 1439863159.962375, -------------- SYN_REPORT ------------
>   Event: time 1439863161.591024, type 1 (EV_KEY), code 272 (BTN_LEFT), value 1
>   Event: time 1439863161.591024, -------------- SYN_REPORT ------------
>   Event: time 1439863161.688792, type 1 (EV_KEY), code 272 (BTN_LEFT), value 0
>   Event: time 1439863161.688792, -------------- SYN_REPORT ------------
>
> Any thoughts?
>
> Thanks,
>   Nick
> --
> To unsubscribe from this list: send the line "unsubscribe linux-input" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 25+ messages in thread

* PROBLEM: Missing events on thinkpad trackpoint buttons
@ 2015-08-18  2:31 Nick Bowler
  2015-08-18 19:06 ` Benjamin Tissoires
  0 siblings, 1 reply; 25+ messages in thread
From: Nick Bowler @ 2015-08-18  2:31 UTC (permalink / raw)
  To: linux-input

Hi,

I'm not sure if this is actually a Linux issue but figured I'd at least
report it here to start...

I have a Lenovo Thinkpad X250, with the newfangled trackpoint buttons.
I have a problem with missing button press or release events: sometimes
pressing a button has no effect, and sometimes releasing a button has no
effect (the latter is especially annoying, as the button remains depressed
as far as any applications are concerned).

After some testing, the problem apparently depends on the position of my
hands over the touchpad.  I can reliably reproduce it as follows: place
two fingers on the touchpad, then press the button repeatedly.  Watching
with evtest, several events (could be either press or release) will
simply be missin, although the kernel never does anything weird like
send two release events in a row.  There are no problems if there are
0 or 1 fingers on the touchpad.

My current kernel version is 4.1.6, although the problem occurs in all
versions that I tried.

Here is the evtest result from placing two fingers on the touchpad, then
pressing the left trackpoint button 10 times, counting 1 second between
each press.  As you can see, only 3 presses and 3 release events total
were sent by the kernel, sometimes with many physical button presses
between the press and its corresponding release:

  Input driver version is 1.0.1
  Input device ID: bus 0x11 vendor 0x2 product 0xa version 0x0
  Input device name: "TPPS/2 IBM TrackPoint"
  Supported events:
    Event type 0 (EV_SYN)
    Event type 1 (EV_KEY)
      Event code 272 (BTN_LEFT)
      Event code 273 (BTN_RIGHT)
      Event code 274 (BTN_MIDDLE)
    Event type 2 (EV_REL)
      Event code 0 (REL_X)
      Event code 1 (REL_Y)
  Properties:
    Property type 0 (INPUT_PROP_POINTER)
    Property type 5 (?)
  Testing ... (interrupt to exit)
  Event: time 1439863173.241278, type 1 (EV_KEY), code 272 (BTN_LEFT), value 1
  Event: time 1439863173.241278, -------------- SYN_REPORT ------------
  Event: time 1439863180.610511, type 1 (EV_KEY), code 272 (BTN_LEFT), value 0
  Event: time 1439863180.610511, -------------- SYN_REPORT ------------
  Event: time 1439863182.162257, type 1 (EV_KEY), code 272 (BTN_LEFT), value 1
  Event: time 1439863182.162257, -------------- SYN_REPORT ------------
  Event: time 1439863185.749212, type 1 (EV_KEY), code 272 (BTN_LEFT), value 0
  Event: time 1439863185.749212, -------------- SYN_REPORT ------------
  Event: time 1439863187.145478, type 1 (EV_KEY), code 272 (BTN_LEFT), value 1
  Event: time 1439863187.145478, -------------- SYN_REPORT ------------
  Event: time 1439863189.162652, type 1 (EV_KEY), code 272 (BTN_LEFT), value 0
  Event: time 1439863189.162652, -------------- SYN_REPORT ------------

For reference: the same test was repeated with only one finger on the
touchpad; all events are delivered properly in this case:

  Input driver version is 1.0.1
  Input device ID: bus 0x11 vendor 0x2 product 0xa version 0x0
  Input device name: "TPPS/2 IBM TrackPoint"
  Supported events:
    Event type 0 (EV_SYN)
    Event type 1 (EV_KEY)
      Event code 272 (BTN_LEFT)
      Event code 273 (BTN_RIGHT)
      Event code 274 (BTN_MIDDLE)
    Event type 2 (EV_REL)
      Event code 0 (REL_X)
      Event code 1 (REL_Y)
  Properties:
    Property type 0 (INPUT_PROP_POINTER)
    Property type 5 (?)
  Testing ... (interrupt to exit)
  Event: time 1439863147.840979, type 1 (EV_KEY), code 272 (BTN_LEFT), value 1
  Event: time 1439863147.840979, -------------- SYN_REPORT ------------
  Event: time 1439863147.919313, type 1 (EV_KEY), code 272 (BTN_LEFT), value 0
  Event: time 1439863147.919313, -------------- SYN_REPORT ------------
  Event: time 1439863149.198783, type 1 (EV_KEY), code 272 (BTN_LEFT), value 1
  Event: time 1439863149.198783, -------------- SYN_REPORT ------------
  Event: time 1439863149.285873, type 1 (EV_KEY), code 272 (BTN_LEFT), value 0
  Event: time 1439863149.285873, -------------- SYN_REPORT ------------
  Event: time 1439863150.673035, type 1 (EV_KEY), code 272 (BTN_LEFT), value 1
  Event: time 1439863150.673035, -------------- SYN_REPORT ------------
  Event: time 1439863150.780064, type 1 (EV_KEY), code 272 (BTN_LEFT), value 0
  Event: time 1439863150.780064, -------------- SYN_REPORT ------------
  Event: time 1439863152.204741, type 1 (EV_KEY), code 272 (BTN_LEFT), value 1
  Event: time 1439863152.204741, -------------- SYN_REPORT ------------
  Event: time 1439863152.321820, type 1 (EV_KEY), code 272 (BTN_LEFT), value 0
  Event: time 1439863152.321820, -------------- SYN_REPORT ------------
  Event: time 1439863153.698388, type 1 (EV_KEY), code 272 (BTN_LEFT), value 1
  Event: time 1439863153.698388, -------------- SYN_REPORT ------------
  Event: time 1439863153.834195, type 1 (EV_KEY), code 272 (BTN_LEFT), value 0
  Event: time 1439863153.834195, -------------- SYN_REPORT ------------
  Event: time 1439863155.181776, type 1 (EV_KEY), code 272 (BTN_LEFT), value 1
  Event: time 1439863155.181776, -------------- SYN_REPORT ------------
  Event: time 1439863155.308142, type 1 (EV_KEY), code 272 (BTN_LEFT), value 0
  Event: time 1439863155.308142, -------------- SYN_REPORT ------------
  Event: time 1439863156.723367, type 1 (EV_KEY), code 272 (BTN_LEFT), value 1
  Event: time 1439863156.723367, -------------- SYN_REPORT ------------
  Event: time 1439863156.849475, type 1 (EV_KEY), code 272 (BTN_LEFT), value 0
  Event: time 1439863156.849475, -------------- SYN_REPORT ------------
  Event: time 1439863158.294692, type 1 (EV_KEY), code 272 (BTN_LEFT), value 1
  Event: time 1439863158.294692, -------------- SYN_REPORT ------------
  Event: time 1439863158.419989, type 1 (EV_KEY), code 272 (BTN_LEFT), value 0
  Event: time 1439863158.419989, -------------- SYN_REPORT ------------
  Event: time 1439863159.846138, type 1 (EV_KEY), code 272 (BTN_LEFT), value 1
  Event: time 1439863159.846138, -------------- SYN_REPORT ------------
  Event: time 1439863159.962375, type 1 (EV_KEY), code 272 (BTN_LEFT), value 0
  Event: time 1439863159.962375, -------------- SYN_REPORT ------------
  Event: time 1439863161.591024, type 1 (EV_KEY), code 272 (BTN_LEFT), value 1
  Event: time 1439863161.591024, -------------- SYN_REPORT ------------
  Event: time 1439863161.688792, type 1 (EV_KEY), code 272 (BTN_LEFT), value 0
  Event: time 1439863161.688792, -------------- SYN_REPORT ------------

Any thoughts?

Thanks,
  Nick

^ permalink raw reply	[flat|nested] 25+ messages in thread

end of thread, other threads:[~2015-09-29  0:26 UTC | newest]

Thread overview: 25+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-08-20 20:50 PROBLEM: Missing events on thinkpad trackpoint buttons Gabor Balla
2015-08-20 21:35 ` Dmitry Torokhov
2015-08-20 22:24   ` Gabor Balla
2015-08-20 22:42     ` Gabor Balla
2015-08-20 22:56     ` Dmitry Torokhov
2015-08-20 23:01       ` Dmitry Torokhov
2015-08-20 23:05         ` Gabor Balla
2015-08-20 23:08           ` Dmitry Torokhov
2015-08-20 23:13             ` Dmitry Torokhov
2015-08-20 23:35               ` Gabor Balla
2015-08-21  0:06                 ` Dmitry Torokhov
2015-08-24 17:57               ` Dmitry Torokhov
2015-08-24 23:44                 ` Nick Bowler
     [not found]               ` <CAN+gG=H88uVbRun=Vs1r1b8jM=wpnC1285BquFpDsh8HQdr07Q@mail.gmail.com>
2015-09-27 12:14                 ` Benjamin Tissoires
2015-09-28 22:52                   ` Dmitry Torokhov
2015-09-29  0:22                     ` Nick Bowler
2015-09-29  0:26                       ` Dmitry Torokhov
  -- strict thread matches above, loose matches on Subject: below --
2015-08-18  2:31 Nick Bowler
2015-08-18 19:06 ` Benjamin Tissoires
2015-08-19 13:52   ` Benjamin Tissoires
2015-08-19 14:10     ` Nick Bowler
2015-08-19 14:12       ` Benjamin Tissoires
2015-08-19 21:27     ` Dmitry Torokhov
2015-08-19 21:33       ` Stephen Chandler Paul
2015-08-19 21:34       ` Benjamin Tissoires

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.