USB: EHCI: compute full-speed bandwidth usage correctly

Although the bandwidth statistics maintained by ehci-hcd show up only
in the /sys/kernel/debug/usb/devices file, they ought to be calculated
correctly.  The calculation for full-speed isochronous endpoints is
wrong; it mistakenly yields bytes per microframe instead of bytes per
frame.  The "interval" value, which is in frames, should not be
converted to microframes.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
Alan Stern 2013-10-11 11:28:21 -04:00 коммит произвёл Greg Kroah-Hartman
Родитель e24371a6be
Коммит 2b90f01b21
1 изменённых файлов: 1 добавлений и 1 удалений

Просмотреть файл

@ -1055,7 +1055,7 @@ iso_stream_init (
} else } else
stream->raw_mask = smask_out [hs_transfers - 1]; stream->raw_mask = smask_out [hs_transfers - 1];
bandwidth = stream->usecs + stream->c_usecs; bandwidth = stream->usecs + stream->c_usecs;
bandwidth /= interval << 3; bandwidth /= interval;
/* stream->splits gets created from raw_mask later */ /* stream->splits gets created from raw_mask later */
stream->address = cpu_to_hc32(ehci, addr); stream->address = cpu_to_hc32(ehci, addr);