usb bug fixes
Subsystems (2)
cover usb bug fixes
This series contains two usb related bug fixes, one regarding the power cycling of hub ports, and the other- a memory leak in ehci-hcd.
Nikita Kiryanov (2):
usb_hub: fix power cycling logic
ehci-hcd: fix memory leak in lowlevel init
common/usb_hub.c | 4 ++-- drivers/usb/host/ehci-hcd.c | 4 +++- 2 files changed, 5 insertions(+), 3 deletions(-)
Signature · 1 line
1.8.1.2
PATCH 1/2 usb_hub: fix power cycling logic
When power cycling the hub ports, a misbehaving port will prevent all ports from being powered on because we quit at the first sign of trouble.
Skip problematic ports instead of failing the entire power on.
--- common/usb_hub.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
common/usb_hub.c +2 -2
@@ -110,7 +110,7 @@ static void usb_hub_power_on(struct usb_hub_device *hub) ret =usb_get_port_status (dev, i +1 , portsts);if (ret <0 ) {debug ("port %d: get_port_status failed\n" , i +1 ); -return ; +continue ; }/*
@@ -125,7 +125,7 @@ static void usb_hub_power_on(struct usb_hub_device *hub) portstatus =le16_to_cpu (portsts->wPortStatus);if (portstatus & (USB_PORT_STAT_POWER <<1 )) {debug ("port %d: Port power change failed\n" , i +1 ); -return ; +continue ; } }
Signature · 1 line
1.8.1.2
PATCH 2/2 ehci-hcd: fix memory leak in lowlevel init
In reply to Nikita Kiryanovusb_lowlevel_init() allocates a new periodic_list each time it is invoked, without freeing the original list. Since it is initialized later on in the code, just reuse the first-allocated list in future invocations of usb_lowlevel_init.
--- drivers/usb/host/ehci-hcd.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/usb/host/ehci-hcd.c +3 -1
@@ -954,7 +954,9 @@ int usb_lowlevel_init(int index, void **controller)* Split Transactions will be spread across microframes using * S-mask and C-mask. */ - ehcic[index].periodic_list =memalign (4096 ,1024 *4 ); +if (ehcic[index].periodic_list ==NULL ) + ehcic[index].periodic_list =memalign (4096 ,1024 *4 ); +if (!ehcic[index].periodic_list)return -ENOMEM ;for (i =0 ; i <1024 ; i++) {
Signature · 1 line
1.8.1.2
Marek Vasut
Appliedcover usb bug fixes
In reply to Nikita KiryanovDear Nikita Kiryanov,
Quoted 6 lines
This series contains two usb related bug fixes, one regarding the power cycling of hub ports, and the other- a memory leak in ehci-hcd.
Cc Marek Vasut <[email protected]>Cc Igor Grinberg <[email protected]>
Quoted 7 lines
Nikita Kiryanov (2):
usb_hub: fix power cycling logic
ehci-hcd: fix memory leak in lowlevel initcommon/usb_hub.c | 4 ++-- drivers/usb/host/ehci-hcd.c | 4 +++- 2 files changed, 5 insertions(+), 3 deletions(-)
Applied both, thanks!
Best regards,
Marek Vasut