All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/1] mips: clear IV bit in CP0 cause if the CPU doesn't support divec
@ 2008-09-09  8:15 Thomas Petazzoni
  2008-09-10  8:31 ` Thomas Bogendoerfer
  2008-09-10 11:11 ` Kevin D. Kissell
  0 siblings, 2 replies; 5+ messages in thread
From: Thomas Petazzoni @ 2008-09-09  8:15 UTC (permalink / raw)
  To: ralf; +Cc: ths, linux-mips, michael, Thomas Petazzoni

When the kernel thinks that the CPU doesn't support the divec feature
(cpu_has_divec is false), reset the corresponding IV bit in the CP0
cause register, so that things will work correctly if the bootloader
had a different idea of the CPU support of the divec feature.

The problem has been found while trying to boot a 2.6.24 kernel for
the Qemu board using U-Boot inside Qemu. For the same CPU type, U-Boot
thinks that divec is supported, and the kernel doesn't. So U-Boot sets
the IV bit, but when the kernel boots and doesn't reset the IV bit,
things break when the first interrupts occur. The Qemu board has been
removed from the kernel in 2.6.25, but the problem might also occur
with other platforms.

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Cc: Thiemo Seufer <ths@networkno.de>
Cc: linux-mips@linux-mips.org
---
 arch/mips/kernel/traps.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/arch/mips/kernel/traps.c b/arch/mips/kernel/traps.c
index 6bee290..8b1e507 100644
--- a/arch/mips/kernel/traps.c
+++ b/arch/mips/kernel/traps.c
@@ -1467,6 +1467,9 @@ void __cpuinit per_cpu_trap_init(void)
 		} else
 			set_c0_cause(CAUSEF_IV);
 	}
+	else {
+		clear_c0_cause(CAUSEF_IV);
+	}
 
 	/*
 	 * Before R2 both interrupt numbers were fixed to 7, so on R2 only:
-- 
1.5.4.3

^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2008-09-10 18:51 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-09-09  8:15 [PATCH 1/1] mips: clear IV bit in CP0 cause if the CPU doesn't support divec Thomas Petazzoni
2008-09-10  8:31 ` Thomas Bogendoerfer
2008-09-10 11:11 ` Kevin D. Kissell
2008-09-10 11:50   ` Ralf Baechle
2008-09-10 15:28   ` Shinya Kuribayashi

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.