Linux USB
 help / color / mirror / Atom feed
From: Greg KH <gregkh@linuxfoundation.org>
To: Michael Grzeschik <m.grzeschik@pengutronix.de>
Cc: linux-usb@vger.kernel.org, balbi@kernel.org, kernel@pengutronix.de
Subject: Re: [PATCH] usb: dwc3: gadget: fix high-speed multiplier setting
Date: Fri, 1 Jul 2022 10:02:56 +0200	[thread overview]
Message-ID: <Yr6qMFCR4Dmr6oai@kroah.com> (raw)
In-Reply-To: <20220630140216.185919-1-m.grzeschik@pengutronix.de>

On Thu, Jun 30, 2022 at 04:02:16PM +0200, Michael Grzeschik wrote:
> For high-speed transfers the __dwc3_prepare_one_trb function is
> calculating the multiplier setting for the trb based on the length of
> the trb currently prepared. This assumption is wrong. For trbs with a
> sglist the length of the actual request has to be taken instead.
> 
> Signed-off-by: Michael Grzeschik <m.grzeschik@pengutronix.de>
> ---
>  drivers/usb/dwc3/gadget.c | 8 ++++----
>  1 file changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/usb/dwc3/gadget.c b/drivers/usb/dwc3/gadget.c
> index 8716bece107208..0fc3ecfaa48baf 100644
> --- a/drivers/usb/dwc3/gadget.c
> +++ b/drivers/usb/dwc3/gadget.c
> @@ -1186,7 +1186,7 @@ static void __dwc3_prepare_one_trb(struct dwc3_ep *dep, struct dwc3_trb *trb,
>  		dma_addr_t dma, unsigned int length, unsigned int chain,
>  		unsigned int node, unsigned int stream_id,
>  		unsigned int short_not_ok, unsigned int no_interrupt,
> -		unsigned int is_last, bool must_interrupt)
> +		unsigned int is_last, bool must_interrupt, int req_length)

Why not put this right next to 'length'?

And wow, that's a crazy number of options for a function.  Why is this
even a separate function at all?  Why can't it just be in
dwc3_prepare_one_trb() as that's the only place this is called?

thanks,

greg k-h

  parent reply	other threads:[~2022-07-01  8:03 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-06-30 14:02 [PATCH] usb: dwc3: gadget: fix high-speed multiplier setting Michael Grzeschik
2022-07-01  8:01 ` Greg KH
2022-07-01 21:27   ` Michael Grzeschik
2022-07-01  8:02 ` Greg KH [this message]
2022-07-01 21:56   ` Michael Grzeschik

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=Yr6qMFCR4Dmr6oai@kroah.com \
    --to=gregkh@linuxfoundation.org \
    --cc=balbi@kernel.org \
    --cc=kernel@pengutronix.de \
    --cc=linux-usb@vger.kernel.org \
    --cc=m.grzeschik@pengutronix.de \
    /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