linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 4.9] usbip: vhci_hcd: clear just the USB_PORT_STAT_POWER bit
@ 2018-01-26 18:54 Shuah Khan
  2018-01-28 12:14 ` Greg KH
  0 siblings, 1 reply; 4+ messages in thread
From: Shuah Khan @ 2018-01-26 18:54 UTC (permalink / raw)
  To: valentina.manea.m, shuah, gregkh
  Cc: Shuah Khan, linux-usb, linux-kernel, stable

Upstream commit 1c9de5bf4286 ("usbip: vhci-hcd: Add USB3 SuperSpeed
support")

vhci_hcd clears all the bits port_status bits instead of clearing
just the USB_PORT_STAT_POWER bit when it handles ClearPortFeature:
USB_PORT_FEAT_POWER. This causes vhci_hcd attach to fail in a bad
state, leaving device unusable by the client. The device is still
attached and however client can't use it.

The problem was fixed as part of larger change to add  USB3 Super
Speed support. This patch backports just the change to clear the
USB_PORT_STAT_POWER.

Signed-off-by: Shuah Khan <shuahkh@osg.samsung.com>
---
 drivers/usb/usbip/vhci_hcd.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/usb/usbip/vhci_hcd.c b/drivers/usb/usbip/vhci_hcd.c
index 7f161b095176..dbe615ba07c9 100644
--- a/drivers/usb/usbip/vhci_hcd.c
+++ b/drivers/usb/usbip/vhci_hcd.c
@@ -300,7 +300,7 @@ static int vhci_hub_control(struct usb_hcd *hcd, u16 typeReq, u16 wValue,
 		case USB_PORT_FEAT_POWER:
 			usbip_dbg_vhci_rh(
 				" ClearPortFeature: USB_PORT_FEAT_POWER\n");
-			dum->port_status[rhport] = 0;
+			dum->port_status[rhport] &= ~USB_PORT_STAT_POWER;
 			dum->resuming = 0;
 			break;
 		case USB_PORT_FEAT_C_RESET:
-- 
2.14.1


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

* Re: [PATCH 4.9] usbip: vhci_hcd: clear just the USB_PORT_STAT_POWER bit
  2018-01-26 18:54 [PATCH 4.9] usbip: vhci_hcd: clear just the USB_PORT_STAT_POWER bit Shuah Khan
@ 2018-01-28 12:14 ` Greg KH
  2018-01-29 20:13   ` Shuah Khan
  0 siblings, 1 reply; 4+ messages in thread
From: Greg KH @ 2018-01-28 12:14 UTC (permalink / raw)
  To: Shuah Khan; +Cc: valentina.manea.m, shuah, linux-usb, linux-kernel, stable

On Fri, Jan 26, 2018 at 11:54:35AM -0700, Shuah Khan wrote:
> Upstream commit 1c9de5bf4286 ("usbip: vhci-hcd: Add USB3 SuperSpeed
> support")

Hm, I think you have the wrong commit id here.

I don't see any commit upstream with the Subject you have here, what are
you referring to?

thanks,

greg k-h

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

* Re: [PATCH 4.9] usbip: vhci_hcd: clear just the USB_PORT_STAT_POWER bit
  2018-01-28 12:14 ` Greg KH
@ 2018-01-29 20:13   ` Shuah Khan
  2018-02-02 10:21     ` Greg KH
  0 siblings, 1 reply; 4+ messages in thread
From: Shuah Khan @ 2018-01-29 20:13 UTC (permalink / raw)
  To: Greg KH
  Cc: valentina.manea.m, shuah, linux-usb, linux-kernel, stable, Shuah Khan

