linux-usb.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Shuah Khan <skhan@linuxfoundation.org>
To: Michael <msbroadf@gmail.com>
Cc: valentina.manea.m@gmail.com, shuah@kernel.org,
	gregkh@linuxfoundation.org, linux-usb@vger.kernel.org,
	linux-kernel@vger.kernel.org,
	Shuah Khan <skhan@linuxfoundation.org>
Subject: Re: [PATCH v2] vhci_hcd: USB port can get stuck in the disabled state
Date: Thu, 19 Aug 2021 16:57:42 -0600	[thread overview]
Message-ID: <3349aa56-afa0-a919-5810-3dbbdbe8717b@linuxfoundation.org> (raw)
In-Reply-To: <CALdjXpB+-RHMrjt10f1ZksR9VZMuT3gj7HyvrXYtdJ_jq0J93g@mail.gmail.com>

On 8/10/21 8:30 PM, Michael wrote:
> On Wed, 11 Aug 2021 at 03:46, Shuah Khan <skhan@linuxfoundation.org> wrote:
>>
>> On 8/2/21 7:00 PM, Michael wrote:
>>> On Tue, 3 Aug 2021 at 09:14, Shuah Khan <skhan@linuxfoundation.org> 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 <mail@virtualhere.com>
> ---
>   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

      reply	other threads:[~2021-08-19 22:57 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-21 23:55 [PATCH v2] vhci_hcd: USB port can get stuck in the disabled state Michael Broadfoot
2021-07-22  1:26 ` Shuah Khan
     [not found]   ` <CALdjXpA4_eXen6RjhsEBYt8CQs-2gzwYs9h9q0Z2LKZ=rXVp+Q@mail.gmail.com>
2021-07-22  6:19     ` Michael
2021-07-23 16:29     ` Shuah Khan
2021-07-23 23:53       ` Michael
2021-07-23 23:58       ` Michael
2021-07-30 22:52         ` Shuah Khan
2021-07-30 23:52           ` Michael
2021-08-02 23:14             ` Shuah Khan
2021-08-03  1:00               ` Michael
2021-08-10 17:46                 ` Shuah Khan
2021-08-11  2:30                   ` Michael
2021-08-19 22:57                     ` Shuah Khan [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=3349aa56-afa0-a919-5810-3dbbdbe8717b@linuxfoundation.org \
    --to=skhan@linuxfoundation.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=msbroadf@gmail.com \
    --cc=shuah@kernel.org \
    --cc=valentina.manea.m@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).