Skip to contentSkip to conversation

Patch "usbip: fix usbip attach to find a port that matches the requested speed" has been added to the 4.14-stable tree

PATCH [email protected] 1 participant 1 message Dec 6, 2017

Subsystems (2)
lore
Share & tools
lore

[email protected]

author maintainer Applied
#0 lore raw

This is a note to let you know that I've just added the patch titled

usbip: fix usbip attach to find a port that matches the requested speed

to the 4.14-stable tree which can be found at:
http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
usbip-fix-usbip-attach-to-find-a-port-that-matches-the-requested-speed.patch
and it can be found in the queue-4.14 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree, please let <[email protected]> know about it.

Quoted 1 line

From 1ac7c8a78be85f84b019d3d2742d1a9f07255cc5 Mon Sep 17 00:00:00 2001

From: Shuah Khan <[email protected]>
Date: Wed, 29 Nov 2017 15:24:22 -0700
Subject: usbip: fix usbip attach to find a port that matches the requested speed

From: Shuah Khan <[email protected]>

commit 1ac7c8a78be85f84b019d3d2742d1a9f07255cc5 upstream.

usbip attach fails to find a free port when the device on the first port is a USB_SPEED_SUPER device and non-super speed device is being attached. It keeps checking the first port and returns without a match getting stuck in a loop.

Fix it check to find the first port with matching speed.

---
 tools/usb/usbip/libsrc/vhci_driver.c |   14 +++++++++++---
 1 file changed, 11 insertions(+), 3 deletions(-)
tools/usb/usbip/libsrc/vhci_driver.c +11 -3
@@ -329,9 +329,17 @@ err:
 int usbip_vhci_get_free_port(uint32_t speed)
 {
 	for (int i = 0; i < vhci_driver->nports; i++) {
-		if (speed == USB_SPEED_SUPER &&
-		    vhci_driver->idev[i].hub != HUB_SPEED_SUPER)
-			continue;
+
+		switch (speed) {
+		case	USB_SPEED_SUPER:
+			if (vhci_driver->idev[i].hub != HUB_SPEED_SUPER)
+				continue;
+		break;
+		default:
+			if (vhci_driver->idev[i].hub != HUB_SPEED_HIGH)
+				continue;
+		break;
+		}
 
 		if (vhci_driver->idev[i].status == VDEV_ST_NULL)
 			return vhci_driver->idev[i].port;

Patches currently in stable-queue which might be from [email protected] are

queue-4.14/usbip-fix-usbip-attach-to-find-a-port-that-matches-the-requested-speed.patch queue-4.14/usbip-fix-usb-device-hang-due-to-wrong-enabling-of-scatter-gather.patch