All of lore.kernel.org
 help / color / mirror / Atom feed
From: Hans de Goede <hdegoede@redhat.com>
To: "Pali Rohár" <pali.rohar@gmail.com>
Cc: Douglas Christman <douglaschristman@gmail.com>,
	Benjamin Tissoires <benjamin.tissoires@gmail.com>,
	linux-input <linux-input@vger.kernel.org>,
	Dmitry Torokhov <dmitry.torokhov@gmail.com>,
	cpaul@redhat.com
Subject: Re: ALPS DualPoint double click bug
Date: Thu, 30 Jul 2015 17:00:56 +0200	[thread overview]
Message-ID: <55BA3C28.3080506@redhat.com> (raw)
In-Reply-To: <20150730144643.GG26714@pali>

[-- Attachment #1: Type: text/plain, Size: 2859 bytes --]

Hi,

On 30-07-15 16:46, Pali Rohár wrote:
> On Thursday 30 July 2015 16:17:23 Hans de Goede wrote:
>> Hi,
>>
>> On 28-07-15 01:38, Douglas Christman wrote:
>>> On Mon, Jul 27, 2015 at 12:40 PM, Hans de Goede <hdegoede@redhat.com> wrote:
>>>>
>>>> OK, please let me know soon, I would like to get to the bottom
>>>> of this, and knowing the exact commit causing the problem will
>>>> help a lot.
>>>>
>>>> Regards,
>>>>
>>>> hans
>>>
>>> I've verified that reverting 92bac83d on a clean v4.1 kernel
>>> (b953c0d2) resolves the issue.
>>
>> Thanks,
>>
>> Can you please apply the attached patch on a clean v4.1 kernel,
>> and confirm that that fixes this ?
>>
>> Regards,
>>
>> Hans
>
>>  From ee3d5d5a298b178ae5284b9766ca849665a37670 Mon Sep 17 00:00:00 2001
>> From: Hans de Goede <hdegoede@redhat.com>
>> Date: Thu, 30 Jul 2015 15:49:16 +0200
>> Subject: [PATCH] alps: Only Dell laptops have separate button bits for v2
>>   dualpoint sticks
>>
>> It turns out that only Dell laptops have the separate button bits for
>> v2 dualpoint sticks and that commit 92bac83dd79e ("Input: alps - non
>> interleaved V2 dualpoint has separate stick button bits") causes
>> regressions on Toshiba laptops.
>>
>> This commit adds a check for Dell laptops to the code for handling these
>> extra button bits, fixing this regression.
>>
>> This patch has been tested on a Dell Latitude D620 to make sure that it
>> does not reintroduce the original problem.
>>
>> Reported-by: Douglas Christman <douglaschristman@gmail.com>
>> Cc: stable@vger.kernel.org
>> Signed-off-by: Hans de Goede <hdegoede@redhat.com>
>> ---
>>   drivers/input/mouse/alps.c | 6 ++++--
>>   1 file changed, 4 insertions(+), 2 deletions(-)
>>
>> diff --git a/drivers/input/mouse/alps.c b/drivers/input/mouse/alps.c
>> index 113d6f1..889aec1 100644
>> --- a/drivers/input/mouse/alps.c
>> +++ b/drivers/input/mouse/alps.c
>> @@ -20,6 +20,7 @@
>>   #include <linux/input/mt.h>
>>   #include <linux/serio.h>
>>   #include <linux/libps2.h>
>> +#include <linux/dmi.h>
>>
>>   #include "psmouse.h"
>>   #include "alps.h"
>> @@ -251,8 +252,9 @@ static void alps_process_packet_v1_v2(struct psmouse *psmouse)
>>   		return;
>>   	}
>>
>> -	/* Non interleaved V2 dualpoint has separate stick button bits */
>> -	if (priv->proto_version == ALPS_PROTO_V2 &&
>> +	/* Dell non interleaved V2 dualpoint has separate stick button bits */
>> +	if (dmi_name_in_vendors("Dell") &&
>> +	    priv->proto_version == ALPS_PROTO_V2 &&
>>   	    priv->flags == (ALPS_PASS | ALPS_DUALPOINT)) {
>>   		left |= packet[0] & 1;
>>   		right |= packet[0] & 2;
>
> What about introducing new flag ALPS_<something> instead calling
> dmi_name_in_vendors() function every time when we need to process
> packet?

That is a good idea. Douglas can you test the attached version
instead of the previous one please ?

Thanks & Regards,

Hans

[-- Attachment #2: 0001-alps-Only-Dell-laptops-have-separate-button-bits-for.patch --]
[-- Type: text/x-patch, Size: 2497 bytes --]

>From 93a1852f32ab37b2cbcdb7e797f1ad59eb6bbef4 Mon Sep 17 00:00:00 2001
From: Hans de Goede <hdegoede@redhat.com>
Date: Thu, 30 Jul 2015 15:49:16 +0200
Subject: [PATCH] alps: Only Dell laptops have separate button bits for v2
 dualpoint sticks

It turns out that only Dell laptops have the separate button bits for
v2 dualpoint sticks and that commit 92bac83dd79e ("Input: alps - non
interleaved V2 dualpoint has separate stick button bits") causes
regressions on Toshiba laptops.

This commit adds a check for Dell laptops to the code for handling these
extra button bits, fixing this regression.

This patch has been tested on a Dell Latitude D620 to make sure that it
does not reintroduce the original problem.

Reported-by: Douglas Christman <douglaschristman@gmail.com>
Cc: stable@vger.kernel.org
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
---
 drivers/input/mouse/alps.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/drivers/input/mouse/alps.c b/drivers/input/mouse/alps.c
index 113d6f1..4d24686 100644
--- a/drivers/input/mouse/alps.c
+++ b/drivers/input/mouse/alps.c
@@ -20,6 +20,7 @@
 #include <linux/input/mt.h>
 #include <linux/serio.h>
 #include <linux/libps2.h>
+#include <linux/dmi.h>
 
 #include "psmouse.h"
 #include "alps.h"
@@ -99,6 +100,7 @@ static const struct alps_nibble_commands alps_v6_nibble_commands[] = {
 #define ALPS_FOUR_BUTTONS	0x40	/* 4 direction button present */
 #define ALPS_PS2_INTERLEAVED	0x80	/* 3-byte PS/2 packet interleaved with
 					   6-byte ALPS packet */
+#define ALPS_DELL		0x100	/* device is a Dell laptop */
 #define ALPS_BUTTONPAD		0x200	/* device is a clickpad */
 
 static const struct alps_model_info alps_model_data[] = {
@@ -251,9 +253,9 @@ static void alps_process_packet_v1_v2(struct psmouse *psmouse)
 		return;
 	}
 
-	/* Non interleaved V2 dualpoint has separate stick button bits */
+	/* Dell non interleaved V2 dualpoint has separate stick button bits */
 	if (priv->proto_version == ALPS_PROTO_V2 &&
-	    priv->flags == (ALPS_PASS | ALPS_DUALPOINT)) {
+	    priv->flags == (ALPS_DELL | ALPS_PASS | ALPS_DUALPOINT)) {
 		left |= packet[0] & 1;
 		right |= packet[0] & 2;
 		middle |= packet[0] & 4;
@@ -2550,6 +2552,8 @@ static int alps_set_protocol(struct psmouse *psmouse,
 	priv->byte0 = protocol->byte0;
 	priv->mask0 = protocol->mask0;
 	priv->flags = protocol->flags;
+	if (dmi_name_in_vendors("Dell"))
+		priv->flags |= ALPS_DELL;
 
 	priv->x_max = 2000;
 	priv->y_max = 1400;
-- 
2.4.3


  reply	other threads:[~2015-07-30 15:00 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-07-19 13:29 ALPS DualPoint double click bug Douglas Christman
2015-07-20  6:54 ` Dmitry Torokhov
2015-07-20  7:25   ` Pali Rohár
2015-07-21  3:00     ` Douglas Christman
2015-07-21  7:12       ` Pali Rohár
2015-07-21 23:51         ` Douglas Christman
2015-07-22  7:21           ` Pali Rohár
2015-07-22 15:08             ` Benjamin Tissoires
2015-07-22 17:26               ` Stephen Chandler Paul
2015-07-23  9:31               ` Hans de Goede
2015-07-25 14:07                 ` Douglas Christman
2015-07-27 16:40                   ` Hans de Goede
2015-07-27 23:38                     ` Douglas Christman
2015-07-29 20:45                       ` [PATCH 0/1] Alps button reporting bugfix cpaul
2015-07-29 20:45                         ` [PATCH 1/1] Input - alps: Fix button reporting on the V2 Alps protocol cpaul
2015-07-29 21:01                           ` Dmitry Torokhov
2015-07-30  7:52                           ` Pali Rohár
2015-07-30 13:51                           ` Hans de Goede
2015-07-30 14:11                             ` Pali Rohár
2015-07-30 14:18                               ` Hans de Goede
2015-07-30 14:28                                 ` Pali Rohár
2015-07-30 14:32                                   ` Pali Rohár
2015-07-30 14:38                                     ` Hans de Goede
2015-07-30 14:45                                       ` Pali Rohár
2015-07-30 14:17                       ` ALPS DualPoint double click bug Hans de Goede
2015-07-30 14:46                         ` Pali Rohár
2015-07-30 15:00                           ` Hans de Goede [this message]
2015-07-30 15:49                             ` Pali Rohár
2015-07-31  8:12                               ` Hans de Goede
2015-07-31 21:12                             ` Douglas Christman
2015-07-31 21:17                               ` Pali Rohár
2015-08-01  6:48                                 ` Hans de Goede
2015-07-21 17:12       ` Dmitry Torokhov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=55BA3C28.3080506@redhat.com \
    --to=hdegoede@redhat.com \
    --cc=benjamin.tissoires@gmail.com \
    --cc=cpaul@redhat.com \
    --cc=dmitry.torokhov@gmail.com \
    --cc=douglaschristman@gmail.com \
    --cc=linux-input@vger.kernel.org \
    --cc=pali.rohar@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.