Re: USB warning on cdc-acm device close

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

 



On Wed, 29 Jul 2009, Manuel Lauss wrote:

> Okay, I changed this to return immediately in "case TIMER_IO_WATCHDOG:"

Good.

> I did the test as you asked, but disconnecting the device proved a bit
> difficult since it doesn't have a physical connector (it's soldered on).

Sorry, my mistake.  I forgot that closing the device was enough to 
trigger the error.

> The "async" debug file is empty in all cases: after detection of the device,
> after closing minicom, even after disconnecting it from the bus; removing
> ehci-hcd still produces the dma pool busy messages.

I think I figured out the problem.  The patch below (which includes the 
previous patch) should fix it.  Let me know how it works.

> khubd is waiting for something at drivers/usb/core/hub.c:3273

That is where khubd is normally supposed to wait, and it means my guess 
about being stuck was wrong.  However the new patch may solve this 
problem as well.

If it doesn't, can you provide both the dmesg log and a usbmon log
(with the new patch) showing what happens when you reload ehci-hcd and
the CDC-ACM device is detected but fails to work?

Matthijs and Valdis, please just try this new patch in place of the old 
one and see if those "dma_pool_destroy" error messages are still 
present when you unload ehci-hcd.

Alan Stern



Index: 2.6.31-rc4/drivers/usb/host/ehci-hcd.c
===================================================================
--- 2.6.31-rc4.orig/drivers/usb/host/ehci-hcd.c
+++ 2.6.31-rc4/drivers/usb/host/ehci-hcd.c
@@ -903,7 +903,8 @@ static int ehci_urb_dequeue(struct usb_h
 			/* already started */
 			break;
 		case QH_STATE_IDLE:
-			WARN_ON(1);
+			/* QH might be waiting for a Clear-TT-Buffer */
+			qh_completions(ehci, qh);
 			break;
 		}
 		break;
Index: 2.6.31-rc4/drivers/usb/host/ehci-q.c
===================================================================
--- 2.6.31-rc4.orig/drivers/usb/host/ehci-q.c
+++ 2.6.31-rc4/drivers/usb/host/ehci-q.c
@@ -940,6 +940,7 @@ static void qh_link_async (struct ehci_h
 	head->qh_next.qh = qh;
 	head->hw_next = dma;
 
+	qh_get(qh);
 	qh->xacterrs = QH_XACTERR_MAX;
 	qh->qh_state = QH_STATE_LINKED;
 	/* qtd completions reported later by interrupt */
@@ -1080,7 +1081,7 @@ submit_async (
 	 * the HC and TT handle it when the TT has a buffer ready.
 	 */
 	if (likely (qh->qh_state == QH_STATE_IDLE))
-		qh_link_async (ehci, qh_get (qh));
+		qh_link_async(ehci, qh);
  done:
 	spin_unlock_irqrestore (&ehci->lock, flags);
 	if (unlikely (qh == NULL))
@@ -1115,8 +1116,6 @@ static void end_unlink_async (struct ehc
 			&& HC_IS_RUNNING (ehci_to_hcd(ehci)->state))
 		qh_link_async (ehci, qh);
 	else {
-		qh_put (qh);		// refcount from async list
-
 		/* it's not free to turn the async schedule on/off; leave it
 		 * active but idle for a while once it empties.
 		 */
@@ -1124,6 +1123,7 @@ static void end_unlink_async (struct ehc
 				&& ehci->async->qh_next.qh == NULL)
 			timer_action (ehci, TIMER_ASYNC_OFF);
 	}
+	qh_put(qh);			/* refcount from async list */
 
 	if (next) {
 		ehci->reclaim = NULL;

--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux