Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1242635
| From | Doug Anderson <dianders@chromium.org> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | Re: [PATCH 3/5] CHROMIUM: usb: dwc2: Avoid double-reset at boot time |
| Date | 2015-10-08 19:40 +0200 |
| Message-ID | <qhnkC-1SL-11@gated-at.bofh.it> (permalink) |
| References | <qh7zb-4q2-5@gated-at.bofh.it> <qh7IR-4B7-11@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
Hi, On Wed, Oct 7, 2015 at 5:48 PM, Douglas Anderson <dianders@chromium.org> wrote: > In (usb: dwc2: reset dwc2 core before dwc2_get_hwparams()) we added an > extra reset to the probe path for the dwc2 USB controllers. This > allowed proper detection of parameters even if the firmware had already > used the USB part. > > Unfortunately, this extra reset is quite slow and is affecting boot > speed. We can avoid the double-reset by skipping the extra reset that > would happen just after the one we added. Logic that explains why this > is safe: > > * As of the CL mentioned above, we now always call dwc2_core_reset() in > dwc2_driver_probe() before dwc2_hcd_init(). > > * The only caller of dwc2_hcd_init() is dwc2_driver_probe(), so we're > guaranteed that dwc2_core_reset() was called before dwc2_hdc_init(). > > * dwc2_hdc_init() is the only caller that passes an irq other than -1 to > dwc2_core_init(). Thus if dwc2_core_init() is called with an irq > other than -1 we're guaranteed that dwc2_core_reset was called before > dwc2_core_init(). > > ...this allows us to remove the dwc2_core_reset() in dwc2_core_init() if > irq is not < 0. > > Note that since "irq" wasn't used in the function dwc2_core_init() > anyway and since select_phy was always set at exactly the same times we > could avoid the reset, we remove "irq" and rename "select_phy" to > "initial_setup" and adjust the callers accordingly. > > Signed-off-by: Douglas Anderson <dianders@chromium.org> > --- > drivers/usb/dwc2/core.c | 29 ++++++++++++++++++----------- > drivers/usb/dwc2/core.h | 2 +- > drivers/usb/dwc2/hcd.c | 6 +++--- > 3 files changed, 22 insertions(+), 15 deletions(-) Obviously I stupidly forgot to remove the "CHROMIUM" prefix on this patch. :( Sorry about that. I can repost if necessary... -Doug -- 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/
Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
[PATCH 0/5] usb: dwc2: fix dwc2_get_hwparams() + optimize probe time a bit Douglas Anderson <dianders@chromium.org> - 2015-10-08 02:50 +0200
[PATCH 1/5] usb: dwc2: Restore GUSBCFG in dwc2_get_hwparams() Douglas Anderson <dianders@chromium.org> - 2015-10-08 02:50 +0200
[PATCH 5/5] usb: dwc2: reduce dwc2 driver probe time Douglas Anderson <dianders@chromium.org> - 2015-10-08 03:00 +0200
[PATCH 3/5] CHROMIUM: usb: dwc2: Avoid double-reset at boot time Douglas Anderson <dianders@chromium.org> - 2015-10-08 03:00 +0200
Re: [PATCH 3/5] CHROMIUM: usb: dwc2: Avoid double-reset at boot time Doug Anderson <dianders@chromium.org> - 2015-10-08 19:40 +0200
[PATCH 4/5] usb: dwc2: Speed dwc2_get_hwparams() on some host-only ports Douglas Anderson <dianders@chromium.org> - 2015-10-08 03:00 +0200
[PATCH 2/5] usb: dwc2: reset dwc2 core before dwc2_get_hwparams() Douglas Anderson <dianders@chromium.org> - 2015-10-08 03:00 +0200
csiph-web