Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758796AbbKSPe4 (ORCPT ); Thu, 19 Nov 2015 10:34:56 -0500 Received: from bear.ext.ti.com ([192.94.94.41]:54378 "EHLO bear.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756521AbbKSPey (ORCPT ); Thu, 19 Nov 2015 10:34:54 -0500 From: Felipe Balbi To: Douglas Anderson , John Youn CC: Yunzhi Li , Heiko =?utf-8?Q?St=C3=BCbner?= , , Julius Werner , , , , , , Douglas Anderson , , , , Subject: Re: [PATCH v3 6/8] usb: dwc2: host: Assume all devices are on one single_tt hub In-Reply-To: <1447721484-22548-7-git-send-email-dianders@chromium.org> References: <1447721484-22548-1-git-send-email-dianders@chromium.org> <1447721484-22548-7-git-send-email-dianders@chromium.org> User-Agent: Notmuch/0.21 (http://notmuchmail.org) Emacs/24.5.1 (x86_64-pc-linux-gnu) Date: Thu, 19 Nov 2015 09:34:11 -0600 Message-ID: <87lh9uf1fw.fsf@saruman.tx.rr.com> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha1; protocol="application/pgp-signature" Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 3514 Lines: 99 --=-=-= Content-Type: text/plain Content-Transfer-Encoding: quoted-printable Hi, Douglas Anderson 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 > --- > 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 =3D start; >=20=20 > + if (qh->do_split) { > + for (i =3D start / EARLY_FRAME_USEC; > + i < DIV_ROUND_UP(start + utime - 1, EARLY_FRAME_USEC); > + i++) > + hsotg->has_split[i] =3D true; hsotg->has_split |=3D BIT(i); > @@ -546,6 +577,13 @@ static void dwc2_deschedule_periodic(struct dwc2_hso= tg *hsotg, > } >=20=20 > bitmap_clear(hsotg->periodic_bitmap, start, utime); > + > + if (qh->do_split) { > + for (i =3D start / EARLY_FRAME_USEC; > + i < DIV_ROUND_UP(start + utime - 1, EARLY_FRAME_USEC); > + i++) > + hsotg->has_split[i] =3D false; hsotg->has_split &=3D ~BIT(i); =2D-=20 balbi --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQIcBAEBAgAGBQJWTevzAAoJEIaOsuA1yqRE164P/3okfRduTpyxQruf+EPPe1wG juAWq0QkbsySPoT/ang4ULeTxnBDJSoN61ztEdfYK63d3R+AxkieBmHR6pusjwEO 9tnDAZXBB/1NVB4QU9CcRYDoYqzFIAd1bQKrs4YUJvRbgpFl/MrBFGpuMBMyiLM0 bnMO7k4pl8WU2SGN0Rys4uMa7nV9Gi/C5pMPo3OuzZyhjq36PkQTjuWl8Bv33kj4 O0QQI+dKxe7RHWqHJ01pN5tc6knf69a4EYcamH0lS0iRMLVHT/X9mUJ1lA4OVcEs 6Ni2Slvi7TlDhVql0ZQrj9oHhTUva5c3UdqRUa9gHD/2fqRmb8OP89aer2N+4V5z anHRRXCsUEdgOlawYsOcYz2HRJfLs6bEc9ZJgJiyiAtdywzNtJv4qpGsnKrbKM5f 2jNr9jYHYai2lZKggXyV/6Rgng2+xl5MDeGKWe8ilgBz1gxkGfX4n6I63xteYUd2 YKlKnf5uJvE+6caUKyhPdxJFh4IjvSOjpVD5G/XIErOjvYYtUqvwgLopmRrCIssh Tc34PUVnzG1z/IK0e2l5YWGpNzqWqzTd0rw/V8RciUr8HLSrjxLUUUujt9CJZY8n JNTLBYtKaKdmG4fWq12dc7NSvRDzLNqLL28jV++VFs89cdbfp1lwedzg/5SPBbo6 1+jbeS6lbwebmm6JDGnO =lmDb -----END PGP SIGNATURE----- --=-=-=-- -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/