From patchwork Sat Apr 24 10:00:33 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christoph Fritz X-Patchwork-Id: 94832 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter.kernel.org (8.14.3/8.14.3) with ESMTP id o3O9t8Qo006749 for ; Sat, 24 Apr 2010 09:55:08 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751093Ab0DXJy7 (ORCPT ); Sat, 24 Apr 2010 05:54:59 -0400 Received: from fg-out-1718.google.com ([72.14.220.154]:17694 "EHLO fg-out-1718.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750837Ab0DXJy6 (ORCPT ); Sat, 24 Apr 2010 05:54:58 -0400 Received: by fg-out-1718.google.com with SMTP id 19so718876fgg.1 for ; Sat, 24 Apr 2010 02:54:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=gamma; h=domainkey-signature:received:received:subject:from:to:cc :in-reply-to:references:content-type:date:message-id:mime-version :x-mailer:content-transfer-encoding; bh=RXdkZEiTmkhvzLs8TjIAbHf/1ORmCEuZcSu/NF1+bGg=; b=h8E/vxtZ03GwHTbko+SSY2u/on1k5MhNHqN0hMMZqGKAUIAldcGpva5AHFN5uhdfmy 4xvWPp3IH53LsKD/gVsWgdfCRdLFNboDu55BRtUdX+gTwiP12cXGXklW3ggOqHooihMr KLMQYbrCOK2VuyDrk9w6mbRabjesUwB3sLDxA= DomainKey-Signature: a=rsa-sha1; c=nofws; d=googlemail.com; s=gamma; h=subject:from:to:cc:in-reply-to:references:content-type:date :message-id:mime-version:x-mailer:content-transfer-encoding; b=kYK1xSIDJOuoZbENcqCsgX8RMnVPlE/FWfB2fptCZhAP4vn4XfHP/WiMofELMayj0w XWjAnamJNXa0NhLob05SWu2hpBmaJ1AnsIGaT6ArVO27MP7LCqVJJSfq0Qwz7Ltj1xvE cKOL1tc6gAbw3IFWmgqvQom65njHZMhb+NBp0= Received: by 10.87.53.28 with SMTP id f28mr2120081fgk.70.1272102896587; Sat, 24 Apr 2010 02:54:56 -0700 (PDT) Received: from [127.0.0.1] (e180008065.adsl.alicedsl.de [85.180.8.65]) by mx.google.com with ESMTPS id 9sm3756949fks.56.2010.04.24.02.54.54 (version=TLSv1/SSLv3 cipher=RC4-MD5); Sat, 24 Apr 2010 02:54:55 -0700 (PDT) Subject: Re: [PATCH] Reset ps/2 port should psmouse_probe fail before retrying From: Christoph Fritz To: Dmitry Torokhov Cc: "Peter M. Petrakis" , linux-input@vger.kernel.org, rubini In-Reply-To: <1272072125.4341.10.camel@lovely> References: <1271723857.6652.6.camel@lovely> <20100422215517.GB28213@core.coreip.homeip.net> <1271983668.16254.44.camel@lovely> <201004230953.52447.dmitry.torokhov@gmail.com> <1272072125.4341.10.camel@lovely> Date: Sat, 24 Apr 2010 12:00:33 +0200 Message-Id: <1272103233.4666.15.camel@lovely> Mime-Version: 1.0 X-Mailer: Evolution 2.22.3.1 Sender: linux-input-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter.kernel.org [140.211.167.41]); Sat, 24 Apr 2010 09:55:08 +0000 (UTC) diff --git a/drivers/input/mouse/psmouse-base.c b/drivers/input/mouse/psmouse-base.c index d8c0c8d..66ce0ac 100644 --- a/drivers/input/mouse/psmouse-base.c +++ b/drivers/input/mouse/psmouse-base.c @@ -116,6 +116,9 @@ struct psmouse_protocol { int (*init)(struct psmouse *); }; +/* to handle some reset quirks */ +static bool synaptics_hardware = false; + /* * psmouse_process_byte() analyzes the PS/2 data stream and reports * relevant events to the input module once full packet has arrived. @@ -597,7 +600,6 @@ static int cortron_detect(struct psmouse *psmouse, bool set_properties) static int psmouse_extensions(struct psmouse *psmouse, unsigned int max_proto, bool set_properties) { - bool synaptics_hardware = false; /* * We always check for lifebook because it does not disturb mouse @@ -1401,10 +1403,14 @@ static int psmouse_reconnect(struct serio *serio) if (psmouse->reconnect) { if (psmouse->reconnect(psmouse)) goto out; - } else if (psmouse_probe(psmouse) < 0 || + } else { + if (synaptics_hardware) /* is using plain PS/2 */ + psmouse_reset(psmouse); + if (psmouse_probe(psmouse) < 0 || psmouse->type != psmouse_extensions(psmouse, psmouse_max_proto, false)) { - goto out; + goto out; + } } /* ok, the device type (and capabilities) match the old one,