Received: by 10.223.185.116 with SMTP id b49csp3603595wrg; Mon, 19 Feb 2018 02:57:15 -0800 (PST) X-Google-Smtp-Source: AH8x2270QfjysAh6YsW4zWuEs3hQn9Oxy/cHvFc9JMY+95SCkrThU4ZdgubkE3AisZATiCme1bL3 X-Received: by 2002:a17:902:900c:: with SMTP id a12-v6mr13765541plp.330.1519037835220; Mon, 19 Feb 2018 02:57:15 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519037835; cv=none; d=google.com; s=arc-20160816; b=MfPLNHCKA4PNDeLDekd6NJoyS/JXLYYbluBgLVJ4+TrmYqZjQw6Y3TB+BM8iyfc8Lf p+cql9MzKGzoO9uUL2zemB+VU0+r3NsjRYtgZZaBgyD0t1URfsmyGf6LjhBfuG3/Eqlu e46i5+LYIEMGQN0OiVwB2fEqUA/fqqpICDgbjcWmSUb6o2is3KDXepZPHN0BeKXqlA33 RLLOBv0ta+3J+bTBJC1lTujFaOBtzZy4aQ28ui+CYODqbq4KL+mAuMW6mJmVXUgFAYYT wSYzRF7y1ZWZ85DMr7TxnFYRseVyjDEZeJiu5g48VOxK8Pb9rauBvZ2i+h0XN/U/jimM RIMw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:message-id:references :in-reply-to:subject:cc:to:from:date:content-transfer-encoding :mime-version:dkim-signature:dkim-signature :arc-authentication-results; bh=wXALVI3xuEl2JvIBXu8Dr3+vvDCndPUEml3wgeJnej8=; b=QtijP/DBazIBgzJmYuEoPML2/e4L+OEQ1ZbWE848V6ROSc/ePf/psfB5UFEWYQyvgC 4GTsIweBEtvKBTyYMLBtvogarwq/sH7L8eLYeGKvpXcglOzWiIdu/KkBJKtOAhKYCNAj WoRXkxe2HHQcTY4ocGKpJomzK6e3O8b7Wzx9mvgQETGjgiIUjh5ro64v/SjWWH8fFEgg PRtO4Orpstycjm3hYcCCfhxZjQEYYevGpfHQIind1vjaskKIHpCx/KH8lYLSeq7wjyml Xqxnqo4t33448Ls3M+UE95B+aQVm5qNMaAsFyk1511KmYMcMT8F9486xwP4S+haHt9oz dg3g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@codeaurora.org header.s=default header.b=Tac6lb/2; dkim=pass header.i=@codeaurora.org header.s=default header.b=fQBcV9od; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b10si8243830pgf.613.2018.02.19.02.57.00; Mon, 19 Feb 2018 02:57:15 -0800 (PST) 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=@codeaurora.org header.s=default header.b=Tac6lb/2; dkim=pass header.i=@codeaurora.org header.s=default header.b=fQBcV9od; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752561AbeBSK4V (ORCPT + 99 others); Mon, 19 Feb 2018 05:56:21 -0500 Received: from smtp.codeaurora.org ([198.145.29.96]:57668 "EHLO smtp.codeaurora.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752468AbeBSK4T (ORCPT ); Mon, 19 Feb 2018 05:56:19 -0500 Received: by smtp.codeaurora.org (Postfix, from userid 1000) id 0119260F91; Mon, 19 Feb 2018 10:56:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1519037779; bh=oF4fCbLKuAqSzZsM/0JeaA/CfbJtz6nSciZY6CUfeQA=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=Tac6lb/2WYE+gJZQ01LxHrEMwjhhHlVMgywEfCKvk+N+gcl1eA1CrqswZUjUMNHiE i5iBvewc+kre7fkmjnbFZRdJW4yUVc+tEhKJ7y798ra/cFI8yX5dU3Vs3WbF+0TY9S ZvM6Fd/SZdAJX+lP5BU3Si0NqGrcpUTeKYNP50lY= X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on pdx-caf-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.8 required=2.0 tests=ALL_TRUSTED,BAYES_00, DKIM_SIGNED,T_DKIM_INVALID autolearn=no autolearn_force=no version=3.4.0 Received: from mail.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.codeaurora.org (Postfix) with ESMTP id 18B5260F72; Mon, 19 Feb 2018 10:56:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1519037778; bh=oF4fCbLKuAqSzZsM/0JeaA/CfbJtz6nSciZY6CUfeQA=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=fQBcV9odyLtN2xCxGWpfTsfc/qM3nZ7meU1V/aGP6dgEL6EGC/hfXTq3vg+wTtQ+k lBFCGtiB26cHHku+gXi8BFoaMwHpYlzeYDUyBPsphLXXl15loIy/UpJOndZLtHNfxi h2bJSzbigm85qNesgaeUf4MjevjJkuzQ2pkz7mzk= MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Date: Mon, 19 Feb 2018 16:26:18 +0530 From: Abhishek Sahu To: Sricharan R Cc: Andy Gross , Wolfram Sang , David Brown , linux-arm-msm@vger.kernel.org, linux-soc@vger.kernel.org, linux-i2c@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 08/12] i2c: qup: change completion timeout according to transfer length In-Reply-To: <7dcbac1f-edaf-aecf-8e58-04d243384758@codeaurora.org> References: <1517644697-30806-1-git-send-email-absahu@codeaurora.org> <1517644697-30806-9-git-send-email-absahu@codeaurora.org> <7dcbac1f-edaf-aecf-8e58-04d243384758@codeaurora.org> Message-ID: <6a1983c0ca81afce908f622a53abd563@codeaurora.org> X-Sender: absahu@codeaurora.org User-Agent: Roundcube Webmail/1.2.5 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2018-02-16 10:18, Sricharan R wrote: > On 2/3/2018 1:28 PM, Abhishek Sahu wrote: >> Currently the completion timeout is being taken according to >> maximum transfer length which is too high if SCL is operating in >> high frequency. This patch calculates timeout on the basis of >> one-byte transfer time and uses the same for completion timeout. >> >> Signed-off-by: Abhishek Sahu >> --- >> drivers/i2c/busses/i2c-qup.c | 9 ++++++--- >> 1 file changed, 6 insertions(+), 3 deletions(-) >> >> diff --git a/drivers/i2c/busses/i2c-qup.c >> b/drivers/i2c/busses/i2c-qup.c >> index a91fc70..6df65ea 100644 >> --- a/drivers/i2c/busses/i2c-qup.c >> +++ b/drivers/i2c/busses/i2c-qup.c >> @@ -130,8 +130,8 @@ >> #define MX_TX_RX_LEN SZ_64K >> #define MX_BLOCKS (MX_TX_RX_LEN / QUP_READ_LIMIT) >> >> -/* Max timeout in ms for 32k bytes */ >> -#define TOUT_MAX 300 >> +/* Min timeout for i2c transfers */ >> +#define TOUT_MIN 2 >> > > may be you can mention, why is this 2 ? > This 2 seconds is timeout which I am adding on the top of maximum xfer time calculated from bus speed to compensate the interrupt latency and other factors. It will make xfer timeout minimum as 2 seconds. I will update the comment to explain it in more detail. Thanks, Abhishek