ChangeSet 1.2181.4.73, 2005/03/24 15:31:46-08:00, [EMAIL PROTECTED]
[PATCH] USB: ehci split ISO fixes (full speed audio etc)
This contains patches to the EHCI driver for the full speed isochronous
transfer support:
- The sitd->hw_buf[1] and sitd->hw_buf_hi[1] fields were not
correctly initialized, affecting transfers which crossed 4K
boundaries. Helps resolve some "buzz" in audio playback.
- Correctly rounds 188-byte OUT transfers to fit into a single
packet ... no split transfers needed. Resolves other "buzz" in
audio OUT streams.
- Fixes a cut'n'paste error in the logic to check for microframe
scheduling collisions with a given transaction translator.
The error caused full speed iso tds to be treated in part as
if they were high speed iso tds, which could oops.
- The split transaction state flag doesn't indicate an error, and
it should be ignored when deciding if (IN) transfers had errors.
- Remove some code rejecting full speed iso IN transfers; it's
not fully working yet though.
Plus a some minor cleanups: reporting the iso start frame in the
relevant units, making a debug message more consistent.
Signed-off-by: Karsten Wiese <[EMAIL PROTECTED]>
Signed-off-by: David Brownell <[EMAIL PROTECTED]>
Signed-off-by: Greg Kroah-Hartman <[EMAIL PROTECTED]>
ehci-sched.c | 31 +++++++++++++------------------
ehci.h | 2 +-
2 files changed, 14 insertions(+), 19 deletions(-)
diff -Nru a/drivers/usb/host/ehci-sched.c b/drivers/usb/host/ehci-sched.c
--- a/drivers/usb/host/ehci-sched.c 2005-03-30 15:19:39 -08:00
+++ b/drivers/usb/host/ehci-sched.c 2005-03-30 15:19:39 -08:00
@@ -208,7 +208,7 @@
here = here.qh->qh_next;
continue;
case Q_TYPE_SITD:
- if (same_tt (dev, here.itd->urb->dev)) {
+ if (same_tt (dev, here.sitd->urb->dev)) {
u16 mask;
mask = le32_to_cpu (here.sitd
@@ -218,7 +218,7 @@
if (mask & uf_mask)
break;
}
- type = Q_NEXT_TYPE (here.qh->hw_next);
+ type = Q_NEXT_TYPE (here.sitd->hw_next);
here = here.sitd->sitd_next;
continue;
// case Q_TYPE_FSTN:
@@ -1180,7 +1180,10 @@
return status;
ready:
+ /* report high speed start in uframes; full speed, in frames */
urb->start_frame = stream->next_uframe;
+ if (!stream->highspeed)
+ urb->start_frame >>= 3;
return 0;
}
@@ -1504,18 +1507,17 @@
/* might need to cross a buffer page within a td */
packet->bufp = buf;
- buf += length;
- packet->buf1 = buf & ~0x0fff;
+ packet->buf1 = (buf + length) & ~0x0fff;
if (packet->buf1 != (buf & ~(u64)0x0fff))
packet->cross = 1;
/* OUT uses multiple start-splits */
if (stream->bEndpointAddress & USB_DIR_IN)
continue;
- length = 1 + (length / 188);
- packet->buf1 |= length;
+ length = (length + 187) / 188;
if (length > 1) /* BEGIN vs ALL */
- packet->buf1 |= 1 << 3;
+ length |= 1 << 3;
+ packet->buf1 |= length;
}
}
@@ -1610,10 +1612,9 @@
sitd->hw_buf_hi [0] = cpu_to_le32 (bufp >> 32);
sitd->hw_buf [1] = cpu_to_le32 (uf->buf1);
- if (uf->cross) {
+ if (uf->cross)
bufp += 4096;
- sitd->hw_buf_hi [1] = cpu_to_le32 (bufp >> 32);
- }
+ sitd->hw_buf_hi [1] = cpu_to_le32 (bufp >> 32);
sitd->index = index;
}
@@ -1650,7 +1651,7 @@
ehci_to_hcd(ehci)->self.bandwidth_allocated
+= stream->bandwidth;
ehci_vdbg (ehci,
- "sched dev%s ep%d%s-iso [%d] %dms/%04x\n",
+ "sched devp %s ep%d%s-iso [%d] %dms/%04x\n",
urb->dev->devpath, stream->bEndpointAddress & 0x0f,
(stream->bEndpointAddress & USB_DIR_IN) ? "in" : "out",
(next_uframe >> 3) % ehci->periodic_size,
@@ -1697,7 +1698,7 @@
/*-------------------------------------------------------------------------*/
#define SITD_ERRS (SITD_STS_ERR | SITD_STS_DBE | SITD_STS_BABBLE \
- | SITD_STS_XACT | SITD_STS_MMF | SITD_STS_STS)
+ | SITD_STS_XACT | SITD_STS_MMF)
static unsigned
sitd_complete (
@@ -1779,12 +1780,6 @@
int status = -EINVAL;
unsigned long flags;
struct ehci_iso_stream *stream;
-
- // FIXME remove when csplits behave
- if (usb_pipein(urb->pipe)) {
- ehci_dbg (ehci, "no iso-IN split transactions yet\n");
- return -ENOMEM;
- }
/* Get iso_stream head */
stream = iso_stream_find (ehci, urb);
diff -Nru a/drivers/usb/host/ehci.h b/drivers/usb/host/ehci.h
--- a/drivers/usb/host/ehci.h 2005-03-30 15:19:39 -08:00
+++ b/drivers/usb/host/ehci.h 2005-03-30 15:19:39 -08:00
@@ -430,7 +430,7 @@
__le32 transaction; /* itd->hw_transaction[i] |= */
u8 cross; /* buf crosses pages */
/* for full speed OUT splits */
- u16 buf1;
+ u32 buf1;
};
/* temporary schedule data for packets from iso urbs (both speeds)
-
To unsubscribe from this list: send the line "unsubscribe bk-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at http://vger.kernel.org/majordomo-info.html