Commit c401e7b4a808d50ab53ef45cb8d0b99b238bf2c9

Authored by Alan Stern
Committed by Greg Kroah-Hartman
1 parent 6d89252a99

USB: EHCI: adjust error return code

The USB stack uses error code -ENOSPC to indicate that the periodic
schedule is too full, with insufficient bandwidth to accommodate a new
allocation.  It uses -EFBIG to indicate that an isochronous transfer
could not be linked into the schedule because it would exceed the
number of isochronous packets the host controller driver can handle
(generally because the new transfer would extend too far into the
future).

ehci-hcd uses the wrong error code at one point.  This patch fixes it,
along with a misleading comment and debugging message.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

Showing 1 changed file with 3 additions and 3 deletions Side-by-side Diff

drivers/usb/host/ehci-sched.c
... ... @@ -1604,11 +1604,11 @@
1604 1604 */
1605 1605 now2 = (now - base) & (mod - 1);
1606 1606  
1607   - /* Is the schedule already full? */
  1607 + /* Is the schedule about to wrap around? */
1608 1608 if (unlikely(!empty && start < period)) {
1609   - ehci_dbg(ehci, "iso sched full %p (%u-%u < %u mod %u)\n",
  1609 + ehci_dbg(ehci, "request %p would overflow (%u-%u < %u mod %u)\n",
1610 1610 urb, stream->next_uframe, base, period, mod);
1611   - status = -ENOSPC;
  1611 + status = -EFBIG;
1612 1612 goto fail;
1613 1613 }
1614 1614