From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from wolverine01.qualcomm.com ([199.106.114.254]:22311 "EHLO wolverine01.qualcomm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755684Ab0LPMxR (ORCPT ); Thu, 16 Dec 2010 07:53:17 -0500 Message-ID: <4D0A0BB7.8070903@codeaurora.org> Date: Thu, 16 Dec 2010 18:23:11 +0530 From: Pavan Kondeti MIME-Version: 1.0 Subject: Re: [RFC 5/5] USB: Eliminate delays involved in root hub initialization during HNP 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> <20101216121547.GA6652@legolas.emea.dhcp.ti.com> In-Reply-To: <20101216121547.GA6652@legolas.emea.dhcp.ti.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Sender: linux-arm-msm-owner@vger.kernel.org List-ID: To: balbi@ti.com Cc: linux-usb@vger.kernel.org, linux-arm-msm@vger.kernel.org On 12/16/2010 5:45 PM, Felipe Balbi wrote: > 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. > If you keep the HCD, root hub auto/system suspend can happen, user may un-configure the root hub or remove the HCD etc. There is not standard way of guarding against PM & user for this kind of HCD. We had a discussion about this some time back. Please see http://www.spinics.net/lists/linux-usb/msg35847.html Thanks, Pavan -- Sent by a consultant of the Qualcomm Innovation Center, Inc. The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum.