All of lore.kernel.org
 help / color / mirror / Atom feed
From: Felipe Balbi <balbi@kernel.org>
To: Thinh Nguyen <thinh.nguyen@synopsys.com>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	linux-usb@vger.kernel.org
Cc: John Youn <john.youn@synopsys.com>
Subject: [v2,2/2] usb: dwc3: gadget: Report isoc scheduled frame number
Date: Thu, 08 Nov 2018 09:08:40 +0200	[thread overview]
Message-ID: <87a7mkt5af.fsf@linux.intel.com> (raw)

Hi,

Thinh Nguyen <thinh.nguyen@synopsys.com> writes:
> Report the scheduled frame number of an isochronous request.
>
> Signed-off-by: Thinh Nguyen <thinhn@synopsys.com>
> ---
> Change in v2:
>  - Capture frame number at request cleanup
>
>  drivers/usb/dwc3/gadget.c | 4 ++++
>  1 file changed, 4 insertions(+)
>
> diff --git a/drivers/usb/dwc3/gadget.c b/drivers/usb/dwc3/gadget.c
> index 679c12e14522..5e5e799699de 100644
> --- a/drivers/usb/dwc3/gadget.c
> +++ b/drivers/usb/dwc3/gadget.c
> @@ -2345,6 +2345,10 @@ static int dwc3_gadget_ep_cleanup_completed_request(struct dwc3_ep *dep,
>  
>  	req->request.actual = req->request.length - req->remaining;
>  
> +	/* Report scheduled frame number for isoc transfers */
> +	if (usb_endpoint_xfer_isoc(dep->endpoint.desc))
> +		req->request.start_frame = dep->frame_number;

yeah, this is really wrong. Since you're setting start_frame when
cleaning up the request, this means that dep->frame_number was already
updated due to XferComplete/XferInProgress. This means thart start_frame
will report frame number of completion event, not start. So your
debugging will be misleading.

             reply	other threads:[~2018-11-08  7:08 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-11-08  7:08 Felipe Balbi [this message]
  -- strict thread matches above, loose matches on Subject: below --
2018-11-08 19:40 [v2,2/2] usb: dwc3: gadget: Report isoc scheduled frame number Thinh Nguyen
2018-11-08  2:47 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=87a7mkt5af.fsf@linux.intel.com \
    --to=balbi@kernel.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=john.youn@synopsys.com \
    --cc=linux-usb@vger.kernel.org \
    --cc=thinh.nguyen@synopsys.com \
    /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 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.