Re: [PATCH] usb: ohci-at91: revert patch 2e2aa1bc7eff90ec on cpu without SFR register

2017-02-20 Thread Jelle Martijn Kok

usb: ohci-at91: Do not drop unhandled USB suspend control requests

In patch 2e2aa1bc7eff90ecm, USB suspend and wakeup control requests are
passed to SFR_OHCIICR register. If a processor does not have such a
register, this hub control request will be dropped.

If no such a SFR register is available, all USB suspend control requests
will now be processed using ohci_hub_control()
(like before patch 2e2aa1bc7eff90ecm.)

Tested on an Atmel AT91SAM9G20 with an on-board TI TUSB2046B hub chip
If the last USB device is unplugged from the USB hub, the hub goes into
sleep and will not wakeup when an USB devices is inserted.

Fixes: 2e2aa1bc7eff90ec ("usb: ohci-at91: Forcibly suspend ports while 
USB suspend")

Signed-off-by: Jelle Martijn Kok 
Tested-by: Wenyou Yang 
Cc: Wenyou Yang 
Cc: Alexandre Belloni 
Cc: Nicolas Ferre 
Cc: Alan Stern 


On 16-02-17 17:35, Greg KH wrote:

On Thu, Feb 16, 2017 at 04:19:44PM +0100, Jelle Martijn Kok wrote:

External USB hubs seems to go into suspend, but never wakeup again.
Tested on an AT91SAM9G20

Signed-off-by: Jelle Martijn Kok 
---
  drivers/usb/host/ohci-at91.c | 4 ++--
  1 file changed, 2 insertions(+), 2 deletions(-)

Can you put a "Fixes:" line in here and cc: the original authors of the
patch you are trying to revert?

Also, this isn't a "full" revert at all, are you sure you just don't
have a hub that can't handle suspend and you should disable it from
userspace instead?

thanks,

greg k-h


--

You/Com Audiocommunicatie b.v.
Motorenweg 5k
2623CR Delft
The Netherlands
tel. : (+31)15 262 59 55
fax. : (+31)15 257 15 95
mail : jm...@youcom.nl
http : https://www.youcom.nl/


--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


RE: [PATCH] usb: ohci-at91: revert patch 2e2aa1bc7eff90ec on cpu without SFR register

2017-02-19 Thread Wenyou.Yang


> -Original Message-
> From: Jelle Martijn Kok [mailto:jm...@youcom.nl]
> Sent: 2017年2月16日 23:20
> To: linux-usb@vger.kernel.org
> Cc: Wenyou Yang - A41535 ; Alan Stern
> 
> Subject: [PATCH] usb: ohci-at91: revert patch 2e2aa1bc7eff90ec on cpu without
> SFR register
> 
> External USB hubs seems to go into suspend, but never wakeup again.
> Tested on an AT91SAM9G20
> 
> Signed-off-by: Jelle Martijn Kok 

Thank you for your discovery and fixed.

Tested-by: Wenyou Yang 


> ---
>   drivers/usb/host/ohci-at91.c | 4 ++--
>   1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/usb/host/ohci-at91.c b/drivers/usb/host/ohci-at91.c index
> b38a228..af0566d 100644
> --- a/drivers/usb/host/ohci-at91.c
> +++ b/drivers/usb/host/ohci-at91.c
> @@ -361,7 +361,7 @@ static int ohci_at91_hub_control(struct usb_hcd *hcd, u16
> typeReq, u16 wValue,
>   case USB_PORT_FEAT_SUSPEND:
>   dev_dbg(hcd->self.controller, "SetPortFeat: SUSPEND\n");
> - if (valid_port(wIndex)) {
> + if (valid_port(wIndex) && ohci_at91->sfr_regmap) {
>   ohci_at91_port_suspend(ohci_at91->sfr_regmap,
>  1);
>   return 0;
> @@ -404,7 +404,7 @@ static int ohci_at91_hub_control(struct usb_hcd *hcd, u16
> typeReq, u16 wValue,
>   case USB_PORT_FEAT_SUSPEND:
>   dev_dbg(hcd->self.controller, "ClearPortFeature:
> SUSPEND\n");
> - if (valid_port(wIndex)) {
> + if (valid_port(wIndex) && ohci_at91->sfr_regmap) {
>   ohci_at91_port_suspend(ohci_at91->sfr_regmap,
>  0);
>   return 0;
> --
> 2.1.4


Best Regards,
Wenyou Yang


Re: [PATCH] usb: ohci-at91: revert patch 2e2aa1bc7eff90ec on cpu without SFR register

2017-02-16 Thread Greg KH
On Thu, Feb 16, 2017 at 04:19:44PM +0100, Jelle Martijn Kok wrote:
> External USB hubs seems to go into suspend, but never wakeup again.
> Tested on an AT91SAM9G20
> 
> Signed-off-by: Jelle Martijn Kok 
> ---
>  drivers/usb/host/ohci-at91.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)

Can you put a "Fixes:" line in here and cc: the original authors of the
patch you are trying to revert?

Also, this isn't a "full" revert at all, are you sure you just don't
have a hub that can't handle suspend and you should disable it from
userspace instead?

thanks,

greg k-h
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html