All of lore.kernel.org
 help / color / mirror / Atom feed
From: Christoph Fritz <chf.fritz@googlemail.com>
To: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Cc: "Peter M. Petrakis" <peter.petrakis@canonical.com>,
	linux-input@vger.kernel.org, rubini <rubini@cvml.unipv.it>
Subject: Re: [PATCH] Reset ps/2 port should      psmouse_probe   fail before retrying
Date: Wed, 12 May 2010 00:24:50 +0200	[thread overview]
Message-ID: <1273616690.3817.5.camel@lovely> (raw)
In-Reply-To: <20100511082218.GB10404@core.coreip.homeip.net>

On Tue, 2010-05-11 at 01:22 -0700, Dmitry Torokhov wrote:
> On Sat, May 08, 2010 at 06:22:09PM +0200, Christoph Fritz wrote:
> > On Wed, 2010-04-28 at 00:26 -0700, Dmitry Torokhov wrote:
> > 
> > > What about simply resetting the mouse before actually trying to
> > > reconnect?
> > 
> > Isn't psmouse_reconnect() the first in psmouse-base.c that gets
> called
> > after waking up from hibernation/suspend?
> > And should all ps2 devices get a reset or only the one which needs
> it
> > (synaptic touchpads not handled by synaptics driver)?
> > 
> 
> I think we should reset all devcices that do not provide reconnect
> method (this includes Synaptics hardware in bare PS/2 mode). Something
> like below.
> 
> -- 
> Dmitry
> 
> Input: psmouse - reset all types of mice before reconnecting
> 
> From: Dmitry Torokhov <dmitry.torokhov@gmail.com>
> 
> Synaptics hardware requires resetting device after suspend to ram
> in order for the device to be operational. The reset lives in
> synaptics-specific reconnect handler, but it is not being invoked
> if synaptics support is disabled and the device is handled as a
> standard PS/2 device (bare or IntelliMouse protocol).
> 
> Let's add reset into generic reconnect handler as well.
> 
> Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
> ---
> 
>  drivers/input/mouse/psmouse-base.c |   14 ++++++++++----
>  1 files changed, 10 insertions(+), 4 deletions(-)
> 
> 
> diff --git a/drivers/input/mouse/psmouse-base.c
> b/drivers/input/mouse/psmouse-base.c
> index cbc8072..a3c9731 100644
> --- a/drivers/input/mouse/psmouse-base.c
> +++ b/drivers/input/mouse/psmouse-base.c
> @@ -1394,6 +1394,7 @@ static int psmouse_reconnect(struct serio
> *serio)
>         struct psmouse *psmouse = serio_get_drvdata(serio);
>         struct psmouse *parent = NULL;
>         struct serio_driver *drv = serio->drv;
> +       unsigned char type;
>         int rc = -1;
>  
>         if (!drv || !psmouse) {
> @@ -1413,10 +1414,15 @@ static int psmouse_reconnect(struct serio
> *serio)
>         if (psmouse->reconnect) {
>                 if (psmouse->reconnect(psmouse))
>                         goto out;
> -       } else if (psmouse_probe(psmouse) < 0 ||
> -                  psmouse->type != psmouse_extensions(psmouse,
> -                                               psmouse_max_proto,
> false)) {
> -               goto out;
> +       } else {
> +               psmouse_reset(psmouse);
> +
> +               if (psmouse_probe(psmouse) < 0)
> +                       goto out;
> +
> +               type = psmouse_extensions(psmouse, psmouse_max_proto,
> false);
> +               if (psmouse->type != type)
> +                       goto out;
>         }
>  
>         /* ok, the device type (and capabilities) match the old one,
> 
> 

This looks good and I can understand making this generic because it
doesn't hurt.

 Thanks,
  Christoph


  reply	other threads:[~2010-05-11 22:18 UTC|newest]

Thread overview: 36+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-04-16 22:52 [PATCH] Reset ps/2 port should psmouse_probe fail before retrying Peter M. Petrakis
2010-04-17 11:01 ` Christoph Fritz
2010-04-17 15:31   ` Peter M. Petrakis
2010-04-17 16:53     ` Christoph Fritz
2010-04-19 15:33       ` Peter M. Petrakis
2010-04-20  0:37         ` Christoph Fritz
2010-04-20 21:08           ` Peter M. Petrakis
2010-04-21  6:33             ` Dmitry Torokhov
2010-04-21 16:05               ` Peter M. Petrakis
2010-04-21 17:10                 ` Dmitry Torokhov
2010-04-21 19:38                   ` Peter M. Petrakis
2010-04-21 19:52                     ` Dmitry Torokhov
2010-04-21 21:10                       ` Peter M. Petrakis
2010-04-22 16:28                         ` Christoph Fritz
2010-04-22 21:48                           ` Peter M. Petrakis
2010-04-22 21:55                             ` Dmitry Torokhov
2010-04-23  0:47                               ` Christoph Fritz
2010-04-23 16:53                                 ` Dmitry Torokhov
2010-04-23 18:46                                   ` Peter M. Petrakis
2010-04-28 17:07                                     ` Dmitry Torokhov
2010-04-28 20:17                                       ` Peter M. Petrakis
2010-04-29 16:57                                         ` Christoph Fritz
2010-04-29 17:46                                           ` Dmitry Torokhov
2010-04-30 22:37                                           ` Peter M. Petrakis
2010-05-02  3:07                                             ` Christoph Fritz
2010-05-02  7:41                                               ` Christoph Fritz
2010-05-07 17:57                                               ` Peter M. Petrakis
2010-05-08 16:01                                                 ` Christoph Fritz
2010-04-24  1:22                                   ` Christoph Fritz
2010-04-24 10:00                                     ` Christoph Fritz
2010-04-28  7:26                                       ` Dmitry Torokhov
2010-05-08 16:22                                         ` Christoph Fritz
2010-05-11  8:22                                           ` Dmitry Torokhov
2010-05-11 22:24                                             ` Christoph Fritz [this message]
  -- strict thread matches above, loose matches on Subject: below --
2010-04-14 20:46 Peter M. Petrakis
2010-04-14 21:04 ` Randy Dunlap

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=1273616690.3817.5.camel@lovely \
    --to=chf.fritz@googlemail.com \
    --cc=dmitry.torokhov@gmail.com \
    --cc=linux-input@vger.kernel.org \
    --cc=peter.petrakis@canonical.com \
    --cc=rubini@cvml.unipv.it \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.