From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751800AbbCVKu5 (ORCPT ); Sun, 22 Mar 2015 06:50:57 -0400 Received: from mx1.redhat.com ([209.132.183.28]:58302 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751283AbbCVKuz (ORCPT ); Sun, 22 Mar 2015 06:50:55 -0400 Message-ID: <550E9DF1.60507@redhat.com> Date: Sun, 22 Mar 2015 11:48:17 +0100 From: Hans de Goede User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.5.0 MIME-Version: 1.0 To: Dmitry Torokhov , linux-input@vger.kernel.org CC: =?windows-1252?Q?Pali_Roh=E1r?= , Santiago Gala , Yunkang Tang , linux-kernel@vger.kernel.org Subject: Re: [PATCH] Input: ALPS - fix max coordinates for v5 and v7 protocols References: <20150322033656.GA35352@dtor-ws> In-Reply-To: <20150322033656.GA35352@dtor-ws> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 > Reported-by: Pali Rohár > Signed-off-by: Dmitry Torokhov Fix looks good to me: Acked-by: Hans de Goede 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; >