From patchwork Wed Dec 16 09:28:58 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mika Westerberg X-Patchwork-Id: 7860391 X-Patchwork-Delegate: jikos@jikos.cz Return-Path: X-Original-To: patchwork-linux-input@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 55EE5BEEE1 for ; Wed, 16 Dec 2015 09:29:09 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 5FC7520382 for ; Wed, 16 Dec 2015 09:29:08 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 3114E203A4 for ; Wed, 16 Dec 2015 09:29:07 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754523AbbLPJ3F (ORCPT ); Wed, 16 Dec 2015 04:29:05 -0500 Received: from mga14.intel.com ([192.55.52.115]:56952 "EHLO mga14.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753389AbbLPJ3E (ORCPT ); Wed, 16 Dec 2015 04:29:04 -0500 Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga103.fm.intel.com with ESMTP; 16 Dec 2015 01:29:03 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.20,436,1444719600"; d="scan'208";a="861825527" Received: from lahna.fi.intel.com (HELO lahna) ([10.237.72.56]) by fmsmga001.fm.intel.com with SMTP; 16 Dec 2015 01:28:59 -0800 Received: by lahna (sSMTP sendmail emulation); Wed, 16 Dec 2015 11:28:58 +0200 Date: Wed, 16 Dec 2015 11:28:58 +0200 From: Mika Westerberg To: Nish Aravamudan Cc: Jiri Kosina , Benjamin Tissoires , Andrew Duggan , Gabriele Mazzotta , Seth Forshee , Dan Carpenter , linux-input@vger.kernel.org, "linux-kernel@vger.kernel.org" Subject: Re: [RESEND] Lenovo Yoga 900 touchpad issues Message-ID: <20151216092858.GP1762@lahna.fi.intel.com> References: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-input-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP On Tue, Dec 15, 2015 at 11:14:32AM -0800, Nish Aravamudan wrote: > [Apologies for the resend, didn't realize I hadn't changed my GMail settings > to not use HTML.] > > I have recently purchased a Lenovo Yoga 900 and most everything is working > with a slightly modified 4.4-rc5 (https://lkml.org/lkml/2015/11/30/441 applied > to enable the touchpad itself), I am seeing two issues: > > 1) On suspend/resume, the touchpad is non-functional. A `modprobe -r i2c-hid; > modprobe i2c-hid` "fixes" it. > > The kernel emits: > > i2c_hid i2c-SYNA2B29:00: failed to reset device. > dpm_run_callback(): i2c_hid_resume+0x0/0xc0 [i2c_hid] returns -61 > PM: Device i2c-SYNA2B29:00 failed to resume: error -61 > > During the resume. So perhaps this is a timing issue (given that once > resumed, the > module reload does work?). Linus noticed this as well and Jiri suggested the below patch which seemed to fix the issue (although it increased resume time a bit). I was supposed to get one Lenovo Yoga 900 here to debug this issue but I'm still waiting for it (sloow big corporation bureaucracy takes some time to get things purchased outside). the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/hid/i2c-hid/i2c-hid.c b/drivers/hid/i2c-hid/i2c-hid.c index 55d8f9d..52dd03a0 100644 --- a/drivers/hid/i2c-hid/i2c-hid.c +++ b/drivers/hid/i2c-hid/i2c-hid.c @@ -1121,10 +1121,16 @@ static int i2c_hid_resume(struct device *dev) struct i2c_client *client = to_i2c_client(dev); struct i2c_hid *ihid = i2c_get_clientdata(client); struct hid_device *hid = ihid->hid; - int wake_status; + int wake_status, tries = 3; enable_irq(ihid->irq); - ret = i2c_hid_hwreset(client); + + do { + ret = i2c_hid_hwreset(client); + if (ret) + msleep(1000); + } while (tries-- > 0 && ret); + if (ret) return ret; -- To unsubscribe from this list: send the line "unsubscribe linux-input" in