All of lore.kernel.org
 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
  0 siblings, 0 replies; 72+ messages in thread
From: Chunfeng Yun @ 2020-09-10  8:21 UTC (permalink / raw)
  To: Greg Kroah-Hartman
  Cc: Mathias Nyman, Felipe Balbi, Matthias Brugger, Douglas Anderson,
	Chunfeng Yun, Daniel Thompson, Eric W. Biederman, Lee Jones,
	Sumit Garg, Jann Horn, Arnd Bergmann, Jason Yan, Chuhong Yuan,
	Gustavo A. R. Silva, Ben Dooks, Saurav Girepunje, linux-usb,
	linux-kernel, linux-arm-kernel, linux-mediatek, Lu Baolu,
	Mathias Nyman

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

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

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

Thread overview: 72+ 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 ` Chunfeng Yun
2020-09-10  8:21 ` Chunfeng Yun
2020-09-10  8:21 ` [PATCH RESEND v3 02/11] usb: early: ehci-dbgp: " Chunfeng Yun
2020-09-10  8:21   ` Chunfeng Yun
2020-09-10  8:21   ` Chunfeng Yun
2020-09-10  8:21 ` [PATCH RESEND v3 03/11] usb: pci-quirks: " Chunfeng Yun
2020-09-10  8:21   ` Chunfeng Yun
2020-09-10  8:21   ` Chunfeng Yun
2020-09-10  8:21 ` [PATCH RESEND v3 04/11] usb: xhci-rcar: " Chunfeng Yun
2020-09-10  8:21   ` Chunfeng Yun
2020-09-10  8:21   ` Chunfeng Yun
2020-09-10 12:56   ` Yoshihiro Shimoda
2020-09-10 12:56     ` Yoshihiro Shimoda
2020-09-10 12:56     ` Yoshihiro Shimoda
2020-09-11  2:21     ` Chunfeng Yun
2020-09-11  2:21       ` Chunfeng Yun
2020-09-11  2:21       ` Chunfeng Yun
2020-09-10 13:12   ` Daniel Thompson
2020-09-10 13:12     ` Daniel Thompson
2020-09-10 13:12     ` Daniel Thompson
2020-09-11  2:33     ` Chunfeng Yun
2020-09-11  2:33       ` Chunfeng Yun
2020-09-11  2:33       ` Chunfeng Yun
2020-09-11  3:13       ` Yoshihiro Shimoda
2020-09-11  3:13         ` Yoshihiro Shimoda
2020-09-11  3:13         ` Yoshihiro Shimoda
2020-09-11  4:12         ` Chunfeng Yun
2020-09-11  4:12           ` Chunfeng Yun
2020-09-11  4:12           ` Chunfeng Yun
2020-09-11  4:57           ` Yoshihiro Shimoda
2020-09-11  4:57             ` Yoshihiro Shimoda
2020-09-11  4:57             ` Yoshihiro Shimoda
2020-09-11 11:46             ` Chunfeng Yun
2020-09-11 11:46               ` Chunfeng Yun
2020-09-11 11:46               ` Chunfeng Yun
2020-09-11  8:34       ` Daniel Thompson
2020-09-11  8:34         ` Daniel Thompson
2020-09-11  8:34         ` Daniel Thompson
2020-09-11  9:27         ` Chunfeng Yun
2020-09-11  9:27           ` Chunfeng Yun
2020-09-11  9:27           ` Chunfeng Yun
2020-09-11  9:48           ` Daniel Thompson
2020-09-11  9:48             ` Daniel Thompson
2020-09-11  9:48             ` Daniel Thompson
2020-09-11  9:58             ` Yoshihiro Shimoda
2020-09-11  9:58               ` Yoshihiro Shimoda
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   ` Chunfeng Yun
2020-09-10  8:21   ` Chunfeng Yun
2020-09-10  8:21 ` [PATCH RESEND v3 06/11] usb: fotg210-hcd: " Chunfeng Yun
2020-09-10  8:21   ` Chunfeng Yun
2020-09-10  8:21   ` Chunfeng Yun
2020-09-10  8:21 ` [PATCH RESEND v3 07/11] usb: isp1760-hcd: " Chunfeng Yun
2020-09-10  8:21   ` Chunfeng Yun
2020-09-10  8:21   ` Chunfeng Yun
2020-09-10  8:21 ` [PATCH RESEND v3 08/11] usb: phy-ulpi-viewport: " Chunfeng Yun
2020-09-10  8:21   ` Chunfeng Yun
2020-09-10  8:21   ` Chunfeng Yun
2020-09-10  8:21 ` [PATCH RESEND v3 09/11] usb: phy: phy-mv-usb: " Chunfeng Yun
2020-09-10  8:21   ` Chunfeng Yun
2020-09-10  8:21   ` Chunfeng Yun
2020-09-10  8:21 ` [PATCH RESEND v3 10/11] usb: udc: net2280: " Chunfeng Yun
2020-09-10  8:21   ` Chunfeng Yun
2020-09-10  8:21   ` 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  8:21   ` Chunfeng Yun
2020-09-10  8:21   ` Chunfeng Yun
2020-09-10 10:49 ` [PATCH RESEND v3 01/11] usb: early: convert to readl_poll_timeout_atomic() Jann Horn
2020-09-10 10:49   ` Jann Horn
2020-09-10 10:49   ` Jann Horn

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.