|
From: Paul M. <le...@li...> - 2007-08-07 09:18:39
|
On Tue, Aug 07, 2007 at 11:09:47AM +0200, EXTERNAL Brunner Markus (Praktikant; ST-FIR/Eng) wrote:
> Paul Mundt wrote:
> > On Tue, Aug 07, 2007 at 10:37:10AM +0200, EXTERNAL Brunner Markus
> > (Praktikant; ST-FIR/Eng) wrote:
> >> markus@linux-markus:~/kernels$ sh3-unknown-linux-gnu-nm vmlinux |
> >> grep mpr2 8c2c18c0 t __initcall_mpr2_devices_setup6
> >> 8c2c1b00 T init_mpr2_IRQ
> >> 8c2c03d4 t mpr2_devices
> >> 8c2b1870 t mpr2_devices_setup
> >> 8c2b16d0 t mpr2_setup
> >> 8c2c1a70 t mv_mpr2
> >>
> >> This is with earlyprintk enabled. Now size and addresses have
> >> changed and mv_mpr2 isn't at the beginning of the machvec anymore.
> >>
> > This is rather interesting. Looking at your board patch again, it
> > seems
> > like this might be caused by the __initmv sprinkling you have on other
> > functions. __initmv is intended _only_ for the machvec description
> > itself, init functions referenced from within it should be flagged as
> > __init. We only ever expect to find full machvec structs within the
> > machvec section, so this is likely what is screwing it up. Please try
> > again with __initmv removed from everything but the machvec definition
> > itself :-)
> >
>
> Thanks a lot! This fixed it.
> I thought I already removed all of them, but one was still left.
>
Does something like this help?
diff --git a/arch/sh/kernel/machvec.c b/arch/sh/kernel/machvec.c
index 23c5948..129b2cf 100644
--- a/arch/sh/kernel/machvec.c
+++ b/arch/sh/kernel/machvec.c
@@ -91,6 +91,13 @@ void __init sh_mv_setup(void)
(unsigned long)&__machvec_start);
/*
+ * Sanity check for machvec section alignment. Ensure
+ * __initmv hasn't been misused.
+ */
+ if (machvec_size % sizeof(struct sh_machine_vector))
+ panic("machvec misaligned, invalid __initmv use?");
+
+ /*
* If the machvec hasn't been preselected, use the first
* vector (usually the only one) from .machvec.init.
*/
|