From patchwork Thu Apr 22 16:28:50 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christoph Fritz X-Patchwork-Id: 94169 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 o3MGQHwJ030300 for ; Thu, 22 Apr 2010 16:26:17 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754112Ab0DVQ0Q (ORCPT ); Thu, 22 Apr 2010 12:26:16 -0400 Received: from fg-out-1718.google.com ([72.14.220.154]:4532 "EHLO fg-out-1718.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753228Ab0DVQ0P (ORCPT ); Thu, 22 Apr 2010 12:26:15 -0400 Received: by fg-out-1718.google.com with SMTP id d23so495372fga.1 for ; Thu, 22 Apr 2010 09:26:12 -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=+d7RKhvUxfS4d+FfzYnlF7BNBCwtc57Y6W2WX5T2spY=; b=KKFVkK1hxWgjt2mbUt1koqyeg6Tc2t8oXJLWCtO+3fgZeu565qYPrtWDdAu8R3ghQl T9bAI4sFUiz5PQ/KKk+QwUwlJn+ljGhy03eCDhqH8wF3YTiZhJy5k6s2ghi1ZhiY3A2l rVzJd+GhJnHslAInaoyC/5PHiuoz8XkuigcC4= 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=Bo+aeiLJRjZ2B4ngceVrrSZRl1M1neixrioai430v+VOgJOvfSfqyzYFvSNtoOmIIm 9uWcKPAkQ6Z57C3nut7N5rum7G3mFbvStOGQxddYfrix+mtafbg7j+eLAxCEEdxGkYEP 8kqfLJjuA6XpSG3Wx6OHseqQJrQs3tCnPX8M8= Received: by 10.223.68.13 with SMTP id t13mr58276fai.69.1271953401649; Thu, 22 Apr 2010 09:23:21 -0700 (PDT) Received: from [127.0.0.1] (p3EE06FEC.dip.t-dialin.net [62.224.111.236]) by mx.google.com with ESMTPS id g28sm142248fkg.58.2010.04.22.09.23.18 (version=TLSv1/SSLv3 cipher=RC4-MD5); Thu, 22 Apr 2010 09:23:19 -0700 (PDT) Subject: Re: [PATCH] Reset ps/2 port should psmouse_probe fail before retrying From: Christoph Fritz To: "Peter M. Petrakis" Cc: Dmitry Torokhov , linux-input@vger.kernel.org, rubini@cvml.unipv.it In-Reply-To: <4BCF69CB.7010000@canonical.com> References: <1271502098.4155.27.camel@lovely> <4BC9D444.3090802@canonical.com> <1271523195.3676.5.camel@lovely> <4BCC77B4.5030703@canonical.com> <1271723857.6652.6.camel@lovely> <4BCE17CC.8020804@canonical.com> <20100421063328.GJ4364@core.coreip.homeip.net> <4BCF2263.40306@canonical.com> <20100421171055.GB10566@core.coreip.homeip.net> <4BCF5453.5060703@canonical.com> <20100421195238.GA10641@core.coreip.homeip.net> <4BCF69CB.7010000@canonical.com> Date: Thu, 22 Apr 2010 18:28:50 +0200 Message-Id: <1271953731.4566.27.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]); Thu, 22 Apr 2010 16:26:17 +0000 (UTC) diff --git a/drivers/input/mouse/psmouse-base.c b/drivers/input/mouse/psmouse-base.c index d8c0c8d..6877371 100644 --- a/drivers/input/mouse/psmouse-base.c +++ b/drivers/input/mouse/psmouse-base.c @@ -1383,6 +1383,7 @@ static int psmouse_reconnect(struct serio *serio) struct psmouse *parent = NULL; struct serio_driver *drv = serio->drv; int rc = -1; + int retries = 0; if (!drv || !psmouse) { printk(KERN_DEBUG "psmouse: reconnect request, but serio is disconnected, ignoring...\n"); @@ -1401,10 +1402,14 @@ static int psmouse_reconnect(struct serio *serio) if (psmouse->reconnect) { if (psmouse->reconnect(psmouse)) goto out; - } else if (psmouse_probe(psmouse) < 0 || + } else { + while ((retries++ < 3) && psmouse_reset(psmouse)) + /* empty */; + 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,