* [PATCH 2.6.11-rc1] add local_irq_enable() to cpu_idle()
@ 2005-01-17 16:49 Yoichi Yuasa
2005-01-17 16:59 ` Kevin D. Kissell
0 siblings, 1 reply; 5+ messages in thread
From: Yoichi Yuasa @ 2005-01-17 16:49 UTC (permalink / raw)
To: Ralf Baechle; +Cc: yuasa, linux-mips
Hi Ralf,
We need to add local_irq_enable() to cpu_idle().
Please add this patch to v2.6.
I don't have any information about R3081.
I didn't fix r3081_wait().
Yoichi
Signed-off-by: Yoichi Yuasa <yuasa@hh.iij4u.or.jp>
diff -urN -X dontdiff a-orig/arch/mips/kernel/cpu-probe.c a/arch/mips/kernel/cpu-probe.c
--- a-orig/arch/mips/kernel/cpu-probe.c Sun Oct 31 21:49:07 2004
+++ a/arch/mips/kernel/cpu-probe.c Tue Jan 18 00:26:12 2005
@@ -42,10 +42,12 @@
{
unsigned long cfg = read_c0_conf();
write_c0_conf(cfg | TX39_CONF_HALT);
+ local_irq_enable();
}
static void r4k_wait(void)
{
+ local_irq_enable();
__asm__(".set\tmips3\n\t"
"wait\n\t"
".set\tmips0");
@@ -61,6 +63,7 @@
void au1k_wait(void)
{
+ local_irq_enable();
#ifdef CONFIG_PM
/* using the wait instruction makes CP0 counter unusable */
__asm__(".set\tmips3\n\t"
diff -urN -X dontdiff a-orig/arch/mips/kernel/process.c a/arch/mips/kernel/process.c
--- a-orig/arch/mips/kernel/process.c Sat Jan 8 23:19:16 2005
+++ a/arch/mips/kernel/process.c Mon Jan 17 21:43:08 2005
@@ -58,6 +58,8 @@
while (!need_resched())
if (cpu_wait)
(*cpu_wait)();
+ else
+ local_irq_enable();
schedule();
}
}
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH 2.6.11-rc1] add local_irq_enable() to cpu_idle()
2005-01-17 16:49 [PATCH 2.6.11-rc1] add local_irq_enable() to cpu_idle() Yoichi Yuasa
@ 2005-01-17 16:59 ` Kevin D. Kissell
2005-01-17 21:31 ` Ralf Baechle
2005-01-18 2:11 ` Yoichi Yuasa
0 siblings, 2 replies; 5+ messages in thread
From: Kevin D. Kissell @ 2005-01-17 16:59 UTC (permalink / raw)
To: Yoichi Yuasa; +Cc: Ralf Baechle, linux-mips
There have been times when having local_irq_enable() in my idle loop
would have prevented a hang in some of my experimental kernels, too,
but it's always been because I had screwed up somewhere else and
forgotten to re-enable interrupts. Is there some good reason why
the kernel should end up in idle with interrupts turned off?
Regards,
Kevin K.
Yoichi Yuasa wrote:
> Hi Ralf,
>
> We need to add local_irq_enable() to cpu_idle().
> Please add this patch to v2.6.
>
> I don't have any information about R3081.
> I didn't fix r3081_wait().
>
> Yoichi
>
> Signed-off-by: Yoichi Yuasa <yuasa@hh.iij4u.or.jp>
>
> diff -urN -X dontdiff a-orig/arch/mips/kernel/cpu-probe.c a/arch/mips/kernel/cpu-probe.c
> --- a-orig/arch/mips/kernel/cpu-probe.c Sun Oct 31 21:49:07 2004
> +++ a/arch/mips/kernel/cpu-probe.c Tue Jan 18 00:26:12 2005
> @@ -42,10 +42,12 @@
> {
> unsigned long cfg = read_c0_conf();
> write_c0_conf(cfg | TX39_CONF_HALT);
> + local_irq_enable();
> }
>
> static void r4k_wait(void)
> {
> + local_irq_enable();
> __asm__(".set\tmips3\n\t"
> "wait\n\t"
> ".set\tmips0");
> @@ -61,6 +63,7 @@
>
> void au1k_wait(void)
> {
> + local_irq_enable();
> #ifdef CONFIG_PM
> /* using the wait instruction makes CP0 counter unusable */
> __asm__(".set\tmips3\n\t"
> diff -urN -X dontdiff a-orig/arch/mips/kernel/process.c a/arch/mips/kernel/process.c
> --- a-orig/arch/mips/kernel/process.c Sat Jan 8 23:19:16 2005
> +++ a/arch/mips/kernel/process.c Mon Jan 17 21:43:08 2005
> @@ -58,6 +58,8 @@
> while (!need_resched())
> if (cpu_wait)
> (*cpu_wait)();
> + else
> + local_irq_enable();
> schedule();
> }
> }
>
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH 2.6.11-rc1] add local_irq_enable() to cpu_idle()
2005-01-17 16:59 ` Kevin D. Kissell
@ 2005-01-17 21:31 ` Ralf Baechle
2005-01-18 2:11 ` Yoichi Yuasa
1 sibling, 0 replies; 5+ messages in thread
From: Ralf Baechle @ 2005-01-17 21:31 UTC (permalink / raw)
To: Kevin D. Kissell; +Cc: Yoichi Yuasa, linux-mips
On Mon, Jan 17, 2005 at 05:59:38PM +0100, Kevin D. Kissell wrote:
> There have been times when having local_irq_enable() in my idle loop
> would have prevented a hang in some of my experimental kernels, too,
> but it's always been because I had screwed up somewhere else and
> forgotten to re-enable interrupts. Is there some good reason why
> the kernel should end up in idle with interrupts turned off?
No, never. It'd result in the scheduler being called with interrupts
disabled which depending if you're lucky or not may happen to reenable
interrupts or not, so you're outside of defined behaviour starting that
point.
Ralf
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH 2.6.11-rc1] add local_irq_enable() to cpu_idle()
2005-01-17 16:59 ` Kevin D. Kissell
2005-01-17 21:31 ` Ralf Baechle
@ 2005-01-18 2:11 ` Yoichi Yuasa
2005-01-19 2:43 ` Ralf Baechle
1 sibling, 1 reply; 5+ messages in thread
From: Yoichi Yuasa @ 2005-01-18 2:11 UTC (permalink / raw)
To: Kevin D. Kissell; +Cc: yuasa, ralf, linux-mips
On Mon, 17 Jan 2005 17:59:38 +0100
"Kevin D. Kissell" <kevink@mips.com> wrote:
> There have been times when having local_irq_enable() in my idle loop
> would have prevented a hang in some of my experimental kernels, too,
> but it's always been because I had screwed up somewhere else and
> forgotten to re-enable interrupts. Is there some good reason why
> the kernel should end up in idle with interrupts turned off?
After call local_irq_disable(), rest_init()(in init/main.c) calls cpu_idle().
Yoichi
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH 2.6.11-rc1] add local_irq_enable() to cpu_idle()
2005-01-18 2:11 ` Yoichi Yuasa
@ 2005-01-19 2:43 ` Ralf Baechle
0 siblings, 0 replies; 5+ messages in thread
From: Ralf Baechle @ 2005-01-19 2:43 UTC (permalink / raw)
To: Yoichi Yuasa; +Cc: Kevin D. Kissell, linux-mips
On Tue, Jan 18, 2005 at 11:11:59AM +0900, Yoichi Yuasa wrote:
> "Kevin D. Kissell" <kevink@mips.com> wrote:
>
> > There have been times when having local_irq_enable() in my idle loop
> > would have prevented a hang in some of my experimental kernels, too,
> > but it's always been because I had screwed up somewhere else and
> > forgotten to re-enable interrupts. Is there some good reason why
> > the kernel should end up in idle with interrupts turned off?
>
> After call local_irq_disable(), rest_init()(in init/main.c) calls cpu_idle().
Indeed. Was looking at a kernel with kdb which removes this line.
Ralf
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2005-01-19 2:46 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-01-17 16:49 [PATCH 2.6.11-rc1] add local_irq_enable() to cpu_idle() Yoichi Yuasa
2005-01-17 16:59 ` Kevin D. Kissell
2005-01-17 21:31 ` Ralf Baechle
2005-01-18 2:11 ` Yoichi Yuasa
2005-01-19 2:43 ` Ralf Baechle
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox