linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] usb: dwc3: gadget: don't remove the request if bus-expired
@ 2018-12-20 20:53 Zeng Tao
  2019-01-14  8:12 ` Felipe Balbi
  0 siblings, 1 reply; 4+ messages in thread
From: Zeng Tao @ 2018-12-20 20:53 UTC (permalink / raw)
  To: felipe.balbi
  Cc: Zeng Tao, Felipe Balbi, Greg Kroah-Hartman, linux-usb, linux-kernel

We have already returned EAGAIN for bus-expiry, and it's designed to
start with a future Frame number and start the transfer again. So we
should not remove the request for that case.

Signed-off-by: Zeng Tao <prime.zeng@hisilicon.com>
---
 drivers/usb/dwc3/gadget.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/drivers/usb/dwc3/gadget.c b/drivers/usb/dwc3/gadget.c
index 2ecde30..16a6e3c 100644
--- a/drivers/usb/dwc3/gadget.c
+++ b/drivers/usb/dwc3/gadget.c
@@ -1250,7 +1250,7 @@ static int __dwc3_gadget_kick_transfer(struct dwc3_ep *dep)
 	}
 
 	ret = dwc3_send_gadget_ep_cmd(dep, cmd, &params);
-	if (ret < 0) {
+	if (ret < 0 && ret != -EAGAIN) {
 		/*
 		 * FIXME we need to iterate over the list of requests
 		 * here and stop, unmap, free and del each of the linked
@@ -1259,10 +1259,9 @@ static int __dwc3_gadget_kick_transfer(struct dwc3_ep *dep)
 		if (req->trb)
 			memset(req->trb, 0, sizeof(struct dwc3_trb));
 		dwc3_gadget_del_and_unmap_request(dep, req, ret);
-		return ret;
 	}
 
-	return 0;
+	return ret;
 }
 
 static int __dwc3_gadget_get_frame(struct dwc3 *dwc)
-- 
2.7.4


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

* Re: [PATCH] usb: dwc3: gadget: don't remove the request if bus-expired
  2018-12-20 20:53 [PATCH] usb: dwc3: gadget: don't remove the request if bus-expired Zeng Tao
@ 2019-01-14  8:12 ` Felipe Balbi
  2019-01-21  1:49   ` Zengtao (B)
  0 siblings, 1 reply; 4+ messages in thread
From: Felipe Balbi @ 2019-01-14  8:12 UTC (permalink / raw)
  To: Zeng Tao; +Cc: Zeng Tao, Greg Kroah-Hartman, linux-usb, linux-kernel

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


Hi,

Zeng Tao <prime.zeng@hisilicon.com> writes:
> We have already returned EAGAIN for bus-expiry, and it's designed to
> start with a future Frame number and start the transfer again. So we
> should not remove the request for that case.
>
> Signed-off-by: Zeng Tao <prime.zeng@hisilicon.com>

Do we need a Fixes tag here? How about Cc stable? Can you share
tracepoints exposing the problem?


thanks

-- 
balbi

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

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

* RE: [PATCH] usb: dwc3: gadget: don't remove the request if bus-expired
  2019-01-14  8:12 ` Felipe Balbi
@ 2019-01-21  1:49   ` Zengtao (B)
  2019-01-21  9:03     ` Felipe Balbi
  0 siblings, 1 reply; 4+ messages in thread
From: Zengtao (B) @ 2019-01-21  1:49 UTC (permalink / raw)
  To: Felipe Balbi; +Cc: Greg Kroah-Hartman, linux-usb, linux-kernel

Hi balbi:

>-----Original Message-----
>From: Felipe Balbi [mailto:felipe.balbi@linux.intel.com]
>Sent: Monday, January 14, 2019 4:13 PM
>To: Zengtao (B) <prime.zeng@hisilicon.com>
>Cc: Zengtao (B) <prime.zeng@hisilicon.com>; Greg Kroah-Hartman
><gregkh@linuxfoundation.org>; linux-usb@vger.kernel.org;
>linux-kernel@vger.kernel.org
>Subject: Re: [PATCH] usb: dwc3: gadget: don't remove the request if
>bus-expired
>
>* PGP Signed by an unknown key
>
>
>Hi,
>
>Zeng Tao <prime.zeng@hisilicon.com> writes:
>> We have already returned EAGAIN for bus-expiry, and it's designed to
>> start with a future Frame number and start the transfer again. So we
>> should not remove the request for that case.
>>
>> Signed-off-by: Zeng Tao <prime.zeng@hisilicon.com>
>
>Do we need a Fixes tag here? How about Cc stable? Can you share
>tracepoints exposing the problem?
>

I am not sure that we need to Fixes tag, it's not related to any single patch, but
there is definitely something wrong, after rethinking it again, I found that there
are still some problems for this patch, for the reties inside the driver, we should not
remove the request, but if we return -EAGAIN to the gadget layer, we should because
the gadget will requeue the request again if we return -EAGAIN.

Any suggestions. 

>
>thanks
>
>--
>balbi
>
>* Unknown Key
>* 0xE11A9906

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

* RE: [PATCH] usb: dwc3: gadget: don't remove the request if bus-expired
  2019-01-21  1:49   ` Zengtao (B)
@ 2019-01-21  9:03     ` Felipe Balbi
  0 siblings, 0 replies; 4+ messages in thread
From: Felipe Balbi @ 2019-01-21  9:03 UTC (permalink / raw)
  To: Zengtao (B); +Cc: Greg Kroah-Hartman, linux-usb, linux-kernel

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


Hi,

"Zengtao (B)" <prime.zeng@hisilicon.com> writes:
>>-----Original Message-----
>>From: Felipe Balbi [mailto:felipe.balbi@linux.intel.com]
>>Sent: Monday, January 14, 2019 4:13 PM
>>To: Zengtao (B) <prime.zeng@hisilicon.com>
>>Cc: Zengtao (B) <prime.zeng@hisilicon.com>; Greg Kroah-Hartman
>><gregkh@linuxfoundation.org>; linux-usb@vger.kernel.org;
>>linux-kernel@vger.kernel.org
>>Subject: Re: [PATCH] usb: dwc3: gadget: don't remove the request if
>>bus-expired
>>
>>* PGP Signed by an unknown key
>>
>>
>>Hi,
>>
>>Zeng Tao <prime.zeng@hisilicon.com> writes:
>>> We have already returned EAGAIN for bus-expiry, and it's designed to
>>> start with a future Frame number and start the transfer again. So we
>>> should not remove the request for that case.
>>>
>>> Signed-off-by: Zeng Tao <prime.zeng@hisilicon.com>
>>
>>Do we need a Fixes tag here? How about Cc stable? Can you share
>>tracepoints exposing the problem?
>>
>
> I am not sure that we need to Fixes tag, it's not related to any single patch, but
> there is definitely something wrong, after rethinking it again, I found that there
> are still some problems for this patch, for the reties inside the driver, we should not
> remove the request, but if we return -EAGAIN to the gadget layer, we should because
> the gadget will requeue the request again if we return -EAGAIN.
>
> Any suggestions. 

Well, that needs to be patched, sure. I'm just saying that we need to
blame a patch that was incomplete so we know which stable releases need
this. Perhaps the patch at fault here was my patch adding the retry
method for isoc transfers.

-- 
balbi

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

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

end of thread, other threads:[~2019-01-21  9:34 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-12-20 20:53 [PATCH] usb: dwc3: gadget: don't remove the request if bus-expired Zeng Tao
2019-01-14  8:12 ` Felipe Balbi
2019-01-21  1:49   ` Zengtao (B)
2019-01-21  9:03     ` Felipe Balbi

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