Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp1538987pxb; Thu, 16 Sep 2021 09:30:08 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyXQ5Gw05Q1cbyvpU599EYWyy0jMTQt9J+BI/M05JXP55nDkf8XecLus2FCvKwRuRJh/tTA X-Received: by 2002:a92:d30c:: with SMTP id x12mr4626798ila.245.1631809808143; Thu, 16 Sep 2021 09:30:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1631809808; cv=none; d=google.com; s=arc-20160816; b=fchNtaWlB5NaOmoiK2AVkvWt0CbO1AZwbfylFNkB+MevJAeXOqX8eBzUXhMkGC7K72 MCedO2T23MD4O3blNiiEjJNkToRXm2u91Q9UxWYaGOuPPoufQaKeRuXeuTDYaj+yQuzL 2BUAKsaCSt1FuefqNM/cR0f74dmpRc0+WoTe3JAhDnQoED2R0fCYowPfS6Ugj/1imn6O S4ExnYQ36OBVCW6yXDSMu4Qkn1ZXWptn7WCept4LRAUzqyVbFIB+SkJHFN4e/42YbPrs 6jLsbqSQBRJn9ksNXBC/DkW4AGuTutsG4t2hTjmvHhrU8gxBAd/W4BNfS+P0mkcHAidY 6vig== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=dwDMyxfVP196EnQ/qsGvfYiZ90aOoEr4bMbfcdsZmx0=; b=v89F1RM82kzdeiFXF6BpQon7y7kEmw1MQZDWO21gsVERHrZh4awkIo8/5mlcIZ54+O 71F24ZvB59rE+FP0NEP/dEqIWXVq5gYa4jHVuGZF6PVso6/Cjspekw2bX/eursSG9eLG q9T4tf0Ixnm7Gh6ILZZMXXbQBuUoZ9fOGKdGeoXj3/7TCE9VRkyH1Oe+gbrZ2EZzje7i ZzJ0HmH+632Mc3DnuqlwqcpgbJr7/01M/sw5nV+f8D6dJ+gpbK7MJilVWvyiJxysr145 UPqjeVIidiO7gMMOHybmuuf0ZWLwe2yCvKIPXmXeB13W3jMrwoC2TiYQqozDTLS2Ngi1 VK0Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=qhVcWrF9; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id x18si3029888ilm.87.2021.09.16.09.29.56; Thu, 16 Sep 2021 09:30:08 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=qhVcWrF9; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243098AbhIPQaA (ORCPT + 99 others); Thu, 16 Sep 2021 12:30:00 -0400 Received: from mail.kernel.org ([198.145.29.99]:60150 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236066AbhIPQUi (ORCPT ); Thu, 16 Sep 2021 12:20:38 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id C9B6461406; Thu, 16 Sep 2021 16:14:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1631808877; bh=ipq2xZ7CFfhWJwJIgNAoPCVmyXRWSBM7cc6PGH9Baig=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=qhVcWrF9S0JmFsxPFKxPpPW1t2hzCqYbrI0yc4tXDunVaGwcYNvRto4nxJ4UHowFT G4UDjCKbodg2BZCztwgtV7l03jXXQIx9EC1f27dZfzwzV056IQEsDjlcGG6kplqzPD ZsJs27DEG7oCb+lzpLyCJJxzXH9VdyTvP2Qcd+Dk= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Michael , Shuah Khan , Sasha Levin Subject: [PATCH 5.10 256/306] usbip:vhci_hcd USB port can get stuck in the disabled state Date: Thu, 16 Sep 2021 18:00:01 +0200 Message-Id: <20210916155802.794908059@linuxfoundation.org> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20210916155753.903069397@linuxfoundation.org> References: <20210916155753.903069397@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Shuah Khan [ Upstream commit 66cce9e73ec61967ed1f97f30cee79bd9a2bb7ee ] When a remote usb device is attached to the local Virtual USB Host Controller Root Hub port, the bound device driver may send a port reset command. vhci_hcd accepts port resets only when the device doesn't have port address assigned to it. When reset happens device is in assigned/used state and vhci_hcd rejects it leaving the port in a stuck state. This problem was found when a blue-tooth or xbox wireless dongle was passed through using usbip. A few drivers reset the port during probe including mt76 driver specific to this bug report. Fix the problem with a change to honor reset requests when device is in used state (VDEV_ST_USED). Reported-and-tested-by: Michael Suggested-by: Michael Signed-off-by: Shuah Khan Link: https://lore.kernel.org/r/20210819225937.41037-1-skhan@linuxfoundation.org Signed-off-by: Greg Kroah-Hartman Signed-off-by: Sasha Levin --- drivers/usb/usbip/vhci_hcd.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/drivers/usb/usbip/vhci_hcd.c b/drivers/usb/usbip/vhci_hcd.c index 190bd3d1c1f0..b07b2925ff78 100644 --- a/drivers/usb/usbip/vhci_hcd.c +++ b/drivers/usb/usbip/vhci_hcd.c @@ -455,8 +455,14 @@ static int vhci_hub_control(struct usb_hcd *hcd, u16 typeReq, u16 wValue, vhci_hcd->port_status[rhport] &= ~(1 << USB_PORT_FEAT_RESET); vhci_hcd->re_timeout = 0; + /* + * A few drivers do usb reset during probe when + * the device could be in VDEV_ST_USED state + */ if (vhci_hcd->vdev[rhport].ud.status == - VDEV_ST_NOTASSIGNED) { + VDEV_ST_NOTASSIGNED || + vhci_hcd->vdev[rhport].ud.status == + VDEV_ST_USED) { usbip_dbg_vhci_rh( " enable rhport %d (status %u)\n", rhport, -- 2.30.2