lkml.org 
[lkml]   [2021]   [Sep]   [9]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH AUTOSEL 5.13 193/219] usbip:vhci_hcd USB port can get stuck in the disabled state
    Date
    From: Shuah Khan <skhan@linuxfoundation.org>

    [ 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 <msbroadf@gmail.com>
    Suggested-by: Michael <msbroadf@gmail.com>
    Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>
    Link: https://lore.kernel.org/r/20210819225937.41037-1-skhan@linuxfoundation.org
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    Signed-off-by: Sasha Levin <sashal@kernel.org>
    ---
    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
    \
     
     \ /
      Last update: 2021-09-09 15:07    [W:2.182 / U:0.308 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site