aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/host/sl811-hcd.c
diff options
context:
space:
mode:
authorDavid Brownell <david-b@pacbell.net>2005-09-22 03:49:07 -0400
committerLinus Torvalds <torvalds@g5.osdl.org>2005-09-22 10:58:25 -0400
commit4b2e790a4d73d729d936cc42f3b08af34f8ea5c6 (patch)
treed052c4c7d260b0eeb3e83376f7f4eb952e1cfd60 /drivers/usb/host/sl811-hcd.c
parent2ba08e825e5a666f540bff15e9977725675e8de6 (diff)
[PATCH] USB: sl811-hcd minor fixes
Three minor sl811-hcd fixes: - Elminate memory leak on one (rare) disable/shutdown path. - For periodic transfers that don't need to be scheduled, update urb->start_frame to represent the transfer phase correctly. - Report the (single) port as removable, by default. Since no drivers yet use start_frame or that part of the hub descriptor, only that leak is likely to ever matter. Signed-off-by: David Brownell <dbrownell@users.sourceforge.net> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> Signed-off-by: Linus Torvalds <torvalds@osdl.org> drivers/usb/host/sl811-hcd.c | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-)
Diffstat (limited to 'drivers/usb/host/sl811-hcd.c')
-rw-r--r--drivers/usb/host/sl811-hcd.c16
1 files changed, 14 insertions, 2 deletions
diff --git a/drivers/usb/host/sl811-hcd.c b/drivers/usb/host/sl811-hcd.c
index d2a1fd40dfcb..d42a15d10a46 100644
--- a/drivers/usb/host/sl811-hcd.c
+++ b/drivers/usb/host/sl811-hcd.c
@@ -782,6 +782,9 @@ retry:
782/* usb 1.1 says max 90% of a frame is available for periodic transfers. 782/* usb 1.1 says max 90% of a frame is available for periodic transfers.
783 * this driver doesn't promise that much since it's got to handle an 783 * this driver doesn't promise that much since it's got to handle an
784 * IRQ per packet; irq handling latencies also use up that time. 784 * IRQ per packet; irq handling latencies also use up that time.
785 *
786 * NOTE: the periodic schedule is a sparse tree, with the load for
787 * each branch minimized. see fig 3.5 in the OHCI spec for example.
785 */ 788 */
786#define MAX_PERIODIC_LOAD 500 /* out of 1000 usec */ 789#define MAX_PERIODIC_LOAD 500 /* out of 1000 usec */
787 790
@@ -843,6 +846,7 @@ static int sl811h_urb_enqueue(
843 if (!(sl811->port1 & (1 << USB_PORT_FEAT_ENABLE)) 846 if (!(sl811->port1 & (1 << USB_PORT_FEAT_ENABLE))
844 || !HC_IS_RUNNING(hcd->state)) { 847 || !HC_IS_RUNNING(hcd->state)) {
845 retval = -ENODEV; 848 retval = -ENODEV;
849 kfree(ep);
846 goto fail; 850 goto fail;
847 } 851 }
848 852
@@ -911,8 +915,16 @@ static int sl811h_urb_enqueue(
911 case PIPE_ISOCHRONOUS: 915 case PIPE_ISOCHRONOUS:
912 case PIPE_INTERRUPT: 916 case PIPE_INTERRUPT:
913 urb->interval = ep->period; 917 urb->interval = ep->period;
914 if (ep->branch < PERIODIC_SIZE) 918 if (ep->branch < PERIODIC_SIZE) {
919 /* NOTE: the phase is correct here, but the value
920 * needs offsetting by the transfer queue depth.
921 * All current drivers ignore start_frame, so this
922 * is unlikely to ever matter...
923 */
924 urb->start_frame = (sl811->frame & (PERIODIC_SIZE - 1))
925 + ep->branch;
915 break; 926 break;
927 }
916 928
917 retval = balance(sl811, ep->period, ep->load); 929 retval = balance(sl811, ep->period, ep->load);
918 if (retval < 0) 930 if (retval < 0)
@@ -1122,7 +1134,7 @@ sl811h_hub_descriptor (
1122 desc->wHubCharacteristics = (__force __u16)cpu_to_le16(temp); 1134 desc->wHubCharacteristics = (__force __u16)cpu_to_le16(temp);
1123 1135
1124 /* two bitmaps: ports removable, and legacy PortPwrCtrlMask */ 1136 /* two bitmaps: ports removable, and legacy PortPwrCtrlMask */
1125 desc->bitmap[0] = 1 << 1; 1137 desc->bitmap[0] = 0 << 1;
1126 desc->bitmap[1] = ~0; 1138 desc->bitmap[1] = ~0;
1127} 1139}
1128 1140