lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Sun, 30 Aug 2020 21:01:38 +0300
From:   Andy Shevchenko <andy.shevchenko@...il.com>
To:     Tali Perry <tali.perry1@...il.com>
Cc:     kunyi@...gle.com, xqiu@...gle.com, benjaminfair@...gle.com,
        Avi Fishman <avifishman70@...il.com>,
        Joel Stanley <joel@....id.au>,
        Tomer Maimon <tmaimon77@...il.com>,
        Wolfram Sang <wsa@...-dreams.de>,
        linux-i2c <linux-i2c@...r.kernel.org>,
        OpenBMC Maillist <openbmc@...ts.ozlabs.org>,
        Linux Kernel Mailing List <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH v2] i2c: npcm7xx: bug fix timeout (usec instead of msec)

On Sun, Aug 30, 2020 at 3:23 PM Tali Perry <tali.perry1@...il.com> 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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