linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH RESEND v3 01/11] usb: early: convert to readl_poll_timeout_atomic()
@ 2020-09-10  8:21 Chunfeng Yun
  2020-09-10  8:21 ` [PATCH RESEND v3 02/11] usb: early: ehci-dbgp: " Chunfeng Yun
                   ` (10 more replies)
  0 siblings, 11 replies; 24+ messages in thread
From: Chunfeng Yun @ 2020-09-10  8:21 UTC (permalink / raw)
  To: Greg Kroah-Hartman
  Cc: Gustavo A. R. Silva, Douglas Anderson, Saurav Girepunje,
	Lee Jones, Daniel Thompson, Mathias Nyman, Jann Horn, Ben Dooks,
	Chunfeng Yun, Arnd Bergmann, Sumit Garg, Chuhong Yuan,
	linux-mediatek, Matthias Brugger, linux-arm-kernel, Felipe Balbi,
	Mathias Nyman, Jason Yan, linux-usb, linux-kernel,
	Eric W. Biederman, Lu Baolu

Use readl_poll_timeout_atomic() to simplify code

Cc: Lu Baolu <baolu.lu@linux.intel.com>
Cc: Mathias Nyman <mathias.nyman@linux.intel.com>
Signed-off-by: Chunfeng Yun <chunfeng.yun@mediatek.com>
---
v2~v3: no changes
---
 drivers/usb/early/xhci-dbc.c | 14 ++++----------
 1 file changed, 4 insertions(+), 10 deletions(-)

diff --git a/drivers/usb/early/xhci-dbc.c b/drivers/usb/early/xhci-dbc.c
index c050776..be4ecba 100644
--- a/drivers/usb/early/xhci-dbc.c
+++ b/drivers/usb/early/xhci-dbc.c
@@ -14,6 +14,7 @@
 #include <linux/pci_ids.h>
 #include <linux/memblock.h>
 #include <linux/io.h>
+#include <linux/iopoll.h>
 #include <asm/pci-direct.h>
 #include <asm/fixmap.h>
 #include <linux/bcd.h>
@@ -135,16 +136,9 @@ static int handshake(void __iomem *ptr, u32 mask, u32 done, int wait, int delay)
 {
 	u32 result;
 
-	do {
-		result = readl(ptr);
-		result &= mask;
-		if (result == done)
-			return 0;
-		udelay(delay);
-		wait -= delay;
-	} while (wait > 0);
-
-	return -ETIMEDOUT;
+	return readl_poll_timeout_atomic(ptr, result,
+					 ((result & mask) == done),
+					 delay, wait);
 }
 
 static void __init xdbc_bios_handoff(void)
-- 
1.9.1
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply related	[flat|nested] 24+ messages in thread

end of thread, other threads:[~2020-09-11 11:50 UTC | newest]

Thread overview: 24+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-09-10  8:21 [PATCH RESEND v3 01/11] usb: early: convert to readl_poll_timeout_atomic() Chunfeng Yun
2020-09-10  8:21 ` [PATCH RESEND v3 02/11] usb: early: ehci-dbgp: " Chunfeng Yun
2020-09-10  8:21 ` [PATCH RESEND v3 03/11] usb: pci-quirks: " Chunfeng Yun
2020-09-10  8:21 ` [PATCH RESEND v3 04/11] usb: xhci-rcar: " Chunfeng Yun
2020-09-10 12:56   ` Yoshihiro Shimoda
2020-09-11  2:21     ` Chunfeng Yun
2020-09-10 13:12   ` Daniel Thompson
2020-09-11  2:33     ` Chunfeng Yun
2020-09-11  3:13       ` Yoshihiro Shimoda
2020-09-11  4:12         ` Chunfeng Yun
2020-09-11  4:57           ` Yoshihiro Shimoda
2020-09-11 11:46             ` Chunfeng Yun
2020-09-11  8:34       ` Daniel Thompson
2020-09-11  9:27         ` Chunfeng Yun
2020-09-11  9:48           ` Daniel Thompson
2020-09-11  9:58             ` Yoshihiro Shimoda
2020-09-10  8:21 ` [PATCH RESEND v3 05/11] usb: oxu210hp-hcd: " Chunfeng Yun
2020-09-10  8:21 ` [PATCH RESEND v3 06/11] usb: fotg210-hcd: " Chunfeng Yun
2020-09-10  8:21 ` [PATCH RESEND v3 07/11] usb: isp1760-hcd: " Chunfeng Yun
2020-09-10  8:21 ` [PATCH RESEND v3 08/11] usb: phy-ulpi-viewport: " Chunfeng Yun
2020-09-10  8:21 ` [PATCH RESEND v3 09/11] usb: phy: phy-mv-usb: " Chunfeng Yun
2020-09-10  8:21 ` [PATCH RESEND v3 10/11] usb: udc: net2280: " Chunfeng Yun
2020-09-10  8:21 ` [PATCH RESEND v3 11/11] iopoll: update kerneldoc of read_poll_timeout_atomic() Chunfeng Yun
2020-09-10 10:49 ` [PATCH RESEND v3 01/11] usb: early: convert to readl_poll_timeout_atomic() Jann Horn

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).