On Thu, 2 Sep 2010, Amit Kucheria wrote: > On 10 Sep 01, Nicolas Pitre wrote: > > On Wed, 1 Sep 2010, Amit Kucheria wrote: > > > > > On 10 Sep 01, Nicolas Pitre wrote: > > [...] > > > > > @@ -284,6 +292,7 @@ MACHINE_START(MX51_BABBAGE, "Freescale MX51 Babbage > > > Board") > > > .phys_io = MX51_AIPS1_BASE_ADDR, > > > .io_pg_offst = ((MX51_AIPS1_BASE_ADDR_VIRT) >> 18) & 0xfffc, > > > .boot_params = PHYS_OFFSET + 0x100, > > > + .fixup = fixup_mx51_babbage, > > > .map_io = mx51_map_io, > > > .init_irq = mx51_init_irq, > > > .init_machine = mxc_board_init, > > > > This won't work as this is called way too early. > > > > I'd suggest calling mx51_neon_fixup() through a late_initcall instead. > > And making it __init too. > > Argh! You're right. > > It becomes a lot simpler with just late_init. Fixed patch attached.
You could make this even simpler still. > diff --git a/arch/arm/mach-mx5/cpu.c b/arch/arm/mach-mx5/cpu.c > index 2d37785..ba5f6be 100644 > --- a/arch/arm/mach-mx5/cpu.c > +++ b/arch/arm/mach-mx5/cpu.c > @@ -70,6 +70,28 @@ int mx51_revision(void) > } > EXPORT_SYMBOL(mx51_revision); > > +#ifdef CONFIG_NEON > + > +/* All versions of the silicon before Rev. 3 have broken NEON > implementations. > + * Dependent on link order - so the assumption is that vfp_init is called > before us > + */ > +static int __init mx51_neon_fixup(void) > +{ > + if (mx51_revision() < MX51_CHIP_REV_3_0) { > + if (elf_hwcap & HWCAP_NEON) { > + elf_hwcap &= ~HWCAP_NEON; > + pr_info("Turning off NEON support, detected broken NEON > implemention\n"); > + } > + } > + return 0; > +} > +#else > +void mx51_neon_fixup(void) > +{ > + return 0; > +} > +#endif Instead of having this empty mx51_neon_fixup() in the #else part... > @@ -98,3 +120,4 @@ static int __init post_cpu_init(void) > } > > postcore_initcall(post_cpu_init); > +late_initcall(mx51_neon_fixup); ... why don't you move this late_initcall() _inside_ the #ifdef CONFIG_NEON ? Nicolas _______________________________________________ linaro-dev mailing list linaro-dev@lists.linaro.org http://lists.linaro.org/mailman/listinfo/linaro-dev