* [PATCH 2/2] Recover from failed recalibration for OLPC touchpad
@ 2008-12-16 19:45 Deepak Saxena
2008-12-16 19:53 ` Andres Salomon
0 siblings, 1 reply; 4+ messages in thread
From: Deepak Saxena @ 2008-12-16 19:45 UTC (permalink / raw)
To: dmitry.torokhov, linux-input; +Cc: pgf, Andres Salomon
Sometimes the the HPGK touchpad will fail to properly respond
to a ps2_command() during recalibration. This patch works around
that issue be scheduling another recalibration if this happens.
This solves http://dev.laptop.org/ticket/9008
Signed-off-by: Paul Fox <pgf@laptop.org>
Signed-off-by: Deepak Saxena <dsaxena@laptop.org>
---
drivers/input/mouse/hgpk.c | 9 ++++++++-
1 files changed, 8 insertions(+), 1 deletions(-)
diff --git a/drivers/input/mouse/hgpk.c b/drivers/input/mouse/hgpk.c
index 39cce65..9548e1c 100644
--- a/drivers/input/mouse/hgpk.c
+++ b/drivers/input/mouse/hgpk.c
@@ -233,6 +233,9 @@ static int hgpk_force_recalibrate(struct psmouse *psmouse)
ps2_command(ps2dev, NULL, 0xf5) ||
ps2_command(ps2dev, NULL, 0xe6) ||
ps2_command(ps2dev, NULL, 0xf5)) {
+ psmouse_set_state(psmouse, PSMOUSE_ACTIVATED);
+ psmouse_queue_work(psmouse, &priv->recalib_wq,
+ msecs_to_jiffies(500));
return -1;
}
@@ -245,8 +248,12 @@ static int hgpk_force_recalibrate(struct psmouse *psmouse)
* (below) is our best option for now.
*/
- if (ps2_command(ps2dev, NULL, PSMOUSE_CMD_ENABLE))
+ if (ps2_command(ps2dev, NULL, PSMOUSE_CMD_ENABLE)) {
+ psmouse_set_state(psmouse, PSMOUSE_ACTIVATED);
+ psmouse_queue_work(psmouse, &priv->recalib_wq,
+ msecs_to_jiffies(500));
return -1;
+ }
psmouse_set_state(psmouse, PSMOUSE_ACTIVATED);
--
Deepak Saxena - Kernel Developer, One Laptop Per Child
_____ __o (o>
------ -\<, Give One Laptop, Get One Laptop //\
----- ( )/ ( ) http://www.amazon.com/xo V_/_
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH 2/2] Recover from failed recalibration for OLPC touchpad
2008-12-16 19:45 [PATCH 2/2] Recover from failed recalibration for OLPC touchpad Deepak Saxena
@ 2008-12-16 19:53 ` Andres Salomon
2008-12-16 21:00 ` pgf
0 siblings, 1 reply; 4+ messages in thread
From: Andres Salomon @ 2008-12-16 19:53 UTC (permalink / raw)
To: dsaxena; +Cc: dmitry.torokhov, linux-input, pgf
On Tue, 16 Dec 2008 11:45:09 -0800
Deepak Saxena <dsaxena@laptop.org> wrote:
> Sometimes the the HPGK touchpad will fail to properly respond
> to a ps2_command() during recalibration. This patch works around
> that issue be scheduling another recalibration if this happens.
>
> This solves http://dev.laptop.org/ticket/9008
>
The bug lacks details regarding testing, see below.
> Signed-off-by: Paul Fox <pgf@laptop.org>
> Signed-off-by: Deepak Saxena <dsaxena@laptop.org>
> ---
> drivers/input/mouse/hgpk.c | 9 ++++++++-
> 1 files changed, 8 insertions(+), 1 deletions(-)
>
> diff --git a/drivers/input/mouse/hgpk.c b/drivers/input/mouse/hgpk.c
> index 39cce65..9548e1c 100644
> --- a/drivers/input/mouse/hgpk.c
> +++ b/drivers/input/mouse/hgpk.c
> @@ -233,6 +233,9 @@ static int hgpk_force_recalibrate(struct psmouse
> *psmouse) ps2_command(ps2dev, NULL, 0xf5) ||
> ps2_command(ps2dev, NULL, 0xe6) ||
> ps2_command(ps2dev, NULL, 0xf5)) {
> + psmouse_set_state(psmouse, PSMOUSE_ACTIVATED);
> + psmouse_queue_work(psmouse, &priv->recalib_wq,
> + msecs_to_jiffies(500));
> return -1;
> }
>
Do we know why the ps2 commands are failing? Do we really want to keep
trying to recalibrate if something's screwy with ps2, rather than (say)
completely reinitializing the driver?
Paul, did you manage to reproduce the problem with this patch applied?
> @@ -245,8 +248,12 @@ static int hgpk_force_recalibrate(struct psmouse
> *psmouse)
> * (below) is our best option for now.
> */
>
> - if (ps2_command(ps2dev, NULL, PSMOUSE_CMD_ENABLE))
> + if (ps2_command(ps2dev, NULL, PSMOUSE_CMD_ENABLE)) {
> + psmouse_set_state(psmouse, PSMOUSE_ACTIVATED);
> + psmouse_queue_work(psmouse, &priv->recalib_wq,
> + msecs_to_jiffies(500));
> return -1;
> + }
>
> psmouse_set_state(psmouse, PSMOUSE_ACTIVATED);
>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH 2/2] Recover from failed recalibration for OLPC touchpad
2008-12-16 19:53 ` Andres Salomon
@ 2008-12-16 21:00 ` pgf
0 siblings, 0 replies; 4+ messages in thread
From: pgf @ 2008-12-16 21:00 UTC (permalink / raw)
To: Andres Salomon; +Cc: dsaxena, dmitry.torokhov, linux-input
andres wrote:
> On Tue, 16 Dec 2008 11:45:09 -0800
> Deepak Saxena <dsaxena@laptop.org> wrote:
>
> > Sometimes the the HPGK touchpad will fail to properly respond
> > to a ps2_command() during recalibration. This patch works around
> > that issue be scheduling another recalibration if this happens.
> >
> > This solves http://dev.laptop.org/ticket/9008
> >
>
> The bug lacks details regarding testing, see below.
>
>
> > Signed-off-by: Paul Fox <pgf@laptop.org>
> > Signed-off-by: Deepak Saxena <dsaxena@laptop.org>
> > ---
> > drivers/input/mouse/hgpk.c | 9 ++++++++-
> > 1 files changed, 8 insertions(+), 1 deletions(-)
> >
> > diff --git a/drivers/input/mouse/hgpk.c b/drivers/input/mouse/hgpk.c
> > index 39cce65..9548e1c 100644
> > --- a/drivers/input/mouse/hgpk.c
> > +++ b/drivers/input/mouse/hgpk.c
> > @@ -233,6 +233,9 @@ static int hgpk_force_recalibrate(struct psmouse
> > *psmouse) ps2_command(ps2dev, NULL, 0xf5) ||
> > ps2_command(ps2dev, NULL, 0xe6) ||
> > ps2_command(ps2dev, NULL, 0xf5)) {
> > + psmouse_set_state(psmouse, PSMOUSE_ACTIVATED);
> > + psmouse_queue_work(psmouse, &priv->recalib_wq,
> > + msecs_to_jiffies(500));
> > return -1;
> > }
> >
>
> Do we know why the ps2 commands are failing? Do we really want to keep
> trying to recalibrate if something's screwy with ps2, rather than (say)
> completely reinitializing the driver?
>
> Paul, did you manage to reproduce the problem with this patch applied?
i used to see this problem regularly (the mouse simply stops working),
and could reproduce it readily. i was not able to reproduce it after
applying the fix.
(that being said, i didn't look into why the ps2 commands were failing.)
paul
=---------------------
paul fox, pgf@laptop.org
give one laptop, get one laptop --- http://www.laptop.com/xo
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH 2/2] Recover from failed recalibration for OLPC touchpad
@ 2008-12-20 10:49 Dmitry Torokhov
0 siblings, 0 replies; 4+ messages in thread
From: Dmitry Torokhov @ 2008-12-20 10:49 UTC (permalink / raw)
To: pgf; +Cc: Andres Salomon, dsaxena, linux-input
On Tuesday 16 December 2008 13:00:18 pgf@laptop.org wrote:
> andres wrote:
> > On Tue, 16 Dec 2008 11:45:09 -0800
> >
> > Deepak Saxena <dsaxena@laptop.org> wrote:
> > > Sometimes the the HPGK touchpad will fail to properly respond
> > > to a ps2_command() during recalibration. This patch works around
> > > that issue be scheduling another recalibration if this happens.
> > >
> > > This solves http://dev.laptop.org/ticket/9008
> >
> > The bug lacks details regarding testing, see below.
> >
> > > Signed-off-by: Paul Fox <pgf@laptop.org>
> > > Signed-off-by: Deepak Saxena <dsaxena@laptop.org>
> > > ---
> > > drivers/input/mouse/hgpk.c | 9 ++++++++-
> > > 1 files changed, 8 insertions(+), 1 deletions(-)
> > >
> > > diff --git a/drivers/input/mouse/hgpk.c b/drivers/input/mouse/hgpk.c
> > > index 39cce65..9548e1c 100644
> > > --- a/drivers/input/mouse/hgpk.c
> > > +++ b/drivers/input/mouse/hgpk.c
> > > @@ -233,6 +233,9 @@ static int hgpk_force_recalibrate(struct psmouse
> > > *psmouse) ps2_command(ps2dev, NULL, 0xf5) ||
> > > ps2_command(ps2dev, NULL, 0xe6) ||
> > > ps2_command(ps2dev, NULL, 0xf5)) {
> > > + psmouse_set_state(psmouse, PSMOUSE_ACTIVATED);
> > > + psmouse_queue_work(psmouse, &priv->recalib_wq,
> > > + msecs_to_jiffies(500));
> > > return -1;
> > > }
> >
> > Do we know why the ps2 commands are failing? Do we really want to keep
> > trying to recalibrate if something's screwy with ps2, rather than (say)
> > completely reinitializing the driver?
> >
> > Paul, did you manage to reproduce the problem with this patch applied?
>
> i used to see this problem regularly (the mouse simply stops working),
> and could reproduce it readily. i was not able to reproduce it after
> applying the fix.
>
> (that being said, i didn't look into why the ps2 commands were failing.)
>
I am not comfortable with the idea of endlessly recalibrating if device gets
really screwy. I'd rather see a patch that did that 3-5 times and then issued
complete reinitialization.
Thanks.
--
Dmitry
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2008-12-20 10:50 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-12-16 19:45 [PATCH 2/2] Recover from failed recalibration for OLPC touchpad Deepak Saxena
2008-12-16 19:53 ` Andres Salomon
2008-12-16 21:00 ` pgf
-- strict thread matches above, loose matches on Subject: below --
2008-12-20 10:49 Dmitry Torokhov
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).