Commit 03e4f4ae authored by David Brownell's avatar David Brownell Committed by Greg Kroah-Hartman

[PATCH] USB: EHCI and full-speed ISO-OUT

This is a minor update to the patch I sent out about a week ago.
The key change is to use the I/O watchdog while doing ISO streaming.
Bernd Porr reports that a VT8235 system needs that; it seems like
IDE activity can interfere with the delivery of USB IRQs.


EHCI periodic scheduling updates.

 - Initial version of full speed ISO transaction support.  This
   should handle OUT transactions, such as those for usb speakers.
   For now, it's controlled using an EXPERIMENTAL config option:

   * I've run into interesting differences in how different USB 2.0
     hub silicon (the transaction translators) handle some older
     audio devices.  Needs more investigation.

   * Interrupt transfer scheduling doesn't yet cope well with schedules
     where every slot already has activity.  For now, don't plug in
     devices like hubs, mice, or keyboards while EHCI is streaming.

 - Protect freelist for highspeed ITDs, using spinlock.  Could be
   an issue for some drivers.

 - Kick in the I/O watchdog timer (5 msec) for periodic transfers.
   In this case, IDE activity on a VT8235 lost the IRQs which should
   have kept the ISO stream active.  Queues shorter than 5 msec are
   not going to work on all USB hosts.

 - Simplified the ISO scheduler:  doesn't attempt to re-schedule
   after lossage, or to short-circuit scanning.  (Rescheduling will
   probably come back later ... for now, the "hard" error here is
   highlighting problems that need attention.)
