Message ID | 20161108151430.GN2927@TopQuark.net (mailing list archive) |
---|---|
State | Superseded |
Headers | show |
On Tuesday 08 November 2016 10:14:30 Paul Donohue wrote: > The current Alps SS5 (SS4 v2) code generates bogus TouchPad events when > TrackStick packets are processed. > > This causes the xorg synaptics driver to print > "unable to find touch point 0" and > "BUG: triggered 'if (priv->num_active_touches > priv->num_slots)'" > messages. It also causes unexpected TouchPad button release and reclick > event sequences if the TrackStick is moved while holding a TouchPad > button. > > This commit corrects the problem by adjusting > alps_process_packet_ss4_v2() so that it only sends TrackStick reports > when processing TrackStick packets. > > Signed-off-by: Paul Donohue <linux-kernel@PaulSD.com> > > diff --git a/drivers/input/mouse/alps.c b/drivers/input/mouse/alps.c > index 6d7de9b..b93fe83 100644 > --- a/drivers/input/mouse/alps.c > +++ b/drivers/input/mouse/alps.c > @@ -1346,6 +1346,18 @@ static void alps_process_packet_ss4_v2(struct psmouse *psmouse) > > priv->multi_packet = 0; > > + /* Report trackstick */ > + if (alps_get_pkt_id_ss4_v2(packet) == SS4_PACKET_ID_STICK) { I would propose to show warning when trackstick packet is received on device marked as non-trackstick. It would help to debug possible problems in future... if (!(priv->flags & ALPS_DUALPOINT)) psmouse_warn(psmouse, "Rejected trackstick packet from non DualPoint device"); > + if (priv->flags & ALPS_DUALPOINT) { > + input_report_key(dev2, BTN_LEFT, f->ts_left); > + input_report_key(dev2, BTN_RIGHT, f->ts_right); > + input_report_key(dev2, BTN_MIDDLE, f->ts_middle); > + input_sync(dev2); > + } > + return; > + }
On Wed, Nov 09, 2016 at 01:12:31PM +0100, Pali Rohár wrote: > On Tuesday 08 November 2016 10:14:30 Paul Donohue wrote: > > --- a/drivers/input/mouse/alps.c > > +++ b/drivers/input/mouse/alps.c > > @@ -1346,6 +1346,18 @@ static void alps_process_packet_ss4_v2(struct psmouse *psmouse) > > > > priv->multi_packet = 0; > > > > + /* Report trackstick */ > > + if (alps_get_pkt_id_ss4_v2(packet) == SS4_PACKET_ID_STICK) { > > I would propose to show warning when trackstick packet is received on > device marked as non-trackstick. It would help to debug possible > problems in future... > > if (!(priv->flags & ALPS_DUALPOINT)) > psmouse_warn(psmouse, "Rejected trackstick packet from non DualPoint device"); For patch 1/3, the original alps_decode_ss4_v2() prints this warning, so I don't think alps_process_packet_ss4_v2() needs to print it again. Since this patch is a bug fix, I was trying to avoid any unnecessary changes, and change just enough to fix the actual bug, so it is clear to future readers what the bug was and how it was fixed. In patch 2/3, I moved the warning from alps_decode_ss4_v2() to alps_process_packet_ss4_v2(), since I agree it probably makes more sense to print the warning in alps_process_packet_ss4_v2(). I also removed the if statement from alps_decode_ss4_v2() entirely because alps_decode_ss4_v2() decodes the trackstick buttons even in cases where the trackstick packet is going to be rejected, and I thought it was a bit confusing that alps_decode_ss4_v2() does not also decode the trackstick movements even in cases where the trackstick packet is going to be rejected (either they should both be decoded, or neither should be decoded, and decoding both rather than skipping both requires less logic). -- 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
diff --git a/drivers/input/mouse/alps.c b/drivers/input/mouse/alps.c index 6d7de9b..b93fe83 100644 --- a/drivers/input/mouse/alps.c +++ b/drivers/input/mouse/alps.c @@ -1346,6 +1346,18 @@ static void alps_process_packet_ss4_v2(struct psmouse *psmouse) priv->multi_packet = 0; + /* Report trackstick */ + if (alps_get_pkt_id_ss4_v2(packet) == SS4_PACKET_ID_STICK) { + if (priv->flags & ALPS_DUALPOINT) { + input_report_key(dev2, BTN_LEFT, f->ts_left); + input_report_key(dev2, BTN_RIGHT, f->ts_right); + input_report_key(dev2, BTN_MIDDLE, f->ts_middle); + input_sync(dev2); + } + return; + } + + /* Report touchpad */ alps_report_mt_data(psmouse, (f->fingers <= 4) ? f->fingers : 4); input_mt_report_finger_count(dev, f->fingers); @@ -1356,13 +1368,6 @@ static void alps_process_packet_ss4_v2(struct psmouse *psmouse) input_report_abs(dev, ABS_PRESSURE, f->pressure); input_sync(dev); - - if (priv->flags & ALPS_DUALPOINT) { - input_report_key(dev2, BTN_LEFT, f->ts_left); - input_report_key(dev2, BTN_RIGHT, f->ts_right); - input_report_key(dev2, BTN_MIDDLE, f->ts_middle); - input_sync(dev2); - } } static bool alps_is_valid_package_ss4_v2(struct psmouse *psmouse)
The current Alps SS5 (SS4 v2) code generates bogus TouchPad events when TrackStick packets are processed. This causes the xorg synaptics driver to print "unable to find touch point 0" and "BUG: triggered 'if (priv->num_active_touches > priv->num_slots)'" messages. It also causes unexpected TouchPad button release and reclick event sequences if the TrackStick is moved while holding a TouchPad button. This commit corrects the problem by adjusting alps_process_packet_ss4_v2() so that it only sends TrackStick reports when processing TrackStick packets. Signed-off-by: Paul Donohue <linux-kernel@PaulSD.com> -- 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