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, 30 Aug 2021 15:55:40 +0300
From:   Andy Shevchenko <andy.shevchenko@...il.com>
To:     Jonas Dreßler <verdre@...d.nl>
Cc:     Amitkumar Karwar <amitkarwar@...il.com>,
        Ganapathi Bhat <ganapathi017@...il.com>,
        Xinming Hu <huxinming820@...il.com>,
        Kalle Valo <kvalo@...eaurora.org>,
        "David S. Miller" <davem@...emloft.net>,
        Jakub Kicinski <kuba@...nel.org>,
        Tsuchiya Yuto <kitakar@...il.com>,
        "open list:TI WILINK WIRELES..." <linux-wireless@...r.kernel.org>,
        netdev <netdev@...r.kernel.org>,
        Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
        linux-pci <linux-pci@...r.kernel.org>,
        Maximilian Luz <luzmaximilian@...il.com>,
        Andy Shevchenko <andriy.shevchenko@...ux.intel.com>,
        Bjorn Helgaas <bhelgaas@...gle.com>,
        Pali Rohár <pali@...nel.org>
Subject: Re: [PATCH 2/2] mwifiex: Try waking the firmware until we get an interrupt

On Mon, Aug 30, 2021 at 3:51 PM Andy Shevchenko
<andy.shevchenko@...il.com> wrote:
> On Mon, Aug 30, 2021 at 3:39 PM Jonas Dreßler <verdre@...d.nl> wrote:

...

> > +       do {
> > +               if (mwifiex_write_reg(adapter, reg->fw_status, FIRMWARE_READY_PCIE)) {
> > +                       mwifiex_dbg(adapter, ERROR,
> > +                                   "Writing fw_status register failed\n");

> > +                       return -1;

Please, use proper code. -EIO or so.

> > +               }
> > +
> > +               n_tries++;
> > +
> > +               if (n_tries <= 15)
> > +                       usleep_range(400, 700);
> > +               else
> > +                       msleep(10);
> > +       } while (n_tries <= 50 && READ_ONCE(adapter->int_status) == 0);

Can you use definitions for 15 and 50?

> NIH read_poll_timeout() from iopoll.h.

On the second thought it might be not optimal to use it (requires
anyway an additional function and doesn't provide an abortion on
error). Just see above.

-- 
With Best Regards,
Andy Shevchenko

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