parent 01ddaf62
...@@ -29,6 +29,15 @@ config USB_EHCI_HCD ...@@ -29,6 +29,15 @@ config USB_EHCI_HCD
To compile this driver as a module, choose M here: the To compile this driver as a module, choose M here: the
module will be called ehci-hcd. module will be called ehci-hcd.
config USB_EHCI_SPLIT_ISO
bool "Full speed ISO transactions (EXPERIMENTAL)"
depends on USB_EHCI_HCD && EXPERIMENTAL
default n
---help---
This code is new and hasn't been used with many different
EHCI or USB 2.0 transaction translator implementations.
It should work for ISO-OUT transfers, like audio.
config USB_OHCI_HCD config USB_OHCI_HCD
tristate "OHCI HCD support" tristate "OHCI HCD support"
depends on USB depends on USB
......
...@@ -579,7 +579,11 @@ show_periodic (struct class_device *class_dev, char *buf) ...@@ -579,7 +579,11 @@ show_periodic (struct class_device *class_dev, char *buf)
break; break;
case Q_TYPE_SITD: case Q_TYPE_SITD:
temp = scnprintf (next, size, temp = scnprintf (next, size,
" sitd/%p", p.sitd); " sitd%d-%04x/%p",
p.sitd->stream->interval,
le32_to_cpup (&p.sitd->hw_uframe)
& 0x0000ffff,
p.sitd);
tag = Q_NEXT_TYPE (p.sitd->hw_next); tag = Q_NEXT_TYPE (p.sitd->hw_next);
p = p.sitd->sitd_next; p = p.sitd->sitd_next;
break; break;
......
...@@ -106,8 +106,6 @@ static const char hcd_name [] = "ehci_hcd"; ...@@ -106,8 +106,6 @@ static const char hcd_name [] = "ehci_hcd";
#undef EHCI_VERBOSE_DEBUG #undef EHCI_VERBOSE_DEBUG
#undef EHCI_URB_TRACE #undef EHCI_URB_TRACE
// #define have_split_iso
#ifdef DEBUG #ifdef DEBUG
#define EHCI_STATS #define EHCI_STATS
#endif #endif
...@@ -676,6 +674,7 @@ static void ehci_work (struct ehci_hcd *ehci, struct pt_regs *regs) ...@@ -676,6 +674,7 @@ static void ehci_work (struct ehci_hcd *ehci, struct pt_regs *regs)
/* the IO watchdog guards against hardware or driver bugs that /* the IO watchdog guards against hardware or driver bugs that
* misplace IRQs, and should let us run completely without IRQs. * misplace IRQs, and should let us run completely without IRQs.
* such lossage has been observed on both VT6202 and VT8235.
*/ */
if ((ehci->async->qh_next.ptr != 0) || (ehci->periodic_sched != 0)) if ((ehci->async->qh_next.ptr != 0) || (ehci->periodic_sched != 0))
timer_action (ehci, TIMER_IO_WATCHDOG); timer_action (ehci, TIMER_IO_WATCHDOG);
...@@ -796,13 +795,8 @@ static int ehci_urb_enqueue ( ...@@ -796,13 +795,8 @@ static int ehci_urb_enqueue (
case PIPE_ISOCHRONOUS: case PIPE_ISOCHRONOUS:
if (urb->dev->speed == USB_SPEED_HIGH) if (urb->dev->speed == USB_SPEED_HIGH)
return itd_submit (ehci, urb, mem_flags); return itd_submit (ehci, urb, mem_flags);
#ifdef have_split_iso
else else
return sitd_submit (ehci, urb, mem_flags); return sitd_submit (ehci, urb, mem_flags);
#else
dbg ("no split iso support yet");
return -ENOSYS;
#endif /* have_split_iso */
} }
} }
......
This diff is collapsed.
...@@ -492,16 +492,16 @@ struct ehci_itd { ...@@ -492,16 +492,16 @@ struct ehci_itd {
/* /*
* EHCI Specification 0.95 Section 3.4 * EHCI Specification 0.95 Section 3.4
* siTD, aka split-transaction isochronous Transfer Descriptor * siTD, aka split-transaction isochronous Transfer Descriptor
* ... describe low/full speed iso xfers through TT in hubs * ... describe full speed iso xfers through TT in hubs
* see Figure 3-5 "Split-transaction Isochronous Transaction Descriptor (siTD) * see Figure 3-5 "Split-transaction Isochronous Transaction Descriptor (siTD)
*/ */
struct ehci_sitd { struct ehci_sitd {
/* first part defined by EHCI spec */ /* first part defined by EHCI spec */
u32 hw_next; u32 hw_next;
/* uses bit field macros above - see EHCI 0.95 Table 3-8 */ /* uses bit field macros above - see EHCI 0.95 Table 3-8 */
u32 hw_fullspeed_ep; /* see EHCI table 3-9 */ u32 hw_fullspeed_ep; /* EHCI table 3-9 */
u32 hw_uframe; /* see EHCI table 3-10 */ u32 hw_uframe; /* EHCI table 3-10 */
u32 hw_results; /* see EHCI table 3-11 */ u32 hw_results; /* EHCI table 3-11 */
#define SITD_IOC (1 << 31) /* interrupt on completion */ #define SITD_IOC (1 << 31) /* interrupt on completion */
#define SITD_PAGE (1 << 30) /* buffer 0/1 */ #define SITD_PAGE (1 << 30) /* buffer 0/1 */
#define SITD_LENGTH(x) (0x3ff & ((x)>>16)) #define SITD_LENGTH(x) (0x3ff & ((x)>>16))
...@@ -515,8 +515,8 @@ struct ehci_sitd { ...@@ -515,8 +515,8 @@ struct ehci_sitd {
#define SITD_ACTIVE __constant_cpu_to_le32(SITD_STS_ACTIVE) #define SITD_ACTIVE __constant_cpu_to_le32(SITD_STS_ACTIVE)
u32 hw_buf [2]; /* see EHCI table 3-12 */ u32 hw_buf [2]; /* EHCI table 3-12 */
u32 hw_backpointer; /* see EHCI table 3-13 */ u32 hw_backpointer; /* EHCI table 3-13 */
u32 hw_buf_hi [2]; /* Appendix B */ u32 hw_buf_hi [2]; /* Appendix B */
/* the rest is HCD-private */ /* the rest is HCD-private */
...@@ -552,8 +552,6 @@ struct ehci_fstn { ...@@ -552,8 +552,6 @@ struct ehci_fstn {
/*-------------------------------------------------------------------------*/ /*-------------------------------------------------------------------------*/
#define SUBMIT_URB(urb,mem_flags) usb_submit_urb(urb,mem_flags)
#ifndef DEBUG #ifndef DEBUG
#define STUB_DEBUG_FILES #define STUB_DEBUG_FILES
#endif /* DEBUG */ #endif /* DEBUG */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment