Re: [RFC PATCH v3 1/5] ufs: mcq: Add supporting functions for mcq abort

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 3/23/2023 3:07 AM, John Garry wrote:
On 23/03/2023 09:53, Bao D. Nguyen wrote:
+static int ufshcd_mcq_poll_register(void __iomem *reg, u32 mask,
+            u32 val, unsigned long timeout_ms)
+{
+    unsigned long timeout = jiffies + msecs_to_jiffies(timeout_ms);
+    int err = 0;
+
+    /* ignore bits that we don't intend to wait on */
+    val = val & mask;
+
+    while ((readl(reg) & mask) != val) {
+        usleep_range(10, 50);
+        if (time_after(jiffies, timeout)) {
+            err = -ETIMEDOUT;
+            break;
+        }

This looks just like readl_poll_timeout()
I will make the change in the next revision. Thanks John.

+    }
+
+    return err;
+}





[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [SCSI Target Devel]     [Linux SCSI Target Infrastructure]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Linux IIO]     [Samba]     [Device Mapper]

  Powered by Linux