Skip to contentSkip to conversation

Input: ALPS - fix max coordinates for v5 and v7 protocols

PATCH In review Dmitry Torokhov 4 participants 4 messages Mar 22, 2015 – Mar 31, 2015

Subsystems (3)
lore
Share & tools
lore

Dmitry Torokhov

author maintainer
#0 lore raw

PATCH 1/1 Input: ALPS - fix max coordinates for v5 and v7 protocols

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.

---
 drivers/input/mouse/alps.c | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)
drivers/input/mouse/alps.c +6 -5
index 1bd15eb..33198b9 100644
@@ -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;
Signature · 9 lines
2.2.0.rc0.207.ga3a616c


-- 
Dmitry
--
To unsubscribe from this list: send the line "unsubscribe linux-input" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Acked-by on v1 1/1
#1 lore raw

Hi,

Quoted 9 lines · Dmitry Torokhov

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.

Fix looks good to me:

Regards,

Hans

Quoted 26 lines
---
  drivers/input/mouse/alps.c | 11 ++++++-----
  1 file changed, 6 insertions(+), 5 deletions(-)
drivers/input/mouse/alps.c +4 -2
index 1bd15eb..33198b9 100644
@@ -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;

drivers/input/mouse/alps.c static int alps_set_protocol(struct psmouse *psmouse, · line 2312

Quoted 10 lines
drivers/input/mouse/alps.c +2 -3
  		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;

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

Acked-by
#2 lore raw
Quoted 14 lines · On Sunday 22 March 2015 11:48:17 Hans de Goede wrote:

Hi,

Quoted 10 lines · Dmitry Torokhov

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.

Quoted 8 lines

Fix looks good to me:

Regards,

Hans

Looks good also for me...

Quoted 46 lines
Quoted 46 lines

---

  drivers/input/mouse/alps.c | 11 ++++++-----
  1 file changed, 6 insertions(+), 5 deletions(-)
(quoted diff) +0 -0

b/drivers/input/mouse/alps.c index 1bd15eb..33198b9 100644

drivers/input/mouse/alps.c +6 -5
@@ -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;
Signature · 2 lines
Pali Rohár
[email protected]
Tested-by on v1 1/1
#3 lore raw
In reply to Dmitry Torokhov
Quoted 10 lines · Dmitry Torokhov

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.

---

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.

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