public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH RESEND 0/2] MIPS: fix loongson2 regression
@ 2014-03-12 22:41 Aaro Koskinen
  2014-03-12 22:41 ` [PATCH RESEND 1/2] MIPS: Replace CONFIG_MIPS64 and CONFIG_MIPS32_R2 Aaro Koskinen
  2014-03-12 22:41 ` [PATCH RESEND 2/2] MIPS: fpu: fix conflict of register usage Aaro Koskinen
  0 siblings, 2 replies; 5+ messages in thread
From: Aaro Koskinen @ 2014-03-12 22:41 UTC (permalink / raw)
  To: Andrew Morton, linux-mips, linux-kernel, Ralf Baechle
  Cc: Paul Burton, Paul Bolle, Huacai Chen, Andreas Barth,
	Guenter Roeck, Aaro Koskinen

Hi,

MIPS/Loongson2 got (again) broken during 3.14-rc merge window,
and so far we haven't been able to get fixes in through the MIPS
tree as there are still some issues with the tree maintenance.
Please consider applying these two fixes. The issues have been reported
and the fixes have been tested by several users. Thanks.

Earlier discussions:
	http://marc.info/?t=139178356200002&r=1&w=2
	http://marc.info/?t=139178356600001&r=1&w=2
	http://marc.info/?t=139183090100002&r=1&w=2
	http://marc.info/?t=139195288700001&r=1&w=2

Huacai Chen (1):
  MIPS: fpu: fix conflict of register usage

Paul Bolle (1):
  MIPS: Replace CONFIG_MIPS64 and CONFIG_MIPS32_R2

 arch/mips/include/asm/asmmacro.h |  4 ++--
 arch/mips/include/asm/fpu.h      |  2 +-
 arch/mips/kernel/r4k_fpu.S       | 16 ++++++++--------
 3 files changed, 11 insertions(+), 11 deletions(-)

-- 
1.9.0


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

* [PATCH RESEND 1/2] MIPS: Replace CONFIG_MIPS64 and CONFIG_MIPS32_R2
  2014-03-12 22:41 [PATCH RESEND 0/2] MIPS: fix loongson2 regression Aaro Koskinen
