diff mbox

[v2,1/2] usb: phy: load usb phy earlier

Message ID 1423142643-12280-2-git-send-email-zhangfei.gao@linaro.org
State Superseded
Headers show

Commit Message

Zhangfei Gao Feb. 5, 2015, 1:24 p.m. UTC
Since phy is definitely used in usb controller, load the phy
earlier to make boot time shorter.

Signed-off-by: Zhangfei Gao <zhangfei.gao@linaro.org>
---
 drivers/usb/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Zhangfei Gao Feb. 25, 2015, 1:19 p.m. UTC | #1
On 02/23/2015 11:28 PM, Felipe Balbi wrote:
> On Fri, Feb 06, 2015 at 09:01:16AM +0800, Peter Chen wrote:
>> On Thu, Feb 05, 2015 at 09:24:02PM +0800, Zhangfei Gao wrote:
>>> Since phy is definitely used in usb controller, load the phy
>>> earlier to make boot time shorter.
>>>
>>> Signed-off-by: Zhangfei Gao <zhangfei.gao@linaro.org>
>>> ---
>>>   drivers/usb/Makefile | 2 +-
>>>   1 file changed, 1 insertion(+), 1 deletion(-)
>>>
>>> diff --git a/drivers/usb/Makefile b/drivers/usb/Makefile
>>> index 2f1e2aa..d8926c6 100644
>>> --- a/drivers/usb/Makefile
>>> +++ b/drivers/usb/Makefile
>>> @@ -5,6 +5,7 @@
>>>   # Object files in subdirectories
>>>
>>>   obj-$(CONFIG_USB)		+= core/
>>> +obj-$(CONFIG_USB_SUPPORT)	+= phy/
>>>
>>>   obj-$(CONFIG_USB_DWC3)		+= dwc3/
>>>   obj-$(CONFIG_USB_DWC2)		+= dwc2/
>>> @@ -48,7 +49,6 @@ obj-$(CONFIG_USB_MICROTEK)	+= image/
>>>   obj-$(CONFIG_USB_SERIAL)	+= serial/
>>>
>>>   obj-$(CONFIG_USB)		+= misc/
>>> -obj-$(CONFIG_USB_SUPPORT)	+= phy/
>>>   obj-$(CONFIG_EARLY_PRINTK_DBGP)	+= early/
>>>
>>>   obj-$(CONFIG_USB_ATM)		+= atm/
>>> --
>>> 1.9.1
>>>
>>
>> After thinking more, I think it is a good patch, USB PHY works proper
>> is the base for coming USB controller operation, with this patch,
>> it can avoid the controller drivers which are linked earlier than USB PHY
>> always being probed deferral, look at drivers/Makefile, it links drivers
>> follow the similar method.
>>
>> Acked-by: Peter Chen <peter.chen@freescale.com>
>
> the problem, though, is that this also hides drivers which are not
> handling unordered initializations properly. If everything is built as a
> module, udev might device to load modules in whatever order it might see
> fit.

But this should not be the reason we intentionally move phy ahead of 
controller, which must use phy as base.

Besides, there are many examples in drivers/Makefile

# Many drivers will want to use DMA so this has to be made available 

# really early. 

obj-$(CONFIG_DMADEVICES)        += dma/

# regulators early, since some subsystems rely on them to initialize 

obj-$(CONFIG_REGULATOR)         += regulator/ 

 

# reset controllers early, since gpu drivers might rely on them to 
initialize
obj-$(CONFIG_RESET_CONTROLLER)  += reset/
>
> Zhangfei, you're claiming boot time is shorter with this patch. How much
> shorter ? How have you measured the time you saved ?

Not measure precisely.
Load ramfs from 5.354419 to 5.302098,

However, as you said, new phy should be in driver/phy, then no such 
issue in the future.

Thanks



--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/drivers/usb/Makefile b/drivers/usb/Makefile
index 2f1e2aa..d8926c6 100644
--- a/drivers/usb/Makefile
+++ b/drivers/usb/Makefile
@@ -5,6 +5,7 @@ 
 # Object files in subdirectories
 
 obj-$(CONFIG_USB)		+= core/
+obj-$(CONFIG_USB_SUPPORT)	+= phy/
 
 obj-$(CONFIG_USB_DWC3)		+= dwc3/
 obj-$(CONFIG_USB_DWC2)		+= dwc2/
@@ -48,7 +49,6 @@  obj-$(CONFIG_USB_MICROTEK)	+= image/
 obj-$(CONFIG_USB_SERIAL)	+= serial/
 
 obj-$(CONFIG_USB)		+= misc/
-obj-$(CONFIG_USB_SUPPORT)	+= phy/
 obj-$(CONFIG_EARLY_PRINTK_DBGP)	+= early/
 
 obj-$(CONFIG_USB_ATM)		+= atm/