From: Xia Kaixu kaixu.xia@linaro.org
The kernel panic occurs when running an allmodconfig kernel on OMAP4460. The inicall "cns3xxx_pcie_init" does not check which hardware it's running on and just tries to access to its specific registers. Now call it from .init_late callback from the two machine descriptors.
Signed-off-by: Xia Kaixu kaixu.xia@linaro.org Signed-off-by: Arnd Bergmann arnd@arndb.de Cc: Anton Vorontsov anton@enomsg.org Cc: Felix Fietkau nbd@openwrt.org Cc: Imre Kaloz kaloz@openwrt.org Cc: linaro-kernel@lists.linaro.org Cc: linux-arm-kernel@lists.infradead.org --- arch/arm/mach-cns3xxx/cns3420vb.c | 1 + arch/arm/mach-cns3xxx/core.c | 1 + arch/arm/mach-cns3xxx/core.h | 9 +++++++++ arch/arm/mach-cns3xxx/pcie.c | 3 +-- 4 files changed, 12 insertions(+), 2 deletions(-)
diff --git a/arch/arm/mach-cns3xxx/cns3420vb.c b/arch/arm/mach-cns3xxx/cns3420vb.c index d863d87..99c74cc 100644 --- a/arch/arm/mach-cns3xxx/cns3420vb.c +++ b/arch/arm/mach-cns3xxx/cns3420vb.c @@ -250,5 +250,6 @@ MACHINE_START(CNS3420VB, "Cavium Networks CNS3420 Validation Board") .init_irq = cns3xxx_init_irq, .init_time = cns3xxx_timer_init, .init_machine = cns3420_init, + .init_late = cns3xxx_pcie_init_late, .restart = cns3xxx_restart, MACHINE_END diff --git a/arch/arm/mach-cns3xxx/core.c b/arch/arm/mach-cns3xxx/core.c index f85449a..c2363bb 100644 --- a/arch/arm/mach-cns3xxx/core.c +++ b/arch/arm/mach-cns3xxx/core.c @@ -404,5 +404,6 @@ DT_MACHINE_START(CNS3XXX_DT, "Cavium Networks CNS3xxx") .init_irq = cns3xxx_init_irq, .init_time = cns3xxx_timer_init, .init_machine = cns3xxx_init, + .init_late = cns3xxx_pcie_init_late, .restart = cns3xxx_restart, MACHINE_END diff --git a/arch/arm/mach-cns3xxx/core.h b/arch/arm/mach-cns3xxx/core.h index 5218b61..780689b 100644 --- a/arch/arm/mach-cns3xxx/core.h +++ b/arch/arm/mach-cns3xxx/core.h @@ -21,6 +21,15 @@ void __init cns3xxx_l2x0_init(void); static inline void cns3xxx_l2x0_init(void) {} #endif /* CONFIG_CACHE_L2X0 */
+#ifdef CONFIG_PCI +extern int __init cns3xxx_pcie_init_late(void); +#else +static inline int __init cns3xxx_pcie_init_late(void) +{ + return -ENXIO; +} +#endif + void __init cns3xxx_map_io(void); void __init cns3xxx_init_irq(void); void cns3xxx_power_off(void); diff --git a/arch/arm/mach-cns3xxx/pcie.c b/arch/arm/mach-cns3xxx/pcie.c index 413134c..bf2a4e8 100644 --- a/arch/arm/mach-cns3xxx/pcie.c +++ b/arch/arm/mach-cns3xxx/pcie.c @@ -318,7 +318,7 @@ static int cns3xxx_pcie_abort_handler(unsigned long addr, unsigned int fsr, return 0; }
-static int __init cns3xxx_pcie_init(void) +int __init cns3xxx_pcie_init_late(void) { int i;
@@ -340,4 +340,3 @@ static int __init cns3xxx_pcie_init(void)
return 0; } -device_initcall(cns3xxx_pcie_init);
On Wednesday 03 September 2014 21:18:12 Xia Kaixu wrote:
From: Xia Kaixu kaixu.xia@linaro.org
The kernel panic occurs when running an allmodconfig kernel on OMAP4460. The inicall "cns3xxx_pcie_init" does not check which hardware it's running on and just tries to access to its specific registers. Now call it from .init_late callback from the two machine descriptors.
Signed-off-by: Xia Kaixu kaixu.xia@linaro.org Signed-off-by: Arnd Bergmann arnd@arndb.de Cc: Anton Vorontsov anton@enomsg.org Cc: Felix Fietkau nbd@openwrt.org Cc: Imre Kaloz kaloz@openwrt.org Cc: linaro-kernel@lists.linaro.org Cc: linux-arm-kernel@lists.infradead.org
Hi Kaixu,
it seems this time all the Cc's worked. One thing I just noticed is that you confused the 'Signed-off-by' lines. I did look at the patch earlier before you sent it out but unfortunately missed that.
You can read again in Documentation/SubmittingPatches about how they work, but the short version is that you must never put someone else's name in Signed-off-by under a patch you write yourself. When we apply the patch, I (or whoever else does) will put that line below yours to document who handled the patch.
Otherwise, the patch looks good to me, thanks a lot for doing it.
Arnd
δΊ 2014/9/3 21:27, Arnd Bergmann ει:
On Wednesday 03 September 2014 21:18:12 Xia Kaixu wrote:
From: Xia Kaixu kaixu.xia@linaro.org
The kernel panic occurs when running an allmodconfig kernel on OMAP4460. The inicall "cns3xxx_pcie_init" does not check which hardware it's running on and just tries to access to its specific registers. Now call it from .init_late callback from the two machine descriptors.
Signed-off-by: Xia Kaixu kaixu.xia@linaro.org Signed-off-by: Arnd Bergmann arnd@arndb.de Cc: Anton Vorontsov anton@enomsg.org Cc: Felix Fietkau nbd@openwrt.org Cc: Imre Kaloz kaloz@openwrt.org Cc: linaro-kernel@lists.linaro.org Cc: linux-arm-kernel@lists.infradead.org
Hi Kaixu,
it seems this time all the Cc's worked. One thing I just noticed is that you confused the 'Signed-off-by' lines. I did look at the patch earlier before you sent it out but unfortunately missed that.
You can read again in Documentation/SubmittingPatches about how they work, but the short version is that you must never put someone else's name in Signed-off-by under a patch you write yourself. When we apply the patch, I (or whoever else does) will put that line below yours to document who handled the patch.
Sure, you are right. Thanks for the reminder!
Otherwise, the patch looks good to me, thanks a lot for doing it.
Arnd
linaro-kernel mailing list linaro-kernel@lists.linaro.org http://lists.linaro.org/mailman/listinfo/linaro-kernel
On Wednesday 03 September 2014, Xia Kaixu wrote:
From: Xia Kaixu kaixu.xia@linaro.org
The kernel panic occurs when running an allmodconfig kernel on OMAP4460. The inicall "cns3xxx_pcie_init" does not check which hardware it's running on and just tries to access to its specific registers. Now call it from .init_late callback from the two machine descriptors.
Signed-off-by: Xia Kaixu kaixu.xia@linaro.org Signed-off-by: Arnd Bergmann arnd@arndb.de Cc: Anton Vorontsov anton@enomsg.org Cc: Felix Fietkau nbd@openwrt.org Cc: Imre Kaloz kaloz@openwrt.org Cc: linaro-kernel@lists.linaro.org Cc: linux-arm-kernel@lists.infradead.org
arch/arm/mach-cns3xxx/cns3420vb.c | 1 + arch/arm/mach-cns3xxx/core.c | 1 + arch/arm/mach-cns3xxx/core.h | 9 +++++++++ arch/arm/mach-cns3xxx/pcie.c | 3 +-- 4 files changed, 12 insertions(+), 2 deletions(-)
I've applied this to next/fixes-non-critical now. I'm fairly confident that this helps more than it can hurt, but not confident enough to put it into 3.17 or stable for now.
It would be nice to get some testing from someone with hardware access. If necessary, I'll revert the change or do a fixup on top.
Arnd
On Wednesday 03 September 2014 21:18:12 Xia Kaixu wrote:
+#ifdef CONFIG_PCI +extern int __init cns3xxx_pcie_init_late(void); +#else +static inline int __init cns3xxx_pcie_init_late(void) +{
return -ENXIO;
+} +#endif
void __init cns3xxx_map_io(void);
I found another problem: we get a new compile-time warning because the function returns an 'int' while the .init_late callback expects a function returning 'void'.
I've fixed it up locally, but please be more careful about introducing warnings in the future.
Arnd
linaro-kernel@lists.linaro.org