linux-usb.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Felipe Balbi <balbi@kernel.org>
To: Thinh Nguyen <Thinh.Nguyen@synopsys.com>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Thinh Nguyen <Thinh.Nguyen@synopsys.com>,
	linux-usb@vger.kernel.org
Cc: John Youn <John.Youn@synopsys.com>
Subject: Re: [PATCH 3/3] usb: dwc3: gadget: Issue END_TRANSFER to retry isoc transfer
Date: Fri, 13 Mar 2020 16:38:06 +0200	[thread overview]
Message-ID: <871rpwgw1d.fsf@kernel.org> (raw)
In-Reply-To: <ab34698f56f613cdf63d7d955e94c064a185b001.1584065705.git.thinhn@synopsys.com>

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


Hi,

Thinh Nguyen <Thinh.Nguyen@synopsys.com> writes:

> After a number of unsuccessful start isoc attempts due to bus-expiry
> status, issue END_TRANSFER command and retry on the next XferNotReady
> event.
>
> Signed-off-by: Thinh Nguyen <thinhn@synopsys.com>
> ---
>  drivers/usb/dwc3/gadget.c | 36 +++++++++++++++++++++++++++++++++++-
>  1 file changed, 35 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/usb/dwc3/gadget.c b/drivers/usb/dwc3/gadget.c
> index f1aae4615cf1..a5ad02987536 100644
> --- a/drivers/usb/dwc3/gadget.c
> +++ b/drivers/usb/dwc3/gadget.c
> @@ -1406,7 +1406,8 @@ static int __dwc3_gadget_start_isoc(struct dwc3_ep *dep)
>  	int ret;
>  	int i;
>  
> -	if (list_empty(&dep->pending_list)) {
> +	if (list_empty(&dep->pending_list) &&
> +	    list_empty(&dep->started_list)) {
>  		dep->flags |= DWC3_EP_PENDING_REQUEST;
>  		return -EAGAIN;
>  	}
> @@ -1429,6 +1430,27 @@ static int __dwc3_gadget_start_isoc(struct dwc3_ep *dep)
>  			break;
>  	}
>  
> +	/*
> +	 * After a number of unsuccessful start attempts due to bus-expiry
> +	 * status, issue END_TRANSFER command and retry on the next XferNotReady
> +	 * event.
> +	 */
> +	if (ret == -EAGAIN) {
> +		struct dwc3_gadget_ep_cmd_params params;
> +		u32 cmd;
> +
> +		cmd = DWC3_DEPCMD_ENDTRANSFER |
> +			DWC3_DEPCMD_CMDIOC |
> +			DWC3_DEPCMD_PARAM(dep->resource_index);
> +
> +		dep->resource_index = 0;
> +		memset(&params, 0, sizeof(params));
> +
> +		ret = dwc3_send_gadget_ep_cmd(dep, cmd, &params);
> +		if (!ret)
> +			dep->flags |= DWC3_EP_END_TRANSFER_PENDING;
> +	}

I like this! Pretty good idea :-) I'll wait for your reply to my
question on the other patch, then start queueing again.

-- 
balbi

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

  reply	other threads:[~2020-03-13 14:38 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-03-13  2:18 [PATCH 0/3] usb: dwc3: gadget: Improve isoc starting mechanism Thinh Nguyen
2020-03-13  2:18 ` [PATCH 1/3] usb: dwc3: gadget: Properly handle failed kick_transfer Thinh Nguyen
2020-03-13 14:20   ` Felipe Balbi
2020-03-13 19:50     ` Thinh Nguyen
2020-03-15  8:48       ` Felipe Balbi
2020-03-16  0:33         ` Thinh Nguyen
2020-03-16  7:03           ` Felipe Balbi
2020-03-16 19:06             ` Thinh Nguyen
2020-03-29  7:52               ` Felipe Balbi
2020-03-29 23:14                 ` Thinh Nguyen
2020-03-13  2:18 ` [PATCH 2/3] ute: dwc3: gadget: Store resource index of start cmd Thinh Nguyen
2020-03-13  2:18 ` [PATCH 3/3] usb: dwc3: gadget: Issue END_TRANSFER to retry isoc transfer Thinh Nguyen
2020-03-13 14:38   ` Felipe Balbi [this message]
2020-03-13 20:01     ` Thinh Nguyen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=871rpwgw1d.fsf@kernel.org \
    --to=balbi@kernel.org \
    --cc=John.Youn@synopsys.com \
    --cc=Thinh.Nguyen@synopsys.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-usb@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).