Skip to contentSkip to conversation

usb: ulpi: ulpi_init should be executed in subsys_initcall

PATCH Superseded Lu Baolu 4 participants 6 messages May 22, 2015 – May 27, 2015

Subsystems (2)

v3 of 5 Superseded Latest is v5 →

lore
Share & tools
lore

Lu Baolu

author
#0 lore raw

PATCH v3 1/1 usb: ulpi: ulpi_init should be executed in subsys_initcall

Phy drivers and the ulpi interface providers depend on the registeration of the ulpi bus. Ulpi registers the bus in module_init(). This could result in a load order issue, i.e. ulpi phy drivers or the ulpi interface providers loading before the bus registeration.

This patch fixes this load order issue by putting ulpi_init in subsys_initcall().

---
 drivers/usb/common/ulpi.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/usb/common/ulpi.c +1 -1
index 0e6f968..01c0c04 100644
@@ -242,7 +242,7 @@ static int __init ulpi_init(void)
 {
 	return bus_register(&ulpi_bus);
 }
-module_init(ulpi_init);
+subsys_initcall(ulpi_init);
 
 static void __exit ulpi_exit(void)
 {
Signature · 1 line
2.1.4
#1 lore raw

Hi,

Quoted 3 lines · Lu Baolu

Phy drivers and the ulpi interface providers depend on the registeration of the ulpi bus. Ulpi registers the bus in module_init(). This could result in a load order issue, i.e.

It's still not an issue :(
I'd say "unnecessary probe delays".

But of cource it's Felipe's call :) Description looks better now.

BR, David

Quoted 28 lines

ulpi phy drivers or the ulpi interface providers loading before the bus registeration.

This patch fixes this load order issue by putting ulpi_init in subsys_initcall().

---
 drivers/usb/common/ulpi.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/usb/common/ulpi.c +1 -1
index 0e6f968..01c0c04 100644
@@ -242,7 +242,7 @@ static int __init ulpi_init(void)
 {
 	return bus_register(&ulpi_bus);
 }
-module_init(ulpi_init);
+subsys_initcall(ulpi_init);
 
 static void __exit ulpi_exit(void)
 {
Signature · 1 line
2.1.4
author
#2 lore raw
Quoted 8 lines · David Cohen

Hi,

Quoted 3 lines · Lu Baolu

Phy drivers and the ulpi interface providers depend on the registeration of the ulpi bus. Ulpi registers the bus in module_init(). This could result in a load order issue, i.e.

It's still not an issue :(
I'd say "unnecessary probe delays".

I managed to boot a kernel built from the top of Felipe's remotes/origin/next branch under an Ubuntu environment on Intel's Bay Trail tablet.

The same panic (as I found in the Android environment previously) shows up as well. And if I replace module_init() with sys_initcall(), the panic disappears.

Thanks,
-Baolu

Quoted 34 lines

But of cource it's Felipe's call :) Description looks better now.

BR, David

Quoted 28 lines

ulpi phy drivers or the ulpi interface providers loading before the bus registeration.

This patch fixes this load order issue by putting ulpi_init in subsys_initcall().

---
  drivers/usb/common/ulpi.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
drivers/usb/common/ulpi.c +1 -1
index 0e6f968..01c0c04 100644
@@ -242,7 +242,7 @@ static int __init ulpi_init(void)
  {
  	return bus_register(&ulpi_bus);
  }
-module_init(ulpi_init);
+subsys_initcall(ulpi_init);
 
  static void __exit ulpi_exit(void)
  {
Signature · 1 line
2.1.4
#3 lore raw

Hi,

Quoted 12 lines · Baolu
Quoted 8 lines · David Cohen

Hi,

Quoted 3 lines · Lu Baolu

Phy drivers and the ulpi interface providers depend on the registeration of the ulpi bus. Ulpi registers the bus in module_init(). This could result in a load order issue, i.e.

It's still not an issue :(
I'd say "unnecessary probe delays".

Quoted 7 lines

I managed to boot a kernel built from the top of Felipe's remotes/origin/next branch under an Ubuntu environment on Intel's Bay Trail tablet.

The same panic (as I found in the Android environment previously) shows up as well. And if I replace module_init() with sys_initcall(), the panic disappears.

the problem is something else... Moving things around in the init levels is just a workaround for another issue. Seems like there's some missing EPROBE_DEFER somewhere.

Signature · 1 line
balbi
author
#4 lore raw
Quoted 17 lines · Felipe Balbi

Hi,

Quoted 14 lines · Baolu
Quoted 8 lines · David Cohen

Hi,

Quoted 3 lines · Lu Baolu

Phy drivers and the ulpi interface providers depend on the registeration of the ulpi bus. Ulpi registers the bus in module_init(). This could result in a load order issue, i.e.

It's still not an issue :(
I'd say "unnecessary probe delays".

I managed to boot a kernel built from the top of Felipe's remotes/origin/next branch under an Ubuntu environment on Intel's Bay Trail tablet.

Quoted 6 lines
Quoted 3 lines

The same panic (as I found in the Android environment previously) shows up as well. And if I replace module_init() with sys_initcall(), the panic disappears.

the problem is something else... Moving things around in the init levels is just a workaround for another issue. Seems like there's some missing EPROBE_DEFER somewhere.

Yes, I agree.

Heikki, I assume "missing EPROBE_DEFER issue" will be fixed by Sasha's patch. I will resend the patch with a new commit message.

Thanks,
Baolu

Quoted 1 line
maintainer Acked-by
#5 lore raw
In reply to David Cohen
Quoted 7 lines · David Cohen

Hi,

Quoted 3 lines · Lu Baolu

Phy drivers and the ulpi interface providers depend on the registeration of the ulpi bus. Ulpi registers the bus in module_init(). This could result in a load order issue, i.e.

Quoted 15 lines

It's still not an issue :(
I'd say "unnecessary probe delays".

But of cource it's Felipe's call :) Description looks better now.

BR, David

Quoted 8 lines

ulpi phy drivers or the ulpi interface providers loading before the bus registeration.

This patch fixes this load order issue by putting ulpi_init in subsys_initcall().

Adding Felipe. FWIW, my ACK in any case:

Thanks,

Signature · 1 line
heikki