All of lore.kernel.org
 help / color / mirror / Atom feed
From: Florian Fainelli <f.fainelli@gmail.com>
To: Petri Gynther <pgynther@google.com>, linux-mips@linux-mips.org
Cc: ralf@linux-mips.org, cernekee@gmail.com
Subject: Re: [PATCH] MIPS: switch BMIPS5000 to use r4k_wait_irqoff()
Date: Mon, 19 Oct 2015 20:18:12 -0700	[thread overview]
Message-ID: <5625B274.4010800@gmail.com> (raw)
In-Reply-To: <1445280264-42016-1-git-send-email-pgynther@google.com>

Le 19/10/2015 11:44, Petri Gynther a écrit :
> BCM7425 CPU Interface Zephyr Processor, pages 5-309 and 5-310
> BCM7428B0 CPU Interface Zephyr Processor, pages 5-337 and 5-338
> 
> WAIT instruction:
> Thread enters wait state. No instructions are executed until an
> interrupt occurs. The processor's clocks are stopped if both threads
> are in idle mode.
> 
> Description:
> Execution of this instruction puts the thread into wait state, an idle
> mode in which no instructions are fetched or executed. The thread remains
> in wait state until an interrupt occurs that is not masked by the
> interrupt mask field in the Status register. Then, if interrupts are
> enabled by the IE bit in the Status register, the interrupt is serviced.
> The ERET instruction returns to the instruction following the WAIT
> instruction. If interrupts are disabled, the processor resumes executing
> instructions with the next sequential instruction.
> 
> Programming notes:
> The WAIT instruction should be executed while interrupts are disabled
> by the IE bit in the Status register. This avoids a potential timing
> hazard, which occurs if an interrupt is taken between testing the counter
> and executing the WAIT instruction. In this hazard case, the interrupt
> will have been completed before the WAIT instruction is executed, so
> the processor will remain indefinitely in wait state until the next
> interrupt.
> 
> Signed-off-by: Petri Gynther <pgynther@google.com>

Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>

> ---
>  arch/mips/kernel/idle.c | 5 +++--
>  1 file changed, 3 insertions(+), 2 deletions(-)
> 
> diff --git a/arch/mips/kernel/idle.c b/arch/mips/kernel/idle.c
> index ab1478d..d636c70 100644
> --- a/arch/mips/kernel/idle.c
> +++ b/arch/mips/kernel/idle.c
> @@ -160,7 +160,6 @@ void __init check_wait(void)
>  	case CPU_BMIPS3300:
>  	case CPU_BMIPS4350:
>  	case CPU_BMIPS4380:
> -	case CPU_BMIPS5000:
>  	case CPU_CAVIUM_OCTEON:
>  	case CPU_CAVIUM_OCTEON_PLUS:
>  	case CPU_CAVIUM_OCTEON2:
> @@ -171,7 +170,9 @@ void __init check_wait(void)
>  	case CPU_XLP:
>  		cpu_wait = r4k_wait;
>  		break;
> -
> +	case CPU_BMIPS5000:
> +		cpu_wait = r4k_wait_irqoff;
> +		break;
>  	case CPU_RM7000:
>  		cpu_wait = rm7k_wait_irqoff;
>  		break;
> 


-- 
Florian

  reply	other threads:[~2015-10-20  3:18 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-10-19 18:44 [PATCH] MIPS: switch BMIPS5000 to use r4k_wait_irqoff() Petri Gynther
2015-10-20  3:18 ` Florian Fainelli [this message]
2015-11-02 20:54   ` Petri Gynther
2015-11-09  9:24 ` Ralf Baechle
2016-01-12  0:42   ` Maciej W. Rozycki
2016-01-12 13:27     ` Ralf Baechle

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=5625B274.4010800@gmail.com \
    --to=f.fainelli@gmail.com \
    --cc=cernekee@gmail.com \
    --cc=linux-mips@linux-mips.org \
    --cc=pgynther@google.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.