drivers: Fix boot problem on SuperH
Subsystems (2)
PATCH 1/1 drivers: Fix boot problem on SuperH
SuperH images crash too eearly to display any console output. Bisect points to commit 507fd01d5333 ("drivers: move the early platform device support to arch/sh"). An analysis of that patch suggests that early_platform_cleanup() is now called at the wrong time. Restoring its call point fixes the problem.
--- arch/sh/drivers/platform_early.c | 11 ++--------- drivers/base/platform.c | 4 ++++ 2 files changed, 6 insertions(+), 9 deletions(-)
arch/sh/drivers/platform_early.c +2 -9
@@ -325,9 +325,9 @@ int __init sh_early_platform_driver_probe(char *class_str, }/** -* sh_early_platform_cleanup - clean up early platform code +* early_platform_cleanup - clean up early platform code */ -static int __init sh_early_platform_cleanup (void ) +void early_platform_cleanup (void ) {struct platform_device *pd, *pd2;
@@ -337,11 +337,4 @@ static int __init sh_early_platform_cleanup(void)list_del (&pd->dev.devres_head);memset (&pd->dev.devres_head,0 ,sizeof (pd->dev.devres_head)); } - -return 0 ; } -/* -* This must happen once after all early devices are probed but before probing -* real platform devices. -*/ -subsys_initcall (sh_early_platform_cleanup);
drivers/base/platform.c +4 -0
@@ -1325,10 +1325,14 @@ struct device *platform_find_device_by_driver(struct device *start, }EXPORT_SYMBOL_GPL (platform_find_device_by_driver); +void __weak early_platform_cleanup (void ) { } +int __init platform_bus_init (void ) {int error; +early_platform_cleanup (); + error =device_register (&platform_bus);if (error) {put_device (&platform_bus);
Signature · 1 line
2.17.1
Hi Günter,
Quoted 14 lines · Guenter Roeck
SuperH images crash too eearly to display any console output. Bisect points to commit
507fd01d5333("drivers: move the early platform device support toarch/sh"). An analysis of that patch suggests thatearly_platform_cleanup()is now called at the wrong time. Restoring its call point fixes the problem.Cc Bartosz Golaszewski <[email protected]>Fixes 507fd01d5333 ("drivers: move the early platform device support to arch/sh")Tested-by Geert Uytterhoeven <[email protected]>Signed-off-by Guenter Roeck <[email protected]>
arch/sh/drivers/platform_early.c int __init sh_early_platform_driver_probe(char *class_str, · line 330
Quoted 8 lines
arch/sh/drivers/platform_early.c +2
-2@@ -325,9 +325,9 @@ int __init sh_early_platform_driver_probe(char *class_str, }/** -* sh_early_platform_cleanup - clean up early platform code +* early_platform_cleanup - clean up early platform code */ -static int __init sh_early_platform_cleanup (void ) +void early_platform_cleanup (void )
This function should be __init...
Quoted 20 lines
arch/sh/drivers/platform_early.c +0
-7{struct platform_device *pd, *pd2;@@ -337,11 +337,4 @@ static int __init sh_early_platform_cleanup(void)list_del (&pd->dev.devres_head);memset (&pd->dev.devres_head,0 ,sizeof (pd->dev.devres_head)); } - -return 0 ; } -/* -* This must happen once after all early devices are probed but before probing -* real platform devices. -*/ -subsys_initcall (sh_early_platform_cleanup);drivers/base/platform.c +0
-0
drivers/base/platform.c struct device *platform_find_device_by_driver(struct device *start, · line 1328
Quoted 4 lines
drivers/base/platform.c +1
-0@@ -1325,10 +1325,14 @@ struct device *platform_find_device_by_driver(struct device *start, }EXPORT_SYMBOL_GPL (platform_find_device_by_driver); +void __weak early_platform_cleanup (void ) { }
... and this one, too.
Sorry for failing to notice that before.
Back to fixing more SH...
drivers/base/platform.c struct device *platform_find_device_by_driver(struct device *start, · line 1338
Quoted 10 lines
drivers/base/platform.c +3
-0+int __init platform_bus_init (void ) {int error; +early_platform_cleanup (); + error =device_register (&platform_bus);if (error) {put_device (&platform_bus);
Gr{oetje,eeting}s,
Geert
Signature · 5 lines
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected] In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that. -- Linus Torvalds