Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp2210328imm; Thu, 23 Aug 2018 16:36:29 -0700 (PDT) X-Google-Smtp-Source: ANB0VdZMEUhFCUbO54pgiuLiMPwbqt7B4CDyDiZ3+tRJeimZmcyI2jnnqiQVo3QTpQgJauBbQUAP X-Received: by 2002:a62:7a01:: with SMTP id v1-v6mr2333029pfc.153.1535067389225; Thu, 23 Aug 2018 16:36:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1535067389; cv=none; d=google.com; s=arc-20160816; b=MENLInzvOHS7T5awVk4eDRrKoMYoFfqgJVzv31BGBkoTpo7CLfykXd6nZQ9QB3rNYM PIcfZV0HUp/PCtBnPlJTPcUpQjycSOcNdd1SZ7mVh33awVRWuRNXyIJaGqR1nzWZ098h nQDNEmdhIe/6oN5Z19RcU8zIDCEGNJhQzWA2/H/1LjdUGXA6YqDoyPWZ2VNugNk27EXF 2/8aistwb0EsIGo3+ezRKUG9fJB5wWbBkBrJt1M9hqlALNNZOCX4dcW1TVdGxwEEjQq/ i8VAJicc8oF0dMsLQCeDCNRPIrVpS86V5QNwZuMMTUR+JBTGJHvMgaWHZF8fAMksR+ld /GJw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature:arc-authentication-results; bh=WSNr20WxcWJxrdsXmR3kOdnfGDIiolHz6aUydrZXF/A=; b=yddEu9AQcbNMqRu0l4DPIQBr3J81X/gOqhvLlNrp8uFBvE49zw76HF5TGRZvNmTf0d F4hS+10T1dB7M4YzLoKdGgPqh0izd6Q8g3yI8Q/n7sQFSsAI90rpohbXJ3G9DyCXREa/ lukaS0RJJ/TG+Tt50ZpwYeobmsGnm7gIpuHQ9nrkEX8F8/0CNfVJ7/vlD5WggPcwuFv/ 8QRP9Jb2OQlwmzCOg89wLrria+K6aJAIt5qoFLx/0aFJgWoid9xKANpTxnImfKtQ1JWw JQLJTs4ertWyX+4HBH9vAvZAKCctDnbEuUAPmwxc8f0q3yEp+VcoqczlS0k+KXdFanS6 /nlQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=e+d4xyg1; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id s65-v6si6069222pfb.271.2018.08.23.16.36.13; Thu, 23 Aug 2018 16:36:29 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=e+d4xyg1; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726649AbeHXDG1 (ORCPT + 99 others); Thu, 23 Aug 2018 23:06:27 -0400 Received: from mail-pg1-f193.google.com ([209.85.215.193]:37264 "EHLO mail-pg1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726085AbeHXDG1 (ORCPT ); Thu, 23 Aug 2018 23:06:27 -0400 Received: by mail-pg1-f193.google.com with SMTP id h8-v6so3402100pgs.4; Thu, 23 Aug 2018 16:34:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=WSNr20WxcWJxrdsXmR3kOdnfGDIiolHz6aUydrZXF/A=; b=e+d4xyg1COFYWpqzZxI2tbxNjvu4t0uMClUyAaMbYMUrJSRyiAivfRll8W9YftyZzx QG/EtQPNByD2tXVuTS6JefeHfOv88QohSR1DuUC/qv+nphjy45ztPu5CjOGsCIrEwyWs Wew8MfSbTa4k7VO14SP/UcJ9VRwSDuFiL6DgYeuHiqeksdCTMLDdzLubyW2JMzuQxNck uBHPoQ1N/k+DBxkge301OAjCyt9qpImH+X0czhwbihUk4oD8unnLXay7R+G0C95E5BeR 0dowP9UnsTYH7ucNHXHgcCi9XskRi3NVlRl2VccaPLGATdyP9uA5NkxEEQj9LDpWG85u xg5g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=WSNr20WxcWJxrdsXmR3kOdnfGDIiolHz6aUydrZXF/A=; b=AOXyGYGFOiNTXUKfG9TrwrzrI25asSYSczdrOs8lmIJ8Xfe2rxHn4oYfAK7nFnTVXE XTA9o5UdUbUT/RgQs09GToepuuLXprvbjbA3xbwOBCZHCYGDW14hMRcjcxELFMp2rm0m SEsLRabr2f+HJjOkfqhLmpW0ALUm4V5LTPb1CXRd3sd3Fh2YyzRa+se96G4O+Fdwhjqr J6BlZ0tP6oSvjDp31wUbvrATT1mZ/g7xq9+uoDf3L1hhSNz8Oobi/cwZFm/6iy33v71n hLxwF+aVVFcfBcHVCjcI7EhlQX+/iLlWhj0Q/riFZhf4ERYzLQIAzA8cW/WwgJlIMG4p Pkag== X-Gm-Message-State: AOUpUlGyDudQfwwx0PbkD3UVT7NEEFkoG1/boEOlT9NEdZypt1O34hjM Wk4kVBCeZUwoOKf3barHLWA= X-Received: by 2002:a62:3545:: with SMTP id c66-v6mr64458322pfa.63.1535067267430; Thu, 23 Aug 2018 16:34:27 -0700 (PDT) Received: from dtor-ws ([2620:15c:202:201:3adc:b08c:7acc:b325]) by smtp.gmail.com with ESMTPSA id y3-v6sm8506858pfi.24.2018.08.23.16.34.25 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 23 Aug 2018 16:34:26 -0700 (PDT) Date: Thu, 23 Aug 2018 16:34:24 -0700 From: Dmitry Torokhov To: Derek Basehore , Johnny Chuang Cc: linux-kernel@vger.kernel.org, linux-input@vger.kernel.org, joe@perches.com, andi@etezian.org, gregkh@linuxfoundation.org, James Chen , KT Liao Subject: Re: [PATCH] Input: elants_i2c - Fix sw reset delays Message-ID: <20180823233424.GE53155@dtor-ws> References: <20180823231013.254037-1-dbasehore@chromium.org> <20180823233028.GC53155@dtor-ws> <20180823233211.GD53155@dtor-ws> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180823233211.GD53155@dtor-ws> User-Agent: Mutt/1.9.2 (2017-12-15) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org For real now... On Thu, Aug 23, 2018 at 04:32:11PM -0700, Dmitry Torokhov wrote: > Let's add Elan folks to the discussion. > > On Thu, Aug 23, 2018 at 04:30:28PM -0700, Dmitry Torokhov wrote: > > Hi Derek, > > > > On Thu, Aug 23, 2018 at 04:10:13PM -0700, Derek Basehore wrote: > > > We only need to wait 10ms instead of 30ms before starting fastboot or > > > sending IAP on the touchscreen. Also, instead of delaying everytime > > > sw_reset is called, this delays 10ms in the function that starts > > > fastboot. There's also an explicit 20ms delay before sending IAP when > > > updating the firmware, so no additional delay is needed there. This > > > change also has the benefit of not delaying when wakeup is enabled > > > during suspend. This is because sw_reset is called, yet fastboot > > > isn't. > > > > > > Change-Id: I9e3019720186ba0023891fafeb4fe3d2510e454b > > > > This is not needed ;) > > > > > Signed-off-by: Derek Basehore > > > --- > > > drivers/input/touchscreen/elants_i2c.c | 16 ++++++++++------ > > > 1 file changed, 10 insertions(+), 6 deletions(-) > > > > > > diff --git a/drivers/input/touchscreen/elants_i2c.c b/drivers/input/touchscreen/elants_i2c.c > > > index d21ca39b0fdb..18ce04ba0173 100644 > > > --- a/drivers/input/touchscreen/elants_i2c.c > > > +++ b/drivers/input/touchscreen/elants_i2c.c > > > @@ -284,12 +284,6 @@ static int elants_i2c_sw_reset(struct i2c_client *client) > > > return error; > > > } > > > > > > - /* > > > - * We should wait at least 10 msec (but no more than 40) before > > > - * sending fastboot or IAP command to the device. > > > - */ > > > - msleep(30); > > > - > > > return 0; > > > } > > > > > > @@ -500,6 +494,12 @@ static int elants_i2c_fastboot(struct i2c_client *client) > > > const u8 boot_cmd[] = { 0x4D, 0x61, 0x69, 0x6E }; > > > int error; > > > > > > + /* > > > + * We should wait at least 10 msec (but no more than 40) before sending > > > + * fastboot command to the device. > > > + */ > > > + usleep_range(10 * 1000, 11 * 1000); > > > + > > > error = elants_i2c_send(client, boot_cmd, sizeof(boot_cmd)); > > > if (error) { > > > dev_err(&client->dev, "boot failed: %d\n", error); > > > @@ -643,6 +643,10 @@ static int elants_i2c_do_update_firmware(struct i2c_client *client, > > > dev_err(&client->dev, "Failed close idle: %d\n", error); > > > msleep(60); > > > elants_i2c_sw_reset(client); > > > + /* > > > + * We should wait at least 10 msec (but no more than 40) before > > > + * sending IAP command to the device. > > > + */ > > > msleep(20); > > > > So the original comment was talking about timing on fastboot or IAP > > command, but the original code had 50 msec wait here (30 from > > elants_i2c_sw_reset plus the 20), thus already violating 40 msec rule > > for IAP. Unless Elan folks can confirm it is OK to reduce the wait here > > I'd prefer we kept it at 50. Firmware update is does not happen that > > often anyway. > > > > Thanks. > > > > -- > > Dmitry > > -- > Dmitry -- Dmitry