All of lore.kernel.org
 help / color / mirror / Atom feed
From: Xia Kaixu <kaixu.xia@linaro.org>
To: linux-kernel@vger.kernel.org
Cc: kaixu.xia@linaro.org, arnd@arndb.de,
	Anton Vorontsov <anton@enomsg.org>,
	Felix Fietkau <nbd@openwrt.org>, Imre Kaloz <kaloz@openwrt.org>,
	linaro-kernel@lists.linaro.org,
	linux-arm-kernel@lists.infradead.org
Subject: [PATCH] ARM: cns3xxx: fix allmodconfig panic in pci driver
Date: Wed,  3 Sep 2014 21:18:12 +0800	[thread overview]
Message-ID: <1409750292-24105-1-git-send-email-kaixu.xia@linaro.org> (raw)
In-Reply-To: <kaixu.xia@linaro.org>

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);
-- 
1.8.5.5


WARNING: multiple messages have this Message-ID (diff)
From: kaixu.xia@linaro.org (Xia Kaixu)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH] ARM: cns3xxx: fix allmodconfig panic in pci driver
Date: Wed,  3 Sep 2014 21:18:12 +0800	[thread overview]
Message-ID: <1409750292-24105-1-git-send-email-kaixu.xia@linaro.org> (raw)
In-Reply-To: <kaixu.xia@linaro.org>

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 at lists.linaro.org
Cc: linux-arm-kernel at 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);
-- 
1.8.5.5

             reply	other threads:[~2014-09-03 13:19 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-09-03 13:18 Xia Kaixu [this message]
2014-09-03 13:18 ` [PATCH] ARM: cns3xxx: fix allmodconfig panic in pci driver Xia Kaixu
2014-09-03 13:27 ` Arnd Bergmann
2014-09-03 13:27   ` Arnd Bergmann
2014-09-04  3:46   ` xiakaixu
2014-09-04  3:46     ` xiakaixu
2014-09-04 20:32 ` Arnd Bergmann
2014-09-04 20:32   ` Arnd Bergmann
2014-09-04 21:42 ` Arnd Bergmann
2014-09-04 21:42   ` Arnd Bergmann
  -- strict thread matches above, loose matches on Subject: below --
2014-09-03 12:39 Xia Kaixu

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1409750292-24105-1-git-send-email-kaixu.xia@linaro.org \
    --to=kaixu.xia@linaro.org \
    --cc=anton@enomsg.org \
    --cc=arnd@arndb.de \
    --cc=kaloz@openwrt.org \
    --cc=linaro-kernel@lists.linaro.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=nbd@openwrt.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.