From: Daniel Mack <daniel@zonque.org>
To: Peter Chen <peter.chen@freescale.com>, balbi@ti.com
Cc: linux-usb@vger.kernel.org, stable@vger.kernel.org
Subject: Re: [PATCH 2/2] usb: gadget: f_uac2: fix calculation of uac2->p_interval
Date: Mon, 27 Jul 2015 10:13:49 +0200 [thread overview]
Message-ID: <55B5E83D.8030709@zonque.org> (raw)
In-Reply-To: <1437979907-29976-2-git-send-email-peter.chen@freescale.com>
On 07/27/2015 08:51 AM, Peter Chen wrote:
> The p_interval should be less if the 'bInterval' at the descriptor
> is larger, eg, if 'bInterval' is 5 for HS, the p_interval should be
> 8000 / 16 = 500.
>
> It fixes the patch 9bb87f16 "usb: gadget: f_uac2: send reasonably
> sized packets"
>
Acked-by: Daniel Mack <zonque@gmail.com>
Thanks for spotting this!
Daniel
> Cc: Daniel Mack <zonque@gmail.com>
> Cc: <stable@vger.kernel.org> #v3.18+
> Signed-off-by: Peter Chen <peter.chen@freescale.com>
> ---
> drivers/usb/gadget/function/f_uac2.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/usb/gadget/function/f_uac2.c b/drivers/usb/gadget/function/f_uac2.c
> index 51ca32d..4bd9a8e 100644
> --- a/drivers/usb/gadget/function/f_uac2.c
> +++ b/drivers/usb/gadget/function/f_uac2.c
> @@ -1191,14 +1191,14 @@ afunc_set_alt(struct usb_function *fn, unsigned intf, unsigned alt)
> factor = 1000;
> } else {
> ep_desc = &hs_epin_desc;
> - factor = 125;
> + factor = 8000;
> }
>
> /* pre-compute some values for iso_complete() */
> uac2->p_framesize = opts->p_ssize *
> num_channels(opts->p_chmask);
> rate = opts->p_srate * uac2->p_framesize;
> - uac2->p_interval = (1 << (ep_desc->bInterval - 1)) * factor;
> + uac2->p_interval = factor / (1 << (ep_desc->bInterval - 1));
> uac2->p_pktsize = min_t(unsigned int, rate / uac2->p_interval,
> prm->max_psize);
>
>
next prev parent reply other threads:[~2015-07-27 8:13 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-07-27 6:51 [PATCH v3 1/2] usb: gadget: f_uac2: finalize wMaxPacketSize according to bandwidth Peter Chen
2015-07-27 6:51 ` [PATCH 2/2] usb: gadget: f_uac2: fix calculation of uac2->p_interval Peter Chen
2015-07-27 8:13 ` Daniel Mack [this message]
2015-07-27 8:13 ` [PATCH v3 1/2] usb: gadget: f_uac2: finalize wMaxPacketSize according to bandwidth Daniel Mack
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=55B5E83D.8030709@zonque.org \
--to=daniel@zonque.org \
--cc=balbi@ti.com \
--cc=linux-usb@vger.kernel.org \
--cc=peter.chen@freescale.com \
--cc=stable@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 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.