Linux Media Controller development
 help / color / mirror / Atom feed
From: Andy Walls <awalls@md.metrocast.net>
To: Sarah Sharp <sarah.a.sharp@linux.intel.com>,
	Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Cc: linux-media@vger.kernel.org, linux-usb@vger.kernel.org,
	Andiry Xu <andiry.xu@amd.com>
Subject: Re: uvcvideo failure under xHCI
Date: Thu, 16 Jun 2011 05:22:19 -0400	[thread overview]
Message-ID: <32b20f69-8be0-408b-a2f9-bf262af2b457@email.android.com> (raw)
In-Reply-To: <20110616013957.GA9809@xanatos>

Sarah Sharp <sarah.a.sharp@linux.intel.com> wrote:

>Hi Laurent,
>
>I think this issue has been happening for a while now, but my recent
>patches to remove most of the xHCI debugging


have finally allowed me to
>use a webcam under xHCI with debugging on.  Unfortunately, it doesn't
>work very well.
>
>When I plug in a webcam under an xHCI host controller in 3.0-rc3+
>(basically top of Greg's usb-linus branch) with xHCI debugging turned
>on, the host controller occasionally cannot keep up with the
>isochronous
>transfers, and it tells the xHCI driver that it had to "skip" several
>microframes of transfers.  These "Missed Service Intervals" aren't
>supposed to be fatal errors, just an indication that something was
>hogging the PCI memory bandwidth.
>
>The xHCI driver then sets the URB's status to -EXDEV, to indicate that
>some of the iso_frame_desc transferred, and sets at least one frame's
>status to -EXDEV:
>
>static int skip_isoc_td(struct xhci_hcd *xhci, struct xhci_td *td,
>                        struct xhci_transfer_event *event,
>                        struct xhci_virt_ep *ep, int *status)
>{
>        struct xhci_ring *ep_ring;
>        struct urb_priv *urb_priv;
>        struct usb_iso_packet_descriptor *frame;
>        int idx;
>
>   ep_ring = xhci_dma_to_transfer_ring(ep, le64_to_cpu(event->buffer));
>        urb_priv = td->urb->hcpriv;
>        idx = urb_priv->td_cnt; 
>        frame = &td->urb->iso_frame_desc[idx];
>        
>        /* The transfer is partly done */
>        *status = -EXDEV;
>        frame->status = -EXDEV;
>        
>        /* calc actual length */
>        frame->actual_length = 0;
>        
>        /* Update ring dequeue pointer */
>        while (ep_ring->dequeue != td->last_trb)
>                inc_deq(xhci, ep_ring, false);
>        inc_deq(xhci, ep_ring, false);
>        
>        return finish_td(xhci, td, NULL, event, ep, status, true);
>}
>
>The urb->status causes uvcvideo code in
>uvc_status.c:uvc_status_complete() to
>fail with the message:
>
>Jun 15 17:37:11 talon kernel: [  117.987769] uvcvideo: Non-zero status
>(-18) in video completion handler.
>
>It doesn't resubmit the isochronous URB in that case, and the userspace
>video freezes.  If I restart the application, the video comes back
>until
>the next Missed Service Interval event from the xHCI driver.  Ideally,
>the video driver would just resubmit the URB, and the xHCI host
>controller would complete transfers as best it can.  I think the frames
>with -EXDEV status should be treated like short transfers.
>
>I've grepped through drivers/media/video, and it seems like none of the
>drivers handle the -EXDEV status.  What should the xHCI driver be
>setting the URB's status and frame status to when the xHCI host
>controller skips over transfers?  -EREMOTEIO?
>
>Or does it need to set the URB's status to zero, but only set the
>individual frame status to -EXDEV?
>
>Sarah Sharp
>--
>To unsubscribe from this list: send the line "unsubscribe linux-media"
>in
>the body of a message to majordomo@vger.kernel.org
>More majordomo info at  http://vger.kernel.org/majordomo-info.html

Video drivers don't handle EXDEV probably because it is an error code about filesystem links:

http://pubs.opengroup.org/onlinepubs/009695399/functions/xsh_chap02_03.html#tag_02_03


Regards,
Andy

      parent reply	other threads:[~2011-06-16  9:22 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-06-16  1:39 uvcvideo failure under xHCI Sarah Sharp
2011-06-16  2:59 ` Sarah Sharp
2011-06-16  8:07   ` Laurent Pinchart
2011-06-16 14:35     ` Alan Stern
2011-06-16 17:17       ` Sarah Sharp
2011-06-16 17:39         ` Alan Stern
2011-06-16 19:06           ` Sarah Sharp
2011-06-16 19:39             ` Alan Stern
2011-06-16 19:58               ` Sarah Sharp
2011-06-16 20:20                 ` Alan Stern
2011-06-17  8:18                   ` Laurent Pinchart
2011-06-17 16:46                     ` Sarah Sharp
2011-06-17 17:01                       ` Laurent Pinchart
2011-06-17 18:19                         ` Sarah Sharp
2011-06-18 11:21                           ` Laurent Pinchart
2011-06-16  9:22 ` Andy Walls [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=32b20f69-8be0-408b-a2f9-bf262af2b457@email.android.com \
    --to=awalls@md.metrocast.net \
    --cc=andiry.xu@amd.com \
    --cc=laurent.pinchart@ideasonboard.com \
    --cc=linux-media@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=sarah.a.sharp@linux.intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox