mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Dmitry Torokhov <dtor_core@ameritech.net>
To: Vojtech Pavlik <vojtech@suse.de>
Cc: linux-input@atrey.karlin.mff.cuni.cz,
	linux-kernel@vger.kernel.org, zhilla <zhilla@spymac.com>,
	Victor Hahn <victorhahn@web.de>
Subject: Re: [RFC/RFT] Better handling of bad xfers/interrupt delays in psmouse
Date: Sun, 6 Feb 2005 12:52:29 -0500	[thread overview]
Message-ID: <200502061252.30084.dtor_core@ameritech.net> (raw)
In-Reply-To: <20050206083739.GC8642@ucw.cz>

On Sunday 06 February 2005 03:37, Vojtech Pavlik wrote:
> On Sun, Feb 06, 2005 at 02:23:48AM -0500, Dmitry Torokhov wrote:
> 
> > Ok, here is the patch using PSMOUSE_CMD_POLL. Seems to work fine with 2
> > external mice that I have and my touchpad in PS/2 compatibility mode.
> > 
> > Unfortunately POLL command kicks Synaptics out of absolute mode so I
> > disabled all time-based sync checks for Synaptics altogether. This should
> > be OK since Synaptics have pretty strict protocol rules and usually
> > can resync on their own. I wonder what POLL does to ALPS?
> > 
> > Again, 2.6.10 version can be found here:
> > 
> > 	http://www.geocities.com/dt_or/input/2_6_10/
> > 
> > Comments/testing is appreciated.
>  
> Did you check that issuing the POLL command in the middle of a mouse
> packet does indeed reset the counter of the streaming mode? I'd expect
> them to be separate, at least on some mice, if POLL is handled as a
> normal mouse command, and after the three bytes from POLL are sent, the
> mouse could just continue sending the packet like with any other
> command.
> 

I have tested with Synaptics touchpad, a noname explorer mouse and a Belkin
USB with USB-PS/2 converted, all of them resumed streaming with the full
packet. I used the following patch to force polling:

===== drivers/input/mouse/psmouse-base.c 1.88 vs edited =====
--- 1.88/drivers/input/mouse/psmouse-base.c	2005-02-06 03:01:36 -05:00
+++ edited/drivers/input/mouse/psmouse-base.c	2005-02-06 12:46:47 -05:00
@@ -185,6 +185,7 @@
 static irqreturn_t psmouse_interrupt(struct serio *serio,
 		unsigned char data, unsigned int flags, struct pt_regs *regs)
 {
+	static int bcnt;
 	struct psmouse *psmouse = serio_get_drvdata(serio);
 	psmouse_ret_t rc;
 
@@ -237,6 +238,20 @@
 			goto out;
 		}
 	}
+
+	if (psmouse->state == PSMOUSE_ACTIVATED &&
+	    psmouse->type != PSMOUSE_SYNAPTICS &&
+	    !serio->parent &&
+	    (++bcnt % 502) == 0) {
+		printk(KERN_WARNING "psmouse.c: %s at %s - repolling, throwing %d bytes away.\n",
+		       psmouse->name, psmouse->phys, psmouse->pktcnt);
+		psmouse->pktcnt = 0;
+		if (serio_write(serio, PSMOUSE_CMD_POLL & 0xff) == 0) {
+			psmouse->resend = 1;
+			goto out;
+		}
+	}
+
 
 	psmouse->last = jiffies;
 	psmouse->packet[psmouse->pktcnt++] = data;



We of course need more testing, I am particularly interested in ALPS reaction
to poll command.

-- 
Dmitry

  reply	other threads:[~2005-02-06 17:52 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-02-05 19:48 Dmitry Torokhov
2005-02-05 21:11 ` Vojtech Pavlik
2005-02-06  5:29   ` Dmitry Torokhov
2005-02-06  7:23     ` Dmitry Torokhov
2005-02-06  8:37       ` Vojtech Pavlik
2005-02-06 17:52         ` Dmitry Torokhov [this message]
2005-02-06  8:29     ` Vojtech Pavlik
2005-02-06  9:27 ` Pavel Machek
2005-02-06 17:55   ` Dmitry Torokhov
2005-02-07  5:31     ` Ryan Anderson

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=200502061252.30084.dtor_core@ameritech.net \
    --to=dtor_core@ameritech.net \
    --cc=linux-input@atrey.karlin.mff.cuni.cz \
    --cc=linux-kernel@vger.kernel.org \
    --cc=victorhahn@web.de \
    --cc=vojtech@suse.de \
    --cc=zhilla@spymac.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome