linux-mips
[Top] [All Lists]

Re: [PATCH] MIPS: Alchemy: make 32kHz and r4k timer coexist peacefully

To: Manuel Lauss <manuel.lauss@gmail.com>
Subject: Re: [PATCH] MIPS: Alchemy: make 32kHz and r4k timer coexist peacefully
From: Sergei Shtylyov <sshtylyov@mvista.com>
Date: Mon, 17 Dec 2012 00:17:41 +0400
Cc: Ralf Baechle <ralf@linux-mips.org>, Linux-MIPS <linux-mips@linux-mips.org>
In-reply-to: <1355686896-26001-1-git-send-email-manuel.lauss@googlemail.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>
References: <1355686896-26001-1-git-send-email-manuel.lauss@googlemail.com>
Sender: linux-mips-bounce@linux-mips.org
User-agent: Mozilla/5.0 (Windows NT 5.1; rv:17.0) Gecko/17.0 Thunderbird/17.0
Hello.

On 16-12-2012 23:41, Manuel Lauss wrote:

From: Manuel Lauss <manuel.lauss@gmail.com>

Now that the r4k timer is registered no matter what, bump the rating of
the Alchemy 32kHz timer so that it gets used when it is working,
and fall back on the r4k when it isn't.

This fixes a timer-related hang on platform with a working 32kHz timer
(the better rated c0 timer stops while executing 'wait' leading to (almost)
eternal sleep) and an oops on boot on platforms without a working 32kHz timer
(due to double registration of the r4k timer).

Signed-off-by: Manuel Lauss <manuel.lauss@gmail.com>
---
For what is to become 3.8.

This is a quick fix; it's far less invasive than my preferred solution:
having each platform register the r4k clocksource explicitly.
It should be enough until Alchemy variants with speeds >= 1.3GHz appear
(which is very unlikely).

  arch/mips/alchemy/common/time.c | 29 ++++++-----------------------
  1 file changed, 6 insertions(+), 23 deletions(-)

diff --git a/arch/mips/alchemy/common/time.c b/arch/mips/alchemy/common/time.c
index a7193ae..12589d0 100644
--- a/arch/mips/alchemy/common/time.c
+++ b/arch/mips/alchemy/common/time.c
[...]
@@ -183,11 +169,8 @@ static int alchemy_m2inttab[] __initdata = {

  void __init plat_time_init(void)
  {
-       int t;
-
-       t = alchemy_get_cputype();
-       if (t == ALCHEMY_CPU_UNKNOWN)
-               alchemy_setup_c0timer();
-       else if (alchemy_time_init(alchemy_m2inttab[t]))
-               alchemy_setup_c0timer();
+       int t = alchemy_get_cputype();

   Could you please keep the coding style and insert empty line here?

+       if ((t == ALCHEMY_CPU_UNKNOWN) ||
+           (alchemy_time_init(alchemy_m2inttab[t])))

   Useless parens around == and especially around function call.

WBR, Sergei


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