From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from na3sys009aog113.obsmtp.com ([74.125.149.209]:43983 "EHLO na3sys009aog113.obsmtp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754725Ab0LPMPw (ORCPT ); Thu, 16 Dec 2010 07:15:52 -0500 Date: Thu, 16 Dec 2010 14:15:47 +0200 From: Felipe Balbi Subject: Re: [RFC 5/5] USB: Eliminate delays involved in root hub initialization during HNP Message-ID: <20101216121547.GA6652@legolas.emea.dhcp.ti.com> Reply-To: balbi@ti.com References: <1292411654-21382-1-git-send-email-pkondeti@codeaurora.org> <1292411654-21382-6-git-send-email-pkondeti@codeaurora.org> <20101215122156.GR2997@legolas.emea.dhcp.ti.com> <4D09F757.5070608@codeaurora.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Disposition: inline In-Reply-To: <4D09F757.5070608@codeaurora.org> Sender: linux-arm-msm-owner@vger.kernel.org List-ID: To: Pavan Kondeti Cc: balbi@ti.com, linux-usb@vger.kernel.org, linux-arm-msm@vger.kernel.org On Thu, Dec 16, 2010 at 04:56:15PM +0530, Pavan Kondeti wrote: >On 12/15/2010 5:51 PM, Felipe Balbi wrote: >> On Wed, Dec 15, 2010 at 04:44:14PM +0530, Pavankumar Kondeti wrote: >>> Some USB controllers have common resources (IRQ, register address >>> space) for Host, Peripheral and OTG. So HCD is added only before >>> entering into Host mode. Root hub initialization is done in >>> different steps to decrease boot up time. But this makes B-device >>> difficult to meet HNP timings. Hence eliminate delays involved in >>> root hub initialization for B-host. >> >> I wonder if this is the best approach. Would it be easier to not touch >> usbcore, probe the entire stack during boot but have a "core" layer >> handling synchronization to shared resources ? >> >The implementation is like this: > >Actually OTG synchronizes UDC and HCD. OTG driver probe will be called >first and it takes care of turning on clocks, resetting controller and >PHY and enabling interrupts (VBUS and Id). UDC and HCD will not modify >hardware registers in their probe functions. So HCD will not call >usb_add_hcd() function in it's probe(). After HCD and UDC registers with >OTG via otg_set_xxx(), OTG activates HCD (by calling usb_add_hcd()) or >UDC (usb_gadget_connect()) based on Id/VBUS status. When gadget is >active, HCD is detached from USB core (usb_remove_hcd()). So user space >can not poke into sysfs/debugfs nodes provided in the usb core. > >> Maybe you could make your device an MFD device that allocates >> platform_devices for its children (HCI, UDC, OTG, etc) and pass in a >> bunch of read/write functions as platform_data for them to use as >> accessors to shared register space ?!? Would that work ? >> >The easy way to deal this problem is removing HCD when Mini/Micro -A >cable is detached. But why do you need to do that isn't clear. What's the problem in keeping HCD always available ? If it's a mini/micro-B cable you will enter peripheral role anyway. -- balbi