Title: [4110] trunk/drivers/usb/musb: [#3778] Don't always disable PING packet.
Revision
4110
Author
cooloney
Date
2008-01-16 19:12:58 -0600 (Wed, 16 Jan 2008)

Log Message

[#3778] Don't always disable PING packet. When NAK_TIMEOUT fired, disable PING.

Diffstat

 musb_core.c |    2 ++
 musb_core.h |    3 +++
 musb_host.c |   15 +++++++++++++--
 3 files changed, 18 insertions(+), 2 deletions(-)

Modified Paths

Diff

Modified: trunk/drivers/usb/musb/musb_core.c (4109 => 4110)


--- trunk/drivers/usb/musb/musb_core.c	2008-01-16 15:30:22 UTC (rev 4109)
+++ trunk/drivers/usb/musb/musb_core.c	2008-01-17 01:12:58 UTC (rev 4110)
@@ -582,6 +582,8 @@
 		musb->is_active = 1;
 		set_bit(HCD_FLAG_SAW_IRQ, &hcd->flags);
 
+		musb->disable_ping = 0;
+
 		musb->ep0_stage = MUSB_EP0_START;
 
 #ifdef CONFIG_USB_MUSB_OTG

Modified: trunk/drivers/usb/musb/musb_core.h (4109 => 4110)


--- trunk/drivers/usb/musb/musb_core.h	2008-01-16 15:30:22 UTC (rev 4109)
+++ trunk/drivers/usb/musb/musb_core.h	2008-01-17 01:12:58 UTC (rev 4110)
@@ -402,6 +402,9 @@
 	unsigned is_multipoint:1;
 	unsigned ignore_disconnect:1;	/* during bus resets */
 
+	/* Disable PING packet to cope with ill-behaved usb thumb drives. */
+	unsigned disable_ping:1;
+
 #ifdef C_MP_TX
 	unsigned bulk_split:1;
 #define	can_bulk_split(musb,type) \

Modified: trunk/drivers/usb/musb/musb_host.c (4109 => 4110)


--- trunk/drivers/usb/musb/musb_host.c	2008-01-16 15:30:22 UTC (rev 4109)
+++ trunk/drivers/usb/musb/musb_host.c	2008-01-17 01:12:58 UTC (rev 4110)
@@ -1067,6 +1067,11 @@
 	} else if (csr & MUSB_CSR0_H_NAKTIMEOUT) {
 		DBG(2, "control NAK timeout\n");
 
+		/* For some ill-behaved USB stick, control transfer should
+		 * disable PING packet
+		 */
+		musb->disable_ping = 1;
+
 		/* NOTE:  this code path would be a good place to PAUSE a
 		 * control transfer, if another one is queued, so that
 		 * ep0 is more likely to stay busy.
@@ -1108,7 +1113,7 @@
 	if (unlikely(!urb)) {
 		/* stop endpoint since we have no place for its data, this
 		 * SHOULD NEVER HAPPEN! */
-		ERR("no URB for end 0\n");
+		DBG(1, "no URB for end 0\n");
 
 		musb_writew(epio, MUSB_CSR0, MUSB_CSR0_FLUSHFIFO);
 		musb_writew(epio, MUSB_CSR0, MUSB_CSR0_FLUSHFIFO);
@@ -1133,7 +1138,8 @@
 				csr = MUSB_CSR0_H_STATUSPKT
 					| MUSB_CSR0_TXPKTRDY;
 
-			csr |= MUSB_CSR0_H_DIS_PING;
+			if (musb->disable_ping)
+				csr |= MUSB_CSR0_H_DIS_PING;
 
 			/* flag status stage */
 			musb->ep0_stage = MUSB_EP0_STATUS;
@@ -1837,6 +1843,11 @@
 	case USB_ENDPOINT_XFER_ISOC:
 		/* iso always uses log encoding */
 		break;
+	case USB_ENDPOINT_XFER_CONTROL:
+		if (!musb->disable_ping) {
+			interval = (USB_SPEED_HIGH == urb->dev->speed) ? 8 : 0;
+			break;
+		}
 	default:
 		/* REVISIT we actually want to use NAK limits, hinting to the
 		 * transfer scheduling logic to try some other qh, e.g. try
_______________________________________________
Linux-kernel-commits mailing list
[email protected]
http://blackfin.uclinux.org/mailman/listinfo/linux-kernel-commits

Reply via email to