@ 2014-03-12 22:41 ` Aaro Koskinen
  2014-03-12 23:01   ` Guenter Roeck
  2014-03-12 22:41 ` [PATCH RESEND 2/2] MIPS: fpu: fix conflict of register usage Aaro Koskinen
  1 sibling, 1 reply; 5+ messages in thread
From: Aaro Koskinen @ 2014-03-12 22:41 UTC (permalink / raw)
  To: Andrew Morton, linux-mips, linux-kernel, Ralf Baechle
  Cc: Paul Burton, Paul Bolle, Huacai Chen, Andreas Barth,
	Guenter Roeck, Aaro Koskinen

From: Paul Bolle <pebolle@tiscali.nl>

Commit 597ce1723e0f ("MIPS: Support for 64-bit FP with O32 binaries")
introduced references to two undefined Kconfig macros. CONFIG_MIPS32_R2
should clearly be replaced with CONFIG_CPU_MIPS32_R2. And CONFIG_MIPS64
should apparently be replaced with CONFIG_64BIT.

Signed-off-by: Paul Bolle <pebolle@tiscali.nl>
Signed-off-by: Huacai Chen <chenhc@lemote.com>
Tested-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
---
 arch/mips/include/asm/asmmacro.h | 4 ++--
 arch/mips/include/asm/fpu.h      | 2 +-
 arch/mips/kernel/r4k_fpu.S       | 8 ++++----
 3 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/arch/mips/include/asm/asmmacro.h b/arch/mips/include/asm/asmmacro.h
index 3220c93..69a9a22 100644
--- a/arch/mips/include/asm/asmmacro.h
+++ b/arch/mips/include/asm/asmmacro.h
@@ -106,7 +106,7 @@
 	.endm
 
 	.macro	fpu_save_double thread status tmp
-#if defined(CONFIG_MIPS64) || defined(CONFIG_CPU_MIPS32_R2)
+#if defined(CONFIG_64BIT) || defined(CONFIG_CPU_MIPS32_R2)
 	sll	\tmp, \status, 5
 	bgez	\tmp, 10f
 	fpu_save_16odd \thread
@@ -159,7 +159,7 @@
 	.endm
 
 	.macro	fpu_restore_double thread status tmp
-#if defined(CONFIG_MIPS64) || defined(CONFIG_CPU_MIPS32_R2)
+#if defined(CONFIG_64BIT) || defined(CONFIG_CPU_MIPS32_R2)
 	sll	\tmp, \status, 5
 	bgez	\tmp, 10f				# 16 register mode?
 
diff --git a/arch/mips/include/asm/fpu.h b/arch/mips/include/asm/fpu.h
index 6b97495..58e50cb 100644
--- a/arch/mips/include/asm/fpu.h
+++ b/arch/mips/include/asm/fpu.h
@@ -57,7 +57,7 @@ static inline int __enable_fpu(enum fpu_mode mode)
 		return 0;
 
 	case FPU_64BIT:
-#if !(defined(CONFIG_CPU_MIPS32_R2) || defined(CONFIG_MIPS64))
+#if !(defined(CONFIG_CPU_MIPS32_R2) || defined(CONFIG_64BIT))
 		/* we only have a 32-bit FPU */
 		return SIGFPE;
 #endif
diff --git a/arch/mips/kernel/r4k_fpu.S b/arch/mips/kernel/r4k_fpu.S
index 253b2fb..841ffc2 100644
--- a/arch/mips/kernel/r4k_fpu.S
+++ b/arch/mips/kernel/r4k_fpu.S
@@ -35,9 +35,9 @@
 LEAF(_save_fp_context)
 	cfc1	t1, fcr31
 
-#if defined(CONFIG_64BIT) || defined(CONFIG_MIPS32_R2)
+#if defined(CONFIG_64BIT) || defined(CONFIG_CPU_MIPS32_R2)
 	.set	push
-#ifdef CONFIG_MIPS32_R2
+#ifdef CONFIG_CPU_MIPS32_R2
 	.set	mips64r2
 	mfc0	t0, CP0_STATUS
 	sll	t0, t0, 5
@@ -148,9 +148,9 @@ LEAF(_save_fp_context32)
 LEAF(_restore_fp_context)
 	EX	lw t0, SC_FPC_CSR(a0)
 
-#if defined(CONFIG_64BIT) || defined(CONFIG_MIPS32_R2)
+#if defined(CONFIG_64BIT) || defined(CONFIG_CPU_MIPS32_R2)
 	.set	push
-#ifdef CONFIG_MIPS32_R2
+#ifdef CONFIG_CPU_MIPS32_R2
 	.set	mips64r2
 	mfc0	t0, CP0_STATUS
 	sll	t0, t0, 5
-- 
1.9.0


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

* [PATCH RESEND 2/2] MIPS: fpu: fix conflict of register usage
  2014-03-12 22:41 [PATCH RESEND 0/2] MIPS: fix loongson2 regression Aaro Koskinen
  2014-03-12 22:41 ` [PATCH RESEND 1/2] MIPS: Replace CONFIG_MIPS64 and CONFIG_MIPS32_R2 Aaro Koskinen
@ 2014-03-12 22:41 ` Aaro Koskinen
  2014-03-12 23:02   ` Guenter Roeck
  1 sibling, 1 reply; 5+ messages in thread
From: Aaro Koskinen @ 2014-03-12 22:41 UTC (permalink / raw)
  To: Andrew Morton, linux-mips, linux-kernel, Ralf Baechle
  Cc: Paul Burton, Paul Bolle, Huacai Chen, Andreas Barth,
	Guenter Roeck, Aaro Koskinen

From: Huacai Chen <chenhc@lemote.com>

In _restore_fp_context/_restore_fp_context32, t0 is used for both
CP0_Status and CP1_FCSR. This is a mistake and cause FP exeception on
boot, so fix it.

Signed-off-by: Huacai Chen <chenhc@lemote.com>
Tested-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Tested-by: Andreas Barth <aba@ayous.org>
Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
---
 arch/mips/kernel/r4k_fpu.S | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/arch/mips/kernel/r4k_fpu.S b/arch/mips/kernel/r4k_fpu.S
index 841ffc2..73b0ddf 100644
--- a/arch/mips/kernel/r4k_fpu.S
+++ b/arch/mips/kernel/r4k_fpu.S
@@ -146,7 +146,7 @@ LEAF(_save_fp_context32)
  *  - cp1 status/control register
  */
 LEAF(_restore_fp_context)
-	EX	lw t0, SC_FPC_CSR(a0)
+	EX	lw t1, SC_FPC_CSR(a0)
 
 #if defined(CONFIG_64BIT) || defined(CONFIG_CPU_MIPS32_R2)
 	.set	push
@@ -191,7 +191,7 @@ LEAF(_restore_fp_context)
 	EX	ldc1 $f26, SC_FPREGS+208(a0)
 	EX	ldc1 $f28, SC_FPREGS+224(a0)
 	EX	ldc1 $f30, SC_FPREGS+240(a0)
-	ctc1	t0, fcr31
+	ctc1	t1, fcr31
 	jr	ra
 	 li	v0, 0					# success
 	END(_restore_fp_context)
@@ -199,7 +199,7 @@ LEAF(_restore_fp_context)
 #ifdef CONFIG_MIPS32_COMPAT
 LEAF(_restore_fp_context32)
 	/* Restore an o32 sigcontext.  */
-	EX	lw t0, SC32_FPC_CSR(a0)
+	EX	lw t1, SC32_FPC_CSR(a0)
 
 	mfc0	t0, CP0_STATUS
 	sll	t0, t0, 5
@@ -239,7 +239,7 @@ LEAF(_restore_fp_context32)
 	EX	ldc1 $f26, SC32_FPREGS+208(a0)
 	EX	ldc1 $f28, SC32_FPREGS+224(a0)
 	EX	ldc1 $f30, SC32_FPREGS+240(a0)
-	ctc1	t0, fcr31
+	ctc1	t1, fcr31
 	jr	ra
 	 li	v0, 0					# success
 	END(_restore_fp_context32)
-- 
1.9.0


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

* Re: [PATCH RESEND 1/2] MIPS: Replace CONFIG_MIPS64 and CONFIG_MIPS32_R2
  2014-03-12 22:41 ` [PATCH RESEND 1/2] MIPS: Replace CONFIG_MIPS64 and CONFIG_MIPS32_R2 Aaro Koskinen
@ 2014-03-12 23:01   ` Guenter Roeck
  0 siblings, 0 replies; 5+ messages in thread
From: Guenter Roeck @ 2014-03-12 23:01 UTC (permalink / raw)
  To: Aaro Koskinen, Andrew Morton, linux-mips, linux-kernel,
	Ralf Baechle
  Cc: Paul Burton, Paul Bolle, Huacai Chen, Andreas Barth

On 03/12/2014 03:41 PM, Aaro Koskinen wrote:
> From: Paul Bolle <pebolle@tiscali.nl>
>
> Commit 597ce1723e0f ("MIPS: Support for 64-bit FP with O32 binaries")
> introduced references to two undefined Kconfig macros. CONFIG_MIPS32_R2
> should clearly be replaced with CONFIG_CPU_MIPS32_R2. And CONFIG_MIPS64
> should apparently be replaced with CONFIG_64BIT.
>
> Signed-off-by: Paul Bolle <pebolle@tiscali.nl>
> Signed-off-by: Huacai Chen <chenhc@lemote.com>
> Tested-by: Aaro Koskinen <aaro.koskinen@iki.fi>
> Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>

With qemu-system-mips64:

Tested-by: Guenter Roeck <linux@roeck-us.net>


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

* Re: [PATCH RESEND 2/2] MIPS: fpu: fix conflict of register usage
  2014-03-12 22:41 ` [PATCH RESEND 2/2] MIPS: fpu: fix conflict of register usage Aaro Koskinen
@ 2014-03-12 23:02   ` Guenter Roeck
  0 siblings, 0 replies; 5+ messages in thread
From: Guenter Roeck @ 2014-03-12 23:02 UTC (permalink / raw)
  To: Aaro Koskinen, Andrew Morton, linux-mips, linux-kernel,
	Ralf Baechle
  Cc: Paul Burton, Paul Bolle, Huacai Chen, Andreas Barth

On 03/12/2014 03:41 PM, Aaro Koskinen wrote:
> From: Huacai Chen <chenhc@lemote.com>
>
> In _restore_fp_context/_restore_fp_context32, t0 is used for both
> CP0_Status and CP1_FCSR. This is a mistake and cause FP exeception on
> boot, so fix it.
>
> Signed-off-by: Huacai Chen <chenhc@lemote.com>
> Tested-by: Aaro Koskinen <aaro.koskinen@iki.fi>
> Tested-by: Andreas Barth <aba@ayous.org>
> Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>

With qemu-system-mips64:

Tested-by: Guenter Roeck <linux@roeck-us.net>



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

end of thread, other threads:[~2014-03-12 23:02 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-03-12 22:41 [PATCH RESEND 0/2] MIPS: fix loongson2 regression Aaro Koskinen
2014-03-12 22:41 ` [PATCH RESEND 1/2] MIPS: Replace CONFIG_MIPS64 and CONFIG_MIPS32_R2 Aaro Koskinen
2014-03-12 23:01   ` Guenter Roeck
2014-03-12 22:41 ` [PATCH RESEND 2/2] MIPS: fpu: fix conflict of register usage Aaro Koskinen
2014-03-12 23:02   ` Guenter Roeck

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox