From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-20.5 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI,NICE_REPLY_A, SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id CF30DC4338F for ; Thu, 19 Aug 2021 22:57:45 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id B86816109E for ; Thu, 19 Aug 2021 22:57:45 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233061AbhHSW6V (ORCPT ); Thu, 19 Aug 2021 18:58:21 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48766 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229522AbhHSW6V (ORCPT ); Thu, 19 Aug 2021 18:58:21 -0400 Received: from mail-il1-x136.google.com (mail-il1-x136.google.com [IPv6:2607:f8b0:4864:20::136]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5E309C061756 for ; Thu, 19 Aug 2021 15:57:44 -0700 (PDT) Received: by mail-il1-x136.google.com with SMTP id s16so7575414ilo.9 for ; Thu, 19 Aug 2021 15:57:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=google; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=dqyq+xLCC62WmtlbZNmPjxhJEJorkWCEaN0Bhw2AePY=; b=cooKeToWpfZekERzCgF0kWR6bvPZBKI+V6Im5GxgZiTYFO0YF/kOpLxrerXm7nf7L0 qAyTMoV5DhF8fVFq+DvreRkoGtQg1mA1918Y8s+P5Fx9kpyYfQovpbKQTovjTxuTBgQA pBht8ci2g8MBR2gtAS/xVkND32I1qDDjH4LwU= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=dqyq+xLCC62WmtlbZNmPjxhJEJorkWCEaN0Bhw2AePY=; b=ffvU/mofxHZOXGTTsMk5NbMwJyLp3lvtcG6pRk2VdSO0PS2nkraEihY8BjN71X2Haq bQRrREmjTVWDZZ1nppxW8kxE8WKRVwkI3LaPqv/DoG7eZaDy/uOlGiZEWTufAwccuC4+ 1kKhEWp6DxHvXCwdLYijwF/Xw7KBFkp0sQPPoZWm8w+x1CX4sIibA7XY0ohCUIvQ3faH 1H7g+TP5IfMnYHXtyE94/gIkVCHHd1M3dDGmg+T4TuokmqKwkOc1/u94HBHG/seb4cIn h3cJ4uriI7s3BznpD2lSiKawutMTJ3Yh16ZNP1GKukx3EA+YOfK3bSV6/hZxy7VxYwWv x+4w== X-Gm-Message-State: AOAM532ik9NoEPFyCCMVs93IV6VD9Fx1y9Z1p1UYah0TB93r3W5/t8qc ekinbUnWWxCkp1Iwiq3uiEqGrA== X-Google-Smtp-Source: ABdhPJwQZ73vfotSnWwgMIvfGhwDa5AtWHmSypp0n37PAVBu8xmpd6r/tOmHTAfQmO3MuQpW2Ox8Gw== X-Received: by 2002:a92:360e:: with SMTP id d14mr11069647ila.171.1629413863755; Thu, 19 Aug 2021 15:57:43 -0700 (PDT) Received: from [192.168.1.112] (c-24-9-64-241.hsd1.co.comcast.net. [24.9.64.241]) by smtp.gmail.com with ESMTPSA id g23sm2277471ioc.8.2021.08.19.15.57.42 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 19 Aug 2021 15:57:42 -0700 (PDT) Subject: Re: [PATCH v2] vhci_hcd: USB port can get stuck in the disabled state To: Michael Cc: valentina.manea.m@gmail.com, shuah@kernel.org, gregkh@linuxfoundation.org, linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org, Shuah Khan References: <20210721235526.10588-1-msbroadf@gmail.com> <7b02cb66-d672-ae95-01ea-c6015725e1ac@linuxfoundation.org> <976d34c0-d603-1f16-edbd-ad6c8881ad4e@linuxfoundation.org> <5165bd84-11af-35dd-8a9b-11c7f219fb88@linuxfoundation.org> <4f345afe-61d5-66b3-3252-562988c8926f@linuxfoundation.org> From: Shuah Khan Message-ID: <3349aa56-afa0-a919-5810-3dbbdbe8717b@linuxfoundation.org> Date: Thu, 19 Aug 2021 16:57:42 -0600 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.8.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org On 8/10/21 8:30 PM, Michael wrote: > On Wed, 11 Aug 2021 at 03:46, Shuah Khan wrote: >> >> On 8/2/21 7:00 PM, Michael wrote: >>> On Tue, 3 Aug 2021 at 09:14, Shuah Khan wrote: >>>> >>>> On 7/30/21 5:52 PM, Michael wrote: >>>>> Yes i think just adding the VDEV_ST_USED check in addition to the >>>>> VDEV_ST_NOT_ASSIGNED state is fine and would fix the issue. >>>>> >>>> >>>> Can you please confirm if this works? >>>> >>>>> After many years of writing virtualhere (a similar system to usb/ip >>>>> but cross-platform and different non-kernel way of doing it server >>>>> side) I've seen many drivers that issue reset at any time. Loading >>>>> firmware is usually the reason. Also sometimes switching >>>>> configurations requires a reset also, for example some gaming wheels >>>>> do this. I don't think you should make this VDEV_ST_USED check >>>>> specific to Wifi devices, as a lot of devices don't follow too closely >>>>> to the USB protocol to begin with from my experience. They primarily >>>>> base their USB interactions assuming the windows platform and its >>>>> quirks. >>>>> >>>> >>>> When sending responses to Linux kernel mailing lists, please use bottom post. >>>> This check will be used for all drivers. We don't add checks for specific cases >>>> in the code. >>>> >>>> thanks, >>>> -- Shuah >>>> >>> >>> Yes it works with that change. >>> >> >> Would you like to send me a patch for this? >> >> thanks, >> -- Shuah > > usbip: Allow port reset to occur when the port is also in the ST_USED state > > Signed-off-by: Michael > --- > drivers/usb/usbip/vhci_hcd.c | 4 +++- > 1 file changed, 3 insertions(+), 1 deletion(-) > > diff --git a/drivers/usb/usbip/vhci_hcd.c b/drivers/usb/usbip/vhci_hcd.c > index 4ba6bcdaa8e9..300131ae5897 100644 > --- a/drivers/usb/usbip/vhci_hcd.c > +++ b/drivers/usb/usbip/vhci_hcd.c > @@ -456,7 +456,9 @@ static int vhci_hub_control(struct usb_hcd *hcd, > u16 typeReq, u16 wValue, > vhci_hcd->re_timeout = 0; > > 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 > Unfortunately we can't apply this diff. I turned this into a proper patch giving you credit for reporting the problem, suggesting the fix and testing it. Patch will be sent shortly. thanks, -- Shuah