Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 469d0229 authored by Clemens Ladisch's avatar Clemens Ladisch Committed by Greg Kroah-Hartman
Browse files

[PATCH] USB: EHCI full speed ISO bugfixes



This patch replaces the split ISO raw_mask calculation code in the
iso_stream_init() function that computed incorrect numbers of high
speed transactions for both input and output transfers.

In the output case, it added a superfluous start-split transaction for
all maxmimum packet sizes that are a multiple of 188.

In the input case, it forgot to add complete-split transactions for all
microframes covered by the full speed transaction, and the additional
complete-split transaction needed for the case when full speed data
starts arriving near the end of a microframe.

These changes don't affect the lack of full speed bandwidth, but at
least it removes the MMF errors that the HC raised with some input
streams.

Signed-off-by: default avatarClemens Ladisch <clemens@ladisch.de>
Signed-off-by: default avatarDavid Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent f8aeb3bb
Loading
Loading
Loading
Loading
+6 −5
Original line number Original line Diff line number Diff line
@@ -707,6 +707,7 @@ iso_stream_init (
	} else {
	} else {
		u32		addr;
		u32		addr;
		int		think_time;
		int		think_time;
		int		hs_transfers;


		addr = dev->ttport << 24;
		addr = dev->ttport << 24;
		if (!ehci_is_TDI(ehci)
		if (!ehci_is_TDI(ehci)
@@ -719,6 +720,7 @@ iso_stream_init (
		think_time = dev->tt ? dev->tt->think_time : 0;
		think_time = dev->tt ? dev->tt->think_time : 0;
		stream->tt_usecs = NS_TO_US (think_time + usb_calc_bus_time (
		stream->tt_usecs = NS_TO_US (think_time + usb_calc_bus_time (
				dev->speed, is_input, 1, maxp));
				dev->speed, is_input, 1, maxp));
		hs_transfers = max (1u, (maxp + 187) / 188);
		if (is_input) {
		if (is_input) {
			u32	tmp;
			u32	tmp;


@@ -727,12 +729,11 @@ iso_stream_init (
			stream->usecs = HS_USECS_ISO (1);
			stream->usecs = HS_USECS_ISO (1);
			stream->raw_mask = 1;
			stream->raw_mask = 1;


			/* pessimistic c-mask */
			/* c-mask as specified in USB 2.0 11.18.4 3.c */
			tmp = usb_calc_bus_time (USB_SPEED_FULL, 1, 0, maxp)
			tmp = (1 << (hs_transfers + 2)) - 1;
					/ (125 * 1000);
			stream->raw_mask |= tmp << (8 + 2);
			stream->raw_mask |= 3 << (tmp + 9);
		} else
		} else
			stream->raw_mask = smask_out [maxp / 188];
			stream->raw_mask = smask_out [hs_transfers - 1];
		bandwidth = stream->usecs + stream->c_usecs;
		bandwidth = stream->usecs + stream->c_usecs;
		bandwidth /= 1 << (interval + 2);
		bandwidth /= 1 << (interval + 2);