Linux-USB Archive on lore.kernel.org
 help / color / Atom feed
* [PATCH] usb: dwc3: gadget: Fix logical condition
@ 2019-11-13  6:15 Tejas Joglekar
  2019-11-22  4:00 ` Tejas Joglekar
  2019-12-03 13:58 ` Felipe Balbi
  0 siblings, 2 replies; 4+ messages in thread
From: Tejas Joglekar @ 2019-11-13  6:15 UTC (permalink / raw)
  To: Felipe Balbi, linux-usb; +Cc: John Youn, Tejas Joglekar, Thinh Nguyen, stable

This patch corrects the condition to kick the transfer without
giving back the requests when either request has remaining data
or when there are pending SGs. The && check was introduced during
spliting up the dwc3_gadget_ep_cleanup_completed_requests() function.

Fixes: f38e35dd84e2 ("usb: dwc3: gadget: split dwc3_gadget_ep_cleanup_completed_requests()")

Cc: stable@vger.kernel.org
Signed-off-by: Tejas Joglekar <joglekar@synopsys.com>
---
 drivers/usb/dwc3/gadget.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/usb/dwc3/gadget.c b/drivers/usb/dwc3/gadget.c
index 86dc1db788a9..e07159e06f9a 100644
--- a/drivers/usb/dwc3/gadget.c
+++ b/drivers/usb/dwc3/gadget.c
@@ -2485,7 +2485,7 @@ static int dwc3_gadget_ep_cleanup_completed_request(struct dwc3_ep *dep,
 
 	req->request.actual = req->request.length - req->remaining;
 
-	if (!dwc3_gadget_ep_request_completed(req) &&
+	if (!dwc3_gadget_ep_request_completed(req) ||
 			req->num_pending_sgs) {
 		__dwc3_gadget_kick_transfer(dep);
 		goto out;
-- 
2.11.0


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

* Re: [PATCH] usb: dwc3: gadget: Fix logical condition
  2019-11-13  6:15 [PATCH] usb: dwc3: gadget: Fix logical condition Tejas Joglekar
@ 2019-11-22  4:00 ` Tejas Joglekar
  2019-12-02 11:30   ` Tejas Joglekar
  2019-12-03 13:58 ` Felipe Balbi
  1 sibling, 1 reply; 4+ messages in thread
From: Tejas Joglekar @ 2019-11-22  4:00 UTC (permalink / raw)
  To: Felipe Balbi, linux-usb; +Cc: John Youn, Thinh Nguyen, stable, greg

Hello Balbi,
       This is a critical patch fix for dwc3, can you please review ?
    
On 11/13/2019 11:45 AM, Tejas Joglekar wrote:
> This patch corrects the condition to kick the transfer without
> giving back the requests when either request has remaining data
> or when there are pending SGs. The && check was introduced during
> spliting up the dwc3_gadget_ep_cleanup_completed_requests() function.
>
> Fixes: f38e35dd84e2 ("usb: dwc3: gadget: split dwc3_gadget_ep_cleanup_completed_requests()")
>
> Cc: stable@vger.kernel.org
> Signed-off-by: Tejas Joglekar <joglekar@synopsys.com>
> ---
>  drivers/usb/dwc3/gadget.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/usb/dwc3/gadget.c b/drivers/usb/dwc3/gadget.c
> index 86dc1db788a9..e07159e06f9a 100644
> --- a/drivers/usb/dwc3/gadget.c
> +++ b/drivers/usb/dwc3/gadget.c
> @@ -2485,7 +2485,7 @@ static int dwc3_gadget_ep_cleanup_completed_request(struct dwc3_ep *dep,
>  
>  	req->request.actual = req->request.length - req->remaining;
>  
> -	if (!dwc3_gadget_ep_request_completed(req) &&
> +	if (!dwc3_gadget_ep_request_completed(req) ||
>  			req->num_pending_sgs) {
>  		__dwc3_gadget_kick_transfer(dep);
>  		goto out;

Thanks & Regards,

Tejas Joglekar


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

* Re: [PATCH] usb: dwc3: gadget: Fix logical condition
  2019-11-22  4:00 ` Tejas Joglekar
@ 2019-12-02 11:30   ` Tejas Joglekar
  0 siblings, 0 replies; 4+ messages in thread
From: Tejas Joglekar @ 2019-12-02 11:30 UTC (permalink / raw)
  To: Felipe Balbi, linux-usb
  Cc: Tejas Joglekar, John Youn, Thinh Nguyen, stable, greg

Hello,
Gentle reminder...

On 11/22/2019 9:30 AM, Tejas Joglekar wrote:
> Hello Balbi,
>        This is a critical patch fix for dwc3, can you please review ?
>     
> On 11/13/2019 11:45 AM, Tejas Joglekar wrote:
>> This patch corrects the condition to kick the transfer without
>> giving back the requests when either request has remaining data
>> or when there are pending SGs. The && check was introduced during
>> spliting up the dwc3_gadget_ep_cleanup_completed_requests() function.
>>
>> Fixes: f38e35dd84e2 ("usb: dwc3: gadget: split dwc3_gadget_ep_cleanup_completed_requests()")
>>
>> Cc: stable@vger.kernel.org
>> Signed-off-by: Tejas Joglekar <joglekar@synopsys.com>
>> ---
>>  drivers/usb/dwc3/gadget.c | 2 +-
>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/drivers/usb/dwc3/gadget.c b/drivers/usb/dwc3/gadget.c
>> index 86dc1db788a9..e07159e06f9a 100644
>> --- a/drivers/usb/dwc3/gadget.c
>> +++ b/drivers/usb/dwc3/gadget.c
>> @@ -2485,7 +2485,7 @@ static int dwc3_gadget_ep_cleanup_completed_request(struct dwc3_ep *dep,
>>  
>>  	req->request.actual = req->request.length - req->remaining;
>>  
>> -	if (!dwc3_gadget_ep_request_completed(req) &&
>> +	if (!dwc3_gadget_ep_request_completed(req) ||
>>  			req->num_pending_sgs) {
>>  		__dwc3_gadget_kick_transfer(dep);
>>  		goto out;
> Thanks & Regards,
>
> Tejas Joglekar
>
Thanks,

Tejas Joglekar


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

* Re: [PATCH] usb: dwc3: gadget: Fix logical condition
  2019-11-13  6:15 [PATCH] usb: dwc3: gadget: Fix logical condition Tejas Joglekar
  2019-11-22  4:00 ` Tejas Joglekar
@ 2019-12-03 13:58 ` Felipe Balbi
  1 sibling, 0 replies; 4+ messages in thread
From: Felipe Balbi @ 2019-12-03 13:58 UTC (permalink / raw)
  To: Tejas Joglekar, linux-usb; +Cc: John Youn, Tejas Joglekar, Thinh Nguyen, stable

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


Hi,

Tejas Joglekar <Tejas.Joglekar@synopsys.com> writes:
> This patch corrects the condition to kick the transfer without
> giving back the requests when either request has remaining data
> or when there are pending SGs. The && check was introduced during
> spliting up the dwc3_gadget_ep_cleanup_completed_requests() function.
>
> Fixes: f38e35dd84e2 ("usb: dwc3: gadget: split dwc3_gadget_ep_cleanup_completed_requests()")
>
> Cc: stable@vger.kernel.org
> Signed-off-by: Tejas Joglekar <joglekar@synopsys.com>

Indeed this is a very important fix :-)

I'll queue it up.

-- 
balbi

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

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

end of thread, back to index

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-11-13  6:15 [PATCH] usb: dwc3: gadget: Fix logical condition Tejas Joglekar
2019-11-22  4:00 ` Tejas Joglekar
2019-12-02 11:30   ` Tejas Joglekar
2019-12-03 13:58 ` Felipe Balbi

Linux-USB Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-usb/0 linux-usb/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-usb linux-usb/ https://lore.kernel.org/linux-usb \
		linux-usb@vger.kernel.org
	public-inbox-index linux-usb

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-usb


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git