Hi Michael,

Le samedi 8 mai 2010 02:08:56, Michael J. Evans a écrit :
> Change ar7_init_clocks to a core level function, removing a race condition.
> 
> Both ar7_init_clocks and ar7_register_devices were using arch_initcall.
> However ar7_register_devices depended on values changed by ar7_init_clocks.

Yes this is correct, I have a committed a slightly smaller and simpler fix 
which also results in clocks being initialized first, then devices registered. 
initcall macros evalute the order of functions at link time, so it's up to you 
to re-order them properly to get linked and called in the right order.

Thanks for tracking this down.

> 
> Also add a printk so that the resulting effect is obvious.
> 
> Signed-off-by: Michael J. Evans <[email protected]>
> 
> --- a/arch/mips/ar7/clock.c
> +++ b/arch/mips/ar7/clock.c
> @@ -424,4 +424,4 @@ int __init ar7_init_clocks(void)
> 
>       return 0;
>  }
> -arch_initcall(ar7_init_clocks);
> +core_initcall(ar7_init_clocks);
> 
> --- a/arch/mips/ar7/platform.c
> +++ b/arch/mips/ar7/platform.c
> @@ -665,6 +665,8 @@ static int __init ar7_register_devices(void)
>  #ifdef CONFIG_SERIAL_8250
>       static struct uart_port uart_port[2];
> 
> +     printk (KERN_INFO "ar7_register_devices: serial clock %d hz.\n",
> +             ar7_bus_freq() / 2);
>       memset(uart_port, 0, sizeof(struct uart_port) * 2);
> 
>       uart_port[0].type = PORT_16550A;
> _______________________________________________
> openwrt-devel mailing list
> [email protected]
> https://lists.openwrt.org/mailman/listinfo/openwrt-devel
> 
_______________________________________________
openwrt-devel mailing list
[email protected]
https://lists.openwrt.org/mailman/listinfo/openwrt-devel

Reply via email to