All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] usb: dwc2: fix transfer stop programming for out endpoint
@ 2015-12-04  7:38 changbin.du
  2015-12-16 16:57 ` Felipe Balbi
  0 siblings, 1 reply; 3+ messages in thread
From: changbin.du @ 2015-12-04  7:38 UTC (permalink / raw)
  To: johnyoun; +Cc: gregkh, balbi, linux-usb, linux-kernel, Du, Changbin

From: "Du, Changbin" <changbin.du@intel.com>

To stop an out endpoint, software should set sets the Global OUT NAK,
but not the Global Non-periodic IN NAK. This driver bug leads the out-ep
failed be in disabled state with below error.

dwc2_hsotg_ep_stop_xfr: timeout DOEPCTL.EPDisable

Signed-off-by: Du, Changbin <changbin.du@intel.com>
---
 drivers/usb/dwc2/gadget.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/usb/dwc2/gadget.c b/drivers/usb/dwc2/gadget.c
index 0abf73c..92a182f 100644
--- a/drivers/usb/dwc2/gadget.c
+++ b/drivers/usb/dwc2/gadget.c
@@ -2911,15 +2911,15 @@ static void dwc2_hsotg_ep_stop_xfr(struct dwc2_hsotg *hsotg,
 				"%s: timeout DIEPINT.NAKEFF\n", __func__);
 	} else {
 		/* Clear any pending nak effect interrupt */
-		dwc2_writel(GINTSTS_GINNAKEFF, hsotg->regs + GINTSTS);
+		dwc2_writel(GINTSTS_GOUTNAKEFF, hsotg->regs + GINTSTS);
 
-		__orr32(hsotg->regs + DCTL, DCTL_SGNPINNAK);
+		__orr32(hsotg->regs + DCTL, DCTL_SGOUTNAK);
 
 		/* Wait for global nak to take effect */
 		if (dwc2_hsotg_wait_bit_set(hsotg, GINTSTS,
-						GINTSTS_GINNAKEFF, 100))
+						GINTSTS_GOUTNAKEFF, 100))
 			dev_warn(hsotg->dev,
-				"%s: timeout GINTSTS.GINNAKEFF\n", __func__);
+				"%s: timeout GINTSTS.GOUTNAKEFF\n", __func__);
 	}
 
 	/* Disable ep */
@@ -2944,7 +2944,7 @@ static void dwc2_hsotg_ep_stop_xfr(struct dwc2_hsotg *hsotg,
 		/* TODO: Flush shared tx fifo */
 	} else {
 		/* Remove global NAKs */
-		__bic32(hsotg->regs + DCTL, DCTL_SGNPINNAK);
+		__bic32(hsotg->regs + DCTL, DCTL_SGOUTNAK);
 	}
 }
 
-- 
2.5.0


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

* Re: [PATCH] usb: dwc2: fix transfer stop programming for out endpoint
  2015-12-04  7:38 [PATCH] usb: dwc2: fix transfer stop programming for out endpoint changbin.du
@ 2015-12-16 16:57 ` Felipe Balbi
  2015-12-16 21:34   ` John Youn
  0 siblings, 1 reply; 3+ messages in thread
From: Felipe Balbi @ 2015-12-16 16:57 UTC (permalink / raw)
  To: changbin.du, johnyoun; +Cc: gregkh, linux-usb, linux-kernel, Du, Changbin

[-- Attachment #1: Type: text/plain, Size: 1824 bytes --]


Hi,

changbin.du@intel.com writes:
> From: "Du, Changbin" <changbin.du@intel.com>
>
> To stop an out endpoint, software should set sets the Global OUT NAK,
> but not the Global Non-periodic IN NAK. This driver bug leads the out-ep
> failed be in disabled state with below error.
>
> dwc2_hsotg_ep_stop_xfr: timeout DOEPCTL.EPDisable
>
> Signed-off-by: Du, Changbin <changbin.du@intel.com>

John, is this patch okay to apply ?

> ---
>  drivers/usb/dwc2/gadget.c | 10 +++++-----
>  1 file changed, 5 insertions(+), 5 deletions(-)
>
> diff --git a/drivers/usb/dwc2/gadget.c b/drivers/usb/dwc2/gadget.c
> index 0abf73c..92a182f 100644
> --- a/drivers/usb/dwc2/gadget.c
> +++ b/drivers/usb/dwc2/gadget.c
> @@ -2911,15 +2911,15 @@ static void dwc2_hsotg_ep_stop_xfr(struct dwc2_hsotg *hsotg,
>  				"%s: timeout DIEPINT.NAKEFF\n", __func__);
>  	} else {
>  		/* Clear any pending nak effect interrupt */
> -		dwc2_writel(GINTSTS_GINNAKEFF, hsotg->regs + GINTSTS);
> +		dwc2_writel(GINTSTS_GOUTNAKEFF, hsotg->regs + GINTSTS);
>  
> -		__orr32(hsotg->regs + DCTL, DCTL_SGNPINNAK);
> +		__orr32(hsotg->regs + DCTL, DCTL_SGOUTNAK);
>  
>  		/* Wait for global nak to take effect */
>  		if (dwc2_hsotg_wait_bit_set(hsotg, GINTSTS,
> -						GINTSTS_GINNAKEFF, 100))
> +						GINTSTS_GOUTNAKEFF, 100))
>  			dev_warn(hsotg->dev,
> -				"%s: timeout GINTSTS.GINNAKEFF\n", __func__);
> +				"%s: timeout GINTSTS.GOUTNAKEFF\n", __func__);
>  	}
>  
>  	/* Disable ep */
> @@ -2944,7 +2944,7 @@ static void dwc2_hsotg_ep_stop_xfr(struct dwc2_hsotg *hsotg,
>  		/* TODO: Flush shared tx fifo */
>  	} else {
>  		/* Remove global NAKs */
> -		__bic32(hsotg->regs + DCTL, DCTL_SGNPINNAK);
> +		__bic32(hsotg->regs + DCTL, DCTL_SGOUTNAK);
>  	}
>  }
>  
> -- 
> 2.5.0
>

-- 
balbi

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 818 bytes --]

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

* Re: [PATCH] usb: dwc2: fix transfer stop programming for out endpoint
  2015-12-16 16:57 ` Felipe Balbi
@ 2015-12-16 21:34   ` John Youn
  0 siblings, 0 replies; 3+ messages in thread
From: John Youn @ 2015-12-16 21:34 UTC (permalink / raw)
  To: Felipe Balbi, changbin.du, John.Youn; +Cc: gregkh, linux-usb, linux-kernel

On 12/16/2015 8:58 AM, Felipe Balbi wrote:
> 
> Hi,
> 
> changbin.du@intel.com writes:
>> From: "Du, Changbin" <changbin.du@intel.com>
>>
>> To stop an out endpoint, software should set sets the Global OUT NAK,
>> but not the Global Non-periodic IN NAK. This driver bug leads the out-ep
>> failed be in disabled state with below error.
>>
>> dwc2_hsotg_ep_stop_xfr: timeout DOEPCTL.EPDisable
>>
>> Signed-off-by: Du, Changbin <changbin.du@intel.com>
> 
> John, is this patch okay to apply ?
> 

Yes. Looks good to me.


Acked-by: John Youn <johnyoun@synopsys.com>

John



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

end of thread, other threads:[~2015-12-16 21:36 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-12-04  7:38 [PATCH] usb: dwc2: fix transfer stop programming for out endpoint changbin.du
2015-12-16 16:57 ` Felipe Balbi
2015-12-16 21:34   ` John Youn

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.