Skip to contentSkip to conversation

patch "xhci: Calculate old endpoints correctly on device reset" added to usb-linus

PATCH [email protected] 1 participant 1 message Jul 22, 2015

Subsystems (3)
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

xhci: Calculate old endpoints correctly on device reset

to my usb git tree which can be found at
git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git
in the usb-linus branch.

The patch will show up in the next release of the linux-next tree (usually sometime within the next 24 hours during the week.)

The patch will hopefully also be merged in Linus's tree for the next -rc kernel release.

If you have any questions about this process, please let me know.

Quoted 1 line

From 326124a027abc9a7f43f72dc94f6f0f7a55b02b3 Mon Sep 17 00:00:00 2001

From: Brian Campbell <[email protected]>
Date: Tue, 21 Jul 2015 17:20:28 +0300
Subject: xhci: Calculate old endpoints correctly on device reset

When resetting a device the number of active TTs may need to be corrected by xhci_update_tt_active_eps, but the number of old active endpoints supplied to it was always zero, so the number of TTs and the bandwidth reserved for them was not updated, and could rise unnecessarily.

This affected systems using Intel's Patherpoint chipset, which rely on software bandwidth checking. For example, a Lenovo X230 would lose the ability to use ports on the docking station after enough suspend/resume cycles because the bandwidth calculated would rise with every cycle when a suitable device is attached.

The correct number of active endpoints is calculated in the same way as in xhci_reserve_bandwidth.

---
 drivers/usb/host/xhci.c | 3 +++
 1 file changed, 3 insertions(+)
drivers/usb/host/xhci.c +3 -0
index 7da0d6043d33..526ebc0c7e72 100644
@@ -3453,6 +3453,9 @@ int xhci_discover_or_reset_device(struct usb_hcd *hcd, struct usb_device *udev)
 			return -EINVAL;
 	}
 
+	if (virt_dev->tt_info)
+		old_active_eps = virt_dev->tt_info->active_eps;
+
 	if (virt_dev->udev != udev) {
 		/* If the virt_dev and the udev does not match, this virt_dev
 		 * may belong to another udev.
Signature · 1 line
2.4.6