Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp486983pxk; Sun, 30 Aug 2020 11:03:03 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzDgb1Z8lAKkMIXVQjMr2dDJa5zG7E3eBo+bL0B/2XhLBuDAMsBXMDJfcJVSdOUmyURIGC9 X-Received: by 2002:a50:9f22:: with SMTP id b31mr7339027edf.345.1598810582997; Sun, 30 Aug 2020 11:03:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1598810582; cv=none; d=google.com; s=arc-20160816; b=TAu7l2qgxGEEXfHYDZLZ9q/B6KHC9T/pZrvMkwV9lRefAxPpO9VSM0dbLRdZiCjsQc BHiSPOcWHKUCq46y9WPr86RKqpp8k+WuOidn4N8QuReZ/3C/ELNQKe3KXjRbEdwbJv+z tkFSru4VtMgM23pyX97mOgZ7MaAr/HePAHxa+aEgvIN3qLEEz9/b/rkVtcvSMDmjOpBO ZQZjWZrirD5gdm93+0Tmj5IwI5KfxcTJzXOHY7OPBjg253IJtLmnmelwBBx7rVBfEFom k5dF7/A53mhcEY/gP6TLP6kFgajKGUcz1Hhd03cwmZvMwrC5ZO9UDo8X5n6iL/+625yX UzoQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=l67Rw1sesTKoXlj3/enQAM/CdJ/NqO3HI/tHvDZitDc=; b=U7M4/qzNFXiobJ/pvLwK1h+X3bg1y665IdXhxgW+bTDu+4yLGj42n64ItAeCxW27CB d1Xp6iIeRflQqWOgtYSM5P3GDfHBoDZztdoSedS00vunSFHFofy9ZN+Ttx5xA6IJSx4t FuDy4YUfff59Agq/PtrdBrcwIYczjyqoaukS7mJOCi6qd8HT3yqFAwEMU170wF3eYTty HTrj3ed/GKxBhTQInnvogJzHvQ9Epnl/Xq7IktOBdNbtn8/GcF0S1TWc5Y34vLLI6IrE C5VFsvEN7M7aOPZkZdqXZtBZM7SPlJg23VhDxkQqrmWBOAOlz3+BFWvaF16IwVlUEKjJ Nleg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=GhLe+JR6; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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. [23.128.96.18]) by mx.google.com with ESMTP id o16si4076508ejc.319.2020.08.30.11.02.37; Sun, 30 Aug 2020 11:03:02 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=GhLe+JR6; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 S1726394AbgH3SB7 (ORCPT + 99 others); Sun, 30 Aug 2020 14:01:59 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53358 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726150AbgH3SB6 (ORCPT ); Sun, 30 Aug 2020 14:01:58 -0400 Received: from mail-pj1-x1043.google.com (mail-pj1-x1043.google.com [IPv6:2607:f8b0:4864:20::1043]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6C533C061573; Sun, 30 Aug 2020 11:01:58 -0700 (PDT) Received: by mail-pj1-x1043.google.com with SMTP id 2so1890286pjx.5; Sun, 30 Aug 2020 11:01:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=l67Rw1sesTKoXlj3/enQAM/CdJ/NqO3HI/tHvDZitDc=; b=GhLe+JR6MCYusy5seMJga70EhO0dPqsJES/tKOcXiEd5uAQKJgZ4KwCCGcXjxP4YyO z8219umkSpaknsvY3swr4PpPl1TiL0u45d5VnMAuJKoDuQth+of2PvQ+D8sj4FV4Crs+ /7DocExmKVPjmmJ14SFc94TCugtt8/C53e+6L5m1EiRG89Z2P08oJEasVQKE1eCzOaWD bINJLMXO9l4LNR5OJ6taAa5qmORQJrex4QLdOGywhGTswbSo05Vw66SSPXy5FC2TpQ/D vOuIO66MhbBf6QmaCimw/SUslZ3FvTznWa0hhw6pcnbpHQHH5TewJV0vpuvBKjLYhCjt OdgQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=l67Rw1sesTKoXlj3/enQAM/CdJ/NqO3HI/tHvDZitDc=; b=Tl5yqiDfDAuxQ++AfIzGQW5V0TnqIh8ODfjAOw5HPzJ52Yfqyo4KP+o+8bIF29Qr/K QgkUU0mWkAalEhTGjmP3GBUFB22Tq4fRodI367+CKj27OCgevmvctxGTgCHOERekHW9E cJPGzco5wF5tgAalCKQAiN/Sxhkio4h6mo1ON76mfQQgd+LFZwP6+n9/0U08eVfWHPvI xJmfzU7eFNqoRxooRrdCfKr7o04D871xRk/0hL22eLSd/hCBkLLZI9po5KAj8M5i6+2C xcSL2YzvhXBkuXbVwnRZErekINYR/fCY7F52Iv/YrsvQzCat3JMzyY98hnMEDy/5ANx6 nszw== X-Gm-Message-State: AOAM533fvGgWl/YuYUBPr9mlI+YdAce2suiokIbrs2UUhcYyC0G3r85E +A4qc/wEiSsZaUCW2eqoekqAWdVcCMAMt74HL+0= X-Received: by 2002:a17:90a:e7cb:: with SMTP id kb11mr7065082pjb.181.1598810515270; Sun, 30 Aug 2020 11:01:55 -0700 (PDT) MIME-Version: 1.0 References: <20200830122051.197892-1-tali.perry1@gmail.com> In-Reply-To: <20200830122051.197892-1-tali.perry1@gmail.com> From: Andy Shevchenko Date: Sun, 30 Aug 2020 21:01:38 +0300 Message-ID: Subject: Re: [PATCH v2] i2c: npcm7xx: bug fix timeout (usec instead of msec) To: Tali Perry Cc: kunyi@google.com, xqiu@google.com, benjaminfair@google.com, Avi Fishman , Joel Stanley , Tomer Maimon , Wolfram Sang , linux-i2c , OpenBMC Maillist , Linux Kernel Mailing List Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sun, Aug 30, 2020 at 3:23 PM Tali Perry wrote: > > i2c: npcm7xx: bug fix timeout (usec instead of msec) This commit message is awful. Please read [1] as a tutorial how to write a commit messages. [1]: https://chris.beams.io/posts/git-commit/ ... > - /* Adaptive TimeOut: astimated time in usec + 100% margin */ > - timeout_usec = (2 * 10000 / bus->bus_freq) * (2 + nread + nwrite); > + /* > + * Adaptive TimeOut: estimated time in usec + 100% margin: > + * 2: double the timeout for clock stretching case > + * 9: bits per transaction (including the ack/nack) > + * 1000000: micro second in a second No need. See below. > + */ > + timeout_usec = (2 * 9 * 1000000 / bus->bus_freq) * (2 + nread + nwrite); USEC_PER_SEC > timeout = max(msecs_to_jiffies(35), usecs_to_jiffies(timeout_usec)); > if (nwrite >= 32 * 1024 || nread >= 32 * 1024) { > dev_err(bus->dev, "i2c%d buffer too big\n", bus->num); -- With Best Regards, Andy Shevchenko