[kernel] r5452 -
dists/trunk/arch/mips/linux-patch-2.6.15-mips-2.6.15/debian/patches
Martin Michlmayr
tbm at costa.debian.org
Mon Jan 16 15:41:49 UTC 2006
Author: tbm
Date: Mon Jan 16 15:41:48 2006
New Revision: 5452
Added:
dists/trunk/arch/mips/linux-patch-2.6.15-mips-2.6.15/debian/patches/17_fpu-emulator.dpatch (contents, props changed)
dists/trunk/arch/mips/linux-patch-2.6.15-mips-2.6.15/debian/patches/26_cobalt-ll-sc.dpatch (contents, props changed)
dists/trunk/arch/mips/linux-patch-2.6.15-mips-2.6.15/debian/patches/32_swarm-cpu-probe.dpatch (contents, props changed)
dists/trunk/arch/mips/linux-patch-2.6.15-mips-2.6.15/debian/patches/61_uaccess_breakage.dpatch (contents, props changed)
Modified:
dists/trunk/arch/mips/linux-patch-2.6.15-mips-2.6.15/debian/patches/00list
Log:
add patches from Thiemo's 2.6.12 that are not in 2.6.15 yet
Modified: dists/trunk/arch/mips/linux-patch-2.6.15-mips-2.6.15/debian/patches/00list
==============================================================================
--- dists/trunk/arch/mips/linux-patch-2.6.15-mips-2.6.15/debian/patches/00list (original)
+++ dists/trunk/arch/mips/linux-patch-2.6.15-mips-2.6.15/debian/patches/00list Mon Jan 16 15:41:48 2006
@@ -2,9 +2,13 @@
10_arch-makefile.dpatch
11_byteorder-proc.dpatch
12_makefile.dpatch
+17_fpu-emulator.dpatch
20_ioc3.dpatch
21_ip30.dpatch
+26_cobalt-ll-sc.dpatch
+32_swarm-cpu-probe.dpatch
51_iomap.dpatch
52_ip22-sercon.dpatch
54_ip32-eth0.dpatch
55_o32-kcore.dpatch
+61_uaccess_breakage.dpatch
Added: dists/trunk/arch/mips/linux-patch-2.6.15-mips-2.6.15/debian/patches/17_fpu-emulator.dpatch
==============================================================================
--- (empty file)
+++ dists/trunk/arch/mips/linux-patch-2.6.15-mips-2.6.15/debian/patches/17_fpu-emulator.dpatch Mon Jan 16 15:41:48 2006
@@ -0,0 +1,121 @@
+#! /bin/sh -e
+## 17_fpu-emulator.dpatch by Atsushi Nemoto <anemo at mba.ocn.ne.jp>
+##
+## All lines beginning with `## DP:' are a description of the patch.
+## DP: Fix segfault triggered by non-inverted fpu sign bit.
+
+if [ $# -lt 1 ]; then
+ echo "`basename $0`: script expects -patch|-unpatch as argument" >&2
+ exit 1
+fi
+
+[ -f debian/patches/00patch-opts ] && . debian/patches/00patch-opts
+patch_opts="${patch_opts:--f --no-backup-if-mismatch} ${2:+-d $2}"
+
+case "$1" in
+ -patch) patch -p1 ${patch_opts} < $0;;
+ -unpatch) patch -R -p1 ${patch_opts} < $0;;
+ *)
+ echo "`basename $0`: script expects -patch|-unpatch as argument" >&2
+ exit 1;;
+esac
+
+exit 0
+
+I have a long standing patch for FPU emulator to fix a segmentation
+fault in pow() library function.
+
+Here is a test program to reproduce it.
+
+main()
+{
+ union {
+ double d;
+ struct {
+#ifdef __MIPSEB
+ unsigned int high, low;
+#else
+ unsigned int low, high;
+#endif
+ } i;
+ } x, y, z;
+ x.i.low = 0x00000000;
+ x.i.high = 0xfff00001;
+ y.i.low = 0x80000000;
+ y.i.high = 0xcff00000;
+ z.d = pow(x.d, y.d);
+ printf("%x %x\n", z.i.high, z.i.low);
+ return 0;
+}
+
+
+If you run this program, you will get segmentation fault (unless your
+FPU does not raise Unimplemented exception for NaN operands). The
+segmentation fault is caused by endless recursion in __ieee754_pow().
+
+It looks glibc's pow() assume unary '-' operation for any number
+(including NaN) always invert its sign bit.
+
+Here is a revised (just added a few comments) patch. Please review.
+Thank you.
+
+diff -u linux-mips/arch/mips/math-emu/dp_simple.c linux/arch/mips/math-emu/dp_simple.c
+--- linux-mips/arch/mips/math-emu/dp_simple.c 2005-01-31 11:05:18.000000000 +0900
++++ linux/arch/mips/math-emu/dp_simple.c 2005-04-20 17:02:02.613112541 +0900
+@@ -48,16 +48,22 @@
+ CLEARCX;
+ FLUSHXDP;
+
++ /*
++ * Invert the sign ALWAYS to prevent an endless recursion on
++ * pow() in libc.
++ */
++ /* quick fix up */
++ DPSIGN(x) ^= 1;
++
+ if (xc == IEEE754_CLASS_SNAN) {
++ ieee754dp y = ieee754dp_indef();
+ SETCX(IEEE754_INVALID_OPERATION);
+- return ieee754dp_nanxcpt(ieee754dp_indef(), "neg");
++ DPSIGN(y) = DPSIGN(x);
++ return ieee754dp_nanxcpt(y, "neg");
+ }
+
+ if (ieee754dp_isnan(x)) /* but not infinity */
+ return ieee754dp_nanxcpt(x, "neg", x);
+-
+- /* quick fix up */
+- DPSIGN(x) ^= 1;
+ return x;
+ }
+
+diff -u linux-mips/arch/mips/math-emu/sp_simple.c linux/arch/mips/math-emu/sp_simple.c
+--- linux-mips/arch/mips/math-emu/sp_simple.c 2005-01-31 11:05:18.000000000 +0900
++++ linux/arch/mips/math-emu/sp_simple.c 2005-04-20 17:02:13.678391113 +0900
+@@ -48,16 +48,22 @@
+ CLEARCX;
+ FLUSHXSP;
+
++ /*
++ * Invert the sign ALWAYS to prevent an endless recursion on
++ * pow() in libc.
++ */
++ /* quick fix up */
++ SPSIGN(x) ^= 1;
++
+ if (xc == IEEE754_CLASS_SNAN) {
++ ieee754sp y = ieee754sp_indef();
+ SETCX(IEEE754_INVALID_OPERATION);
+- return ieee754sp_nanxcpt(ieee754sp_indef(), "neg");
++ SPSIGN(y) = SPSIGN(x);
++ return ieee754sp_nanxcpt(y, "neg");
+ }
+
+ if (ieee754sp_isnan(x)) /* but not infinity */
+ return ieee754sp_nanxcpt(x, "neg", x);
+-
+- /* quick fix up */
+- SPSIGN(x) ^= 1;
+ return x;
+ }
+
Added: dists/trunk/arch/mips/linux-patch-2.6.15-mips-2.6.15/debian/patches/26_cobalt-ll-sc.dpatch
==============================================================================
--- (empty file)
+++ dists/trunk/arch/mips/linux-patch-2.6.15-mips-2.6.15/debian/patches/26_cobalt-ll-sc.dpatch Mon Jan 16 15:41:48 2006
@@ -0,0 +1,100 @@
+#! /bin/sh -e
+## 26_cobalt-ll-sc.dpatch by Peter Horton <pdh at colonel-panic.org>
+##
+## All lines beginning with `## DP:' are a description of the patch.
+## DP: Work around broken ll/sc of some 64bit cobalt boxen.
+
+if [ $# -lt 1 ]; then
+ echo "`basename $0`: script expects -patch|-unpatch as argument" >&2
+ exit 1
+fi
+
+[ -f debian/patches/00patch-opts ] && . debian/patches/00patch-opts
+patch_opts="${patch_opts:--f --no-backup-if-mismatch} ${2:+-d $2}"
+
+case "$1" in
+ -patch) patch -p1 ${patch_opts} < $0;;
+ -unpatch) patch -R -p1 ${patch_opts} < $0;;
+ *)
+ echo "`basename $0`: script expects -patch|-unpatch as argument" >&2
+ exit 1;;
+esac
+
+exit 0
+
+This patch adds detection of broken 64-bit mode LL/SC on Cobalt units.
+With this patch my Qube2700 boots a 64-bit build fine. The later units
+have some problems with the Tulip driver.
+
+--- linux-source-2.6.12/arch/mips/kernel/cpu-bugs64.c~ 2005-06-17 21:48:29.000000000 +0200
++++ linux-source-2.6.12/arch/mips/kernel/cpu-bugs64.c 2005-09-13 23:11:41.000000000 +0200
+@@ -313,9 +313,69 @@ static inline void check_daddiu(void)
+ );
+ }
+
++/*
++ * On R5000/RM5230/RM5231 all accesses to XKPHYS by LL(D) are forced
++ * to be uncached, bits 61-59 of the address are ignored.
++ *
++ * Apparently fixed on RM5230A/5231A.
++ */
++static void check_lld(void)
++{
++ struct cpuinfo_mips *c = ¤t_cpu_data;
++ unsigned long flags, value, match, phys, *addr;
++
++ switch (c->cputype) {
++ case CPU_R5000:
++ case CPU_NEVADA:
++ break;
++
++ default:
++ return;
++ }
++
++ printk("Checking for lld bug... ");
++
++ /* hope the stack is in the low 512MB */
++ phys = CPHYSADDR((unsigned long) &value);
++
++ /* write value to memory */
++ value = 0xfedcba9876543210;
++ addr = (unsigned long *) PHYS_TO_XKPHYS(K_CALG_UNCACHED, phys);
++ *addr = value;
++
++ /* stop spurious flushes */
++ local_irq_save(flags);
++
++ /* flip cached value */
++ value = ~value;
++
++ /* read value, supposedly from cache */
++ addr = (unsigned long *) PHYS_TO_XKPHYS(K_CALG_NONCOHERENT, phys);
++ __asm__ __volatile__("lld %0, %1" : "=r" (match) : "m" (*addr));
++
++ local_irq_restore(flags);
++
++ match ^= value;
++
++ switch ((long) match) {
++ case 0:
++ printk("no.\n");
++ break;
++ case -1:
++ printk("yes.\n");
++ break;
++ default:
++ printk("yikes yes! (%lx/%lx@%p)\nPlease report to <linux-mips at linux-mips.org>.", value, match, &value);
++ }
++
++ if (!match)
++ c->options &= ~MIPS_CPU_LLSC;
++}
++
+ void __init check_bugs64(void)
+ {
+ check_mult_sh();
+ check_daddi();
+ check_daddiu();
++ check_lld();
+ }
Added: dists/trunk/arch/mips/linux-patch-2.6.15-mips-2.6.15/debian/patches/32_swarm-cpu-probe.dpatch
==============================================================================
--- (empty file)
+++ dists/trunk/arch/mips/linux-patch-2.6.15-mips-2.6.15/debian/patches/32_swarm-cpu-probe.dpatch Mon Jan 16 15:41:48 2006
@@ -0,0 +1,41 @@
+#! /bin/sh -e
+## 32_swarm-cpu-probe.dpatch by "Andrew Isaacson" <adi at broadcom.com>
+##
+## All lines beginning with `## DP:' are a description of the patch.
+## DP: Fix SB-1 cpu probe flags.
+
+if [ $# -lt 1 ]; then
+ echo "`basename $0`: script expects -patch|-unpatch as argument" >&2
+ exit 1
+fi
+
+[ -f debian/patches/00patch-opts ] && . debian/patches/00patch-opts
+patch_opts="${patch_opts:--f --no-backup-if-mismatch} ${2:+-d $2}"
+
+case "$1" in
+ -patch) patch -p1 ${patch_opts} < $0;;
+ -unpatch) patch -R -p1 ${patch_opts} < $0;;
+ *)
+ echo "`basename $0`: script expects -patch|-unpatch as argument" >&2
+ exit 1;;
+esac
+
+exit 0
+
+SB1 does not use the R4K TLB code.
+
+Signed-Off-By: Andrew Isaacson <adi at broadcom.com>
+
+Index: linux-2.6-work/arch/mips/kernel/cpu-probe.c
+===================================================================
+--- linux-2.6-work.orig/arch/mips/kernel/cpu-probe.c 2005-06-22 11:17:22.000000000 -0700
++++ linux-2.6-work/arch/mips/kernel/cpu-probe.c 2005-06-22 11:17:29.000000000 -0700
+@@ -583,6 +583,8 @@
+ switch (c->processor_id & 0xff00) {
+ case PRID_IMP_SB1:
+ c->cputype = CPU_SB1;
++ c->options &= ~MIPS_CPU_4KTLB;
++ c->options |= MIPS_CPU_TLB;
+ #ifdef CONFIG_SB1_PASS_1_WORKAROUNDS
+ /* FPU in pass1 is known to have issues. */
+ c->options &= ~(MIPS_CPU_FPU | MIPS_CPU_32FPR);
Added: dists/trunk/arch/mips/linux-patch-2.6.15-mips-2.6.15/debian/patches/61_uaccess_breakage.dpatch
==============================================================================
--- (empty file)
+++ dists/trunk/arch/mips/linux-patch-2.6.15-mips-2.6.15/debian/patches/61_uaccess_breakage.dpatch Mon Jan 16 15:41:48 2006
@@ -0,0 +1,35 @@
+#! /bin/sh -e
+## 61_uaccess_breakage.dpatch by Thiemo Seufer <ths at debian.org>
+##
+## All lines beginning with `## DP:' are a description of the patch.
+## DP: Work around uaccess breakage.
+
+if [ $# -lt 1 ]; then
+ echo "`basename $0`: script expects -patch|-unpatch as argument" >&2
+ exit 1
+fi
+
+[ -f debian/patches/00patch-opts ] && . debian/patches/00patch-opts
+patch_opts="${patch_opts:--f --no-backup-if-mismatch} ${2:+-d $2}"
+
+case "$1" in
+ -patch) patch -p1 ${patch_opts} < $0;;
+ -unpatch) patch -R -p1 ${patch_opts} < $0;;
+ *)
+ echo "`basename $0`: script expects -patch|-unpatch as argument" >&2
+ exit 1;;
+esac
+
+exit 0
+
+--- build-flavour-sb1-swarm-bn/fs/compat_ioctl.c.old 2005-10-13 02:14:34.000000000 +0200
++++ build-flavour-sb1-swarm-bn/fs/compat_ioctl.c 2005-10-13 02:14:53.000000000 +0200
+@@ -1925,7 +1925,7 @@ struct floppy_struct32 {
+ unsigned char rate;
+ unsigned char spec1;
+ unsigned char fmt_gap;
+- const compat_caddr_t name;
++ compat_caddr_t name;
+ };
+
+ struct floppy_drive_params32 {
More information about the Kernel-svn-changes
mailing list