Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1273219

Re: [PATCH v3 6/8] usb: dwc2: host: Assume all devices are on one single_tt hub

From Felipe Balbi <balbi@ti.com>
Newsgroups linux.kernel
Subject Re: [PATCH v3 6/8] usb: dwc2: host: Assume all devices are on one single_tt hub
Date 2015-11-19 16:40 +0100
Message-ID <qwztw-2Iv-9@gated-at.bofh.it> (permalink)
References <qvCMN-6dd-3@gated-at.bofh.it> <qvCMO-6dd-13@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


[Multipart message — attachments visible in raw view] - view raw

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

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH v3 6/8] usb: dwc2: host: Assume all devices are on one single_tt hub Douglas Anderson <dianders@chromium.org> - 2015-11-17 02:00 +0100
  Re: [PATCH v3 6/8] usb: dwc2: host: Assume all devices are on one  single_tt hub Doug Anderson <dianders@chromium.org> - 2015-11-17 22:30 +0100
  Re: [PATCH v3 6/8] usb: dwc2: host: Assume all devices are on one single_tt hub Felipe Balbi <balbi@ti.com> - 2015-11-19 16:40 +0100
    Re: [PATCH v3 6/8] usb: dwc2: host: Assume all devices are on one  single_tt hub Doug Anderson <dianders@chromium.org> - 2015-11-19 17:30 +0100
      Re: [PATCH v3 6/8] usb: dwc2: host: Assume all devices are on one single_tt hub Felipe Balbi <balbi@ti.com> - 2015-11-19 20:30 +0100
      Re: [PATCH v3 6/8] usb: dwc2: host: Assume all devices are on one  single_tt hub John Youn <John.Youn@synopsys.com> - 2015-11-20 05:40 +0100
        Re: [PATCH v3 6/8] usb: dwc2: host: Assume all devices are on one  single_tt hub Doug Anderson <dianders@chromium.org> - 2015-11-24 01:30 +0100
          Re: [PATCH v3 6/8] usb: dwc2: host: Assume all devices are on one  single_tt hub Doug Anderson <dianders@chromium.org> - 2015-11-26 01:50 +0100

csiph-web