diff mbox

fsl_udc_core not initializing properly?

Message ID 20110312090002.7b703e61@wker (mailing list archive)
State Not Applicable
Headers show

Commit Message

Anatolij Gustschin March 12, 2011, 8 a.m. UTC
Hi Matthew,

On Thu, 10 Mar 2011 13:46:29 -0500
"Matthew L. Creech" <mlcreech@gmail.com> wrote:
...
> I tracked the problem down to a change made in September, which
> happens to be yours:
> 
> http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commitdiff;h=126512e3f274802ca65ebeca8660237f0361ad48
> 
> When I roll this back, everything works fine again.
> 
> First of all, I noticed that fsl-mph-dr-of.c isn't even compiling for
> me (even though I have the option enabled in my .config), because it's
> been placed in "usb/host/", and I'm only using device/gadget-mode USB.
> 
> I edited the top-level Makefile to just force it into "usb/host/", and
> that makes sure that your driver gets built (and it's probed just fine
> at runtime).  But that still didn't solve the problem - as before,
> fsl_udc_probe() is never being called.
> 
> Did you test this change in device mode?  I'm wondering if there's
> something different about my configuration that prevents it from
> working.  My config is uploaded here if it helps:
> 
> http://mcreech.com/work/linux.config

Can you please apply the attached patch, then build with your
linux.config and send me the kernel boot log? It will help to
fix the issue.

Thanks,

Anatolij

Comments

Matthew L. Creech March 14, 2011, 3:47 p.m. UTC | #1
On Sat, Mar 12, 2011 at 3:00 AM, Anatolij Gustschin <agust@denx.de> wrote:
>
> Can you please apply the attached patch, then build with your
> linux.config and send me the kernel boot log? It will help to
> fix the issue.
>

Actually, this kernel seems to work:

...
Freescale PowerQUICC MII Bus: probed
tun: Universal TUN/TAP device driver, 1.6
tun: (C) 1999-2004 Max Krasnyansky <maxk@qualcomm.com>
fsl_usb2_mph_dr_of_probe
Freescale High-Speed USB SOC Device Controller driver (Apr 20, 2007)
fsl_udc_probe
g_ether gadget: using random self ethernet address
...

Oddly enough, the kernel I tried last week did the same thing (I
hard-coded "obj-y += usb/host/" into drivers/Makefile), but I had a
printk() at the top of fsl_udc_probe() that never got called.

Oh, I see the difference now: you added the usb/host/ entry before
usb/gadget/, while I added it afterward...  I forgot that link order
determines initialization order in the kernel.

Anyway, seems to work fine.  :)  Thanks Antolij!
diff mbox

Patch

diff --git a/drivers/Makefile b/drivers/Makefile
index f3ebb30..bf1ad90 100644
--- a/drivers/Makefile
+++ b/drivers/Makefile
@@ -67,6 +67,7 @@  obj-$(CONFIG_UWB)		+= uwb/
 obj-$(CONFIG_USB_OTG_UTILS)	+= usb/otg/
 obj-$(CONFIG_USB)		+= usb/
 obj-$(CONFIG_USB_MUSB_HDRC)	+= usb/musb/
+obj-$(CONFIG_USB_FSL_MPH_DR_OF)	+= usb/host/
 obj-$(CONFIG_PCI)		+= usb/
 obj-$(CONFIG_USB_GADGET)	+= usb/gadget/
 obj-$(CONFIG_SERIO)		+= input/serio/
diff --git a/drivers/usb/gadget/fsl_udc_core.c b/drivers/usb/gadget/fsl_udc_core.c
index 4c55eda..a3ba374 100644
--- a/drivers/usb/gadget/fsl_udc_core.c
+++ b/drivers/usb/gadget/fsl_udc_core.c
@@ -2240,6 +2240,7 @@  static int __init fsl_udc_probe(struct platform_device *pdev)
 	unsigned int i;
 	u32 dccparams;
 
+	printk("%s\n", __func__);
 	if (strcmp(pdev->name, driver_name)) {
 		VDBG("Wrong device");
 		return -ENODEV;
diff --git a/drivers/usb/host/fsl-mph-dr-of.c b/drivers/usb/host/fsl-mph-dr-of.c
index 574b99e..b8b3070 100644
--- a/drivers/usb/host/fsl-mph-dr-of.c
+++ b/drivers/usb/host/fsl-mph-dr-of.c
@@ -130,6 +130,7 @@  static int __devinit fsl_usb2_mph_dr_of_probe(struct platform_device *ofdev)
 	static unsigned int idx;
 	int i;
 
+	printk("%s\n", __func__);
 	if (!of_device_is_available(np))
 		return -ENODEV;