[U-Boot] [PATCH 14/16] usb: ohci: Skip unnecessary mdelay(1) calls in various places

Hans de Goede hdegoede at redhat.com
Tue May 5 23:56:17 CEST 2015


For some reason the ohci code is full with:

		pkt_print(...)
		mdelay(1);

AFAICT there is no reason for the mdelay(1) calls. This commit disables them
when building the ohci code for new driver-model using boards. It leaves
the mdelay(1) calls in place when building for older boards, so as to avoid
causing any regressions there.

Signed-off-by: Hans de Goede <hdegoede at redhat.com>
---
 drivers/usb/host/ohci-hcd.c | 16 +++++++++-------
 1 file changed, 9 insertions(+), 7 deletions(-)

diff --git a/drivers/usb/host/ohci-hcd.c b/drivers/usb/host/ohci-hcd.c
index dc0892f..d06d9dc 100644
--- a/drivers/usb/host/ohci-hcd.c
+++ b/drivers/usb/host/ohci-hcd.c
@@ -1256,7 +1256,7 @@ static int ohci_submit_rh_msg(ohci_t *ohci, struct usb_device *dev,
 #ifdef DEBUG
 pkt_print(ohci, NULL, dev, pipe, buffer, transfer_len,
 	  cmd, "SUB(rh)", usb_pipein(pipe));
-#else
+#elif !defined CONFIG_DM_USB
 	mdelay(1);
 #endif
 	if (usb_pipeint(pipe)) {
@@ -1441,7 +1441,7 @@ pkt_print(ohci, NULL, dev, pipe, buffer, transfer_len,
 
 #ifdef	DEBUG
 	ohci_dump_roothub(ohci, 1);
-#else
+#elif !defined CONFIG_DM_USB
 	mdelay(1);
 #endif
 
@@ -1454,7 +1454,7 @@ pkt_print(ohci, NULL, dev, pipe, buffer, transfer_len,
 #ifdef DEBUG
 	pkt_print(ohci, NULL, dev, pipe, buffer,
 		  transfer_len, cmd, "RET(rh)", 0/*usb_pipein(pipe)*/);
-#else
+#elif !defined CONFIG_DM_USB
 	mdelay(1);
 #endif
 
@@ -1487,7 +1487,7 @@ static int submit_common_msg(ohci_t *ohci, struct usb_device *dev,
 	urb->actual_length = 0;
 	pkt_print(ohci, urb, dev, pipe, buffer, transfer_len,
 		  setup, "SUB", usb_pipein(pipe));
-#else
+#elif !defined CONFIG_DM_USB
 	mdelay(1);
 #endif
 	if (!maxsize) {
@@ -1555,7 +1555,7 @@ static int submit_common_msg(ohci_t *ohci, struct usb_device *dev,
 #ifdef DEBUG
 	pkt_print(ohci, urb, dev, pipe, buffer, transfer_len,
 		  setup, "RET(ctlr)", usb_pipein(pipe));
-#else
+#elif !defined CONFIG_DM_USB
 	mdelay(1);
 #endif
 	urb_free_priv(urb);
@@ -1589,7 +1589,7 @@ static int _ohci_submit_control_msg(ohci_t *ohci, struct usb_device *dev,
 #ifdef DEBUG
 	pkt_print(ohci, NULL, dev, pipe, buffer, transfer_len,
 		  setup, "SUB", usb_pipein(pipe));
-#else
+#elif !defined CONFIG_DM_USB
 	mdelay(1);
 #endif
 	if (!maxsize) {
@@ -1786,7 +1786,7 @@ static int hc_interrupt(ohci_t *ohci)
 
 #ifdef	DEBUG
 		ohci_dump(ohci, 1);
-#else
+#elif !defined CONFIG_DM_USB
 		mdelay(1);
 #endif
 		/* FIXME: be optimistic, hope that bug won't repeat often. */
@@ -1798,7 +1798,9 @@ static int hc_interrupt(ohci_t *ohci)
 	}
 
 	if (ints & OHCI_INTR_WDH) {
+#if !defined CONFIG_DM_USB
 		mdelay(1);
+#endif
 		ohci_writel(OHCI_INTR_WDH, &regs->intrdisable);
 		(void)ohci_readl(&regs->intrdisable); /* flush */
 		stat = dl_done_list(ohci);
-- 
2.3.6



More information about the U-Boot mailing list