On 2/21/24 07:25, Sumit Garg wrote:

[...]

+static int wait_link_up(struct pcie_dw_imx8 *priv)
+{
+     unsigned long timeout;
+
+     timeout = get_timer(0) + PCIE_LINK_UP_TIMEOUT_MS;

wait_for_bit() or read_poll_timeout()

They won't appropriately fit here as I would like to add delay in
between consecutive polls too...


+     while (!is_link_up(priv)) {
+             if (get_timer(0) > timeout)
+                     return 0;
+             mdelay(10);

...here.

include/linux/iopoll.h:#define read_poll_timeout(op, val, cond, sleep_us, timeout_us, args...) \

That's the "sleep_us" , is it not ?

+     };
+
+     return 1;

return -ETIMEDOUT ?

Here 0 represents timeout and 1 represents success condition.

0 generally represents success, non-zero error, please fix.

[...]

Reply via email to