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:   Mon, 24 May 2021 13:18:50 +0300
From:   Andy Shevchenko <andy.shevchenko@...il.com>
To:     Sander Vanheule <sander@...nheule.net>
Cc:     Pavel Machek <pavel@....cz>, Rob Herring <robh+dt@...nel.org>,
        Lee Jones <lee.jones@...aro.org>,
        Mark Brown <broonie@...nel.org>,
        Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
        "Rafael J . Wysocki" <rafael@...nel.org>,
        Michael Walle <michael@...le.cc>,
        Linus Walleij <linus.walleij@...aro.org>,
        Bartosz Golaszewski <bgolaszewski@...libre.com>,
        Linux LED Subsystem <linux-leds@...r.kernel.org>,
        devicetree <devicetree@...r.kernel.org>,
        "open list:GPIO SUBSYSTEM" <linux-gpio@...r.kernel.org>,
        Andrew Lunn <andrew@...n.ch>,
        Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
        kernel test robot <lkp@...el.com>
Subject: Re: [PATCH v3 4/6] mfd: Add RTL8231 core device

On Mon, May 24, 2021 at 11:23 AM Sander Vanheule <sander@...nheule.net> wrote:
> On Mon, 2021-05-24 at 11:02 +0300, Andy Shevchenko wrote:
> > On Mon, May 24, 2021 at 1:34 AM Sander Vanheule <sander@...nheule.net> wrote:

...

> > > +       usleep_range(1000, 10000);
> >
> > It's strange to see this big range of minimum and maximum sleep.
> > Usually the ratio should not be bigger than ~3-4 between the values.
>
> I could also change this from a usleep to a polling loop that checks (with a
> loop limit) if the reset bit has self-cleared already.
>
> The datasheet that I have doesn't mention how fast it should self-clear. So I
> checked, and it appears to be done after one loop iteration already. So,
> certainly faster than the current usleep.
>
> Would a polling loop (with maybe like max. 10 iterations) be a good alternative
> for you?

I guess it's the right way to go. Just check the iopoll.h for helpers.
Also regmap has regmap_read_poll_timeout().

-- 
With Best Regards,
Andy Shevchenko

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