Return-Path: Received: from mga03.intel.com ([134.134.136.65]:8557 "EHLO mga03.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932432AbbGUORT (ORCPT ); Tue, 21 Jul 2015 10:17:19 -0400 From: Mathias Nyman To: Cc: , Brian Campbell , , Mathias Nyman Subject: [PATCH 4/7] xhci: Calculate old endpoints correctly on device reset Date: Tue, 21 Jul 2015 17:20:28 +0300 Message-Id: <1437488431-1153-5-git-send-email-mathias.nyman@linux.intel.com> In-Reply-To: <1437488431-1153-1-git-send-email-mathias.nyman@linux.intel.com> References: <1437488431-1153-1-git-send-email-mathias.nyman@linux.intel.com> Sender: stable-owner@vger.kernel.org List-ID: From: Brian Campbell 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. Cc: Signed-off-by: Brian Campbell Signed-off-by: Mathias Nyman --- drivers/usb/host/xhci.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/usb/host/xhci.c b/drivers/usb/host/xhci.c index 7da0d60..526ebc0 100644 --- a/drivers/usb/host/xhci.c +++ b/drivers/usb/host/xhci.c @@ -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. -- 1.8.3.2