LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
* [PATCH] Input: ALPS - fix max coordinates for v5 and v7 protocols
@ 2015-03-22  3:36 Dmitry Torokhov
  2015-03-22 10:48 ` Hans de Goede
  2015-03-31  3:47 ` Luca Coelho
  0 siblings, 2 replies; 4+ messages in thread
From: Dmitry Torokhov @ 2015-03-22  3:36 UTC (permalink / raw)
  To: linux-input
  Cc: Hans de Goede, Pali Rohár, Santiago Gala, Yunkang Tang,
	linux-kernel

Commit 3296f71cd2fde7a2ad52e66a27eae419f6328066 ("Input: ALPS - consolidate
setting protocol parameters") inadvertently moved call to
alps_dolphin_get_device_area() from v5 to v7 protocol, causing both
protocols report incorrect maximum values for X and Y axes which resulted
in crash in Synaptics X driver.

Reported-by: Santiago Gala <sgala@apache.org>
Reported-by: Pali Rohár <pali.rohar@gmail.com>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
---
 drivers/input/mouse/alps.c | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)

diff --git a/drivers/input/mouse/alps.c b/drivers/input/mouse/alps.c
index 1bd15eb..33198b9 100644
--- a/drivers/input/mouse/alps.c
+++ b/drivers/input/mouse/alps.c
@@ -2281,10 +2281,12 @@ static int alps_set_protocol(struct psmouse *psmouse,
 		priv->set_abs_params = alps_set_abs_params_mt;
 		priv->nibble_commands = alps_v3_nibble_commands;
 		priv->addr_command = PSMOUSE_CMD_RESET_WRAP;
-		priv->x_max = 1360;
-		priv->y_max = 660;
 		priv->x_bits = 23;
 		priv->y_bits = 12;
+
+		if (alps_dolphin_get_device_area(psmouse, priv))
+			return -EIO;
+
 		break;
 
 	case ALPS_PROTO_V6:
@@ -2303,9 +2305,8 @@ static int alps_set_protocol(struct psmouse *psmouse,
 		priv->set_abs_params = alps_set_abs_params_mt;
 		priv->nibble_commands = alps_v3_nibble_commands;
 		priv->addr_command = PSMOUSE_CMD_RESET_WRAP;
-
-		if (alps_dolphin_get_device_area(psmouse, priv))
-			return -EIO;
+		priv->x_max = 0xfff;
+		priv->y_max = 0x7ff;
 
 		if (priv->fw_ver[1] != 0xba)
 			priv->flags |= ALPS_BUTTONPAD;
-- 
2.2.0.rc0.207.ga3a616c


-- 
Dmitry

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

* Re: [PATCH] Input: ALPS - fix max coordinates for v5 and v7 protocols
  2015-03-22  3:36 [PATCH] Input: ALPS - fix max coordinates for v5 and v7 protocols Dmitry Torokhov
@ 2015-03-22 10:48 ` Hans de Goede
  2015-03-22 12:33   ` Pali Rohár
  2015-03-31  3:47 ` Luca Coelho
  1 sibling, 1 reply; 4+ messages in thread
From: Hans de Goede @ 2015-03-22 10:48 UTC (permalink / raw)
  To: Dmitry Torokhov, linux-input
  Cc: Pali Rohár, Santiago Gala, Yunkang Tang, linux-kernel

Hi,

On 22-03-15 04:36, Dmitry Torokhov wrote:
> Commit 3296f71cd2fde7a2ad52e66a27eae419f6328066 ("Input: ALPS - consolidate
> setting protocol parameters") inadvertently moved call to
> alps_dolphin_get_device_area() from v5 to v7 protocol, causing both
> protocols report incorrect maximum values for X and Y axes which resulted
> in crash in Synaptics X driver.
>
> Reported-by: Santiago Gala <sgala@apache.org>
> Reported-by: Pali Rohár <pali.rohar@gmail.com>
> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>

Fix looks good to me:

Acked-by: Hans de Goede <hdegoede@redhat.com>

Regards,

Hans


> ---
>   drivers/input/mouse/alps.c | 11 ++++++-----
>   1 file changed, 6 insertions(+), 5 deletions(-)
>
> diff --git a/drivers/input/mouse/alps.c b/drivers/input/mouse/alps.c
> index 1bd15eb..33198b9 100644
> --- a/drivers/input/mouse/alps.c
> +++ b/drivers/input/mouse/alps.c
> @@ -2281,10 +2281,12 @@ static int alps_set_protocol(struct psmouse *psmouse,
>   		priv->set_abs_params = alps_set_abs_params_mt;
>   		priv->nibble_commands = alps_v3_nibble_commands;
>   		priv->addr_command = PSMOUSE_CMD_RESET_WRAP;
> -		priv->x_max = 1360;
> -		priv->y_max = 660;
>   		priv->x_bits = 23;
>   		priv->y_bits = 12;
> +
> +		if (alps_dolphin_get_device_area(psmouse, priv))
> +			return -EIO;
> +
>   		break;
>
>   	case ALPS_PROTO_V6:
> @@ -2303,9 +2305,8 @@ static int alps_set_protocol(struct psmouse *psmouse,
>   		priv->set_abs_params = alps_set_abs_params_mt;
>   		priv->nibble_commands = alps_v3_nibble_commands;
>   		priv->addr_command = PSMOUSE_CMD_RESET_WRAP;
> -
> -		if (alps_dolphin_get_device_area(psmouse, priv))
> -			return -EIO;
> +		priv->x_max = 0xfff;
> +		priv->y_max = 0x7ff;
>
>   		if (priv->fw_ver[1] != 0xba)
>   			priv->flags |= ALPS_BUTTONPAD;
>

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

* Re: [PATCH] Input: ALPS - fix max coordinates for v5 and v7 protocols
  2015-03-22 10:48 ` Hans de Goede
@ 2015-03-22 12:33   ` Pali Rohár
  0 siblings, 0 replies; 4+ messages in thread
From: Pali Rohár @ 2015-03-22 12:33 UTC (permalink / raw)
  To: Hans de Goede
  Cc: Dmitry Torokhov, linux-input, Santiago Gala, Yunkang Tang, linux-kernel

[-- Attachment #1: Type: Text/Plain, Size: 2220 bytes --]

On Sunday 22 March 2015 11:48:17 Hans de Goede wrote:
> Hi,
> 
> On 22-03-15 04:36, Dmitry Torokhov wrote:
> > Commit 3296f71cd2fde7a2ad52e66a27eae419f6328066 ("Input:
> > ALPS - consolidate setting protocol parameters")
> > inadvertently moved call to alps_dolphin_get_device_area()
> > from v5 to v7 protocol, causing both protocols report
> > incorrect maximum values for X and Y axes which resulted in
> > crash in Synaptics X driver.
> > 
> > Reported-by: Santiago Gala <sgala@apache.org>
> > Reported-by: Pali Rohár <pali.rohar@gmail.com>
> > Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
> 
> Fix looks good to me:
> 
> Acked-by: Hans de Goede <hdegoede@redhat.com>
> 
> Regards,
> 
> Hans
> 

Looks good also for me...

Acked-by: Pali Rohár <pali.rohar@gmail.com>

> > ---
> > 
> >   drivers/input/mouse/alps.c | 11 ++++++-----
> >   1 file changed, 6 insertions(+), 5 deletions(-)
> > 
> > diff --git a/drivers/input/mouse/alps.c
> > b/drivers/input/mouse/alps.c index 1bd15eb..33198b9 100644
> > --- a/drivers/input/mouse/alps.c
> > +++ b/drivers/input/mouse/alps.c
> > @@ -2281,10 +2281,12 @@ static int alps_set_protocol(struct
> > psmouse *psmouse,
> > 
> >   		priv->set_abs_params = alps_set_abs_params_mt;
> >   		priv->nibble_commands = alps_v3_nibble_commands;
> >   		priv->addr_command = PSMOUSE_CMD_RESET_WRAP;
> > 
> > -		priv->x_max = 1360;
> > -		priv->y_max = 660;
> > 
> >   		priv->x_bits = 23;
> >   		priv->y_bits = 12;
> > 
> > +
> > +		if (alps_dolphin_get_device_area(psmouse, priv))
> > +			return -EIO;
> > +
> > 
> >   		break;
> >   	
> >   	case ALPS_PROTO_V6:
> > @@ -2303,9 +2305,8 @@ static int alps_set_protocol(struct
> > psmouse *psmouse,
> > 
> >   		priv->set_abs_params = alps_set_abs_params_mt;
> >   		priv->nibble_commands = alps_v3_nibble_commands;
> >   		priv->addr_command = PSMOUSE_CMD_RESET_WRAP;
> > 
> > -
> > -		if (alps_dolphin_get_device_area(psmouse, priv))
> > -			return -EIO;
> > +		priv->x_max = 0xfff;
> > +		priv->y_max = 0x7ff;
> > 
> >   		if (priv->fw_ver[1] != 0xba)
> >   		
> >   			priv->flags |= ALPS_BUTTONPAD;


-- 
Pali Rohár
pali.rohar@gmail.com

[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 198 bytes --]

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

* Re: [PATCH] Input: ALPS - fix max coordinates for v5 and v7 protocols
  2015-03-22  3:36 [PATCH] Input: ALPS - fix max coordinates for v5 and v7 protocols Dmitry Torokhov
  2015-03-22 10:48 ` Hans de Goede
@ 2015-03-31  3:47 ` Luca Coelho
  1 sibling, 0 replies; 4+ messages in thread
From: Luca Coelho @ 2015-03-31  3:47 UTC (permalink / raw)
  To: Dmitry Torokhov
  Cc: linux-input, Hans de Goede, Pali Rohár, Santiago Gala,
	Yunkang Tang, linux-kernel

On Sat, 2015-03-21 at 20:36 -0700, Dmitry Torokhov wrote:
> Commit 3296f71cd2fde7a2ad52e66a27eae419f6328066 ("Input: ALPS - consolidate
> setting protocol parameters") inadvertently moved call to
> alps_dolphin_get_device_area() from v5 to v7 protocol, causing both
> protocols report incorrect maximum values for X and Y axes which resulted
> in crash in Synaptics X driver.
> 
> Reported-by: Santiago Gala <sgala@apache.org>
> Reported-by: Pali Rohár <pali.rohar@gmail.com>
> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
> ---

Tested-by: Luciano Coelho <luca@coelho.fi>

Tested on a Dell E5250.

Are you planning to send this to 4.0-rc*? That would be nice, since this
is a regression from 3.19.

--
Cheers,
Luca.


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

end of thread, other threads:[~2015-03-31  4:25 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-03-22  3:36 [PATCH] Input: ALPS - fix max coordinates for v5 and v7 protocols Dmitry Torokhov
2015-03-22 10:48 ` Hans de Goede
2015-03-22 12:33   ` Pali Rohár
2015-03-31  3:47 ` Luca Coelho

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).