linux-mips
[Top] [All Lists]

[PATCH] MIPS: GIC: Select R4K counter as fallback.

To: linux-mips@linux-mips.org
Subject: [PATCH] MIPS: GIC: Select R4K counter as fallback.
From: "Steven J. Hill" <Steven.Hill@imgtec.com>
Date: Wed, 11 Sep 2013 13:53:54 -0500
Cc: Leonid Yegoshin <Leonid.Yegoshin@imgtec.com>, ralf@linux-mips.org, "Steven J. Hill" <Steven.Hill@imgtec.com>
List-archive: <http://www.linux-mips.org/archives/linux-mips/>
List-help: <mailto:ecartis@linux-mips.org?Subject=help>
List-id: linux-mips <linux-mips.eddie.linux-mips.org>
List-owner: <mailto:ralf@linux-mips.org>
List-post: <mailto:linux-mips@linux-mips.org>
List-software: Ecartis version 1.0.0
List-subscribe: <mailto:ecartis@linux-mips.org?subject=subscribe%20linux-mips>
List-unsubscribe: <mailto:ecartis@linux-mips.org?subject=unsubscribe%20linux-mips>
Original-recipient: rfc822;linux-mips@linux-mips.org
Sender: linux-mips-bounce@linux-mips.org
From: Leonid Yegoshin <Leonid.Yegoshin@imgtec.com>

If CONFIG_CSRC_GIC is selected and the GIC is not found during
boot, then fallback to the R4K counter gracefully.

Signed-off-by: Leonid Yegoshin <Leonid.Yegoshin@imgtec.com>
Signed-off-by: Steven J. Hill <Steven.Hill@imgtec.com>
---
 arch/mips/include/asm/time.h |   10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/arch/mips/include/asm/time.h b/arch/mips/include/asm/time.h
index 2d7b9df..1194c31 100644
--- a/arch/mips/include/asm/time.h
+++ b/arch/mips/include/asm/time.h
@@ -75,11 +75,13 @@ extern int init_r4k_clocksource(void);
 
 static inline int init_mips_clocksource(void)
 {
-#if defined(CONFIG_CSRC_R4K) && !defined(CONFIG_CSRC_GIC)
-       return init_r4k_clocksource();
-#else
-       return 0;
+#ifdef CONFIG_CSRC_R4K
+#ifdef CONFIG_CSRC_GIC
+       if (!gic_present)
 #endif
+               return init_r4k_clocksource();
+#endif
+       return 0;
 }
 
 static inline void clockevent_set_clock(struct clock_event_device *cd,
-- 
1.7.9.5


<Prev in Thread] Current Thread [Next in Thread>