Thread (32 messages) flat view 32 messages, 7 authors, 2021-09-30

Re: [PATCH 2/2] mwifiex: Try waking the firmware until we get an interrupt

From: Andy Shevchenko <hidden>
Date: 2021-08-30 12:56:24
Also in: linux-pci, linux-wireless, lkml

On Mon, Aug 30, 2021 at 3:51 PM Andy Shevchenko
[off-list ref] wrote:
On Mon, Aug 30, 2021 at 3:39 PM Jonas Dreßler [off-list ref] wrote:
...
quoted
+       do {
+               if (mwifiex_write_reg(adapter, reg->fw_status, FIRMWARE_READY_PCIE)) {
+                       mwifiex_dbg(adapter, ERROR,
+                                   "Writing fw_status register failed\n");
quoted
+                       return -1;
Please, use proper code. -EIO or so.
quoted
+               }
+
+               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
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help