On 01/28/2018 05:14 AM, Greg KH wrote:
> On Fri, Jan 26, 2018 at 11:54:35AM -0700, Shuah Khan wrote:
>> Upstream commit 1c9de5bf4286 ("usbip: vhci-hcd: Add USB3 SuperSpeed
>> support")
> 
> Hm, I think you have the wrong commit id here.
> 
> I don't see any commit upstream with the Subject you have here, what are
> you referring to?
> 
> thanks,
> 
> greg k-h
> 

That is odd. Th commit went in a while back. Here are the details:

This is the commit from upstream:

https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/drivers/usb/usbip/vhci_hcd.c?id=1c9de5bf428612458427943b724bea51abde520a

commit 1c9de5bf428612458427943b724bea51abde520a
Author: Yuyang Du <yuyang.du@intel.com>
Date:   Thu Jun 8 13:04:10 2017 +0800

    usbip: vhci-hcd: Add USB3 SuperSpeed support
    
    This patch adds a USB3 HCD to an existing USB2 HCD and provides
    the support of SuperSpeed, in case the device can only be enumerated
    with SuperSpeed.
    
    The bulk of the added code in usb3_bos_desc and hub_control to support
    SuperSpeed is borrowed from the commit 1cd8fd2887e162ad ("usb: gadget:
    dummy_hcd: add SuperSpeed support").
    
    With this patch, each vhci will have VHCI_HC_PORTS HighSpeed ports
    and VHCI_HC_PORTS SuperSpeed ports.
    
    Suggested-by: Krzysztof Opasiak <k.opasiak@samsung.com>
    Signed-off-by: Yuyang Du <yuyang.du@intel.com>
    Acked-by: Shuah Khan <shuahkh@osg.samsung.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


I isolated and backported a one line fix to the problem I saw in 4.9
and 4.4 stables.

thanks,
-- Shuah

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

* Re: [PATCH 4.9] usbip: vhci_hcd: clear just the USB_PORT_STAT_POWER bit
  2018-01-29 20:13   ` Shuah Khan
@ 2018-02-02 10:21     ` Greg KH
  0 siblings, 0 replies; 4+ messages in thread
From: Greg KH @ 2018-02-02 10:21 UTC (permalink / raw)
  To: Shuah Khan; +Cc: valentina.manea.m, shuah, linux-usb, linux-kernel, stable

On Mon, Jan 29, 2018 at 01:13:32PM -0700, Shuah Khan wrote:
> On 01/28/2018 05:14 AM, Greg KH wrote:
> > On Fri, Jan 26, 2018 at 11:54:35AM -0700, Shuah Khan wrote:
> >> Upstream commit 1c9de5bf4286 ("usbip: vhci-hcd: Add USB3 SuperSpeed
> >> support")
> > 
> > Hm, I think you have the wrong commit id here.
> > 
> > I don't see any commit upstream with the Subject you have here, what are
> > you referring to?
> > 
> > thanks,
> > 
> > greg k-h
> > 
> 
> That is odd. Th commit went in a while back. Here are the details:
> 
> This is the commit from upstream:
> 
> https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/drivers/usb/usbip/vhci_hcd.c?id=1c9de5bf428612458427943b724bea51abde520a
> 
> commit 1c9de5bf428612458427943b724bea51abde520a
> Author: Yuyang Du <yuyang.du@intel.com>
> Date:   Thu Jun 8 13:04:10 2017 +0800
> 
>     usbip: vhci-hcd: Add USB3 SuperSpeed support
>     
>     This patch adds a USB3 HCD to an existing USB2 HCD and provides
>     the support of SuperSpeed, in case the device can only be enumerated
>     with SuperSpeed.
>     
>     The bulk of the added code in usb3_bos_desc and hub_control to support
>     SuperSpeed is borrowed from the commit 1cd8fd2887e162ad ("usb: gadget:
>     dummy_hcd: add SuperSpeed support").
>     
>     With this patch, each vhci will have VHCI_HC_PORTS HighSpeed ports
>     and VHCI_HC_PORTS SuperSpeed ports.
>     
>     Suggested-by: Krzysztof Opasiak <k.opasiak@samsung.com>
>     Signed-off-by: Yuyang Du <yuyang.du@intel.com>
>     Acked-by: Shuah Khan <shuahkh@osg.samsung.com>
>     Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
> 
> 
> I isolated and backported a one line fix to the problem I saw in 4.9
> and 4.4 stables.

Ah, the "isolation" part is what I missed here, sorry about that.  You
are right, I'll go queue this up now, sorry for the noise.

greg k-h

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

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

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-01-26 18:54 [PATCH 4.9] usbip: vhci_hcd: clear just the USB_PORT_STAT_POWER bit Shuah Khan
2018-01-28 12:14 ` Greg KH
2018-01-29 20:13   ` Shuah Khan
2018-02-02 10:21     ` 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).