linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] vhci_hcd: Always re-enable a USB Port after reset
@ 2021-07-21  9:49 Michael Broadfoot
  2021-07-21  9:54 ` Greg KH
  0 siblings, 1 reply; 2+ messages in thread
From: Michael Broadfoot @ 2021-07-21  9:49 UTC (permalink / raw)
  To: valentina.manea.m, shuah, gregkh, linux-usb, linux-kernel
  Cc: Michael Broadfoot

A (virtual) usb port can getting stuck in a disabled state on reset
Always re-enable a usb port regardless of if its addressed or not

Signed-off-by: Michael Broadfoot <msbroadf@gmail.com>
---
 drivers/usb/usbip/vhci_hcd.c | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/drivers/usb/usbip/vhci_hcd.c b/drivers/usb/usbip/vhci_hcd.c
index 4ba6bcdaa8e9..cea3781d04e6 100644
--- a/drivers/usb/usbip/vhci_hcd.c
+++ b/drivers/usb/usbip/vhci_hcd.c
@@ -455,15 +455,12 @@ 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;
 
-			if (vhci_hcd->vdev[rhport].ud.status ==
-			    VDEV_ST_NOTASSIGNED) {
 				usbip_dbg_vhci_rh(
 					" enable rhport %d (status %u)\n",
 					rhport,
 					vhci_hcd->vdev[rhport].ud.status);
 				vhci_hcd->port_status[rhport] |=
 					USB_PORT_STAT_ENABLE;
-			}
 
 			if (hcd->speed < HCD_USB3) {
 				switch (vhci_hcd->vdev[rhport].speed) {
-- 
2.30.2


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] vhci_hcd: Always re-enable a USB Port after reset
  2021-07-21  9:49 [PATCH] vhci_hcd: Always re-enable a USB Port after reset Michael Broadfoot
@ 2021-07-21  9:54 ` Greg KH
  0 siblings, 0 replies; 2+ messages in thread
From: Greg KH @ 2021-07-21  9:54 UTC (permalink / raw)
  To: Michael Broadfoot; +Cc: valentina.manea.m, shuah, linux-usb, linux-kernel

On Wed, Jul 21, 2021 at 07:49:22PM +1000, Michael Broadfoot wrote:
> A (virtual) usb port can getting stuck in a disabled state on reset

How can that happen?

> Always re-enable a usb port regardless of if its addressed or not

Are you sure?  What causes this?

And what do you mean by "not" here?

Please write full sentences.

> 
> Signed-off-by: Michael Broadfoot <msbroadf@gmail.com>
> ---
>  drivers/usb/usbip/vhci_hcd.c | 3 ---
>  1 file changed, 3 deletions(-)
> 
> diff --git a/drivers/usb/usbip/vhci_hcd.c b/drivers/usb/usbip/vhci_hcd.c
> index 4ba6bcdaa8e9..cea3781d04e6 100644
> --- a/drivers/usb/usbip/vhci_hcd.c
> +++ b/drivers/usb/usbip/vhci_hcd.c
> @@ -455,15 +455,12 @@ 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;
>  
> -			if (vhci_hcd->vdev[rhport].ud.status ==
> -			    VDEV_ST_NOTASSIGNED) {
>  				usbip_dbg_vhci_rh(
>  					" enable rhport %d (status %u)\n",
>  					rhport,
>  					vhci_hcd->vdev[rhport].ud.status);
>  				vhci_hcd->port_status[rhport] |=
>  					USB_PORT_STAT_ENABLE;
> -			}

Coding style is now all messed up, this change isn't ok as-is, sorry.

thanks,

greg k-h

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-07-21 10:10 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-07-21  9:49 [PATCH] vhci_hcd: Always re-enable a USB Port after reset Michael Broadfoot
2021-07-21  9:54 ` Greg KH

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).