Re: [2.6.34-rc1] Problem using USB 1.1 device on USB 3.0 xhci host controller

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

 



On Mon, 2010-03-15 at 09:37 +0100, Sander Eikelenboom wrote: 
> Hello Sarah,
> 
> Attached is the syslog, tar'ed and bzip2,ed.
> (it grows rather fast with debug on :-) )
> 
> Done the same as the previous time,
> 
> - boot
> - use vgrabbj to grab a jpeg from the video device a few times.
> 

>From the syslog, the situation I can tell is that isoc TDs are
successfully inserted into transfer ring, but the xHC does not process
them correctly: all isoc TDs are returned with short packet, data is not
transferred completely. I wonder why it acts like this. Please apply the
attached patch and send the syslog. 

I verified the patchset with USB1.1 speaker and it works fine. It's a
OUT device while webcam is a IN device. I'll try webcam and see if it's
a code issue.

-- 

Thanks,
Andiry

diff --git a/drivers/usb/host/xhci-ring.c b/drivers/usb/host/xhci-ring.c
index 25f0928..db99567 100644
--- a/drivers/usb/host/xhci-ring.c
+++ b/drivers/usb/host/xhci-ring.c
@@ -1360,6 +1360,7 @@ static int handle_tx_event(struct xhci_hcd *xhci,
 		urb = td->urb;
 		urb_priv = urb->hcpriv;
 		idx = urb_priv->td_cnt;
+		status = 0;
 
 		/* handle completion code */
 		switch (trb_comp_code) {
@@ -1368,6 +1369,13 @@ static int handle_tx_event(struct xhci_hcd *xhci,
 			xhci_dbg(xhci, "Successful isoc "
 					"transfer!\n");
 			break;
+		case COMP_SHORT_TX:
+			xhci_dbg(xhci, "short transfer on isoc ep\n");
+			if (td->urb->transfer_flags & URB_SHORT_NOT_OK)
+				urb->iso_frame_desc[idx].status = -EREMOTEIO;
+			else
+				urb->iso_frame_desc[idx].status = 0;
+			break;
 		case COMP_UNDERRUN:
 			urb->iso_frame_desc[idx].status = -EREMOTEIO;
 			skip_td = 1;
@@ -2381,7 +2389,7 @@ static int xhci_queue_isoc_tx(struct xhci_hcd *xhci, gfp_t mem_flags,
 
 	if (!in_interrupt())
 		dev_dbg(&urb->dev->dev, "ep %#x - urb len = %#x (%d),"
-				" addr = %#llx, num_trbs = %d\n",
+				" addr = %#llx, num_tds = %d\n",
 				urb->ep->desc.bEndpointAddress,
 				urb->transfer_buffer_length,
 				urb->transfer_buffer_length,

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

  Powered by Linux