diff options
author | Alan Stern <stern@rowland.harvard.edu> | 2012-07-11 17:22:39 +0200 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2012-07-17 01:54:26 +0200 |
commit | 8c5bf7be56f1a8aecc1f802f132d53f556a9bc45 (patch) | |
tree | d3b22a284f3f81b804bf9898928f866cfb8a45cd /drivers/usb/host/ehci-hcd.c | |
parent | USB: EHCI: use hrtimer for (s)iTD deallocation (diff) | |
download | linux-8c5bf7be56f1a8aecc1f802f132d53f556a9bc45.tar.xz linux-8c5bf7be56f1a8aecc1f802f132d53f556a9bc45.zip |
USB: EHCI: don't refcount iso_stream structures
This patch (as1580) makes ehci_iso_stream structures behave more like
QHs, in that they will remain allocated until their isochronous
endpoint is disabled. This will come in useful in the future, when
periodic bandwidth gets allocated as an altsetting is installed rather
than on-the-fly.
For now, the change to the ehci_iso_stream lifetimes means that each
structure is always deallocated at exactly one spot in
ehci_endpoint_disable() and never used again. As a result, it is no
longer necessary to use reference counting on these things, and the
patch removes it.
Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/usb/host/ehci-hcd.c')
-rw-r--r-- | drivers/usb/host/ehci-hcd.c | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/drivers/usb/host/ehci-hcd.c b/drivers/usb/host/ehci-hcd.c index 98b945840c9e..fb1966cf5649 100644 --- a/drivers/usb/host/ehci-hcd.c +++ b/drivers/usb/host/ehci-hcd.c @@ -1085,8 +1085,14 @@ rescan: * accelerate iso completions ... so spin a while. */ if (qh->hw == NULL) { - ehci_vdbg (ehci, "iso delay\n"); - goto idle_timeout; + struct ehci_iso_stream *stream = ep->hcpriv; + + if (!list_empty(&stream->td_list)) + goto idle_timeout; + + /* BUG_ON(!list_empty(&stream->free_list)); */ + kfree(stream); + goto done; } if (ehci->rh_state < EHCI_RH_RUNNING) @@ -1127,8 +1133,8 @@ idle_timeout: list_empty (&qh->qtd_list) ? "" : "(has tds)"); break; } + done: ep->hcpriv = NULL; -done: spin_unlock_irqrestore (&ehci->lock, flags); } |