All of lore.kernel.org
 help / color / mirror / Atom feed
From: Sergei Shtylyov <sshtylyov@mvista.com>
To: Manuel Lauss <manuel.lauss@gmail.com>
Cc: Ralf Baechle <ralf@linux-mips.org>,
	Linux-MIPS <linux-mips@linux-mips.org>
Subject: Re: [PATCH] MIPS: Alchemy: make 32kHz and r4k timer coexist peacefully
Date: Mon, 17 Dec 2012 00:17:41 +0400	[thread overview]
Message-ID: <50CE2C65.6020805@mvista.com> (raw)
In-Reply-To: <1355686896-26001-1-git-send-email-manuel.lauss@googlemail.com>

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

      reply	other threads:[~2012-12-16 20:17 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-12-16 19:41 [PATCH] MIPS: Alchemy: make 32kHz and r4k timer coexist peacefully Manuel Lauss
2012-12-16 20:17 ` Sergei Shtylyov [this message]

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=50CE2C65.6020805@mvista.com \
    --to=sshtylyov@mvista.com \
    --cc=linux-mips@linux-mips.org \
    --cc=manuel.lauss@gmail.com \
    --cc=ralf@linux-mips.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.