From: Felipe Balbi <balbi@ti.com>
To: Douglas Anderson <dianders@chromium.org>,
John Youn <John.Youn@synopsys.com>
Cc: "Yunzhi Li" <lyz@rock-chips.com>,
"Heiko Stübner" <heiko@sntech.de>,
linux-rockchip@lists.infradead.org,
"Julius Werner" <jwerner@chromium.org>,
gregory.herrero@intel.com, yousaf.kaukab@intel.com,
dinguyen@opensource.altera.com, stern@rowland.harvard.edu,
ming.lei@canonical.com,
"Douglas Anderson" <dianders@chromium.org>,
johnyoun@synopsys.com, gregkh@linuxfoundation.org,
linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v3 6/8] usb: dwc2: host: Assume all devices are on one single_tt hub
Date: Thu, 19 Nov 2015 09:34:11 -0600 [thread overview]
Message-ID: <87lh9uf1fw.fsf@saruman.tx.rr.com> (raw)
In-Reply-To: <1447721484-22548-7-git-send-email-dianders@chromium.org>
[-- Attachment #1: Type: text/plain, Size: 2323 bytes --]
Hi,
Douglas Anderson <dianders@chromium.org> writes:
> Until we have logic to determine which devices share the same TT let's
> add logic to assume that all devices on a given dwc2 controller are on
> one single_tt hub. This is better than the previous code that assumed
> that all devices were on one multi_tt hub, since single_tt hubs
> appear (in my experience) to be much more common and any schedule that
> would work on a single_tt hub will also work on a multi_tt hub. This
> will prevent more than 8 total low/full speed devices to be on the bus
> at one time, but that's a reasonable restriction until we've made things
> smarter.
>
> Signed-off-by: Douglas Anderson <dianders@chromium.org>
> ---
> Changes in v3:
> - Assuming single_tt is new for v3; not terribly well tested (yet).
>
> Changes in v2: None
>
> drivers/usb/dwc2/core.h | 1 +
> drivers/usb/dwc2/hcd_queue.c | 40 +++++++++++++++++++++++++++++++++++++++-
> 2 files changed, 40 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/usb/dwc2/core.h b/drivers/usb/dwc2/core.h
> index 567ee2c9e69f..09aa2b5ae29e 100644
> --- a/drivers/usb/dwc2/core.h
> +++ b/drivers/usb/dwc2/core.h
> @@ -782,6 +782,7 @@ struct dwc2_hsotg {
> u16 periodic_usecs;
> unsigned long periodic_bitmap[DIV_ROUND_UP(TOTAL_PERIODIC_USEC,
> BITS_PER_LONG)];
> + bool has_split[8];
why don't you use a u8 instead then just set each bit for each
"has_split" you need to take care of. This array is kinda ugly.
> @@ -386,6 +409,13 @@ static int dwc2_find_multi_uframe(struct dwc2_hsotg *hsotg, struct dwc2_qh *qh)
> bitmap_set(hsotg->periodic_bitmap, start, qh->usecs);
> qh->start_usecs = start;
>
> + if (qh->do_split) {
> + for (i = start / EARLY_FRAME_USEC;
> + i < DIV_ROUND_UP(start + utime - 1, EARLY_FRAME_USEC);
> + i++)
> + hsotg->has_split[i] = true;
hsotg->has_split |= BIT(i);
> @@ -546,6 +577,13 @@ static void dwc2_deschedule_periodic(struct dwc2_hsotg *hsotg,
> }
>
> bitmap_clear(hsotg->periodic_bitmap, start, utime);
> +
> + if (qh->do_split) {
> + for (i = start / EARLY_FRAME_USEC;
> + i < DIV_ROUND_UP(start + utime - 1, EARLY_FRAME_USEC);
> + i++)
> + hsotg->has_split[i] = false;
hsotg->has_split &= ~BIT(i);
--
balbi
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 818 bytes --]
next prev parent reply other threads:[~2015-11-19 15:34 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-11-17 0:51 [PATCH v3 0/8] dwc2: Fix uframe scheduler + speed up the interrupt handler quite a bit Douglas Anderson
2015-11-17 0:51 ` [PATCH v3 1/8] usb: dwc2: rockchip: Make the max_transfer_size automatic Douglas Anderson
2015-11-17 0:51 ` [PATCH v3 2/8] usb: dwc2: host: Get aligned DMA in a more supported way Douglas Anderson
2015-11-17 0:51 ` [PATCH v3 3/8] usb: dwc2: host: Add scheduler tracing Douglas Anderson
2015-11-17 0:51 ` [PATCH v3 4/8] usb: dwc2: host: Rewrite the microframe scheduler Douglas Anderson
2015-11-17 0:51 ` [PATCH v3 5/8] usb: dwc2: host: Keep track of and use our scheduled microframe Douglas Anderson
2015-11-17 0:51 ` [PATCH v3 6/8] usb: dwc2: host: Assume all devices are on one single_tt hub Douglas Anderson
2015-11-17 21:22 ` Doug Anderson
2015-11-19 15:34 ` Felipe Balbi [this message]
2015-11-19 16:27 ` Doug Anderson
2015-11-19 19:20 ` Felipe Balbi
2015-11-20 4:33 ` John Youn
2015-11-24 0:28 ` Doug Anderson
2015-11-26 0:44 ` Doug Anderson
2015-11-17 0:51 ` [PATCH v3 7/8] usb: dwc2: host: Add a delay before releasing periodic bandwidth Douglas Anderson
2015-11-17 0:51 ` [PATCH v3 8/8] usb: dwc2: host: Giveback URB in tasklet context Douglas Anderson
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=87lh9uf1fw.fsf@saruman.tx.rr.com \
--to=balbi@ti.com \
--cc=John.Youn@synopsys.com \
--cc=dianders@chromium.org \
--cc=dinguyen@opensource.altera.com \
--cc=gregkh@linuxfoundation.org \
--cc=gregory.herrero@intel.com \
--cc=heiko@sntech.de \
--cc=johnyoun@synopsys.com \
--cc=jwerner@chromium.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-rockchip@lists.infradead.org \
--cc=linux-usb@vger.kernel.org \
--cc=lyz@rock-chips.com \
--cc=ming.lei@canonical.com \
--cc=stern@rowland.harvard.edu \
--cc=yousaf.kaukab@intel.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 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).