[PATCH] psmouse: touchpad doesn't reconnect after resume: Synaptics ps2 Bug: 551234

Peter M. Petrakis peter.petrakis at canonical.com
Thu Apr 1 15:45:04 UTC 2010



On 04/01/2010 05:24 AM, Andy Whitcroft wrote:
> On Mon, Mar 29, 2010 at 05:18:35PM -0400, Peter M. Petrakis wrote:
>> Hi All,
>>
>> This is my first stab at correcting some PS/2 misbehavior when returning
>> from S3. Fire away :). Thanks.
>>
>> Peter
>>
>> P.S. Collaborated with Colin King on this one.
>
>>  From 006e55bacfe64f5fe6b8c12af071f7b2bf528c3a Mon Sep 17 00:00:00 2001
>> From: Peter M. Petrakis<peter.petrakis at canonical.com>
>> Date: Fri, 26 Mar 2010 17:23:43 -0400
>> Subject: [PATCH] Perform a reset should psmouse_probe fail for any reason. This is necessary for some PS/2 devices who can't even be identified when returning from sleep (S3).
>>
>> ---
>>   psmouse-base.c |   28 +++++++++++++++++++++++++---
>>   1 files changed, 25 insertions(+), 3 deletions(-)
>>
>> diff --git a/psmouse-base.c b/psmouse-base.c
>> index b407b35..3b8e63c 100644
>> --- a/psmouse-base.c
>> +++ b/psmouse-base.c
>> @@ -856,12 +856,12 @@ static const struct psmouse_protocol *psmouse_protocol_by_name(const char *name,
>>   	return NULL;
>>   }
>>
>> -
>>   /*
>> - * psmouse_probe() probes for a PS/2 mouse.
>> + * __psmouse_probe() probes for a PS/2 mouse.
>> + * Wrapped by psmouse_probe() for clean reset code.
>>    */
>>
>> -static int psmouse_probe(struct psmouse *psmouse)
>> +static int __psmouse_probe(struct psmouse *psmouse)
>>   {
>>   	struct ps2dev *ps2dev =&psmouse->ps2dev;
>>   	unsigned char param[2];
>> @@ -892,6 +892,28 @@ static int psmouse_probe(struct psmouse *psmouse)
>>   }
>>
>>   /*
>> + * Wrapper for probe routine to cleanly reset the device should
>> + * the initial probe fail for any reason.
>> + */
>> +static int psmouse_probe(struct psmouse *psmouse) {
>> +	struct ps2dev *ps2dev =&psmouse->ps2dev;
>> +	int tries = 3;
>> +	int ret = -1;
>> +
>> +retry:
>> +	if (tries>  0&&  ((ret = __psmouse_probe(psmouse)) != 0)) {
>> +		printk(KERN_ERR "psmouse.c: Error encountered while probing PS/2 device on %s "
>> +			"reseting...\n", ps2dev->serio->phys);
>> +		psmouse_reset(psmouse);
>> +		msleep(500);
>> +		tries--;
>> +		goto retry;
>> +	}


> How does this behave if the machine does not have a psmouse on this
> port?  Do we still call here?  If so that sounds like it might add 1.5s
> to boot/resume?

Didn't test that and good point. There are some other sleeps in the 
mouse code and their sum including retries doesn't seem to exceed 1s. 
I'll retest and see if I can do without it. I was hoping someone on
the list would be able to point a better value for settling time
after issuing the reset.

> Is 500ms a number picked out of the air or does it have some basis in an
> errata?  It seems like a long time in the real world.

Plucked out of the air indeed :), The longest sleep I could find in this
could was 200ms per try, I'll start there and ratchet down.

> Also what machines have this issue, what devices?  Can we quirk this on
> only for the machines which are broken?

Specific Dell laptops with Synaptics touchpads. We  could quirk this per 
platform... where would that live? dell_laptop?

> Finally, what releases is this aimed at?

lucid, though if it could be pulled into the next SRU for karmic that 
would be good too.

Peter

>> +
>> +	return ret;
>> +}
>> +
>> +/*
>>    * Here we set the mouse resolution.
>>    */
>
> -apw




More information about the kernel-team mailing list