* [patch 00/76] 2.6.24-stable review
@ 2008-03-21 22:42 Chris Wright
2008-03-21 22:42 ` [patch 01/76] Revert "NET: Add if_addrlabel.h to sanitized headers." Chris Wright
` (77 more replies)
0 siblings, 78 replies; 100+ messages in thread
From: Chris Wright @ 2008-03-21 22:42 UTC (permalink / raw)
To: linux-kernel, stable
Cc: Justin Forbes, Zwane Mwaikambo, Theodore Ts'o, Randy Dunlap,
Dave Jones, Chuck Wolber, Chris Wedgwood, Michael Krufky,
Chuck Ebbert, Domenico Andreoli, torvalds, akpm, alan
This is the start of the stable review cycle for the 2.6.24.4 release.
There are 76 patches in this series, all will be posted as a response
to this one. If anyone has any issues with these being applied, please
let us know. If anyone is a maintainer of the proper subsystem, and
wants to add a Signed-off-by: line to the patch, please respond with it.
These patches are sent out with a number of different people on the
Cc: line. If you wish to be a reviewer, please email stable@kernel.org
to add your name to the list. If you want to be off the reviewer list,
also email us.
Responses should be made by Sunday, Mar 21, 2008, 22:45:00 UTC
Anything received after that time might be too late.
The whole patch series can be found in one patch at:
kernel.org/pub/linux/kernel/v2.6/stable-review/patch-2.6.24.4-rc1.gz
and the diffstat can be found below.
thanks,
the -stable release team
---
Makefile | 2 +-
arch/arm/mach-pxa/clock.c | 23 ++-
arch/mips/kernel/i8259.c | 4 +-
arch/mips/kernel/irq.c | 5 +
arch/sparc/kernel/Makefile | 5 +-
arch/sparc/kernel/una_asm.S | 153 ++++++++++++++++++++
arch/sparc/kernel/unaligned.c | 252 +++++++---------------------------
arch/sparc64/mm/fault.c | 14 +--
arch/x86/ia32/ia32_signal.c | 4 +-
arch/x86/kernel/apic_32.c | 2 +-
arch/x86/kernel/apic_64.c | 2 +-
arch/x86/kernel/io_apic_32.c | 4 +-
arch/x86/kernel/io_apic_64.c | 6 +-
arch/x86/kernel/process_64.c | 3 +-
arch/x86/kernel/signal_32.c | 4 +-
arch/x86/kernel/signal_64.c | 2 +-
arch/x86/kernel/smpboot_32.c | 2 +-
arch/x86/kernel/smpboot_64.c | 2 +-
arch/x86/pci/mmconfig-shared.c | 35 -----
arch/x86/pci/mmconfig_32.c | 22 ++--
arch/x86/pci/mmconfig_64.c | 22 ++--
arch/x86/pci/pci.h | 7 -
crypto/async_tx/async_xor.c | 2 +-
crypto/xcbc.c | 6 +-
crypto/xts.c | 13 +-
drivers/acorn/char/defkeymap-l7200.c | 68 +++++-----
drivers/ata/pata_hpt366.c | 6 +-
drivers/ata/pata_hpt37x.c | 6 +-
drivers/ata/pata_serverworks.c | 2 +-
drivers/base/platform.c | 2 +-
drivers/block/ub.c | 2 +-
drivers/char/defkeymap.c_shipped | 68 +++++-----
drivers/char/vt.c | 1 +
drivers/dma/ioat_dma.c | 2 +
drivers/message/fusion/mptsas.c | 5 +
drivers/net/e1000e/netdev.c | 6 +-
drivers/net/macb.c | 2 +-
drivers/net/niu.c | 20 ++-
drivers/net/niu.h | 2 +-
drivers/net/wireless/b43/dma.c | 32 +++--
drivers/net/wireless/b43/main.c | 3 +-
drivers/s390/char/defkeymap.c | 4 +-
drivers/scsi/advansys.c | 15 ++-
drivers/scsi/aic94xx/aic94xx_scb.c | 14 ++-
drivers/scsi/arcmsr/arcmsr_hba.c | 20 ++--
drivers/scsi/gdth.c | 112 ++++++----------
drivers/scsi/gdth.h | 1 +
drivers/scsi/gdth_proc.c | 6 +-
drivers/scsi/ips.c | 20 ++-
drivers/scsi/scsi_lib.c | 1 -
drivers/spi/atmel_spi.c | 10 ++
drivers/spi/pxa2xx_spi.c | 41 ++++--
drivers/usb/host/ehci-q.c | 2 +-
drivers/usb/serial/ftdi_sio.c | 25 ++++
drivers/usb/serial/ftdi_sio.h | 7 +
drivers/usb/storage/protocol.c | 5 +-
fs/aio.c | 8 +
fs/ecryptfs/mmap.c | 102 ++++++++++----
fs/fuse/dir.c | 2 +-
fs/isofs/compress.c | 11 ++
fs/jbd/recovery.c | 2 +-
fs/jbd2/recovery.c | 2 +-
fs/nfsd/nfsfh.c | 4 +-
fs/ufs/util.h | 2 +-
include/asm-arm/arch-pxa/pxa-regs.h | 1 +
include/asm-x86/apic_32.h | 2 +-
include/asm-x86/futex_32.h | 6 +-
include/asm-x86/futex_64.h | 6 +-
include/asm-x86/io_apic_64.h | 2 +-
include/asm-x86/processor_32.h | 5 +-
include/linux/Kbuild | 1 -
include/linux/futex.h | 1 +
include/linux/irq.h | 3 +
include/linux/moduleparam.h | 12 ++-
include/net/inet_sock.h | 3 +-
kernel/futex.c | 50 ++++++--
kernel/futex_compat.c | 9 ++
kernel/irq/chip.c | 36 +++++
kernel/relay.c | 5 +-
kernel/sched.c | 36 ++---
kernel/sysctl.c | 2 +-
mm/filemap.c | 22 ++--
mm/hugetlb.c | 2 +-
net/bluetooth/hci_sysfs.c | 8 +-
net/bridge/netfilter/ebt_dnat.c | 4 +-
net/bridge/netfilter/ebt_redirect.c | 4 +-
net/bridge/netfilter/ebt_snat.c | 4 +-
net/core/dev.c | 6 +-
net/ipv4/ip_sockglue.c | 5 -
net/ipv4/ipcomp.c | 5 +-
net/ipv4/ipconfig.c | 4 +-
net/ipv4/netfilter/arpt_mangle.c | 2 +-
net/ipv4/netfilter/ip_queue.c | 12 +-
net/ipv6/ip6_output.c | 6 +-
net/ipv6/ip6_tunnel.c | 1 +
net/ipv6/ipcomp6.c | 2 +
net/ipv6/netfilter/ip6_queue.c | 10 +-
net/ipv6/xfrm6_output.c | 2 +-
net/netfilter/nfnetlink_log.c | 2 +-
net/netfilter/nfnetlink_queue.c | 12 +-
net/netfilter/xt_time.c | 7 +-
security/commoncap.c | 2 +-
102 files changed, 873 insertions(+), 668 deletions(-)
^ permalink raw reply [flat|nested] 100+ messages in thread
* [patch 01/76] Revert "NET: Add if_addrlabel.h to sanitized headers."
2008-03-21 22:42 [patch 00/76] 2.6.24-stable review Chris Wright
@ 2008-03-21 22:42 ` Chris Wright
2008-03-21 22:42 ` [patch 02/76] SPARC64: Loosen checks in exception table handling Chris Wright
` (76 subsequent siblings)
77 siblings, 0 replies; 100+ messages in thread
From: Chris Wright @ 2008-03-21 22:42 UTC (permalink / raw)
To: linux-kernel, stable
Cc: Justin Forbes, Zwane Mwaikambo, Theodore Ts'o, Randy Dunlap,
Dave Jones, Chuck Wolber, Chris Wedgwood, Michael Krufky,
Chuck Ebbert, Domenico Andreoli, torvalds, akpm, alan,
Greg Kroah-Hartman, Stephen Hemminger, David S. Miller
[-- Attachment #1: revert-net-add-if_addrlabel.h-to-sanitized-headers.patch --]
[-- Type: text/plain, Size: 815 bytes --]
-stable review patch. If anyone has any objections, please let us know.
---------------------
From: Greg Kroah-Hartman <gregkh@suse.de>
This reverts commit 5fb7ba76544d95bfa05199f7394a442de5660be7.
It was incorrectly added to the .24.y stable tree and causes build
breakages.
Cc: Stephen Hemminger <stephen.hemminger@vyatta.com>
Cc: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: Chris Wright <chrisw@sous-sol.org>
---
include/linux/Kbuild | 1 -
1 file changed, 1 deletion(-)
--- a/include/linux/Kbuild
+++ b/include/linux/Kbuild
@@ -217,7 +217,6 @@ unifdef-y += i2o-dev.h
unifdef-y += icmp.h
unifdef-y += icmpv6.h
unifdef-y += if_addr.h
-unifdef-y += if_addrlabel.h
unifdef-y += if_arp.h
unifdef-y += if_bridge.h
unifdef-y += if_ec.h
--
^ permalink raw reply [flat|nested] 100+ messages in thread
* [patch 02/76] SPARC64: Loosen checks in exception table handling.
2008-03-21 22:42 [patch 00/76] 2.6.24-stable review Chris Wright
2008-03-21 22:42 ` [patch 01/76] Revert "NET: Add if_addrlabel.h to sanitized headers." Chris Wright
@ 2008-03-21 22:42 ` Chris Wright
2008-03-21 22:42 ` [patch 03/76] SPARC: Fix link errors with gcc-4.3 Chris Wright
` (75 subsequent siblings)
77 siblings, 0 replies; 100+ messages in thread
From: Chris Wright @ 2008-03-21 22:42 UTC (permalink / raw)
To: linux-kernel, stable
Cc: Justin Forbes, Zwane Mwaikambo, Theodore Ts'o, Randy Dunlap,
Dave Jones, Chuck Wolber, Chris Wedgwood, Michael Krufky,
Chuck Ebbert, Domenico Andreoli, torvalds, akpm, alan,
David S. Miller, Greg Kroah-Hartman
[-- Attachment #1: sparc64-loosen-checks-in-exception-table-handling.patch --]
[-- Type: text/plain, Size: 2133 bytes --]
-stable review patch. If anyone has any objections, please let us know.
---------------------
From: David S. Miller <davem@davemloft.net>
Upstream commits: 622eaec613130e6ea78f2a5d5070e3278b21cd8f
be71716e464f4ea38f08034dc666f2feb55535d9
Some parts of the kernel now do things like do *_user() accesses while
set_fs(KERNEL_DS) that fault on purpose.
See, for example, the code added by changeset
a0c1e9073ef7428a14309cba010633a6cd6719ea ("futex: runtime enable pi
and robust functionality").
That trips up the ASI sanity checking we make in do_kernel_fault().
Just remove it for now. Maybe we can add it back later with an added
conditional which looks at the current get_fs() value.
Also, because of the new futex validation init handler, we have
to accept faults in init section text as well as the normal
kernel text.
Thanks to Tom Callaway for the bug report.
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: Chris Wright <chrisw@sous-sol.org>
---
arch/sparc64/mm/fault.c | 14 +++-----------
1 file changed, 3 insertions(+), 11 deletions(-)
--- a/arch/sparc64/mm/fault.c
+++ b/arch/sparc64/mm/fault.c
@@ -244,16 +244,8 @@ static void do_kernel_fault(struct pt_re
if (regs->tstate & TSTATE_PRIV) {
const struct exception_table_entry *entry;
- if (asi == ASI_P && (insn & 0xc0800000) == 0xc0800000) {
- if (insn & 0x2000)
- asi = (regs->tstate >> 24);
- else
- asi = (insn >> 5);
- }
-
- /* Look in asi.h: All _S asis have LS bit set */
- if ((asi & 0x1) &&
- (entry = search_exception_tables(regs->tpc))) {
+ entry = search_exception_tables(regs->tpc);
+ if (entry) {
regs->tpc = entry->fixup;
regs->tnpc = regs->tpc + 4;
return;
@@ -294,7 +286,7 @@ asmlinkage void __kprobes do_sparc64_fau
unsigned long tpc = regs->tpc;
/* Sanity check the PC. */
- if ((tpc >= KERNBASE && tpc < (unsigned long) _etext) ||
+ if ((tpc >= KERNBASE && tpc < (unsigned long) __init_end) ||
(tpc >= MODULES_VADDR && tpc < MODULES_END)) {
/* Valid, no problems... */
} else {
--
^ permalink raw reply [flat|nested] 100+ messages in thread
* [patch 03/76] SPARC: Fix link errors with gcc-4.3
2008-03-21 22:42 [patch 00/76] 2.6.24-stable review Chris Wright
2008-03-21 22:42 ` [patch 01/76] Revert "NET: Add if_addrlabel.h to sanitized headers." Chris Wright
2008-03-21 22:42 ` [patch 02/76] SPARC64: Loosen checks in exception table handling Chris Wright
@ 2008-03-21 22:42 ` Chris Wright
2008-03-21 22:42 ` [patch 04/76] TCP: Improve ipv4 established hash function Chris Wright
` (74 subsequent siblings)
77 siblings, 0 replies; 100+ messages in thread
From: Chris Wright @ 2008-03-21 22:42 UTC (permalink / raw)
To: linux-kernel, stable
Cc: Justin Forbes, Zwane Mwaikambo, Theodore Ts'o, Randy Dunlap,
Dave Jones, Chuck Wolber, Chris Wedgwood, Michael Krufky,
Chuck Ebbert, Domenico Andreoli, torvalds, akpm, alan,
David S. Miller, Greg Kroah-Hartman
[-- Attachment #1: sparc-fix-link-errors-with-gcc-4.3.patch --]
[-- Type: text/plain, Size: 14918 bytes --]
-stable review patch. If anyone has any objections, please let us know.
---------------------
From: David S. Miller <davem@davemloft.net>
Upstream commit: f0e98c387e61de00646be31fab4c2fa0224e1efb
Reported by Adrian Bunk.
Just like in changeset a3f9985843b674cbcb58f39fab8416675e7ab842
("[SPARC64]: Move kernel unaligned trap handlers into assembler
file.") we have to move the assembler bits into a seperate
asm file because as far as the compiler is concerned
these inline bits we're doing in unaligned.c are unreachable.
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: Chris Wright <chrisw@sous-sol.org>
---
arch/sparc/kernel/Makefile | 5
arch/sparc/kernel/una_asm.S | 153 +++++++++++++++++++++++++
arch/sparc/kernel/unaligned.c | 252 +++++++-----------------------------------
3 files changed, 203 insertions(+), 207 deletions(-)
--- a/arch/sparc/kernel/Makefile
+++ b/arch/sparc/kernel/Makefile
@@ -1,4 +1,4 @@
-# $Id: Makefile,v 1.62 2000/12/15 00:41:17 davem Exp $
+#
# Makefile for the linux kernel.
#
@@ -12,7 +12,8 @@ obj-y := entry.o wof.o wuf.o etrap.o
sys_sparc.o sunos_asm.o systbls.o \
time.o windows.o cpu.o devices.o sclow.o \
tadpole.o tick14.o ptrace.o sys_solaris.o \
- unaligned.o muldiv.o semaphore.o prom.o of_device.o devres.o
+ unaligned.o una_asm.o muldiv.o semaphore.o \
+ prom.o of_device.o devres.o
devres-y = ../../../kernel/irq/devres.o
--- /dev/null
+++ b/arch/sparc/kernel/una_asm.S
@@ -0,0 +1,153 @@
+/* una_asm.S: Kernel unaligned trap assembler helpers.
+ *
+ * Copyright (C) 1996,2005,2008 David S. Miller (davem@davemloft.net)
+ * Copyright (C) 1996,1997 Jakub Jelinek (jj@sunsite.mff.cuni.cz)
+ */
+
+#include <linux/errno.h>
+
+ .text
+
+retl_efault:
+ retl
+ mov -EFAULT, %o0
+
+ /* int __do_int_store(unsigned long *dst_addr, int size,
+ * unsigned long *src_val)
+ *
+ * %o0 = dest_addr
+ * %o1 = size
+ * %o2 = src_val
+ *
+ * Return '0' on success, -EFAULT on failure.
+ */
+ .globl __do_int_store
+__do_int_store:
+ ld [%o2], %g1
+ cmp %1, 2
+ be 2f
+ cmp %1, 4
+ be 1f
+ srl %g1, 24, %g2
+ srl %g1, 16, %g7
+4: stb %g2, [%o0]
+ srl %g1, 8, %g2
+5: stb %g7, [%o0 + 1]
+ ld [%o2 + 4], %g7
+6: stb %g2, [%o0 + 2]
+ srl %g7, 24, %g2
+7: stb %g1, [%o0 + 3]
+ srl %g7, 16, %g1
+8: stb %g2, [%o0 + 4]
+ srl %g7, 8, %g2
+9: stb %g1, [%o0 + 5]
+10: stb %g2, [%o0 + 6]
+ b 0f
+11: stb %g7, [%o0 + 7]
+1: srl %g1, 16, %g7
+12: stb %g2, [%o0]
+ srl %g1, 8, %g2
+13: stb %g7, [%o0 + 1]
+14: stb %g2, [%o0 + 2]
+ b 0f
+15: stb %g1, [%o0 + 3]
+2: srl %g1, 8, %g2
+16: stb %g2, [%o0]
+17: stb %g1, [%o0 + 1]
+0: retl
+ mov 0, %o0
+
+ .section __ex_table,#alloc
+ .word 4b, retl_efault
+ .word 5b, retl_efault
+ .word 6b, retl_efault
+ .word 7b, retl_efault
+ .word 8b, retl_efault
+ .word 9b, retl_efault
+ .word 10b, retl_efault
+ .word 11b, retl_efault
+ .word 12b, retl_efault
+ .word 13b, retl_efault
+ .word 14b, retl_efault
+ .word 15b, retl_efault
+ .word 16b, retl_efault
+ .word 17b, retl_efault
+ .previous
+
+ /* int do_int_load(unsigned long *dest_reg, int size,
+ * unsigned long *saddr, int is_signed)
+ *
+ * %o0 = dest_reg
+ * %o1 = size
+ * %o2 = saddr
+ * %o3 = is_signed
+ *
+ * Return '0' on success, -EFAULT on failure.
+ */
+ .globl do_int_load
+do_int_load:
+ cmp %o1, 8
+ be 9f
+ cmp %o1, 4
+ be 6f
+4: ldub [%o2], %g1
+5: ldub [%o2 + 1], %g2
+ sll %g1, 8, %g1
+ tst %o3
+ be 3f
+ or %g1, %g2, %g1
+ sll %g1, 16, %g1
+ sra %g1, 16, %g1
+3: b 0f
+ st %g1, [%o0]
+6: ldub [%o2 + 1], %g2
+ sll %g1, 24, %g1
+7: ldub [%o2 + 2], %g7
+ sll %g2, 16, %g2
+8: ldub [%o2 + 3], %g3
+ sll %g7, 8, %g7
+ or %g3, %g2, %g3
+ or %g7, %g3, %g7
+ or %g1, %g7, %g1
+ b 0f
+ st %g1, [%o0]
+9: ldub [%o2], %g1
+10: ldub [%o2 + 1], %g2
+ sll %g1, 24, %g1
+11: ldub [%o2 + 2], %g7
+ sll %g2, 16, %g2
+12: ldub [%o2 + 3], %g3
+ sll %g7, 8, %g7
+ or %g1, %g2, %g1
+ or %g7, %g3, %g7
+ or %g1, %g7, %g7
+13: ldub [%o2 + 4], %g1
+ st %g7, [%o0]
+14: ldub [%o2 + 5], %g2
+ sll %g1, 24, %g1
+15: ldub [%o2 + 6], %g7
+ sll %g2, 16, %g2
+16: ldub [%o2 + 7], %g3
+ sll %g7, 8, %g7
+ or %g1, %g2, %g1
+ or %g7, %g3, %g7
+ or %g1, %g7, %g7
+ st %g7, [%o0 + 4]
+0: retl
+ mov 0, %o0
+
+ .section __ex_table,#alloc
+ .word 4b, retl_efault
+ .word 5b, retl_efault
+ .word 6b, retl_efault
+ .word 7b, retl_efault
+ .word 8b, retl_efault
+ .word 9b, retl_efault
+ .word 10b, retl_efault
+ .word 11b, retl_efault
+ .word 12b, retl_efault
+ .word 13b, retl_efault
+ .word 14b, retl_efault
+ .word 15b, retl_efault
+ .word 16b, retl_efault
+ .previous
--- a/arch/sparc/kernel/unaligned.c
+++ b/arch/sparc/kernel/unaligned.c
@@ -175,157 +175,31 @@ static void unaligned_panic(char *str)
panic(str);
}
-#define do_integer_load(dest_reg, size, saddr, is_signed, errh) ({ \
-__asm__ __volatile__ ( \
- "cmp %1, 8\n\t" \
- "be 9f\n\t" \
- " cmp %1, 4\n\t" \
- "be 6f\n" \
-"4:\t" " ldub [%2], %%l1\n" \
-"5:\t" "ldub [%2 + 1], %%l2\n\t" \
- "sll %%l1, 8, %%l1\n\t" \
- "tst %3\n\t" \
- "be 3f\n\t" \
- " add %%l1, %%l2, %%l1\n\t" \
- "sll %%l1, 16, %%l1\n\t" \
- "sra %%l1, 16, %%l1\n" \
-"3:\t" "b 0f\n\t" \
- " st %%l1, [%0]\n" \
-"6:\t" "ldub [%2 + 1], %%l2\n\t" \
- "sll %%l1, 24, %%l1\n" \
-"7:\t" "ldub [%2 + 2], %%g7\n\t" \
- "sll %%l2, 16, %%l2\n" \
-"8:\t" "ldub [%2 + 3], %%g1\n\t" \
- "sll %%g7, 8, %%g7\n\t" \
- "or %%l1, %%l2, %%l1\n\t" \
- "or %%g7, %%g1, %%g7\n\t" \
- "or %%l1, %%g7, %%l1\n\t" \
- "b 0f\n\t" \
- " st %%l1, [%0]\n" \
-"9:\t" "ldub [%2], %%l1\n" \
-"10:\t" "ldub [%2 + 1], %%l2\n\t" \
- "sll %%l1, 24, %%l1\n" \
-"11:\t" "ldub [%2 + 2], %%g7\n\t" \
- "sll %%l2, 16, %%l2\n" \
-"12:\t" "ldub [%2 + 3], %%g1\n\t" \
- "sll %%g7, 8, %%g7\n\t" \
- "or %%l1, %%l2, %%l1\n\t" \
- "or %%g7, %%g1, %%g7\n\t" \
- "or %%l1, %%g7, %%g7\n" \
-"13:\t" "ldub [%2 + 4], %%l1\n\t" \
- "st %%g7, [%0]\n" \
-"14:\t" "ldub [%2 + 5], %%l2\n\t" \
- "sll %%l1, 24, %%l1\n" \
-"15:\t" "ldub [%2 + 6], %%g7\n\t" \
- "sll %%l2, 16, %%l2\n" \
-"16:\t" "ldub [%2 + 7], %%g1\n\t" \
- "sll %%g7, 8, %%g7\n\t" \
- "or %%l1, %%l2, %%l1\n\t" \
- "or %%g7, %%g1, %%g7\n\t" \
- "or %%l1, %%g7, %%g7\n\t" \
- "st %%g7, [%0 + 4]\n" \
-"0:\n\n\t" \
- ".section __ex_table,#alloc\n\t" \
- ".word 4b, " #errh "\n\t" \
- ".word 5b, " #errh "\n\t" \
- ".word 6b, " #errh "\n\t" \
- ".word 7b, " #errh "\n\t" \
- ".word 8b, " #errh "\n\t" \
- ".word 9b, " #errh "\n\t" \
- ".word 10b, " #errh "\n\t" \
- ".word 11b, " #errh "\n\t" \
- ".word 12b, " #errh "\n\t" \
- ".word 13b, " #errh "\n\t" \
- ".word 14b, " #errh "\n\t" \
- ".word 15b, " #errh "\n\t" \
- ".word 16b, " #errh "\n\n\t" \
- ".previous\n\t" \
- : : "r" (dest_reg), "r" (size), "r" (saddr), "r" (is_signed) \
- : "l1", "l2", "g7", "g1", "cc"); \
-})
-
-#define store_common(dst_addr, size, src_val, errh) ({ \
-__asm__ __volatile__ ( \
- "ld [%2], %%l1\n" \
- "cmp %1, 2\n\t" \
- "be 2f\n\t" \
- " cmp %1, 4\n\t" \
- "be 1f\n\t" \
- " srl %%l1, 24, %%l2\n\t" \
- "srl %%l1, 16, %%g7\n" \
-"4:\t" "stb %%l2, [%0]\n\t" \
- "srl %%l1, 8, %%l2\n" \
-"5:\t" "stb %%g7, [%0 + 1]\n\t" \
- "ld [%2 + 4], %%g7\n" \
-"6:\t" "stb %%l2, [%0 + 2]\n\t" \
- "srl %%g7, 24, %%l2\n" \
-"7:\t" "stb %%l1, [%0 + 3]\n\t" \
- "srl %%g7, 16, %%l1\n" \
-"8:\t" "stb %%l2, [%0 + 4]\n\t" \
- "srl %%g7, 8, %%l2\n" \
-"9:\t" "stb %%l1, [%0 + 5]\n" \
-"10:\t" "stb %%l2, [%0 + 6]\n\t" \
- "b 0f\n" \
-"11:\t" " stb %%g7, [%0 + 7]\n" \
-"1:\t" "srl %%l1, 16, %%g7\n" \
-"12:\t" "stb %%l2, [%0]\n\t" \
- "srl %%l1, 8, %%l2\n" \
-"13:\t" "stb %%g7, [%0 + 1]\n" \
-"14:\t" "stb %%l2, [%0 + 2]\n\t" \
- "b 0f\n" \
-"15:\t" " stb %%l1, [%0 + 3]\n" \
-"2:\t" "srl %%l1, 8, %%l2\n" \
-"16:\t" "stb %%l2, [%0]\n" \
-"17:\t" "stb %%l1, [%0 + 1]\n" \
-"0:\n\n\t" \
- ".section __ex_table,#alloc\n\t" \
- ".word 4b, " #errh "\n\t" \
- ".word 5b, " #errh "\n\t" \
- ".word 6b, " #errh "\n\t" \
- ".word 7b, " #errh "\n\t" \
- ".word 8b, " #errh "\n\t" \
- ".word 9b, " #errh "\n\t" \
- ".word 10b, " #errh "\n\t" \
- ".word 11b, " #errh "\n\t" \
- ".word 12b, " #errh "\n\t" \
- ".word 13b, " #errh "\n\t" \
- ".word 14b, " #errh "\n\t" \
- ".word 15b, " #errh "\n\t" \
- ".word 16b, " #errh "\n\t" \
- ".word 17b, " #errh "\n\n\t" \
- ".previous\n\t" \
- : : "r" (dst_addr), "r" (size), "r" (src_val) \
- : "l1", "l2", "g7", "g1", "cc"); \
-})
-
-#define do_integer_store(reg_num, size, dst_addr, regs, errh) ({ \
- unsigned long *src_val; \
- static unsigned long zero[2] = { 0, }; \
- \
- if (reg_num) src_val = fetch_reg_addr(reg_num, regs); \
- else { \
- src_val = &zero[0]; \
- if (size == 8) \
- zero[1] = fetch_reg(1, regs); \
- } \
- store_common(dst_addr, size, src_val, errh); \
-})
+/* una_asm.S */
+extern int do_int_load(unsigned long *dest_reg, int size,
+ unsigned long *saddr, int is_signed);
+extern int __do_int_store(unsigned long *dst_addr, int size,
+ unsigned long *src_val);
+
+static int do_int_store(int reg_num, int size, unsigned long *dst_addr,
+ struct pt_regs *regs)
+{
+ unsigned long zero[2] = { 0, 0 };
+ unsigned long *src_val;
+
+ if (reg_num)
+ src_val = fetch_reg_addr(reg_num, regs);
+ else {
+ src_val = &zero[0];
+ if (size == 8)
+ zero[1] = fetch_reg(1, regs);
+ }
+ return __do_int_store(dst_addr, size, src_val);
+}
extern void smp_capture(void);
extern void smp_release(void);
-#define do_atomic(srcdest_reg, mem, errh) ({ \
- unsigned long flags, tmp; \
- \
- smp_capture(); \
- local_irq_save(flags); \
- tmp = *srcdest_reg; \
- do_integer_load(srcdest_reg, 4, mem, 0, errh); \
- store_common(mem, 4, &tmp, errh); \
- local_irq_restore(flags); \
- smp_release(); \
-})
-
static inline void advance(struct pt_regs *regs)
{
regs->pc = regs->npc;
@@ -342,9 +216,7 @@ static inline int ok_for_kernel(unsigned
return !floating_point_load_or_store_p(insn);
}
-void kernel_mna_trap_fault(struct pt_regs *regs, unsigned int insn) __asm__ ("kernel_mna_trap_fault");
-
-void kernel_mna_trap_fault(struct pt_regs *regs, unsigned int insn)
+static void kernel_mna_trap_fault(struct pt_regs *regs, unsigned int insn)
{
unsigned long g2 = regs->u_regs [UREG_G2];
unsigned long fixup = search_extables_range(regs->pc, &g2);
@@ -379,48 +251,34 @@ asmlinkage void kernel_unaligned_trap(st
printk("Unsupported unaligned load/store trap for kernel at <%08lx>.\n",
regs->pc);
unaligned_panic("Wheee. Kernel does fpu/atomic unaligned load/store.");
-
- __asm__ __volatile__ ("\n"
-"kernel_unaligned_trap_fault:\n\t"
- "mov %0, %%o0\n\t"
- "call kernel_mna_trap_fault\n\t"
- " mov %1, %%o1\n\t"
- :
- : "r" (regs), "r" (insn)
- : "o0", "o1", "o2", "o3", "o4", "o5", "o7",
- "g1", "g2", "g3", "g4", "g5", "g7", "cc");
} else {
unsigned long addr = compute_effective_address(regs, insn);
+ int err;
#ifdef DEBUG_MNA
printk("KMNA: pc=%08lx [dir=%s addr=%08lx size=%d] retpc[%08lx]\n",
regs->pc, dirstrings[dir], addr, size, regs->u_regs[UREG_RETPC]);
#endif
- switch(dir) {
+ switch (dir) {
case load:
- do_integer_load(fetch_reg_addr(((insn>>25)&0x1f), regs),
- size, (unsigned long *) addr,
- decode_signedness(insn),
- kernel_unaligned_trap_fault);
+ err = do_int_load(fetch_reg_addr(((insn>>25)&0x1f),
+ regs),
+ size, (unsigned long *) addr,
+ decode_signedness(insn));
break;
case store:
- do_integer_store(((insn>>25)&0x1f), size,
- (unsigned long *) addr, regs,
- kernel_unaligned_trap_fault);
- break;
-#if 0 /* unsupported */
- case both:
- do_atomic(fetch_reg_addr(((insn>>25)&0x1f), regs),
- (unsigned long *) addr,
- kernel_unaligned_trap_fault);
+ err = do_int_store(((insn>>25)&0x1f), size,
+ (unsigned long *) addr, regs);
break;
-#endif
default:
panic("Impossible kernel unaligned trap.");
/* Not reached... */
}
- advance(regs);
+ if (err)
+ kernel_mna_trap_fault(regs, insn);
+ else
+ advance(regs);
}
}
@@ -459,9 +317,7 @@ static inline int ok_for_user(struct pt_
return 0;
}
-void user_mna_trap_fault(struct pt_regs *regs, unsigned int insn) __asm__ ("user_mna_trap_fault");
-
-void user_mna_trap_fault(struct pt_regs *regs, unsigned int insn)
+static void user_mna_trap_fault(struct pt_regs *regs, unsigned int insn)
{
siginfo_t info;
@@ -485,7 +341,7 @@ asmlinkage void user_unaligned_trap(stru
if(!ok_for_user(regs, insn, dir)) {
goto kill_user;
} else {
- int size = decode_access_size(insn);
+ int err, size = decode_access_size(insn);
unsigned long addr;
if(floating_point_load_or_store_p(insn)) {
@@ -496,48 +352,34 @@ asmlinkage void user_unaligned_trap(stru
addr = compute_effective_address(regs, insn);
switch(dir) {
case load:
- do_integer_load(fetch_reg_addr(((insn>>25)&0x1f), regs),
- size, (unsigned long *) addr,
- decode_signedness(insn),
- user_unaligned_trap_fault);
+ err = do_int_load(fetch_reg_addr(((insn>>25)&0x1f),
+ regs),
+ size, (unsigned long *) addr,
+ decode_signedness(insn));
break;
case store:
- do_integer_store(((insn>>25)&0x1f), size,
- (unsigned long *) addr, regs,
- user_unaligned_trap_fault);
+ err = do_int_store(((insn>>25)&0x1f), size,
+ (unsigned long *) addr, regs);
break;
case both:
-#if 0 /* unsupported */
- do_atomic(fetch_reg_addr(((insn>>25)&0x1f), regs),
- (unsigned long *) addr,
- user_unaligned_trap_fault);
-#else
/*
* This was supported in 2.4. However, we question
* the value of SWAP instruction across word boundaries.
*/
printk("Unaligned SWAP unsupported.\n");
- goto kill_user;
-#endif
+ err = -EFAULT;
break;
default:
unaligned_panic("Impossible user unaligned trap.");
-
- __asm__ __volatile__ ("\n"
-"user_unaligned_trap_fault:\n\t"
- "mov %0, %%o0\n\t"
- "call user_mna_trap_fault\n\t"
- " mov %1, %%o1\n\t"
- :
- : "r" (regs), "r" (insn)
- : "o0", "o1", "o2", "o3", "o4", "o5", "o7",
- "g1", "g2", "g3", "g4", "g5", "g7", "cc");
goto out;
}
- advance(regs);
+ if (err)
+ goto kill_user;
+ else
+ advance(regs);
goto out;
}
--
^ permalink raw reply [flat|nested] 100+ messages in thread
* [patch 04/76] TCP: Improve ipv4 established hash function.
2008-03-21 22:42 [patch 00/76] 2.6.24-stable review Chris Wright
` (2 preceding siblings ...)
2008-03-21 22:42 ` [patch 03/76] SPARC: Fix link errors with gcc-4.3 Chris Wright
@ 2008-03-21 22:42 ` Chris Wright
2008-03-21 22:42 ` [patch 05/76] NIU: More BMAC alt MAC address fixes Chris Wright
` (73 subsequent siblings)
77 siblings, 0 replies; 100+ messages in thread
From: Chris Wright @ 2008-03-21 22:42 UTC (permalink / raw)
To: linux-kernel, stable
Cc: Justin Forbes, Zwane Mwaikambo, Theodore Ts'o, Randy Dunlap,
Dave Jones, Chuck Wolber, Chris Wedgwood, Michael Krufky,
Chuck Ebbert, Domenico Andreoli, torvalds, akpm, alan,
David S. Miller, Greg Kroah-Hartman
[-- Attachment #1: tcp-improve-ipv4-established-hash-function.patch --]
[-- Type: text/plain, Size: 1917 bytes --]
-stable review patch. If anyone has any objections, please let us know.
---------------------
From: David S. Miller <davem@davemloft.net>
Upstream commit: 7adc3830f90df04a13366914d80a3ed407db5381
If all of the entropy is in the local and foreign addresses,
but xor'ing together would cancel out that entropy, the
current hash performs poorly.
Suggested by Cosmin Ratiu:
Basically, the situation is as follows: There is a client
machine and a server machine. Both create 15000 virtual
interfaces, open up a socket for each pair of interfaces and
do SIP traffic. By profiling I noticed that there is a lot of
time spent walking the established hash chains with this
particular setup.
The addresses were distributed like this: client interfaces
were 198.18.0.1/16 with increments of 1 and server interfaces
were 198.18.128.1/16 with increments of 1. As I said, there
were 15000 interfaces. Source and destination ports were 5060
for each connection. So in this case, ports don't matter for
hashing purposes, and the bits from the address pairs used
cancel each other, meaning there are no differences in the
whole lot of pairs, so they all end up in the same hash chain.
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: Chris Wright <chrisw@sous-sol.org>
---
include/net/inet_sock.h | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
--- a/include/net/inet_sock.h
+++ b/include/net/inet_sock.h
@@ -175,7 +175,8 @@ extern void build_ehash_secret(void);
static inline unsigned int inet_ehashfn(const __be32 laddr, const __u16 lport,
const __be32 faddr, const __be16 fport)
{
- return jhash_2words((__force __u32) laddr ^ (__force __u32) faddr,
+ return jhash_3words((__force __u32) laddr,
+ (__force __u32) faddr,
((__u32) lport) << 16 | (__force __u32)fport,
inet_ehash_secret);
}
--
^ permalink raw reply [flat|nested] 100+ messages in thread
* [patch 05/76] NIU: More BMAC alt MAC address fixes.
2008-03-21 22:42 [patch 00/76] 2.6.24-stable review Chris Wright
` (3 preceding siblings ...)
2008-03-21 22:42 ` [patch 04/76] TCP: Improve ipv4 established hash function Chris Wright
@ 2008-03-21 22:42 ` Chris Wright
2008-03-21 22:42 ` [patch 06/76] NIU: Fix BMAC alternate MAC address indexing Chris Wright
` (72 subsequent siblings)
77 siblings, 0 replies; 100+ messages in thread
From: Chris Wright @ 2008-03-21 22:42 UTC (permalink / raw)
To: linux-kernel, stable
Cc: Justin Forbes, Zwane Mwaikambo, Theodore Ts'o, Randy Dunlap,
Dave Jones, Chuck Wolber, Chris Wedgwood, Michael Krufky,
Chuck Ebbert, Domenico Andreoli, torvalds, akpm, alan,
Matheos Worku, David S Miller, Greg Kroah-Hartman
[-- Attachment #1: niu-more-bmac-alt-mac-address-fixes.patch --]
[-- Type: text/plain, Size: 1430 bytes --]
-stable review patch. If anyone has any objections, please let us know.
---------------------
From: Matheos Worku <Matheos.Worku@Sun.COM>
Upstream commit: fa907895b7b776208a1406efe5ba7ffe0f49f507
From: Matheos Worku <Matheos.Worku@Sun.COM>
1) niu_enable_alt_mac() needs to be adjusted so that the mask
is computed properly for the BMAC case.
2) BMAC has 6 alt MAC addresses available, not 7.
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: Chris Wright <chrisw@sous-sol.org>
---
drivers/net/niu.c | 9 +++++----
drivers/net/niu.h | 2 +-
2 files changed, 6 insertions(+), 5 deletions(-)
--- a/drivers/net/niu.c
+++ b/drivers/net/niu.c
@@ -1616,12 +1616,13 @@ static int niu_enable_alt_mac(struct niu
if (index >= niu_num_alt_addr(np))
return -EINVAL;
- if (np->flags & NIU_FLAGS_XMAC)
+ if (np->flags & NIU_FLAGS_XMAC) {
reg = XMAC_ADDR_CMPEN;
- else
+ mask = 1 << index;
+ } else {
reg = BMAC_ADDR_CMPEN;
-
- mask = 1 << index;
+ mask = 1 << (index + 1);
+ }
val = nr64_mac(reg);
if (on)
--- a/drivers/net/niu.h
+++ b/drivers/net/niu.h
@@ -499,7 +499,7 @@
#define BMAC_ADDR2 0x00110UL
#define BMAC_ADDR2_ADDR2 0x000000000000ffffULL
-#define BMAC_NUM_ALT_ADDR 7
+#define BMAC_NUM_ALT_ADDR 6
#define BMAC_ALT_ADDR0(NUM) (0x00118UL + (NUM)*0x18UL)
#define BMAC_ALT_ADDR0_ADDR0 0x000000000000ffffULL
--
^ permalink raw reply [flat|nested] 100+ messages in thread
* [patch 06/76] NIU: Fix BMAC alternate MAC address indexing.
2008-03-21 22:42 [patch 00/76] 2.6.24-stable review Chris Wright
` (4 preceding siblings ...)
2008-03-21 22:42 ` [patch 05/76] NIU: More BMAC alt MAC address fixes Chris Wright
@ 2008-03-21 22:42 ` Chris Wright
2008-03-21 22:42 ` [patch 07/76] NIU: Bump driver version and release date Chris Wright
` (71 subsequent siblings)
77 siblings, 0 replies; 100+ messages in thread
From: Chris Wright @ 2008-03-21 22:42 UTC (permalink / raw)
To: linux-kernel, stable
Cc: Justin Forbes, Zwane Mwaikambo, Theodore Ts'o, Randy Dunlap,
Dave Jones, Chuck Wolber, Chris Wedgwood, Michael Krufky,
Chuck Ebbert, Domenico Andreoli, torvalds, akpm, alan,
Matheos Worku, David S Miller, Greg Kroah-Hartman
[-- Attachment #1: niu-fix-bmac-alternate-mac-address-indexing.patch --]
[-- Type: text/plain, Size: 1044 bytes --]
-stable review patch. If anyone has any objections, please let us know.
---------------------
From: Matheos Worku <matheos.worku@sun.com>
Upstream commit: 3b5bcedeeb755b6e813537fcf4c32f010b490aef
BMAC port alternate MAC address index needs to start at 1. Index 0 is
used for the main MAC address.
Signed-off-by: Matheos Worku <matheos.worku@sun.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: Chris Wright <chrisw@sous-sol.org>
---
drivers/net/niu.c | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
--- a/drivers/net/niu.c
+++ b/drivers/net/niu.c
@@ -5148,7 +5148,12 @@ static void niu_set_rx_mode(struct net_d
index++;
}
} else {
- for (i = 0; i < niu_num_alt_addr(np); i++) {
+ int alt_start;
+ if (np->flags & NIU_FLAGS_XMAC)
+ alt_start = 0;
+ else
+ alt_start = 1;
+ for (i = alt_start; i < niu_num_alt_addr(np); i++) {
err = niu_enable_alt_mac(np, i, 0);
if (err)
printk(KERN_WARNING PFX "%s: Error %d "
--
^ permalink raw reply [flat|nested] 100+ messages in thread
* [patch 07/76] NIU: Bump driver version and release date.
2008-03-21 22:42 [patch 00/76] 2.6.24-stable review Chris Wright
` (5 preceding siblings ...)
2008-03-21 22:42 ` [patch 06/76] NIU: Fix BMAC alternate MAC address indexing Chris Wright
@ 2008-03-21 22:42 ` Chris Wright
2008-03-22 0:10 ` Jesper Juhl
2008-03-21 22:42 ` [patch 08/76] NET: Messed multicast lists after dev_mc_sync/unsync Chris Wright
` (70 subsequent siblings)
77 siblings, 1 reply; 100+ messages in thread
From: Chris Wright @ 2008-03-21 22:42 UTC (permalink / raw)
To: linux-kernel, stable
Cc: Justin Forbes, Zwane Mwaikambo, Theodore Ts'o, Randy Dunlap,
Dave Jones, Chuck Wolber, Chris Wedgwood, Michael Krufky,
Chuck Ebbert, Domenico Andreoli, torvalds, akpm, alan,
David S. Miller, Greg Kroah-Hartman
[-- Attachment #1: niu-bump-driver-version-and-release-date.patch --]
[-- Type: text/plain, Size: 857 bytes --]
-stable review patch. If anyone has any objections, please let us know.
---------------------
From: David S. Miller <davem@davemloft.net>
Upstream commit: a442585952f137bd4cdb1f2f3166e4157d383b82
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: Chris Wright <chrisw@sous-sol.org>
---
drivers/net/niu.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
--- a/drivers/net/niu.c
+++ b/drivers/net/niu.c
@@ -33,8 +33,8 @@
#define DRV_MODULE_NAME "niu"
#define PFX DRV_MODULE_NAME ": "
-#define DRV_MODULE_VERSION "0.6"
-#define DRV_MODULE_RELDATE "January 5, 2008"
+#define DRV_MODULE_VERSION "0.7"
+#define DRV_MODULE_RELDATE "February 18, 2008"
static char version[] __devinitdata =
DRV_MODULE_NAME ".c:v" DRV_MODULE_VERSION " (" DRV_MODULE_RELDATE ")\n";
--
^ permalink raw reply [flat|nested] 100+ messages in thread
* [patch 08/76] NET: Messed multicast lists after dev_mc_sync/unsync
2008-03-21 22:42 [patch 00/76] 2.6.24-stable review Chris Wright
` (6 preceding siblings ...)
2008-03-21 22:42 ` [patch 07/76] NIU: Bump driver version and release date Chris Wright
@ 2008-03-21 22:42 ` Chris Wright
2008-03-21 22:42 ` [patch 09/76] NET: Fix race in dev_close(). (Bug 9750) Chris Wright
` (69 subsequent siblings)
77 siblings, 0 replies; 100+ messages in thread
From: Chris Wright @ 2008-03-21 22:42 UTC (permalink / raw)
To: linux-kernel, stable
Cc: Justin Forbes, Zwane Mwaikambo, Theodore Ts'o, Randy Dunlap,
Dave Jones, Chuck Wolber, Chris Wedgwood, Michael Krufky,
Chuck Ebbert, Domenico Andreoli, torvalds, akpm, alan,
Jorge Boncompte [DTI2], Patrick McHardy, David S Miller,
Greg Kroah-Hartman
[-- Attachment #1: net-messed-multicast-lists-after-dev_mc_sync-unsync.patch --]
[-- Type: text/plain, Size: 1228 bytes --]
-stable review patch. If anyone has any objections, please let us know.
---------------------
From: Jorge Boncompte [DTI2] <jorge@dti2.net>
Upstream commit: 12aa343add3eced38a44bdb612b35fdf634d918c
Commit a0a400d79e3dd7843e7e81baa3ef2957bdc292d0 ("[NET]: dev_mcast:
add multicast list synchronization helpers") from you introduced a new
field "da_synced" to struct dev_addr_list that is not properly
initialized to 0. So when any of the current users (8021q, macvlan,
mac80211) calls dev_mc_sync/unsync they mess the address list for both
devices.
The attached patch fixed it for me and avoid future problems.
Signed-off-by: Jorge Boncompte [DTI2] <jorge@dti2.net>
Signed-off-by: Patrick McHardy <kaber@trash.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: Chris Wright <chrisw@sous-sol.org>
---
net/core/dev.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -2906,7 +2906,7 @@ int __dev_addr_add(struct dev_addr_list
}
}
- da = kmalloc(sizeof(*da), GFP_ATOMIC);
+ da = kzalloc(sizeof(*da), GFP_ATOMIC);
if (da == NULL)
return -ENOMEM;
memcpy(da->da_addr, addr, alen);
--
^ permalink raw reply [flat|nested] 100+ messages in thread
* [patch 09/76] NET: Fix race in dev_close(). (Bug 9750)
2008-03-21 22:42 [patch 00/76] 2.6.24-stable review Chris Wright
` (7 preceding siblings ...)
2008-03-21 22:42 ` [patch 08/76] NET: Messed multicast lists after dev_mc_sync/unsync Chris Wright
@ 2008-03-21 22:42 ` Chris Wright
2008-03-21 22:43 ` [patch 10/76] IPV6: Fix IPsec datagram fragmentation Chris Wright
` (68 subsequent siblings)
77 siblings, 0 replies; 100+ messages in thread
From: Chris Wright @ 2008-03-21 22:42 UTC (permalink / raw)
To: linux-kernel, stable
Cc: Justin Forbes, Zwane Mwaikambo, Theodore Ts'o, Randy Dunlap,
Dave Jones, Chuck Wolber, Chris Wedgwood, Michael Krufky,
Chuck Ebbert, Domenico Andreoli, torvalds, akpm, alan,
Matti Linnanvuori, David S Miller, Greg Kroah-Hartman
[-- Attachment #1: net-fix-race-in-dev_close.patch --]
[-- Type: text/plain, Size: 1659 bytes --]
-stable review patch. If anyone has any objections, please let us know.
---------------------
From: Matti Linnanvuori <mattilinnanvuori@yahoo.com>
Upstream commit: d8b2a4d21e0b37b9669b202867bfef19f68f786a
There is a race in Linux kernel file net/core/dev.c, function dev_close.
The function calls function dev_deactivate, which calls function
dev_watchdog_down that deletes the watchdog timer. However, after that, a
driver can call netif_carrier_ok, which calls function
__netdev_watchdog_up that can add the watchdog timer again. Function
unregister_netdevice calls function dev_shutdown that traps the bug
!timer_pending(&dev->watchdog_timer). Moving dev_deactivate after
netif_running() has been cleared prevents function netif_carrier_on
from calling __netdev_watchdog_up and adding the watchdog timer again.
Signed-off-by: Matti Linnanvuori <mattilinnanvuori@yahoo.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: Chris Wright <chrisw@sous-sol.org>
---
net/core/dev.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -1068,8 +1068,6 @@ int dev_close(struct net_device *dev)
*/
call_netdevice_notifiers(NETDEV_GOING_DOWN, dev);
- dev_deactivate(dev);
-
clear_bit(__LINK_STATE_START, &dev->state);
/* Synchronize to scheduled poll. We cannot touch poll list,
@@ -1080,6 +1078,8 @@ int dev_close(struct net_device *dev)
*/
smp_mb__after_clear_bit(); /* Commit netif_running(). */
+ dev_deactivate(dev);
+
/*
* Call the device specific close. This cannot fail.
* Only if device is UP
--
^ permalink raw reply [flat|nested] 100+ messages in thread
* [patch 10/76] IPV6: Fix IPsec datagram fragmentation
2008-03-21 22:42 [patch 00/76] 2.6.24-stable review Chris Wright
` (8 preceding siblings ...)
2008-03-21 22:42 ` [patch 09/76] NET: Fix race in dev_close(). (Bug 9750) Chris Wright
@ 2008-03-21 22:43 ` Chris Wright
2008-03-21 22:43 ` [patch 11/76] IPV6: dst_entry leak in ip4ip6_err Chris Wright
` (67 subsequent siblings)
77 siblings, 0 replies; 100+ messages in thread
From: Chris Wright @ 2008-03-21 22:43 UTC (permalink / raw)
To: linux-kernel, stable
Cc: Justin Forbes, Zwane Mwaikambo, Theodore Ts'o, Randy Dunlap,
Dave Jones, Chuck Wolber, Chris Wedgwood, Michael Krufky,
Chuck Ebbert, Domenico Andreoli, torvalds, akpm, alan, Herbert Xu,
David S Miller, Greg Kroah-Hartman
[-- Attachment #1: ipv6-fix-ipsec-datagram-fragmentation.patch --]
[-- Type: text/plain, Size: 2298 bytes --]
-stable review patch. If anyone has any objections, please let us know.
---------------------
From: Herbert Xu <herbert@gondor.apana.org.au>
Upstream commits: 28a89453b1e8de8d777ad96fa1eef27b5d1ce074
b5c15fc004ac83b7ad280acbe0fd4bbed7e2c8d4
This is a long-standing bug in the IPsec IPv6 code that breaks
when we emit a IPsec tunnel-mode datagram packet. The problem
is that the code the emits the packet assumes the IPv6 stack
will fragment it later, but the IPv6 stack assumes that whoever
is emitting the packet is going to pre-fragment the packet.
In the long term we need to fix both sides, e.g., to get the
datagram code to pre-fragment as well as to get the IPv6 stack
to fragment locally generated tunnel-mode packet.
For now this patch does the second part which should make it
work for the IPsec host case.
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: Chris Wright <chrisw@sous-sol.org>
---
net/ipv6/ip6_output.c | 6 +++++-
net/ipv6/xfrm6_output.c | 2 +-
2 files changed, 6 insertions(+), 2 deletions(-)
--- a/net/ipv6/ip6_output.c
+++ b/net/ipv6/ip6_output.c
@@ -593,7 +593,7 @@ static int ip6_fragment(struct sk_buff *
* or if the skb it not generated by a local socket. (This last
* check should be redundant, but it's free.)
*/
- if (!np || np->pmtudisc >= IPV6_PMTUDISC_DO) {
+ if (!skb->local_df) {
skb->dev = skb->dst->dev;
icmpv6_send(skb, ICMPV6_PKT_TOOBIG, 0, mtu, skb->dev);
IP6_INC_STATS(ip6_dst_idev(skb->dst), IPSTATS_MIB_FRAGFAILS);
@@ -1389,6 +1389,10 @@ int ip6_push_pending_frames(struct sock
tmp_skb->sk = NULL;
}
+ /* Allow local fragmentation. */
+ if (np->pmtudisc < IPV6_PMTUDISC_DO)
+ skb->local_df = 1;
+
ipv6_addr_copy(final_dst, &fl->fl6_dst);
__skb_pull(skb, skb_network_header_len(skb));
if (opt && opt->opt_flen)
--- a/net/ipv6/xfrm6_output.c
+++ b/net/ipv6/xfrm6_output.c
@@ -34,7 +34,7 @@ static int xfrm6_tunnel_check_size(struc
if (mtu < IPV6_MIN_MTU)
mtu = IPV6_MIN_MTU;
- if (skb->len > mtu) {
+ if (!skb->local_df && skb->len > mtu) {
skb->dev = dst->dev;
icmpv6_send(skb, ICMPV6_PKT_TOOBIG, 0, mtu, skb->dev);
ret = -EMSGSIZE;
--
^ permalink raw reply [flat|nested] 100+ messages in thread
* [patch 11/76] IPV6: dst_entry leak in ip4ip6_err.
2008-03-21 22:42 [patch 00/76] 2.6.24-stable review Chris Wright
` (9 preceding siblings ...)
2008-03-21 22:43 ` [patch 10/76] IPV6: Fix IPsec datagram fragmentation Chris Wright
@ 2008-03-21 22:43 ` Chris Wright
2008-03-21 22:43 ` [patch 12/76] IPV4: Remove IP_TOS setting privilege checks Chris Wright
` (66 subsequent siblings)
77 siblings, 0 replies; 100+ messages in thread
From: Chris Wright @ 2008-03-21 22:43 UTC (permalink / raw)
To: linux-kernel, stable
Cc: Justin Forbes, Zwane Mwaikambo, Theodore Ts'o, Randy Dunlap,
Dave Jones, Chuck Wolber, Chris Wedgwood, Michael Krufky,
Chuck Ebbert, Domenico Andreoli, torvalds, akpm, alan,
Denis V. Lunev, David S Miller, Greg Kroah-Hartman
[-- Attachment #1: ipv6-dst_entry-leak-in-ip4ip6_err.patch --]
[-- Type: text/plain, Size: 926 bytes --]
-stable review patch. If anyone has any objections, please let us know.
---------------------
From: Denis V. Lunev <den@openvz.org>
Upstream commit: 9937ded8e44de8865cba1509d24eea9d350cebf0
The result of the ip_route_output is not assigned to skb. This means that
- it is leaked
- possible OOPS below dereferrencing skb->dst
- no ICMP message for this case
Signed-off-by: Denis V. Lunev <den@openvz.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: Chris Wright <chrisw@sous-sol.org>
---
net/ipv6/ip6_tunnel.c | 1 +
1 file changed, 1 insertion(+)
--- a/net/ipv6/ip6_tunnel.c
+++ b/net/ipv6/ip6_tunnel.c
@@ -550,6 +550,7 @@ ip4ip6_err(struct sk_buff *skb, struct i
ip_rt_put(rt);
goto out;
}
+ skb2->dst = (struct dst_entry *)rt;
} else {
ip_rt_put(rt);
if (ip_route_input(skb2, eiph->daddr, eiph->saddr, eiph->tos,
--
^ permalink raw reply [flat|nested] 100+ messages in thread
* [patch 12/76] IPV4: Remove IP_TOS setting privilege checks.
2008-03-21 22:42 [patch 00/76] 2.6.24-stable review Chris Wright
` (10 preceding siblings ...)
2008-03-21 22:43 ` [patch 11/76] IPV6: dst_entry leak in ip4ip6_err Chris Wright
@ 2008-03-21 22:43 ` Chris Wright
2008-03-21 22:43 ` [patch 13/76] IPCONFIG: The kernel gets no IP from some DHCP servers Chris Wright
` (65 subsequent siblings)
77 siblings, 0 replies; 100+ messages in thread
From: Chris Wright @ 2008-03-21 22:43 UTC (permalink / raw)
To: linux-kernel, stable
Cc: Justin Forbes, Zwane Mwaikambo, Theodore Ts'o, Randy Dunlap,
Dave Jones, Chuck Wolber, Chris Wedgwood, Michael Krufky,
Chuck Ebbert, Domenico Andreoli, torvalds, akpm, alan,
David S. Miller, Greg Kroah-Hartman
[-- Attachment #1: ipv4-remove-ip_tos-setting-privilege-checks.patch --]
[-- Type: text/plain, Size: 2300 bytes --]
-stable review patch. If anyone has any objections, please let us know.
---------------------
From: David S. Miller <davem@davemloft.net>
Upstream commit: e4f8b5d4edc1edb0709531bd1a342655d5e8b98e
Various RFCs have all sorts of things to say about the CS field of the
DSCP value. In particular they try to make the distinction between
values that should be used by "user applications" and things like
routing daemons.
This seems to have influenced the CAP_NET_ADMIN check which exists for
IP_TOS socket option settings, but in fact it has an off-by-one error
so it wasn't allowing CS5 which is meant for "user applications" as
well.
Further adding to the inconsistency and brokenness here, IPV6 does not
validate the DSCP values specified for the IPV6_TCLASS socket option.
The real actual uses of these TOS values are system specific in the
final analysis, and these RFC recommendations are just that, "a
recommendation". In fact the standards very purposefully use
"SHOULD" and "SHOULD NOT" when describing how these values can be
used.
In the final analysis the only clean way to provide consistency here
is to remove the CAP_NET_ADMIN check. The alternatives just don't
work out:
1) If we add the CAP_NET_ADMIN check to ipv6, this can break existing
setups.
2) If we just fix the off-by-one error in the class comparison in
IPV4, certain DSCP values can be used in IPV6 but not IPV4 by
default. So people will just ask for a sysctl asking to
override that.
I checked several other freely available kernel trees and they
do not make any privilege checks in this area like we do. For
the BSD stacks, this goes back all the way to Stevens Volume 2
and beyond.
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: Chris Wright <chrisw@sous-sol.org>
---
net/ipv4/ip_sockglue.c | 5 -----
1 file changed, 5 deletions(-)
--- a/net/ipv4/ip_sockglue.c
+++ b/net/ipv4/ip_sockglue.c
@@ -514,11 +514,6 @@ static int do_ip_setsockopt(struct sock
val &= ~3;
val |= inet->tos & 3;
}
- if (IPTOS_PREC(val) >= IPTOS_PREC_CRITIC_ECP &&
- !capable(CAP_NET_ADMIN)) {
- err = -EPERM;
- break;
- }
if (inet->tos != val) {
inet->tos = val;
sk->sk_priority = rt_tos2priority(val);
--
^ permalink raw reply [flat|nested] 100+ messages in thread
* [patch 13/76] IPCONFIG: The kernel gets no IP from some DHCP servers
2008-03-21 22:42 [patch 00/76] 2.6.24-stable review Chris Wright
` (11 preceding siblings ...)
2008-03-21 22:43 ` [patch 12/76] IPV4: Remove IP_TOS setting privilege checks Chris Wright
@ 2008-03-21 22:43 ` Chris Wright
2008-03-21 22:43 ` [patch 14/76] IPCOMP: Disable BH on output when using shared tfm Chris Wright
` (64 subsequent siblings)
77 siblings, 0 replies; 100+ messages in thread
From: Chris Wright @ 2008-03-21 22:43 UTC (permalink / raw)
To: linux-kernel, stable
Cc: Justin Forbes, Zwane Mwaikambo, Theodore Ts'o, Randy Dunlap,
Dave Jones, Chuck Wolber, Chris Wedgwood, Michael Krufky,
Chuck Ebbert, Domenico Andreoli, torvalds, akpm, alan,
Stephen Hemminger, David S Miller, Greg Kroah-Hartman
[-- Attachment #1: ipconfig-the-kernel-gets-no-ip-from-some-dhcp-servers.patch --]
[-- Type: text/plain, Size: 1585 bytes --]
-stable review patch. If anyone has any objections, please let us know.
---------------------
From: Stephen Hemminger <shemminger@linux-foundation.org>
Upstream commit: dea75bdfa57f75a7a7ec2961ec28db506c18e5db
From: Stephen Hemminger <shemminger@linux-foundation.org>
Based upon a patch by Marcel Wappler:
This patch fixes a DHCP issue of the kernel: some DHCP servers
(i.e. in the Linksys WRT54Gv5) are very strict about the contents
of the DHCPDISCOVER packet they receive from clients.
Table 5 in RFC2131 page 36 requests the fields 'ciaddr' and
'siaddr' MUST be set to '0'. These DHCP servers ignore Linux
kernel's DHCP discovery packets with these two fields set to
'255.255.255.255' (in contrast to popular DHCP clients, such as
'dhclient' or 'udhcpc'). This leads to a not booting system.
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: Chris Wright <chrisw@sous-sol.org>
---
net/ipv4/ipconfig.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
--- a/net/ipv4/ipconfig.c
+++ b/net/ipv4/ipconfig.c
@@ -739,9 +739,9 @@ static void __init ic_bootp_send_if(stru
printk("Unknown ARP type 0x%04x for device %s\n", dev->type, dev->name);
b->htype = dev->type; /* can cause undefined behavior */
}
+
+ /* server_ip and your_ip address are both already zero per RFC2131 */
b->hlen = dev->addr_len;
- b->your_ip = NONE;
- b->server_ip = NONE;
memcpy(b->hw_addr, dev->dev_addr, dev->addr_len);
b->secs = htons(jiffies_diff / HZ);
b->xid = d->xid;
--
^ permalink raw reply [flat|nested] 100+ messages in thread
* [patch 14/76] IPCOMP: Disable BH on output when using shared tfm
2008-03-21 22:42 [patch 00/76] 2.6.24-stable review Chris Wright
` (12 preceding siblings ...)
2008-03-21 22:43 ` [patch 13/76] IPCONFIG: The kernel gets no IP from some DHCP servers Chris Wright
@ 2008-03-21 22:43 ` Chris Wright
2008-03-21 22:43 ` [patch 15/76] IRQ_NOPROBE helper functions Chris Wright
` (63 subsequent siblings)
77 siblings, 0 replies; 100+ messages in thread
From: Chris Wright @ 2008-03-21 22:43 UTC (permalink / raw)
To: linux-kernel, stable
Cc: Justin Forbes, Zwane Mwaikambo, Theodore Ts'o, Randy Dunlap,
Dave Jones, Chuck Wolber, Chris Wedgwood, Michael Krufky,
Chuck Ebbert, Domenico Andreoli, torvalds, akpm, alan, Herbert Xu,
David S Miller, Greg Kroah-Hartman
[-- Attachment #1: ipcomp-disable-bh-on-output-when-using-shared-tfm.patch --]
[-- Type: text/plain, Size: 1726 bytes --]
-stable review patch. If anyone has any objections, please let us know.
---------------------
From: Herbert Xu <herbert@gondor.apana.org.au>
Upstream commit: 21e43188f272c7fd9efc84b8244c0b1dfccaa105
Because we use shared tfm objects in order to conserve memory,
(each tfm requires 128K of vmalloc memory), BH needs to be turned
off on output as that can occur in process context.
Previously this was done implicitly by the xfrm output code.
That was lost when it became lockless. So we need to add the
BH disabling to IPComp directly.
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: Chris Wright <chrisw@sous-sol.org>
---
net/ipv4/ipcomp.c | 5 ++++-
net/ipv6/ipcomp6.c | 2 ++
2 files changed, 6 insertions(+), 1 deletion(-)
--- a/net/ipv4/ipcomp.c
+++ b/net/ipv4/ipcomp.c
@@ -108,8 +108,11 @@ static int ipcomp_compress(struct xfrm_s
const int cpu = get_cpu();
u8 *scratch = *per_cpu_ptr(ipcomp_scratches, cpu);
struct crypto_comp *tfm = *per_cpu_ptr(ipcd->tfms, cpu);
- int err = crypto_comp_compress(tfm, start, plen, scratch, &dlen);
+ int err;
+ local_bh_disable();
+ err = crypto_comp_compress(tfm, start, plen, scratch, &dlen);
+ local_bh_enable();
if (err)
goto out;
--- a/net/ipv6/ipcomp6.c
+++ b/net/ipv6/ipcomp6.c
@@ -146,7 +146,9 @@ static int ipcomp6_output(struct xfrm_st
scratch = *per_cpu_ptr(ipcomp6_scratches, cpu);
tfm = *per_cpu_ptr(ipcd->tfms, cpu);
+ local_bh_disable();
err = crypto_comp_compress(tfm, start, plen, scratch, &dlen);
+ local_bh_enable();
if (err || (dlen + sizeof(*ipch)) >= plen) {
put_cpu();
goto out_ok;
--
^ permalink raw reply [flat|nested] 100+ messages in thread
* [patch 15/76] IRQ_NOPROBE helper functions
2008-03-21 22:42 [patch 00/76] 2.6.24-stable review Chris Wright
` (13 preceding siblings ...)
2008-03-21 22:43 ` [patch 14/76] IPCOMP: Disable BH on output when using shared tfm Chris Wright
@ 2008-03-21 22:43 ` Chris Wright
2008-03-21 22:43 ` [patch 16/76] MIPS: Mark all but i8259 interrupts as no-probe Chris Wright
` (62 subsequent siblings)
77 siblings, 0 replies; 100+ messages in thread
From: Chris Wright @ 2008-03-21 22:43 UTC (permalink / raw)
To: linux-kernel, stable
Cc: Justin Forbes, Zwane Mwaikambo, Theodore Ts'o, Randy Dunlap,
Dave Jones, Chuck Wolber, Chris Wedgwood, Michael Krufky,
Chuck Ebbert, Domenico Andreoli, torvalds, akpm, alan,
Ralf Baechle, Ingo Molnar, Greg Kroah-Hartman
[-- Attachment #1: irq_noprobe-helper-functions.patch --]
[-- Type: text/plain, Size: 2617 bytes --]
-stable review patch. If anyone has any objections, please let us know.
---------------------
From: Ralf Baechle <ralf@linux-mips.org>
Probing non-ISA interrupts using the handle_percpu_irq as their handle_irq
method may crash the system because handle_percpu_irq does not check
IRQ_WAITING. This for example hits the MIPS Qemu configuration.
This patch provides two helper functions set_irq_noprobe and set_irq_probe to
set rsp. clear the IRQ_NOPROBE flag. The only current caller is MIPS code
but this really belongs into generic code.
As an aside, interrupt probing these days has become a mostly obsolete if not
dangerous art. I think Linux interrupts should be changed to default to
non-probing but that's subject of this patch.
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Acked-and-tested-by: Rob Landley <rob@landley.net>
Cc: Alan Cox <alan@lxorguk.ukuu.org.uk>
Cc: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Chris Wright <chrisw@sous-sol.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
---
include/linux/irq.h | 3 +++
kernel/irq/chip.c | 36 ++++++++++++++++++++++++++++++++++++
2 files changed, 39 insertions(+)
--- linux-2.6.24.3.orig/include/linux/irq.h
+++ linux-2.6.24.3/include/linux/irq.h
@@ -367,6 +367,9 @@ set_irq_chained_handler(unsigned int irq
__set_irq_handler(irq, handle, 1, NULL);
}
+extern void set_irq_noprobe(unsigned int irq);
+extern void set_irq_probe(unsigned int irq);
+
/* Handle dynamic irq creation and destruction */
extern int create_irq(void);
extern void destroy_irq(unsigned int irq);
--- linux-2.6.24.3.orig/kernel/irq/chip.c
+++ linux-2.6.24.3/kernel/irq/chip.c
@@ -607,3 +607,39 @@ set_irq_chip_and_handler_name(unsigned i
set_irq_chip(irq, chip);
__set_irq_handler(irq, handle, 0, name);
}
+
+void __init set_irq_noprobe(unsigned int irq)
+{
+ struct irq_desc *desc;
+ unsigned long flags;
+
+ if (irq >= NR_IRQS) {
+ printk(KERN_ERR "Trying to mark IRQ%d non-probeable\n", irq);
+
+ return;
+ }
+
+ desc = irq_desc + irq;
+
+ spin_lock_irqsave(&desc->lock, flags);
+ desc->status |= IRQ_NOPROBE;
+ spin_unlock_irqrestore(&desc->lock, flags);
+}
+
+void __init set_irq_probe(unsigned int irq)
+{
+ struct irq_desc *desc;
+ unsigned long flags;
+
+ if (irq >= NR_IRQS) {
+ printk(KERN_ERR "Trying to mark IRQ%d probeable\n", irq);
+
+ return;
+ }
+
+ desc = irq_desc + irq;
+
+ spin_lock_irqsave(&desc->lock, flags);
+ desc->status &= ~IRQ_NOPROBE;
+ spin_unlock_irqrestore(&desc->lock, flags);
+}
--
^ permalink raw reply [flat|nested] 100+ messages in thread
* [patch 16/76] MIPS: Mark all but i8259 interrupts as no-probe.
2008-03-21 22:42 [patch 00/76] 2.6.24-stable review Chris Wright
` (14 preceding siblings ...)
2008-03-21 22:43 ` [patch 15/76] IRQ_NOPROBE helper functions Chris Wright
@ 2008-03-21 22:43 ` Chris Wright
2008-03-21 22:43 ` [patch 17/76] ub: fix up the conversion to sg_init_table() Chris Wright
` (61 subsequent siblings)
77 siblings, 0 replies; 100+ messages in thread
From: Chris Wright @ 2008-03-21 22:43 UTC (permalink / raw)
To: linux-kernel, stable
Cc: Justin Forbes, Zwane Mwaikambo, Theodore Ts'o, Randy Dunlap,
Dave Jones, Chuck Wolber, Chris Wedgwood, Michael Krufky,
Chuck Ebbert, Domenico Andreoli, torvalds, akpm, alan,
Ralf Baechle, Ingo Molnar, Greg Kroah-Hartman
[-- Attachment #1: mips-mark-all-but-i8259-interrupts-as-no-probe.patch --]
[-- Type: text/plain, Size: 1493 bytes --]
-stable review patch. If anyone has any objections, please let us know.
---------------------
From: Ralf Baechle <ralf@linux-mips.org>
Use set_irq_noprobe() to mark all MIPS interrupts as non-probe. Override that
default for i8259 interrupts.
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Acked-and-tested-by: Rob Landley <rob@landley.net>
Cc: Alan Cox <alan@lxorguk.ukuu.org.uk>
Cc: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Chris Wright <chrisw@sous-sol.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
---
arch/mips/kernel/i8259.c | 4 +++-
arch/mips/kernel/irq.c | 5 +++++
2 files changed, 8 insertions(+), 1 deletion(-)
--- linux-2.6.24.3.orig/arch/mips/kernel/i8259.c
+++ linux-2.6.24.3/arch/mips/kernel/i8259.c
@@ -338,8 +338,10 @@ void __init init_i8259_irqs(void)
init_8259A(0);
- for (i = I8259A_IRQ_BASE; i < I8259A_IRQ_BASE + 16; i++)
+ for (i = I8259A_IRQ_BASE; i < I8259A_IRQ_BASE + 16; i++) {
set_irq_chip_and_handler(i, &i8259A_chip, handle_level_irq);
+ set_irq_probe(i);
+ }
setup_irq(I8259A_IRQ_BASE + PIC_CASCADE_IR, &irq2);
}
--- linux-2.6.24.3.orig/arch/mips/kernel/irq.c
+++ linux-2.6.24.3/arch/mips/kernel/irq.c
@@ -145,6 +145,11 @@ __setup("nokgdb", nokgdb);
void __init init_IRQ(void)
{
+ int i;
+
+ for (i = 0; i < NR_IRQS; i++)
+ set_irq_noprobe(i);
+
arch_init_irq();
#ifdef CONFIG_KGDB
--
^ permalink raw reply [flat|nested] 100+ messages in thread
* [patch 17/76] ub: fix up the conversion to sg_init_table()
2008-03-21 22:42 [patch 00/76] 2.6.24-stable review Chris Wright
` (15 preceding siblings ...)
2008-03-21 22:43 ` [patch 16/76] MIPS: Mark all but i8259 interrupts as no-probe Chris Wright
@ 2008-03-21 22:43 ` Chris Wright
2008-03-21 22:43 ` [patch 18/76] x86: Clear DF before calling signal handler Chris Wright
` (60 subsequent siblings)
77 siblings, 0 replies; 100+ messages in thread
From: Chris Wright @ 2008-03-21 22:43 UTC (permalink / raw)
To: linux-kernel, stable
Cc: Justin Forbes, Zwane Mwaikambo, Theodore Ts'o, Randy Dunlap,
Dave Jones, Chuck Wolber, Chris Wedgwood, Michael Krufky,
Chuck Ebbert, Domenico Andreoli, torvalds, akpm, alan,
Oliver Pinter, Pete Zaitcev, FUJITA Tomonori, Greg KH,
Greg Kroah-Hartman
[-- Attachment #1: ub-fix-up-the-conversion-to-sg_init_table.patch --]
[-- Type: text/plain, Size: 814 bytes --]
-stable review patch. If anyone has any objections, please let us know.
---------------------
From: Pete Zaitcev <zaitcev@redhat.com>
---
drivers/block/ub.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- a/drivers/block/ub.c
+++ b/drivers/block/ub.c
@@ -657,7 +657,6 @@ static int ub_request_fn_1(struct ub_lun
if ((cmd = ub_get_cmd(lun)) == NULL)
return -1;
memset(cmd, 0, sizeof(struct ub_scsi_cmd));
- sg_init_table(cmd->sgv, UB_MAX_REQ_SG);
blkdev_dequeue_request(rq);
@@ -668,6 +667,7 @@ static int ub_request_fn_1(struct ub_lun
/*
* get scatterlist from block layer
*/
+ sg_init_table(&urq->sgv[0], UB_MAX_REQ_SG);
n_elem = blk_rq_map_sg(lun->disk->queue, rq, &urq->sgv[0]);
if (n_elem < 0) {
/* Impossible, because blk_rq_map_sg should not hit ENOMEM. */
--
^ permalink raw reply [flat|nested] 100+ messages in thread
* [patch 18/76] x86: Clear DF before calling signal handler
2008-03-21 22:42 [patch 00/76] 2.6.24-stable review Chris Wright
` (16 preceding siblings ...)
2008-03-21 22:43 ` [patch 17/76] ub: fix up the conversion to sg_init_table() Chris Wright
@ 2008-03-21 22:43 ` Chris Wright
2008-03-21 22:43 ` [patch 19/76] iov_iter_advance() fix Chris Wright
` (59 subsequent siblings)
77 siblings, 0 replies; 100+ messages in thread
From: Chris Wright @ 2008-03-21 22:43 UTC (permalink / raw)
To: linux-kernel, stable
Cc: Justin Forbes, Zwane Mwaikambo, Theodore Ts'o, Randy Dunlap,
Dave Jones, Chuck Wolber, Chris Wedgwood, Michael Krufky,
Chuck Ebbert, Domenico Andreoli, torvalds, akpm, alan,
Aurelien Jarno, Ingo Molnar, H. Peter Anvin, Greg Kroah-Hartman
[-- Attachment #1: x86-clear-df-before-calling-signal-handler.patch --]
[-- Type: text/plain, Size: 2618 bytes --]
-stable review patch. If anyone has any objections, please let us know.
---------------------
From: Aurelien Jarno <aurelien@aurel32.net>
x86: Clear DF before calling signal handler
The Linux kernel currently does not clear the direction flag before
calling a signal handler, whereas the x86/x86-64 ABI requires that.
This become a real problem with gcc version 4.3, which assumes that
the direction flag is correctly cleared at the entry of a function.
This patches changes the setup_frame() functions to clear the
direction before entering the signal handler.
This is a backport of patch e40cd10ccff3d9fbffd57b93780bee4b7b9bff51
("x86: clear DF before calling signal handler") that has been applied
in 2.6.25-rc.
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
Signed-off-by: Chris Wright <chrisw@sous-sol.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
---
arch/x86/ia32/ia32_signal.c | 4 ++--
arch/x86/kernel/signal_32.c | 4 ++--
arch/x86/kernel/signal_64.c | 2 +-
3 files changed, 5 insertions(+), 5 deletions(-)
--- a/arch/x86/ia32/ia32_signal.c
+++ b/arch/x86/ia32/ia32_signal.c
@@ -494,7 +494,7 @@ int ia32_setup_frame(int sig, struct k_s
regs->ss = __USER32_DS;
set_fs(USER_DS);
- regs->eflags &= ~TF_MASK;
+ regs->eflags &= ~(TF_MASK | X86_EFLAGS_DF);
if (test_thread_flag(TIF_SINGLESTEP))
ptrace_notify(SIGTRAP);
@@ -600,7 +600,7 @@ int ia32_setup_rt_frame(int sig, struct
regs->ss = __USER32_DS;
set_fs(USER_DS);
- regs->eflags &= ~TF_MASK;
+ regs->eflags &= ~(TF_MASK | X86_EFLAGS_DF);
if (test_thread_flag(TIF_SINGLESTEP))
ptrace_notify(SIGTRAP);
--- a/arch/x86/kernel/signal_32.c
+++ b/arch/x86/kernel/signal_32.c
@@ -396,7 +396,7 @@ static int setup_frame(int sig, struct k
* The tracer may want to single-step inside the
* handler too.
*/
- regs->eflags &= ~TF_MASK;
+ regs->eflags &= ~(TF_MASK | X86_EFLAGS_DF);
if (test_thread_flag(TIF_SINGLESTEP))
ptrace_notify(SIGTRAP);
@@ -489,7 +489,7 @@ static int setup_rt_frame(int sig, struc
* The tracer may want to single-step inside the
* handler too.
*/
- regs->eflags &= ~TF_MASK;
+ regs->eflags &= ~(TF_MASK | X86_EFLAGS_DF);
if (test_thread_flag(TIF_SINGLESTEP))
ptrace_notify(SIGTRAP);
--- a/arch/x86/kernel/signal_64.c
+++ b/arch/x86/kernel/signal_64.c
@@ -295,7 +295,7 @@ static int setup_rt_frame(int sig, struc
see include/asm-x86_64/uaccess.h for details. */
set_fs(USER_DS);
- regs->eflags &= ~TF_MASK;
+ regs->eflags &= ~(TF_MASK | X86_EFLAGS_DF);
if (test_thread_flag(TIF_SINGLESTEP))
ptrace_notify(SIGTRAP);
#ifdef DEBUG_SIG
--
^ permalink raw reply [flat|nested] 100+ messages in thread
* [patch 19/76] iov_iter_advance() fix
2008-03-21 22:42 [patch 00/76] 2.6.24-stable review Chris Wright
` (17 preceding siblings ...)
2008-03-21 22:43 ` [patch 18/76] x86: Clear DF before calling signal handler Chris Wright
@ 2008-03-21 22:43 ` Chris Wright
2008-03-21 22:43 ` [patch 20/76] drivers: fix dma_get_required_mask Chris Wright
` (58 subsequent siblings)
77 siblings, 0 replies; 100+ messages in thread
From: Chris Wright @ 2008-03-21 22:43 UTC (permalink / raw)
To: linux-kernel, stable, jejb
Cc: Justin Forbes, Zwane Mwaikambo, Theodore Ts'o, Randy Dunlap,
Dave Jones, Chuck Wolber, Chris Wedgwood, Michael Krufky,
Chuck Ebbert, Domenico Andreoli, torvalds, akpm, alan,
Nick Piggin, Alexey Dobriyan, Greg Kroah-Hartman
[-- Attachment #1: iov_iter_advance-fix.patch --]
[-- Type: text/plain, Size: 2280 bytes --]
-stable review patch. If anyone has any objections, please let us know.
---------------------
From: Nick Piggin <npiggin@suse.de>
iov_iter_advance() skips over zero-length iovecs, however it does not properly
terminate at the end of the iovec array. Fix this by checking against
i->count before we skip a zero-length iov.
The bug was reproduced with a test program that continually randomly creates
iovs to writev. The fix was also verified with the same program and also it
could verify that the correct data was contained in the file after each
writev.
Signed-off-by: Nick Piggin <npiggin@suse.de>
Tested-by: "Kevin Coffman" <kwc@citi.umich.edu>
Cc: "Alexey Dobriyan" <adobriyan@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Chris Wright <chrisw@sous-sol.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
---
mm/filemap.c | 22 ++++++++++------------
1 file changed, 10 insertions(+), 12 deletions(-)
--- a/mm/filemap.c
+++ b/mm/filemap.c
@@ -1725,21 +1725,27 @@ size_t iov_iter_copy_from_user(struct pa
}
EXPORT_SYMBOL(iov_iter_copy_from_user);
-static void __iov_iter_advance_iov(struct iov_iter *i, size_t bytes)
+void iov_iter_advance(struct iov_iter *i, size_t bytes)
{
+ BUG_ON(i->count < bytes);
+
if (likely(i->nr_segs == 1)) {
i->iov_offset += bytes;
+ i->count -= bytes;
} else {
const struct iovec *iov = i->iov;
size_t base = i->iov_offset;
/*
* The !iov->iov_len check ensures we skip over unlikely
- * zero-length segments.
+ * zero-length segments (without overruning the iovec).
*/
- while (bytes || !iov->iov_len) {
- int copy = min(bytes, iov->iov_len - base);
+ while (bytes || unlikely(!iov->iov_len && i->count)) {
+ int copy;
+ copy = min(bytes, iov->iov_len - base);
+ BUG_ON(!i->count || i->count < copy);
+ i->count -= copy;
bytes -= copy;
base += copy;
if (iov->iov_len == base) {
@@ -1751,14 +1757,6 @@ static void __iov_iter_advance_iov(struc
i->iov_offset = base;
}
}
-
-void iov_iter_advance(struct iov_iter *i, size_t bytes)
-{
- BUG_ON(i->count < bytes);
-
- __iov_iter_advance_iov(i, bytes);
- i->count -= bytes;
-}
EXPORT_SYMBOL(iov_iter_advance);
/*
--
^ permalink raw reply [flat|nested] 100+ messages in thread
* [patch 20/76] drivers: fix dma_get_required_mask
2008-03-21 22:42 [patch 00/76] 2.6.24-stable review Chris Wright
` (18 preceding siblings ...)
2008-03-21 22:43 ` [patch 19/76] iov_iter_advance() fix Chris Wright
@ 2008-03-21 22:43 ` Chris Wright
2008-03-21 22:43 ` [patch 21/76] x86: adjust enable_NMI_through_LVT0() Chris Wright
` (57 subsequent siblings)
77 siblings, 0 replies; 100+ messages in thread
From: Chris Wright @ 2008-03-21 22:43 UTC (permalink / raw)
To: linux-kernel, stable, jejb
Cc: Justin Forbes, Zwane Mwaikambo, Theodore Ts'o, Randy Dunlap,
Dave Jones, Chuck Wolber, Chris Wedgwood, Michael Krufky,
Chuck Ebbert, Domenico Andreoli, torvalds, akpm, alan,
James Bottomley, Greg Kroah-Hartman
[-- Attachment #1: drivers-fix-dma_get_required_mask.patch --]
[-- Type: text/plain, Size: 1234 bytes --]
-stable review patch. If anyone has any objections, please let us know.
---------------------
From: James Bottomley <James.Bottomley@HansenPartnership.com>
There's a bug in the current implementation of dma_get_required_mask()
where it ands the returned mask with the current device mask. This
rather defeats the purpose if you're using the call to determine what
your mask should be (since you will at that time have the default
DMA_32BIT_MASK). This bug results in any driver that uses this function
*always* getting a 32 bit mask, which is wrong.
Fix by removing the and with dev->dma_mask.
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: Chris Wright <chrisw@sous-sol.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
---
drivers/base/platform.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- a/drivers/base/platform.c
+++ b/drivers/base/platform.c
@@ -647,7 +647,7 @@ u64 dma_get_required_mask(struct device
high_totalram += high_totalram - 1;
mask = (((u64)high_totalram) << 32) + 0xffffffff;
}
- return mask & *dev->dma_mask;
+ return mask;
}
EXPORT_SYMBOL_GPL(dma_get_required_mask);
#endif
--
^ permalink raw reply [flat|nested] 100+ messages in thread
* [patch 21/76] x86: adjust enable_NMI_through_LVT0()
2008-03-21 22:42 [patch 00/76] 2.6.24-stable review Chris Wright
` (19 preceding siblings ...)
2008-03-21 22:43 ` [patch 20/76] drivers: fix dma_get_required_mask Chris Wright
@ 2008-03-21 22:43 ` Chris Wright
2008-03-21 22:43 ` [patch 22/76] SCSI ips: handle scsi_add_host() failure, and other err cleanups Chris Wright
` (56 subsequent siblings)
77 siblings, 0 replies; 100+ messages in thread
From: Chris Wright @ 2008-03-21 22:43 UTC (permalink / raw)
To: linux-kernel, stable, Justin Piszcz
Cc: Justin Forbes, Zwane Mwaikambo, Theodore Ts'o, Randy Dunlap,
Dave Jones, Chuck Wolber, Chris Wedgwood, Michael Krufky,
Chuck Ebbert, Domenico Andreoli, torvalds, akpm, alan,
Thomas Gleixner, Jan Beulich, Ingo Molnar, Greg Kroah-Hartman
[-- Attachment #1: x86-adjust-enable_nmi_through_lvt0.patch --]
[-- Type: text/plain, Size: 4404 bytes --]
-stable review patch. If anyone has any objections, please let us know.
---------------------
From: Jan Beulich <jbeulich@novell.com>
commit e94271017f0933b29362a3c9dea5a6b9d04d98e1
Its previous use in a call to on_each_cpu() was pointless, as at the
time that code gets executed only one CPU is online. Further, the
function can be __cpuinit, and for this to work without
CONFIG_HOTPLUG_CPU setup_nmi() must also get an attribute (this one
can even be __init; on 64-bits check_timer() also was lacking that
attribute).
Signed-off-by: Jan Beulich <jbeulich@novell.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
[ tglx@linutronix.de: backport to 2.6.24.3]
Cc: Justin Piszcz <jpiszcz@lucidpixels.com>
Signed-off-by: Chris Wright <chrisw@sous-sol.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
---
arch/x86/kernel/apic_32.c | 2 +-
arch/x86/kernel/apic_64.c | 2 +-
arch/x86/kernel/io_apic_32.c | 4 ++--
arch/x86/kernel/io_apic_64.c | 6 +++---
arch/x86/kernel/smpboot_32.c | 2 +-
arch/x86/kernel/smpboot_64.c | 2 +-
include/asm-x86/apic_32.h | 2 +-
include/asm-x86/io_apic_64.h | 2 +-
8 files changed, 11 insertions(+), 11 deletions(-)
--- a/arch/x86/kernel/apic_32.c
+++ b/arch/x86/kernel/apic_32.c
@@ -154,7 +154,7 @@ unsigned long safe_apic_wait_icr_idle(vo
/**
* enable_NMI_through_LVT0 - enable NMI through local vector table 0
*/
-void enable_NMI_through_LVT0 (void * dummy)
+void __cpuinit enable_NMI_through_LVT0(void)
{
unsigned int v = APIC_DM_NMI;
--- a/arch/x86/kernel/apic_64.c
+++ b/arch/x86/kernel/apic_64.c
@@ -151,7 +151,7 @@ unsigned int safe_apic_wait_icr_idle(voi
return send_status;
}
-void enable_NMI_through_LVT0 (void * dummy)
+void enable_NMI_through_LVT0(void)
{
unsigned int v;
--- a/arch/x86/kernel/io_apic_32.c
+++ b/arch/x86/kernel/io_apic_32.c
@@ -2080,7 +2080,7 @@ static struct irq_chip lapic_chip __read
.eoi = ack_apic,
};
-static void setup_nmi (void)
+static void __init setup_nmi(void)
{
/*
* Dirty trick to enable the NMI watchdog ...
@@ -2093,7 +2093,7 @@ static void setup_nmi (void)
*/
apic_printk(APIC_VERBOSE, KERN_INFO "activating NMI Watchdog ...");
- on_each_cpu(enable_NMI_through_LVT0, NULL, 1, 1);
+ enable_NMI_through_LVT0();
apic_printk(APIC_VERBOSE, " done.\n");
}
--- a/arch/x86/kernel/io_apic_64.c
+++ b/arch/x86/kernel/io_apic_64.c
@@ -1565,7 +1565,7 @@ static struct hw_interrupt_type lapic_ir
.end = end_lapic_irq,
};
-static void setup_nmi (void)
+static void __init setup_nmi(void)
{
/*
* Dirty trick to enable the NMI watchdog ...
@@ -1578,7 +1578,7 @@ static void setup_nmi (void)
*/
printk(KERN_INFO "activating NMI Watchdog ...");
- enable_NMI_through_LVT0(NULL);
+ enable_NMI_through_LVT0();
printk(" done.\n");
}
@@ -1654,7 +1654,7 @@ static inline void unlock_ExtINT_logic(v
*
* FIXME: really need to revamp this for modern platforms only.
*/
-static inline void check_timer(void)
+static inline void __init check_timer(void)
{
struct irq_cfg *cfg = irq_cfg + 0;
int apic1, pin1, apic2, pin2;
--- a/arch/x86/kernel/smpboot_32.c
+++ b/arch/x86/kernel/smpboot_32.c
@@ -405,7 +405,7 @@ static void __cpuinit start_secondary(vo
setup_secondary_clock();
if (nmi_watchdog == NMI_IO_APIC) {
disable_8259A_irq(0);
- enable_NMI_through_LVT0(NULL);
+ enable_NMI_through_LVT0();
enable_8259A_irq(0);
}
/*
--- a/arch/x86/kernel/smpboot_64.c
+++ b/arch/x86/kernel/smpboot_64.c
@@ -338,7 +338,7 @@ void __cpuinit start_secondary(void)
if (nmi_watchdog == NMI_IO_APIC) {
disable_8259A_irq(0);
- enable_NMI_through_LVT0(NULL);
+ enable_NMI_through_LVT0();
enable_8259A_irq(0);
}
--- a/include/asm-x86/apic_32.h
+++ b/include/asm-x86/apic_32.h
@@ -109,7 +109,7 @@ extern void setup_boot_APIC_clock (void)
extern void setup_secondary_APIC_clock (void);
extern int APIC_init_uniprocessor (void);
-extern void enable_NMI_through_LVT0 (void * dummy);
+extern void enable_NMI_through_LVT0(void);
#define ARCH_APICTIMER_STOPS_ON_C3 1
--- a/include/asm-x86/io_apic_64.h
+++ b/include/asm-x86/io_apic_64.h
@@ -129,7 +129,7 @@ extern int io_apic_set_pci_routing (int
extern int sis_apic_bug; /* dummy */
-void enable_NMI_through_LVT0 (void * dummy);
+void enable_NMI_through_LVT0(void);
extern spinlock_t i8259A_lock;
--
^ permalink raw reply [flat|nested] 100+ messages in thread
* [patch 22/76] SCSI ips: handle scsi_add_host() failure, and other err cleanups
2008-03-21 22:42 [patch 00/76] 2.6.24-stable review Chris Wright
` (20 preceding siblings ...)
2008-03-21 22:43 ` [patch 21/76] x86: adjust enable_NMI_through_LVT0() Chris Wright
@ 2008-03-21 22:43 ` Chris Wright
2008-03-21 22:43 ` [patch 23/76] CRYPTO xcbc: Fix crash with IPsec Chris Wright
` (55 subsequent siblings)
77 siblings, 0 replies; 100+ messages in thread
From: Chris Wright @ 2008-03-21 22:43 UTC (permalink / raw)
To: linux-kernel, stable
Cc: Justin Forbes, Zwane Mwaikambo, Theodore Ts'o, Randy Dunlap,
Dave Jones, Chuck Wolber, Chris Wedgwood, Michael Krufky,
Chuck Ebbert, Domenico Andreoli, torvalds, akpm, alan,
FUJITA Tomonori, Jeff Garzik, Jeff Garzik, Mark Salyzyn,
James Bottomley, Greg Kroah-Hartman
[-- Attachment #1: scsi-ips-handle-scsi_add_host-failure-and-other-err-cleanups.patch --]
[-- Type: text/plain, Size: 1837 bytes --]
-stable review patch. If anyone has any objections, please let us know.
---------------------
From: Jeff Garzik <jeff@garzik.org>
commit 2551a13e61d3c3df6c2da6de5a3ece78e6d67111
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
Acked-by: Mark Salyzyn <mark_salyzyn@adaptec.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
FUJITA Tomonori notes:
It didn't intend to fix a critical bug, however, it turned out that it
does. Without this patch, the ips driver in 2.6.23 and 2.6.24 doesn't
work at all. You can find the more details at the following thread:
http://marc.info/?t=120293911900023&r=1&w=2
Signed-off-by: Chris Wright <chrisw@sous-sol.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
---
drivers/scsi/ips.c | 18 +++++++++++++-----
1 file changed, 13 insertions(+), 5 deletions(-)
--- a/drivers/scsi/ips.c
+++ b/drivers/scsi/ips.c
@@ -6842,13 +6842,10 @@ ips_register_scsi(int index)
if (request_irq(ha->irq, do_ipsintr, IRQF_SHARED, ips_name, ha)) {
IPS_PRINTK(KERN_WARNING, ha->pcidev,
"Unable to install interrupt handler\n");
- scsi_host_put(sh);
- return -1;
+ goto err_out_sh;
}
kfree(oldha);
- ips_sh[index] = sh;
- ips_ha[index] = ha;
/* Store away needed values for later use */
sh->io_port = ha->io_addr;
@@ -6867,10 +6864,21 @@ ips_register_scsi(int index)
sh->max_channel = ha->nbus - 1;
sh->can_queue = ha->max_cmds - 1;
- scsi_add_host(sh, NULL);
+ if (scsi_add_host(sh, &ha->pcidev->dev))
+ goto err_out;
+
+ ips_sh[index] = sh;
+ ips_ha[index] = ha;
+
scsi_scan_host(sh);
return 0;
+
+err_out:
+ free_irq(ha->pcidev->irq, ha);
+err_out_sh:
+ scsi_host_put(sh);
+ return -1;
}
/*---------------------------------------------------------------------------*/
--
^ permalink raw reply [flat|nested] 100+ messages in thread
* [patch 23/76] CRYPTO xcbc: Fix crash with IPsec
2008-03-21 22:42 [patch 00/76] 2.6.24-stable review Chris Wright
` (21 preceding siblings ...)
2008-03-21 22:43 ` [patch 22/76] SCSI ips: handle scsi_add_host() failure, and other err cleanups Chris Wright
@ 2008-03-21 22:43 ` Chris Wright
2008-03-21 22:43 ` [patch 24/76] CRYPTO xts: Use proper alignment Chris Wright
` (54 subsequent siblings)
77 siblings, 0 replies; 100+ messages in thread
From: Chris Wright @ 2008-03-21 22:43 UTC (permalink / raw)
To: linux-kernel, stable
Cc: Justin Forbes, Zwane Mwaikambo, Theodore Ts'o, Randy Dunlap,
Dave Jones, Chuck Wolber, Chris Wedgwood, Michael Krufky,
Chuck Ebbert, Domenico Andreoli, torvalds, akpm, alan, Herbert Xu,
Joy Latten, Greg Kroah-Hartman
[-- Attachment #1: crypto-xcbc-fix-crash-with-ipsec.patch --]
[-- Type: text/plain, Size: 1516 bytes --]
-stable review patch. If anyone has any objections, please let us know.
---------------------
From: Joy Latten <latten@austin.ibm.com>
[ Upstream commit: 2f40a178e70030c4712fe63807c883f34c3645eb ]
When using aes-xcbc-mac for authentication in IPsec,
the kernel crashes. It seems this algorithm doesn't
account for the space IPsec may make in scatterlist for authtag.
Thus when crypto_xcbc_digest_update2() gets called,
nbytes may be less than sg[i].length.
Since nbytes is an unsigned number, it wraps
at the end of the loop allowing us to go back
into loop and causing crash in memcpy.
I used update function in digest.c to model this fix.
Please let me know if it looks ok.
Signed-off-by: Joy Latten <latten@austin.ibm.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: Chris Wright <chrisw@sous-sol.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
---
crypto/xcbc.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
--- a/crypto/xcbc.c
+++ b/crypto/xcbc.c
@@ -124,6 +124,11 @@ static int crypto_xcbc_digest_update2(st
unsigned int offset = sg[i].offset;
unsigned int slen = sg[i].length;
+ if (unlikely(slen > nbytes))
+ slen = nbytes;
+
+ nbytes -= slen;
+
while (slen > 0) {
unsigned int len = min(slen, ((unsigned int)(PAGE_SIZE)) - offset);
char *p = crypto_kmap(pg, 0) + offset;
@@ -177,7 +182,6 @@ static int crypto_xcbc_digest_update2(st
offset = 0;
pg++;
}
- nbytes-=sg[i].length;
i++;
} while (nbytes>0);
--
^ permalink raw reply [flat|nested] 100+ messages in thread
* [patch 24/76] CRYPTO xts: Use proper alignment
2008-03-21 22:42 [patch 00/76] 2.6.24-stable review Chris Wright
` (22 preceding siblings ...)
2008-03-21 22:43 ` [patch 23/76] CRYPTO xcbc: Fix crash with IPsec Chris Wright
@ 2008-03-21 22:43 ` Chris Wright
2008-03-21 22:43 ` [patch 25/76] fuse: fix permission checking Chris Wright
` (53 subsequent siblings)
77 siblings, 0 replies; 100+ messages in thread
From: Chris Wright @ 2008-03-21 22:43 UTC (permalink / raw)
To: linux-kernel, stable
Cc: Justin Forbes, Zwane Mwaikambo, Theodore Ts'o, Randy Dunlap,
Dave Jones, Chuck Wolber, Chris Wedgwood, Michael Krufky,
Chuck Ebbert, Domenico Andreoli, torvalds, akpm, alan, Herbert Xu,
Sebastian Siewior, Greg Kroah-Hartman
[-- Attachment #1: crypto-xts-use-proper-alignment.patch --]
[-- Type: text/plain, Size: 2108 bytes --]
-stable review patch. If anyone has any objections, please let us know.
---------------------
From: Sebastian Siewior <sebastian@breakpoint.cc>
[ Upstream commit: 6212f2c7f70c591efb0d9f3d50ad29112392fee2 ]
The XTS blockmode uses a copy of the IV which is saved on the stack
and may or may not be properly aligned. If it is not, it will break
hardware cipher like the geode or padlock.
This patch encrypts the IV in place so we don't have to worry about
alignment.
Signed-off-by: Sebastian Siewior <sebastian@breakpoint.cc>
Tested-by: Stefan Hellermann <stefan@the2masters.de>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: Chris Wright <chrisw@sous-sol.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
---
crypto/xts.c | 13 ++++++-------
1 file changed, 6 insertions(+), 7 deletions(-)
--- a/crypto/xts.c
+++ b/crypto/xts.c
@@ -77,16 +77,16 @@ static int setkey(struct crypto_tfm *par
}
struct sinfo {
- be128 t;
+ be128 *t;
struct crypto_tfm *tfm;
void (*fn)(struct crypto_tfm *, u8 *, const u8 *);
};
static inline void xts_round(struct sinfo *s, void *dst, const void *src)
{
- be128_xor(dst, &s->t, src); /* PP <- T xor P */
+ be128_xor(dst, s->t, src); /* PP <- T xor P */
s->fn(s->tfm, dst, dst); /* CC <- E(Key1,PP) */
- be128_xor(dst, dst, &s->t); /* C <- T xor CC */
+ be128_xor(dst, dst, s->t); /* C <- T xor CC */
}
static int crypt(struct blkcipher_desc *d,
@@ -101,7 +101,6 @@ static int crypt(struct blkcipher_desc *
.tfm = crypto_cipher_tfm(ctx->child),
.fn = fn
};
- be128 *iv;
u8 *wsrc;
u8 *wdst;
@@ -109,20 +108,20 @@ static int crypt(struct blkcipher_desc *
if (!w->nbytes)
return err;
+ s.t = (be128 *)w->iv;
avail = w->nbytes;
wsrc = w->src.virt.addr;
wdst = w->dst.virt.addr;
/* calculate first value of T */
- iv = (be128 *)w->iv;
- tw(crypto_cipher_tfm(ctx->tweak), (void *)&s.t, w->iv);
+ tw(crypto_cipher_tfm(ctx->tweak), w->iv, w->iv);
goto first;
for (;;) {
do {
- gf128mul_x_ble(&s.t, &s.t);
+ gf128mul_x_ble(s.t, s.t);
first:
xts_round(&s, wdst, wsrc);
--
^ permalink raw reply [flat|nested] 100+ messages in thread
* [patch 25/76] fuse: fix permission checking
2008-03-21 22:42 [patch 00/76] 2.6.24-stable review Chris Wright
` (23 preceding siblings ...)
2008-03-21 22:43 ` [patch 24/76] CRYPTO xts: Use proper alignment Chris Wright
@ 2008-03-21 22:43 ` Chris Wright
2008-03-21 22:43 ` [patch 26/76] usb-storage: dont access beyond the end of the sg buffer Chris Wright
` (52 subsequent siblings)
77 siblings, 0 replies; 100+ messages in thread
From: Chris Wright @ 2008-03-21 22:43 UTC (permalink / raw)
To: linux-kernel, stable
Cc: Justin Forbes, Zwane Mwaikambo, Theodore Ts'o, Randy Dunlap,
Dave Jones, Chuck Wolber, Chris Wedgwood, Michael Krufky,
Chuck Ebbert, Domenico Andreoli, torvalds, akpm, alan,
Miklos Szeredi, Greg Kroah-Hartman
[-- Attachment #1: fuse-fix-permission-checking.patch --]
[-- Type: text/plain, Size: 1371 bytes --]
-stable review patch. If anyone has any objections, please let us know.
---------------------
From: Miklos Szeredi <mszeredi@suse.cz>
[upstream commit 1a823ac9ff09cbdf39201df37b7ede1f9395de83]
I added a nasty local variable shadowing bug to fuse in 2.6.24, with the
result, that the 'default_permissions' mount option is basically ignored.
How did this happen?
- old err declaration in inner scope
- new err getting declared in outer scope
- 'return err' from inner scope getting removed
- old declaration not being noticed
-Wshadow would have saved us, but it doesn't seem practical for
the kernel :(
More testing would have also saved us :((
Signed-off-by: Miklos Szeredi <mszeredi@suse.cz>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Chris Wright <chrisw@sous-sol.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
---
fs/fuse/dir.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- a/fs/fuse/dir.c
+++ b/fs/fuse/dir.c
@@ -905,7 +905,7 @@ static int fuse_permission(struct inode
}
if (fc->flags & FUSE_DEFAULT_PERMISSIONS) {
- int err = generic_permission(inode, mask, NULL);
+ err = generic_permission(inode, mask, NULL);
/* If permission is denied, try to refresh file
attributes. This is also needed, because the root
--
^ permalink raw reply [flat|nested] 100+ messages in thread
* [patch 26/76] usb-storage: dont access beyond the end of the sg buffer
2008-03-21 22:42 [patch 00/76] 2.6.24-stable review Chris Wright
` (24 preceding siblings ...)
2008-03-21 22:43 ` [patch 25/76] fuse: fix permission checking Chris Wright
@ 2008-03-21 22:43 ` Chris Wright
2008-03-21 22:43 ` [patch 27/76] SCSI ips: fix data buffer accessors conversion bug Chris Wright
` (51 subsequent siblings)
77 siblings, 0 replies; 100+ messages in thread
From: Chris Wright @ 2008-03-21 22:43 UTC (permalink / raw)
To: linux-kernel, stable
Cc: Justin Forbes, Zwane Mwaikambo, Theodore Ts'o, Randy Dunlap,
Dave Jones, Chuck Wolber, Chris Wedgwood, Michael Krufky,
Chuck Ebbert, Domenico Andreoli, torvalds, akpm, alan, Alan Stern,
Mark Glines, linux-usb, Boaz Harrosh, Greg Kroah-Hartman
[-- Attachment #1: usb-storage-don-t-access-beyond-the-end-of-the-sg-buffer.patch --]
[-- Type: text/plain, Size: 1884 bytes --]
-stable review patch. If anyone has any objections, please let us know.
---------------------
From: Alan Stern <stern@rowland.harvard.edu>
This patch (as1038) fixes a bug in usb_stor_access_xfer_buf() and
usb_stor_set_xfer_buf() (the bug was originally found by Boaz
Harrosh): The routine must not attempt to write beyond the end of a
scatter-gather list or beyond the number of bytes requested.
This is the minimal 2.6.24 equivalent to as1035 +
as1037 (7084191d53b224b953c8e1db525ea6c31aca5fc7 "USB:
usb-storage: don't access beyond the end of the sg buffer" +
6d512a80c26d87f8599057c86dc920fbfe0aa3aa "usb-storage: update earlier
scatter-gather bug fix"). Mark Glines has confirmed that it fixes
his problem.
Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Cc: Mark Glines <mark@glines.org>
Cc: Boaz Harrosh <bharrosh@panasas.com>
Signed-off-by: Chris Wright <chrisw@sous-sol.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
---
drivers/usb/storage/protocol.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
--- a/drivers/usb/storage/protocol.c
+++ b/drivers/usb/storage/protocol.c
@@ -194,7 +194,7 @@ unsigned int usb_stor_access_xfer_buf(un
* and the starting offset within the page, and update
* the *offset and *index values for the next loop. */
cnt = 0;
- while (cnt < buflen) {
+ while (cnt < buflen && sg) {
struct page *page = sg_page(sg) +
((sg->offset + *offset) >> PAGE_SHIFT);
unsigned int poff =
@@ -249,7 +249,8 @@ void usb_stor_set_xfer_buf(unsigned char
unsigned int offset = 0;
struct scatterlist *sg = NULL;
- usb_stor_access_xfer_buf(buffer, buflen, srb, &sg, &offset,
+ buflen = min(buflen, srb->request_bufflen);
+ buflen = usb_stor_access_xfer_buf(buffer, buflen, srb, &sg, &offset,
TO_XFER_BUF);
if (buflen < srb->request_bufflen)
srb->resid = srb->request_bufflen - buflen;
--
^ permalink raw reply [flat|nested] 100+ messages in thread
* [patch 27/76] SCSI ips: fix data buffer accessors conversion bug
2008-03-21 22:42 [patch 00/76] 2.6.24-stable review Chris Wright
` (25 preceding siblings ...)
2008-03-21 22:43 ` [patch 26/76] usb-storage: dont access beyond the end of the sg buffer Chris Wright
@ 2008-03-21 22:43 ` Chris Wright
2008-03-21 22:43 ` [patch 28/76] SCSI gdth: dont call pci_free_consistent under spinlock Chris Wright
` (50 subsequent siblings)
77 siblings, 0 replies; 100+ messages in thread
From: Chris Wright @ 2008-03-21 22:43 UTC (permalink / raw)
To: linux-kernel, stable, jejb
Cc: Justin Forbes, Zwane Mwaikambo, Theodore Ts'o, Randy Dunlap,
Dave Jones, Chuck Wolber, Chris Wedgwood, Michael Krufky,
Chuck Ebbert, Domenico Andreoli, torvalds, akpm, alan,
FUJITA Tomonori, FUJITA Tomonori, Mark Salyzyn, James Bottomley,
Greg Kroah-Hartman
[-- Attachment #1: scsi-ips-fix-data-buffer-accessors-conversion-bug.patch --]
[-- Type: text/plain, Size: 987 bytes --]
-stable review patch. If anyone has any objections, please let us know.
---------------------
From: FUJITA Tomonori <tomof@acm.org>
This fixes a bug that can't handle a passthru command with more than
two sg entries.
Big thanks to Tim Pepper for debugging the problem.
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Acked-by: Mark Salyzyn <Mark_Salyzyn@adaptec.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
Signed-off-by: Chris Wright <chrisw@sous-sol.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
---
drivers/scsi/ips.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- a/drivers/scsi/ips.c
+++ b/drivers/scsi/ips.c
@@ -1580,7 +1580,7 @@ ips_make_passthru(ips_ha_t *ha, struct s
METHOD_TRACE("ips_make_passthru", 1);
scsi_for_each_sg(SC, sg, scsi_sg_count(SC), i)
- length += sg[i].length;
+ length += sg->length;
if (length < sizeof (ips_passthru_t)) {
/* wrong size */
--
^ permalink raw reply [flat|nested] 100+ messages in thread
* [patch 28/76] SCSI gdth: dont call pci_free_consistent under spinlock
2008-03-21 22:42 [patch 00/76] 2.6.24-stable review Chris Wright
` (26 preceding siblings ...)
2008-03-21 22:43 ` [patch 27/76] SCSI ips: fix data buffer accessors conversion bug Chris Wright
@ 2008-03-21 22:43 ` Chris Wright
2008-03-21 22:43 ` [patch 29/76] SCSI aic94xx: fix REQ_TASK_ABORT and REQ_DEVICE_RESET Chris Wright
` (49 subsequent siblings)
77 siblings, 0 replies; 100+ messages in thread
From: Chris Wright @ 2008-03-21 22:43 UTC (permalink / raw)
To: linux-kernel, stable, jejb
Cc: Justin Forbes, Zwane Mwaikambo, Theodore Ts'o, Randy Dunlap,
Dave Jones, Chuck Wolber, Chris Wedgwood, Michael Krufky,
Chuck Ebbert, Domenico Andreoli, torvalds, akpm, alan,
James Bottomley, Greg Kroah-Hartman
[-- Attachment #1: scsi-gdth-don-t-call-pci_free_consistent-under-spinlock.patch --]
[-- Type: text/plain, Size: 1237 bytes --]
-stable review patch. If anyone has any objections, please let us know.
---------------------
From: James Bottomley <James.Bottomley@HansenPartnership.com>
The spinlock is held over too large a region: pscratch is a permanent
address (it's allocated at boot time and never changes). All you need
the smp lock for is mediating the scratch in use flag, so fix this by
moving the spinlock into the case where we set the pscratch_busy flag
to false.
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
Signed-off-by: Chris Wright <chrisw@sous-sol.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
---
drivers/scsi/gdth_proc.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
--- a/drivers/scsi/gdth_proc.c
+++ b/drivers/scsi/gdth_proc.c
@@ -694,15 +694,13 @@ static void gdth_ioctl_free(gdth_ha_str
{
ulong flags;
- spin_lock_irqsave(&ha->smp_lock, flags);
-
if (buf == ha->pscratch) {
+ spin_lock_irqsave(&ha->smp_lock, flags);
ha->scratch_busy = FALSE;
+ spin_unlock_irqrestore(&ha->smp_lock, flags);
} else {
pci_free_consistent(ha->pdev, size, buf, paddr);
}
-
- spin_unlock_irqrestore(&ha->smp_lock, flags);
}
#ifdef GDTH_IOCTL_PROC
--
^ permalink raw reply [flat|nested] 100+ messages in thread
* [patch 29/76] SCSI aic94xx: fix REQ_TASK_ABORT and REQ_DEVICE_RESET
2008-03-21 22:42 [patch 00/76] 2.6.24-stable review Chris Wright
` (27 preceding siblings ...)
2008-03-21 22:43 ` [patch 28/76] SCSI gdth: dont call pci_free_consistent under spinlock Chris Wright
@ 2008-03-21 22:43 ` Chris Wright
2008-03-21 22:43 ` [patch 30/76] x86: replace LOCK_PREFIX in futex.h Chris Wright
` (48 subsequent siblings)
77 siblings, 0 replies; 100+ messages in thread
From: Chris Wright @ 2008-03-21 22:43 UTC (permalink / raw)
To: linux-kernel, stable, jejb
Cc: Justin Forbes, Zwane Mwaikambo, Theodore Ts'o, Randy Dunlap,
Dave Jones, Chuck Wolber, Chris Wedgwood, Michael Krufky,
Chuck Ebbert, Domenico Andreoli, torvalds, akpm, alan,
James Bottomley, Greg Kroah-Hartman
[-- Attachment #1: scsi-aic94xx-fix-req_task_abort-and-req_device_reset.patch --]
[-- Type: text/plain, Size: 2136 bytes --]
-stable review patch. If anyone has any objections, please let us know.
---------------------
From: James Bottomley <James.Bottomley@HansenPartnership.com>
This driver has been failing under heavy load with
aic94xx: escb_tasklet_complete: REQ_TASK_ABORT, reason=0x6
aic94xx: escb_tasklet_complete: Can't find task (tc=4) to abort!
The second message is because the driver fails to identify the task
it's being asked to abort. On closer inpection, there's a thinko in
the for each task loop over pending tasks in both the REQ_TASK_ABORT
and REQ_DEVICE_RESET cases where it doesn't look at the task on the
pending list but at the one on the ESCB (which is always NULL).
Fix by looking at the right task. Also add a print for the case where
the pending SCB doesn't have a task attached.
Not sure if this will fix all the problems, but it's a definite first
step.
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
Signed-off-by: Chris Wright <chrisw@sous-sol.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
---
drivers/scsi/aic94xx/aic94xx_scb.c | 14 ++++++++++----
1 file changed, 10 insertions(+), 4 deletions(-)
--- a/drivers/scsi/aic94xx/aic94xx_scb.c
+++ b/drivers/scsi/aic94xx/aic94xx_scb.c
@@ -458,13 +458,19 @@ static void escb_tasklet_complete(struct
tc_abort = le16_to_cpu(tc_abort);
list_for_each_entry_safe(a, b, &asd_ha->seq.pend_q, list) {
- struct sas_task *task = ascb->uldd_task;
+ struct sas_task *task = a->uldd_task;
+
+ if (a->tc_index != tc_abort)
+ continue;
- if (task && a->tc_index == tc_abort) {
+ if (task) {
failed_dev = task->dev;
sas_task_abort(task);
- break;
+ } else {
+ ASD_DPRINTK("R_T_A for non TASK scb 0x%x\n",
+ a->scb->header.opcode);
}
+ break;
}
if (!failed_dev) {
@@ -478,7 +484,7 @@ static void escb_tasklet_complete(struct
* that the EH will wake up and do something.
*/
list_for_each_entry_safe(a, b, &asd_ha->seq.pend_q, list) {
- struct sas_task *task = ascb->uldd_task;
+ struct sas_task *task = a->uldd_task;
if (task &&
task->dev == failed_dev &&
--
^ permalink raw reply [flat|nested] 100+ messages in thread
* [patch 30/76] x86: replace LOCK_PREFIX in futex.h
2008-03-21 22:42 [patch 00/76] 2.6.24-stable review Chris Wright
` (28 preceding siblings ...)
2008-03-21 22:43 ` [patch 29/76] SCSI aic94xx: fix REQ_TASK_ABORT and REQ_DEVICE_RESET Chris Wright
@ 2008-03-21 22:43 ` Chris Wright
2008-03-21 22:43 ` [patch 31/76] ARM pxa: fix clock lookup to find specific device clocks Chris Wright
` (47 subsequent siblings)
77 siblings, 0 replies; 100+ messages in thread
From: Chris Wright @ 2008-03-21 22:43 UTC (permalink / raw)
To: linux-kernel, stable, Greg KH
Cc: Justin Forbes, Zwane Mwaikambo, Theodore Ts'o, Randy Dunlap,
Dave Jones, Chuck Wolber, Chris Wedgwood, Michael Krufky,
Chuck Ebbert, Domenico Andreoli, torvalds, akpm, alan,
Thomas Gleixner, Ingo Molnar
[-- Attachment #1: x86-replace-lock_prefix-in-futex.h.patch --]
[-- Type: text/plain, Size: 2757 bytes --]
-stable review patch. If anyone has any objections, please let us know.
---------------------
From: Thomas Gleixner <tglx@linutronix.de>
The exception fixup for the futex macros __futex_atomic_op1/2 and
futex_atomic_cmpxchg_inatomic() is missing an entry when the lock
prefix is replaced by a NOP via SMP alternatives.
Chuck Ebert tracked this down from the information provided in:
https://bugzilla.redhat.com/show_bug.cgi?id=429412
A possible solution would be to add another fixup after the
LOCK_PREFIX, so both the LOCK and NOP case have their own entry in the
exception table, but it's not really worth the trouble.
Simply replace LOCK_PREFIX with lock and keep those untouched by SMP
alternatives.
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
[cebbert@redhat.com: backport to 2.6.24]
Signed-off-by: Chris Wright <chrisw@sous-sol.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
---
include/asm-x86/futex_32.h | 6 +++---
include/asm-x86/futex_64.h | 6 +++---
2 files changed, 6 insertions(+), 6 deletions(-)
--- a/include/asm-x86/futex_32.h
+++ b/include/asm-x86/futex_32.h
@@ -28,7 +28,7 @@
"1: movl %2, %0\n\
movl %0, %3\n" \
insn "\n" \
-"2: " LOCK_PREFIX "cmpxchgl %3, %2\n\
+"2: lock ; cmpxchgl %3, %2\n\
jnz 1b\n\
3: .section .fixup,\"ax\"\n\
4: mov %5, %1\n\
@@ -68,7 +68,7 @@ futex_atomic_op_inuser (int encoded_op,
#endif
switch (op) {
case FUTEX_OP_ADD:
- __futex_atomic_op1(LOCK_PREFIX "xaddl %0, %2", ret,
+ __futex_atomic_op1("lock ; xaddl %0, %2", ret,
oldval, uaddr, oparg);
break;
case FUTEX_OP_OR:
@@ -111,7 +111,7 @@ futex_atomic_cmpxchg_inatomic(int __user
return -EFAULT;
__asm__ __volatile__(
- "1: " LOCK_PREFIX "cmpxchgl %3, %1 \n"
+ "1: lock ; cmpxchgl %3, %1 \n"
"2: .section .fixup, \"ax\" \n"
"3: mov %2, %0 \n"
--- a/include/asm-x86/futex_64.h
+++ b/include/asm-x86/futex_64.h
@@ -27,7 +27,7 @@
"1: movl %2, %0\n\
movl %0, %3\n" \
insn "\n" \
-"2: " LOCK_PREFIX "cmpxchgl %3, %2\n\
+"2: lock ; cmpxchgl %3, %2\n\
jnz 1b\n\
3: .section .fixup,\"ax\"\n\
4: mov %5, %1\n\
@@ -62,7 +62,7 @@ futex_atomic_op_inuser (int encoded_op,
__futex_atomic_op1("xchgl %0, %2", ret, oldval, uaddr, oparg);
break;
case FUTEX_OP_ADD:
- __futex_atomic_op1(LOCK_PREFIX "xaddl %0, %2", ret, oldval,
+ __futex_atomic_op1("lock ; xaddl %0, %2", ret, oldval,
uaddr, oparg);
break;
case FUTEX_OP_OR:
@@ -101,7 +101,7 @@ futex_atomic_cmpxchg_inatomic(int __user
return -EFAULT;
__asm__ __volatile__(
- "1: " LOCK_PREFIX "cmpxchgl %3, %1 \n"
+ "1: lock ; cmpxchgl %3, %1 \n"
"2: .section .fixup, \"ax\" \n"
"3: mov %2, %0 \n"
--
^ permalink raw reply [flat|nested] 100+ messages in thread
* [patch 31/76] ARM pxa: fix clock lookup to find specific device clocks
2008-03-21 22:42 [patch 00/76] 2.6.24-stable review Chris Wright
` (29 preceding siblings ...)
2008-03-21 22:43 ` [patch 30/76] x86: replace LOCK_PREFIX in futex.h Chris Wright
@ 2008-03-21 22:43 ` Chris Wright
2008-03-21 22:43 ` [patch 32/76] futex: fix init order Chris Wright
` (46 subsequent siblings)
77 siblings, 0 replies; 100+ messages in thread
From: Chris Wright @ 2008-03-21 22:43 UTC (permalink / raw)
To: linux-kernel, stable
Cc: Justin Forbes, Zwane Mwaikambo, Theodore Ts'o, Randy Dunlap,
Dave Jones, Chuck Wolber, Chris Wedgwood, Michael Krufky,
Chuck Ebbert, Domenico Andreoli, torvalds, akpm, alan, Uli Luckas,
Russell King, Greg Kroah-Hartman
[-- Attachment #1: arm-pxa-fix-clock-lookup-to-find-specific-device-clocks.patch --]
[-- Type: text/plain, Size: 1925 bytes --]
-stable review patch. If anyone has any objections, please let us know.
---------------------
From: Russell King <rmk+kernel@arm.linux.org.uk>
Ensure that the clock lookup always finds an entry for a specific
device and ID before it falls back to finding just by ID. This
fixes a problem reported by Holger Schurig where the BTUART was
assigned the wrong clock.
Tested-by: Holger Schurig <hs4233@mail.mn-solutions.de>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Uli Luckas notes:
The patch fixes the otherwise unusable bluetooth uart on pxa25x. The
patch is written by Russell King [1] who also gave his OK for
stable inclusion [2]. The patch is also available as commit
a0dd005d1d9f4c3beab52086f3844ef9342d1e67 to Linus' tree.
[1] http://marc.info/?l=linux-arm-kernel&m=120298366510315
[2] http://marc.info/?l=linux-arm-kernel&m=120384388411097
Signed-off-by: Chris Wright <chrisw@sous-sol.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
---
arch/arm/mach-pxa/clock.c | 23 ++++++++++++++++-------
1 file changed, 16 insertions(+), 7 deletions(-)
--- a/arch/arm/mach-pxa/clock.c
+++ b/arch/arm/mach-pxa/clock.c
@@ -23,18 +23,27 @@ static LIST_HEAD(clocks);
static DEFINE_MUTEX(clocks_mutex);
static DEFINE_SPINLOCK(clocks_lock);
+static struct clk *clk_lookup(struct device *dev, const char *id)
+{
+ struct clk *p;
+
+ list_for_each_entry(p, &clocks, node)
+ if (strcmp(id, p->name) == 0 && p->dev == dev)
+ return p;
+
+ return NULL;
+}
+
struct clk *clk_get(struct device *dev, const char *id)
{
struct clk *p, *clk = ERR_PTR(-ENOENT);
mutex_lock(&clocks_mutex);
- list_for_each_entry(p, &clocks, node) {
- if (strcmp(id, p->name) == 0 &&
- (p->dev == NULL || p->dev == dev)) {
- clk = p;
- break;
- }
- }
+ p = clk_lookup(dev, id);
+ if (!p)
+ p = clk_lookup(NULL, id);
+ if (p)
+ clk = p;
mutex_unlock(&clocks_mutex);
return clk;
--
^ permalink raw reply [flat|nested] 100+ messages in thread
* [patch 32/76] futex: fix init order
2008-03-21 22:42 [patch 00/76] 2.6.24-stable review Chris Wright
` (30 preceding siblings ...)
2008-03-21 22:43 ` [patch 31/76] ARM pxa: fix clock lookup to find specific device clocks Chris Wright
@ 2008-03-21 22:43 ` Chris Wright
2008-03-21 22:43 ` [patch 33/76] futex: runtime enable pi and robust functionality Chris Wright
` (45 subsequent siblings)
77 siblings, 0 replies; 100+ messages in thread
From: Chris Wright @ 2008-03-21 22:43 UTC (permalink / raw)
To: linux-kernel, stable, jejb
Cc: Justin Forbes, Zwane Mwaikambo, Theodore Ts'o, Randy Dunlap,
Dave Jones, Chuck Wolber, Chris Wedgwood, Michael Krufky,
Chuck Ebbert, Domenico Andreoli, torvalds, akpm, alan,
Thomas Gleixner, Ingo Molnar, Lennert Buytenhek, Riku Voipio,
Greg Kroah-Hartman
[-- Attachment #1: futex-fix-init-order.patch --]
[-- Type: text/plain, Size: 1675 bytes --]
-stable review patch. If anyone has any objections, please let us know.
---------------------
From: Thomas Gleixner <tglx@linutronix.de>
When the futex init code fails to initialize the futex pseudo file system it
returns early without initializing the hash queues. Should the boot succeed
then a futex syscall which tries to enqueue a waiter on the hashqueue will
crash due to the unitilialized plist heads.
Initialize the hash queues before the filesystem.
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Acked-by: Ingo Molnar <mingo@elte.hu>
Cc: Lennert Buytenhek <buytenh@wantstofly.org>
Cc: Riku Voipio <riku.voipio@movial.fi>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Chris Wright <chrisw@sous-sol.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
---
kernel/futex.c | 12 +++++++-----
1 file changed, 7 insertions(+), 5 deletions(-)
--- a/kernel/futex.c
+++ b/kernel/futex.c
@@ -2123,8 +2123,14 @@ static struct file_system_type futex_fs_
static int __init init(void)
{
- int i = register_filesystem(&futex_fs_type);
+ int i;
+ for (i = 0; i < ARRAY_SIZE(futex_queues); i++) {
+ plist_head_init(&futex_queues[i].chain, &futex_queues[i].lock);
+ spin_lock_init(&futex_queues[i].lock);
+ }
+
+ i = register_filesystem(&futex_fs_type);
if (i)
return i;
@@ -2134,10 +2140,6 @@ static int __init init(void)
return PTR_ERR(futex_mnt);
}
- for (i = 0; i < ARRAY_SIZE(futex_queues); i++) {
- plist_head_init(&futex_queues[i].chain, &futex_queues[i].lock);
- spin_lock_init(&futex_queues[i].lock);
- }
return 0;
}
__initcall(init);
--
^ permalink raw reply [flat|nested] 100+ messages in thread
* [patch 33/76] futex: runtime enable pi and robust functionality
2008-03-21 22:42 [patch 00/76] 2.6.24-stable review Chris Wright
` (31 preceding siblings ...)
2008-03-21 22:43 ` [patch 32/76] futex: fix init order Chris Wright
@ 2008-03-21 22:43 ` Chris Wright
2008-03-22 7:37 ` Thomas Gleixner
2008-03-27 3:28 ` Benjamin Herrenschmidt
2008-03-21 22:43 ` [patch 34/76] file capabilities: simplify signal check Chris Wright
` (44 subsequent siblings)
77 siblings, 2 replies; 100+ messages in thread
From: Chris Wright @ 2008-03-21 22:43 UTC (permalink / raw)
To: linux-kernel, stable, jejb
Cc: Justin Forbes, Zwane Mwaikambo, Theodore Ts'o, Randy Dunlap,
Dave Jones, Chuck Wolber, Chris Wedgwood, Michael Krufky,
Chuck Ebbert, Domenico Andreoli, torvalds, akpm, alan,
Thomas Gleixner, Ingo Molnar, Lennert Buytenhek, Riku Voipio,
Greg Kroah-Hartman
[-- Attachment #1: futex-runtime-enable-pi-and-robust-functionality.patch --]
[-- Type: text/plain, Size: 6242 bytes --]
-stable review patch. If anyone has any objections, please let us know.
---------------------
From: Thomas Gleixner <tglx@linutronix.de>
Not all architectures implement futex_atomic_cmpxchg_inatomic(). The default
implementation returns -ENOSYS, which is currently not handled inside of the
futex guts.
Futex PI calls and robust list exits with a held futex result in an endless
loop in the futex code on architectures which have no support.
Fixing up every place where futex_atomic_cmpxchg_inatomic() is called would
add a fair amount of extra if/else constructs to the already complex code. It
is also not possible to disable the robust feature before user space tries to
register robust lists.
Compile time disabling is not a good idea either, as there are already
architectures with runtime detection of futex_atomic_cmpxchg_inatomic support.
Detect the functionality at runtime instead by calling
cmpxchg_futex_value_locked() with a NULL pointer from the futex initialization
code. This is guaranteed to fail, but the call of
futex_atomic_cmpxchg_inatomic() happens with pagefaults disabled.
On architectures, which use the asm-generic implementation or have a runtime
CPU feature detection, a -ENOSYS return value disables the PI/robust features.
On architectures with a working implementation the call returns -EFAULT and
the PI/robust features are enabled.
The relevant syscalls return -ENOSYS and the robust list exit code is blocked,
when the detection fails.
Fixes http://lkml.org/lkml/2008/2/11/149
Originally reported by: Lennart Buytenhek
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Acked-by: Ingo Molnar <mingo@elte.hu>
Cc: Lennert Buytenhek <buytenh@wantstofly.org>
Cc: Riku Voipio <riku.voipio@movial.fi>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Chris Wright <chrisw@sous-sol.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
---
include/linux/futex.h | 1 +
kernel/futex.c | 38 ++++++++++++++++++++++++++++++++++----
kernel/futex_compat.c | 9 +++++++++
3 files changed, 44 insertions(+), 4 deletions(-)
--- a/include/linux/futex.h
+++ b/include/linux/futex.h
@@ -153,6 +153,7 @@ union futex_key {
#ifdef CONFIG_FUTEX
extern void exit_robust_list(struct task_struct *curr);
extern void exit_pi_state_list(struct task_struct *curr);
+extern int futex_cmpxchg_enabled;
#else
static inline void exit_robust_list(struct task_struct *curr)
{
--- a/kernel/futex.c
+++ b/kernel/futex.c
@@ -60,6 +60,8 @@
#include "rtmutex_common.h"
+int __read_mostly futex_cmpxchg_enabled;
+
#define FUTEX_HASHBITS (CONFIG_BASE_SMALL ? 4 : 8)
/*
@@ -466,6 +468,8 @@ void exit_pi_state_list(struct task_stru
struct futex_hash_bucket *hb;
union futex_key key;
+ if (!futex_cmpxchg_enabled)
+ return;
/*
* We are a ZOMBIE and nobody can enqueue itself on
* pi_state_list anymore, but we have to be careful
@@ -1854,6 +1858,8 @@ asmlinkage long
sys_set_robust_list(struct robust_list_head __user *head,
size_t len)
{
+ if (!futex_cmpxchg_enabled)
+ return -ENOSYS;
/*
* The kernel knows only one size for now:
*/
@@ -1878,6 +1884,9 @@ sys_get_robust_list(int pid, struct robu
struct robust_list_head __user *head;
unsigned long ret;
+ if (!futex_cmpxchg_enabled)
+ return -ENOSYS;
+
if (!pid)
head = current->robust_list;
else {
@@ -1980,6 +1989,9 @@ void exit_robust_list(struct task_struct
unsigned long futex_offset;
int rc;
+ if (!futex_cmpxchg_enabled)
+ return;
+
/*
* Fetch the list head (which was registered earlier, via
* sys_set_robust_list()):
@@ -2034,7 +2046,7 @@ void exit_robust_list(struct task_struct
long do_futex(u32 __user *uaddr, int op, u32 val, ktime_t *timeout,
u32 __user *uaddr2, u32 val2, u32 val3)
{
- int ret;
+ int ret = -ENOSYS;
int cmd = op & FUTEX_CMD_MASK;
struct rw_semaphore *fshared = NULL;
@@ -2062,13 +2074,16 @@ long do_futex(u32 __user *uaddr, int op,
ret = futex_wake_op(uaddr, fshared, uaddr2, val, val2, val3);
break;
case FUTEX_LOCK_PI:
- ret = futex_lock_pi(uaddr, fshared, val, timeout, 0);
+ if (futex_cmpxchg_enabled)
+ ret = futex_lock_pi(uaddr, fshared, val, timeout, 0);
break;
case FUTEX_UNLOCK_PI:
- ret = futex_unlock_pi(uaddr, fshared);
+ if (futex_cmpxchg_enabled)
+ ret = futex_unlock_pi(uaddr, fshared);
break;
case FUTEX_TRYLOCK_PI:
- ret = futex_lock_pi(uaddr, fshared, 0, timeout, 1);
+ if (futex_cmpxchg_enabled)
+ ret = futex_lock_pi(uaddr, fshared, 0, timeout, 1);
break;
default:
ret = -ENOSYS;
@@ -2123,8 +2138,23 @@ static struct file_system_type futex_fs_
static int __init init(void)
{
+ u32 curval;
int i;
+ /*
+ * This will fail and we want it. Some arch implementations do
+ * runtime detection of the futex_atomic_cmpxchg_inatomic()
+ * functionality. We want to know that before we call in any
+ * of the complex code paths. Also we want to prevent
+ * registration of robust lists in that case. NULL is
+ * guaranteed to fault and we get -EFAULT on functional
+ * implementation, the non functional ones will return
+ * -ENOSYS.
+ */
+ curval = cmpxchg_futex_value_locked(NULL, 0, 0);
+ if (curval == -EFAULT)
+ futex_cmpxchg_enabled = 1;
+
for (i = 0; i < ARRAY_SIZE(futex_queues); i++) {
plist_head_init(&futex_queues[i].chain, &futex_queues[i].lock);
spin_lock_init(&futex_queues[i].lock);
--- a/kernel/futex_compat.c
+++ b/kernel/futex_compat.c
@@ -54,6 +54,9 @@ void compat_exit_robust_list(struct task
compat_long_t futex_offset;
int rc;
+ if (!futex_cmpxchg_enabled)
+ return;
+
/*
* Fetch the list head (which was registered earlier, via
* sys_set_robust_list()):
@@ -115,6 +118,9 @@ asmlinkage long
compat_sys_set_robust_list(struct compat_robust_list_head __user *head,
compat_size_t len)
{
+ if (!futex_cmpxchg_enabled)
+ return -ENOSYS;
+
if (unlikely(len != sizeof(*head)))
return -EINVAL;
@@ -130,6 +136,9 @@ compat_sys_get_robust_list(int pid, comp
struct compat_robust_list_head __user *head;
unsigned long ret;
+ if (!futex_cmpxchg_enabled)
+ return -ENOSYS;
+
if (!pid)
head = current->compat_robust_list;
else {
--
^ permalink raw reply [flat|nested] 100+ messages in thread
* [patch 34/76] file capabilities: simplify signal check
2008-03-21 22:42 [patch 00/76] 2.6.24-stable review Chris Wright
` (32 preceding siblings ...)
2008-03-21 22:43 ` [patch 33/76] futex: runtime enable pi and robust functionality Chris Wright
@ 2008-03-21 22:43 ` Chris Wright
2008-03-21 22:43 ` [patch 35/76] hugetlb: ensure we do not reference a surplus page after handing it to buddy Chris Wright
` (43 subsequent siblings)
77 siblings, 0 replies; 100+ messages in thread
From: Chris Wright @ 2008-03-21 22:43 UTC (permalink / raw)
To: linux-kernel, stable, jejb
Cc: Justin Forbes, Zwane Mwaikambo, Theodore Ts'o, Randy Dunlap,
Dave Jones, Chuck Wolber, Chris Wedgwood, Michael Krufky,
Chuck Ebbert, Domenico Andreoli, torvalds, akpm, alan,
Serge E. Hallyn, Andrew G Morgan, Greg Kroah-Hartman
[-- Attachment #1: file-capabilities-simplify-signal-check.patch --]
[-- Type: text/plain, Size: 1040 bytes --]
-stable review patch. If anyone has any objections, please let us know.
---------------------
From: Serge E. Hallyn <serue@us.ibm.com>
Simplify the uid equivalence check in cap_task_kill(). Anyone can kill a
process owned by the same uid.
Without this patch wireshark is reported to fail.
Signed-off-by: Serge E. Hallyn <serue@us.ibm.com>
Signed-off-by: Andrew G. Morgan <morgan@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Chris Wright <chrisw@sous-sol.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
---
security/commoncap.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- a/security/commoncap.c
+++ b/security/commoncap.c
@@ -539,7 +539,7 @@ int cap_task_kill(struct task_struct *p,
* allowed.
* We must preserve legacy signal behavior in this case.
*/
- if (p->euid == 0 && p->uid == current->uid)
+ if (p->uid == current->uid)
return 0;
/* sigcont is permitted within same session */
--
^ permalink raw reply [flat|nested] 100+ messages in thread
* [patch 35/76] hugetlb: ensure we do not reference a surplus page after handing it to buddy
2008-03-21 22:42 [patch 00/76] 2.6.24-stable review Chris Wright
` (33 preceding siblings ...)
2008-03-21 22:43 ` [patch 34/76] file capabilities: simplify signal check Chris Wright
@ 2008-03-21 22:43 ` Chris Wright
2008-03-21 22:43 ` [patch 36/76] ufs: fix parenthesisation in ufs_set_fs_state() Chris Wright
` (42 subsequent siblings)
77 siblings, 0 replies; 100+ messages in thread
From: Chris Wright @ 2008-03-21 22:43 UTC (permalink / raw)
To: linux-kernel, stable, jejb
Cc: Justin Forbes, Zwane Mwaikambo, Theodore Ts'o, Randy Dunlap,
Dave Jones, Chuck Wolber, Chris Wedgwood, Michael Krufky,
Chuck Ebbert, Domenico Andreoli, torvalds, akpm, alan,
Andy Whitcroft, Adam Litke, Greg Kroah-Hartman
[-- Attachment #1: hugetlb-ensure-we-do-not-reference-a-surplus-page-after-handing-it-to-buddy.patch --]
[-- Type: text/plain, Size: 1472 bytes --]
-stable review patch. If anyone has any objections, please let us know.
---------------------
From: Andy Whitcroft <apw@shadowen.org>
When we free a page via free_huge_page and we detect that we are in surplus
the page will be returned to the buddy. After this we no longer own the page.
However at the end free_huge_page we clear out our mapping pointer from
page private. Even where the page is not a surplus we free the page to
the hugepage pool, drop the pool locks and then clear page private. In
either case the page may have been reallocated. BAD.
Make sure we clear out page private before we free the page.
Signed-off-by: Andy Whitcroft <apw@shadowen.org>
Acked-by: Adam Litke <agl@us.ibm.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Chris Wright <chrisw@sous-sol.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
---
mm/hugetlb.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- a/mm/hugetlb.c
+++ b/mm/hugetlb.c
@@ -119,6 +119,7 @@ static void free_huge_page(struct page *
struct address_space *mapping;
mapping = (struct address_space *) page_private(page);
+ set_page_private(page, 0);
BUG_ON(page_count(page));
INIT_LIST_HEAD(&page->lru);
@@ -133,7 +134,6 @@ static void free_huge_page(struct page *
spin_unlock(&hugetlb_lock);
if (mapping)
hugetlb_put_quota(mapping, 1);
- set_page_private(page, 0);
}
/*
--
^ permalink raw reply [flat|nested] 100+ messages in thread
* [patch 36/76] ufs: fix parenthesisation in ufs_set_fs_state()
2008-03-21 22:42 [patch 00/76] 2.6.24-stable review Chris Wright
` (34 preceding siblings ...)
2008-03-21 22:43 ` [patch 35/76] hugetlb: ensure we do not reference a surplus page after handing it to buddy Chris Wright
@ 2008-03-21 22:43 ` Chris Wright
2008-03-21 22:43 ` [patch 37/76] spi: pxa2xx_spi clock polarity fix Chris Wright
` (41 subsequent siblings)
77 siblings, 0 replies; 100+ messages in thread
From: Chris Wright @ 2008-03-21 22:43 UTC (permalink / raw)
To: linux-kernel, stable, jejb
Cc: Justin Forbes, Zwane Mwaikambo, Theodore Ts'o, Randy Dunlap,
Dave Jones, Chuck Wolber, Chris Wedgwood, Michael Krufky,
Chuck Ebbert, Domenico Andreoli, torvalds, akpm, alan, Roel Kluin,
Evgeniy Dushistov, Mark Fortescue, Greg Kroah-Hartman
[-- Attachment #1: ufs-fix-parenthesisation-in-ufs_set_fs_state.patch --]
[-- Type: text/plain, Size: 1162 bytes --]
-stable review patch. If anyone has any objections, please let us know.
---------------------
From: Roel Kluin <12o3l@tiscali.nl>
This bug snuck in with
commit 252e211e90ce56bf005cb533ad5a297c18c19407
Author: Mark Fortescue <mark@mtfhpc.demon.co.uk>
Date: Tue Oct 16 23:26:31 2007 -0700
Add in SunOS 4.1.x compatible mode for UFS
Signed-off-by: Roel Kluin <12o3l@tiscali.nl>
Acked-by: Evgeniy Dushistov <dushistov@mail.ru>
Cc: Mark Fortescue <mark@mtfhpc.demon.co.uk>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Chris Wright <chrisw@sous-sol.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
---
fs/ufs/util.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- a/fs/ufs/util.h
+++ b/fs/ufs/util.h
@@ -58,7 +58,7 @@ ufs_set_fs_state(struct super_block *sb,
{
switch (UFS_SB(sb)->s_flags & UFS_ST_MASK) {
case UFS_ST_SUNOS:
- if (fs32_to_cpu(sb, usb3->fs_postblformat == UFS_42POSTBLFMT)) {
+ if (fs32_to_cpu(sb, usb3->fs_postblformat) == UFS_42POSTBLFMT) {
usb1->fs_u0.fs_sun.fs_state = cpu_to_fs32(sb, value);
break;
}
--
^ permalink raw reply [flat|nested] 100+ messages in thread
* [patch 37/76] spi: pxa2xx_spi clock polarity fix
2008-03-21 22:42 [patch 00/76] 2.6.24-stable review Chris Wright
` (35 preceding siblings ...)
2008-03-21 22:43 ` [patch 36/76] ufs: fix parenthesisation in ufs_set_fs_state() Chris Wright
@ 2008-03-21 22:43 ` Chris Wright
2008-03-21 22:43 ` [patch 38/76] NETFILTER: nfnetlink_queue: fix SKB_LINEAR_ASSERT when mangling packet data Chris Wright
` (40 subsequent siblings)
77 siblings, 0 replies; 100+ messages in thread
From: Chris Wright @ 2008-03-21 22:43 UTC (permalink / raw)
To: linux-kernel, stable, jejb
Cc: Justin Forbes, Zwane Mwaikambo, Theodore Ts'o, Randy Dunlap,
Dave Jones, Chuck Wolber, Chris Wedgwood, Michael Krufky,
Chuck Ebbert, Domenico Andreoli, torvalds, akpm, alan,
Ned Forrester, David Brownell, Russell King, Greg Kroah-Hartman
[-- Attachment #1: spi-pxa2xx_spi-clock-polarity-fix.patch --]
[-- Type: text/plain, Size: 5343 bytes --]
-stable review patch. If anyone has any objections, please let us know.
---------------------
From: Ned Forrester <nforrester@whoi.edu>
Fixes a sequencing bug in spi driver pxa2xx_spi.c in which the chip select
for a transfer may be asserted before the clock polarity is set on the
interface. As a result of this bug, the clock signal may have the wrong
polarity at transfer start, so it may need to make an extra half transition
before the intended clock/data signals begin. (This probably means all
transfers are one bit out of sequence.)
This only occurs on the first transfer following a change in clock polarity
in systems using more than one more than one such polarity. The fix
assures that the clock mode is properly set before asserting chip select.
This bug was introduced in a patch merged on 2006/12/10, kernel 2.6.20.
The patch defines an additional bit in: include/asm-arm/arch-pxa/regs-ssp.h
for 2.6.25 and newer kernels but this addition must be made in:
include/asm-arm/arch-pxa/pxa-regs.h for kernels between 2.6.20 and 2.6.24,
inclusive
Signed-off-by: Ned Forrester <nforrester@whoi.edu>
Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Cc: Russell King <rmk@arm.linux.org.uk>
Cc: <stable@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
[chrisw@sous-sol.org: backport to 2.6.24.3]
Signed-off-by: Chris Wright <chrisw@sous-sol.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
---
drivers/spi/pxa2xx_spi.c | 41 +++++++++++++++++++++++-------------
include/asm-arm/arch-pxa/pxa-regs.h | 1
2 files changed, 28 insertions(+), 14 deletions(-)
--- a/drivers/spi/pxa2xx_spi.c
+++ b/drivers/spi/pxa2xx_spi.c
@@ -48,13 +48,19 @@ MODULE_LICENSE("GPL");
#define RESET_DMA_CHANNEL (DCSR_NODESC | DMA_INT_MASK)
#define IS_DMA_ALIGNED(x) (((u32)(x)&0x07)==0)
-/* for testing SSCR1 changes that require SSP restart, basically
- * everything except the service and interrupt enables */
-#define SSCR1_CHANGE_MASK (SSCR1_TTELP | SSCR1_TTE | SSCR1_EBCEI | SSCR1_SCFR \
+/*
+ * for testing SSCR1 changes that require SSP restart, basically
+ * everything except the service and interrupt enables, the pxa270 developer
+ * manual says only SSCR1_SCFR, SSCR1_SPH, SSCR1_SPO need to be in this
+ * list, but the PXA255 dev man says all bits without really meaning the
+ * service and interrupt enables
+ */
+#define SSCR1_CHANGE_MASK (SSCR1_TTELP | SSCR1_TTE | SSCR1_SCFR \
| SSCR1_ECRA | SSCR1_ECRB | SSCR1_SCLKDIR \
- | SSCR1_RWOT | SSCR1_TRAIL | SSCR1_PINTE \
- | SSCR1_STRF | SSCR1_EFWR |SSCR1_RFT \
- | SSCR1_TFT | SSCR1_SPH | SSCR1_SPO | SSCR1_LBM)
+ | SSCR1_SFRMDIR | SSCR1_RWOT | SSCR1_TRAIL \
+ | SSCR1_IFS | SSCR1_STRF | SSCR1_EFWR \
+ | SSCR1_RFT | SSCR1_TFT | SSCR1_MWDS \
+ | SSCR1_SPH | SSCR1_SPO | SSCR1_LBM)
#define DEFINE_SSP_REG(reg, off) \
static inline u32 read_##reg(void *p) { return __raw_readl(p + (off)); } \
@@ -961,9 +967,6 @@ static void pump_transfers(unsigned long
if (drv_data->ssp_type == PXA25x_SSP)
DCMD(drv_data->tx_channel) |= DCMD_ENDIRQEN;
- /* Fix me, need to handle cs polarity */
- drv_data->cs_control(PXA2XX_CS_ASSERT);
-
/* Clear status and start DMA engine */
cr1 = chip->cr1 | dma_thresh | drv_data->dma_cr1;
write_SSSR(drv_data->clear_sr, reg);
@@ -973,9 +976,6 @@ static void pump_transfers(unsigned long
/* Ensure we have the correct interrupt handler */
drv_data->transfer_handler = interrupt_transfer;
- /* Fix me, need to handle cs polarity */
- drv_data->cs_control(PXA2XX_CS_ASSERT);
-
/* Clear status */
cr1 = chip->cr1 | chip->threshold | drv_data->int_cr1;
write_SSSR(drv_data->clear_sr, reg);
@@ -986,16 +986,29 @@ static void pump_transfers(unsigned long
|| (read_SSCR1(reg) & SSCR1_CHANGE_MASK) !=
(cr1 & SSCR1_CHANGE_MASK)) {
+ /* stop the SSP, and update the other bits */
write_SSCR0(cr0 & ~SSCR0_SSE, reg);
if (drv_data->ssp_type != PXA25x_SSP)
write_SSTO(chip->timeout, reg);
- write_SSCR1(cr1, reg);
+ /* first set CR1 without interrupt and service enables */
+ write_SSCR1(cr1 & SSCR1_CHANGE_MASK, reg);
+ /* restart the SSP */
write_SSCR0(cr0, reg);
+
} else {
if (drv_data->ssp_type != PXA25x_SSP)
write_SSTO(chip->timeout, reg);
- write_SSCR1(cr1, reg);
}
+
+ /* FIXME, need to handle cs polarity,
+ * this driver uses struct pxa2xx_spi_chip.cs_control to
+ * specify a CS handling function, and it ignores most
+ * struct spi_device.mode[s], including SPI_CS_HIGH */
+ drv_data->cs_control(PXA2XX_CS_ASSERT);
+
+ /* after chip select, release the data by enabling service
+ * requests and interrupts, without changing any mode bits */
+ write_SSCR1(cr1, reg);
}
static void pump_messages(struct work_struct *work)
--- a/include/asm-arm/arch-pxa/pxa-regs.h
+++ b/include/asm-arm/arch-pxa/pxa-regs.h
@@ -1669,6 +1669,7 @@
#define SSCR1_RSRE (1 << 20) /* Receive Service Request Enable */
#define SSCR1_TINTE (1 << 19) /* Receiver Time-out Interrupt enable */
#define SSCR1_PINTE (1 << 18) /* Peripheral Trailing Byte Interupt Enable */
+#define SSCR1_IFS (1 << 16) /* Invert Frame Signal */
#define SSCR1_STRF (1 << 15) /* Select FIFO or EFWR */
#define SSCR1_EFWR (1 << 14) /* Enable FIFO Write/Read */
--
^ permalink raw reply [flat|nested] 100+ messages in thread
* [patch 38/76] NETFILTER: nfnetlink_queue: fix SKB_LINEAR_ASSERT when mangling packet data
2008-03-21 22:42 [patch 00/76] 2.6.24-stable review Chris Wright
` (36 preceding siblings ...)
2008-03-21 22:43 ` [patch 37/76] spi: pxa2xx_spi clock polarity fix Chris Wright
@ 2008-03-21 22:43 ` Chris Wright
2008-03-21 22:43 ` [patch 39/76] NETFILTER: Fix incorrect use of skb_make_writable Chris Wright
` (39 subsequent siblings)
77 siblings, 0 replies; 100+ messages in thread
From: Chris Wright @ 2008-03-21 22:43 UTC (permalink / raw)
To: linux-kernel, stable
Cc: Justin Forbes, Zwane Mwaikambo, Theodore Ts'o, Randy Dunlap,
Dave Jones, Chuck Wolber, Chris Wedgwood, Michael Krufky,
Chuck Ebbert, Domenico Andreoli, torvalds, akpm, alan,
Patrick McHardy, netfilter-devel, davem, Greg Kroah-Hartman
[-- Attachment #1: netfilter-nfnetlink_queue-fix-skb_linear_assert-when-mangling-packet-data.patch --]
[-- Type: text/plain, Size: 3692 bytes --]
-stable review patch. If anyone has any objections, please let us know.
---------------------
From: Patrick McHardy <kaber@trash.net>
Upstream commit e2b58a67:
As reported by Tomas Simonaitis <tomas.simonaitis@gmail.com>, inserting new
data in skbs queued over {ip,ip6,nfnetlink}_queue triggers a SKB_LINEAR_ASSERT
in skb_put().
Going back through the git history, it seems this bug is present since at
least 2.6.12-rc2, probably even since the removal of skb_linearize() for
netfilter.
Linearize non-linear skbs through skb_copy_expand() when enlarging them.
Tested by Thomas, fixes bugzilla #9933.
Signed-off-by: Patrick McHardy <kaber@trash.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Chris Wright <chrisw@sous-sol.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
---
Patrick, which part of commit log did you want to drop?
net/ipv4/netfilter/ip_queue.c | 12 +++++++-----
net/ipv6/netfilter/ip6_queue.c | 10 ++++++----
net/netfilter/nfnetlink_queue.c | 10 ++++++----
3 files changed, 19 insertions(+), 13 deletions(-)
--- a/net/ipv4/netfilter/ip_queue.c
+++ b/net/ipv4/netfilter/ip_queue.c
@@ -336,8 +336,8 @@ static int
ipq_mangle_ipv4(ipq_verdict_msg_t *v, struct ipq_queue_entry *e)
{
int diff;
- int err;
struct iphdr *user_iph = (struct iphdr *)v->payload;
+ struct sk_buff *nskb;
if (v->data_len < sizeof(*user_iph))
return 0;
@@ -349,14 +349,16 @@ ipq_mangle_ipv4(ipq_verdict_msg_t *v, st
if (v->data_len > 0xFFFF)
return -EINVAL;
if (diff > skb_tailroom(e->skb)) {
- err = pskb_expand_head(e->skb, 0,
+ nskb = skb_copy_expand(e->skb, 0,
diff - skb_tailroom(e->skb),
GFP_ATOMIC);
- if (err) {
+ if (!nskb) {
printk(KERN_WARNING "ip_queue: error "
- "in mangle, dropping packet: %d\n", -err);
- return err;
+ "in mangle, dropping packet\n");
+ return -ENOMEM;
}
+ kfree_skb(e->skb);
+ e->skb = nskb;
}
skb_put(e->skb, diff);
}
--- a/net/ipv6/netfilter/ip6_queue.c
+++ b/net/ipv6/netfilter/ip6_queue.c
@@ -333,8 +333,8 @@ static int
ipq_mangle_ipv6(ipq_verdict_msg_t *v, struct ipq_queue_entry *e)
{
int diff;
- int err;
struct ipv6hdr *user_iph = (struct ipv6hdr *)v->payload;
+ struct sk_buff *nskb;
if (v->data_len < sizeof(*user_iph))
return 0;
@@ -346,14 +346,16 @@ ipq_mangle_ipv6(ipq_verdict_msg_t *v, st
if (v->data_len > 0xFFFF)
return -EINVAL;
if (diff > skb_tailroom(e->skb)) {
- err = pskb_expand_head(e->skb, 0,
+ nskb = skb_copy_expand(e->skb, 0,
diff - skb_tailroom(e->skb),
GFP_ATOMIC);
- if (err) {
+ if (!nskb) {
printk(KERN_WARNING "ip6_queue: OOM "
"in mangle, dropping packet\n");
- return err;
+ return -ENOMEM;
}
+ kfree_skb(e->skb);
+ e->skb = nskb;
}
skb_put(e->skb, diff);
}
--- a/net/netfilter/nfnetlink_queue.c
+++ b/net/netfilter/nfnetlink_queue.c
@@ -616,8 +616,8 @@ err_out_put:
static int
nfqnl_mangle(void *data, int data_len, struct nfqnl_queue_entry *e)
{
+ struct sk_buff *nskb;
int diff;
- int err;
diff = data_len - e->skb->len;
if (diff < 0) {
@@ -627,14 +627,16 @@ nfqnl_mangle(void *data, int data_len, s
if (data_len > 0xFFFF)
return -EINVAL;
if (diff > skb_tailroom(e->skb)) {
- err = pskb_expand_head(e->skb, 0,
+ nskb = skb_copy_expand(e->skb, 0,
diff - skb_tailroom(e->skb),
GFP_ATOMIC);
- if (err) {
+ if (!nskb) {
printk(KERN_WARNING "nf_queue: OOM "
"in mangle, dropping packet\n");
- return err;
+ return -ENOMEM;
}
+ kfree_skb(e->skb);
+ e->skb = nskb;
}
skb_put(e->skb, diff);
}
--
^ permalink raw reply [flat|nested] 100+ messages in thread
* [patch 39/76] NETFILTER: Fix incorrect use of skb_make_writable
2008-03-21 22:42 [patch 00/76] 2.6.24-stable review Chris Wright
` (37 preceding siblings ...)
2008-03-21 22:43 ` [patch 38/76] NETFILTER: nfnetlink_queue: fix SKB_LINEAR_ASSERT when mangling packet data Chris Wright
@ 2008-03-21 22:43 ` Chris Wright
2008-03-21 22:43 ` [patch 40/76] NETFILTER: fix ebtable targets return Chris Wright
` (38 subsequent siblings)
77 siblings, 0 replies; 100+ messages in thread
From: Chris Wright @ 2008-03-21 22:43 UTC (permalink / raw)
To: linux-kernel, stable
Cc: Justin Forbes, Zwane Mwaikambo, Theodore Ts'o, Randy Dunlap,
Dave Jones, Chuck Wolber, Chris Wedgwood, Michael Krufky,
Chuck Ebbert, Domenico Andreoli, torvalds, akpm, alan,
Patrick McHardy, netfilter-devel, davem, Joonwoo Park,
Greg Kroah-Hartman
[-- Attachment #1: netfilter-fix-incorrect-use-of-skb_make_writable.patch --]
[-- Type: text/plain, Size: 2083 bytes --]
-stable review patch. If anyone has any objections, please let us know.
---------------------
From: Patrick McHardy <kaber@trash.net>
Upstream commit eb1197bc0:
http://bugzilla.kernel.org/show_bug.cgi?id=9920
The function skb_make_writable returns true or false.
Signed-off-by: Joonwoo Park <joonwpark81@gmail.com>
Signed-off-by: Patrick McHardy <kaber@trash.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Chris Wright <chrisw@sous-sol.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
---
net/bridge/netfilter/ebt_dnat.c | 2 +-
net/bridge/netfilter/ebt_redirect.c | 2 +-
net/bridge/netfilter/ebt_snat.c | 2 +-
net/ipv4/netfilter/arpt_mangle.c | 2 +-
4 files changed, 4 insertions(+), 4 deletions(-)
--- a/net/bridge/netfilter/ebt_dnat.c
+++ b/net/bridge/netfilter/ebt_dnat.c
@@ -20,7 +20,7 @@ static int ebt_target_dnat(struct sk_buf
{
struct ebt_nat_info *info = (struct ebt_nat_info *)data;
- if (skb_make_writable(skb, 0))
+ if (!skb_make_writable(skb, 0))
return NF_DROP;
memcpy(eth_hdr(skb)->h_dest, info->mac, ETH_ALEN);
--- a/net/bridge/netfilter/ebt_redirect.c
+++ b/net/bridge/netfilter/ebt_redirect.c
@@ -21,7 +21,7 @@ static int ebt_target_redirect(struct sk
{
struct ebt_redirect_info *info = (struct ebt_redirect_info *)data;
- if (skb_make_writable(skb, 0))
+ if (!skb_make_writable(skb, 0))
return NF_DROP;
if (hooknr != NF_BR_BROUTING)
--- a/net/bridge/netfilter/ebt_snat.c
+++ b/net/bridge/netfilter/ebt_snat.c
@@ -22,7 +22,7 @@ static int ebt_target_snat(struct sk_buf
{
struct ebt_nat_info *info = (struct ebt_nat_info *) data;
- if (skb_make_writable(skb, 0))
+ if (!skb_make_writable(skb, 0))
return NF_DROP;
memcpy(eth_hdr(skb)->h_source, info->mac, ETH_ALEN);
--- a/net/ipv4/netfilter/arpt_mangle.c
+++ b/net/ipv4/netfilter/arpt_mangle.c
@@ -19,7 +19,7 @@ target(struct sk_buff *skb,
unsigned char *arpptr;
int pln, hln;
- if (skb_make_writable(skb, skb->len))
+ if (!skb_make_writable(skb, skb->len))
return NF_DROP;
arp = arp_hdr(skb);
--
^ permalink raw reply [flat|nested] 100+ messages in thread
* [patch 40/76] NETFILTER: fix ebtable targets return
2008-03-21 22:42 [patch 00/76] 2.6.24-stable review Chris Wright
` (38 preceding siblings ...)
2008-03-21 22:43 ` [patch 39/76] NETFILTER: Fix incorrect use of skb_make_writable Chris Wright
@ 2008-03-21 22:43 ` Chris Wright
2008-03-21 22:43 ` [patch 41/76] SCSI advansys: fix overrun_buf aligned bug Chris Wright
` (37 subsequent siblings)
77 siblings, 0 replies; 100+ messages in thread
From: Chris Wright @ 2008-03-21 22:43 UTC (permalink / raw)
To: linux-kernel, stable
Cc: Justin Forbes, Zwane Mwaikambo, Theodore Ts'o, Randy Dunlap,
Dave Jones, Chuck Wolber, Chris Wedgwood, Michael Krufky,
Chuck Ebbert, Domenico Andreoli, torvalds, akpm, alan,
Patrick McHardy, netfilter-devel, davem, Joonwoo Park,
Greg Kroah-Hartman
[-- Attachment #1: netfilter-fix-ebtable-targets-return.patch --]
[-- Type: text/plain, Size: 1767 bytes --]
-stable review patch. If anyone has any objections, please let us know.
---------------------
From: Patrick McHardy <kaber@trash.net>
Upstream commit 1b04ab459:
The function ebt_do_table doesn't take NF_DROP as a verdict from the targets.
Signed-off-by: Joonwoo Park <joonwpark81@gmail.com>
Signed-off-by: Patrick McHardy <kaber@trash.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Chris Wright <chrisw@sous-sol.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
---
net/bridge/netfilter/ebt_dnat.c | 2 +-
net/bridge/netfilter/ebt_redirect.c | 2 +-
net/bridge/netfilter/ebt_snat.c | 2 +-
3 files changed, 3 insertions(+), 3 deletions(-)
--- a/net/bridge/netfilter/ebt_dnat.c
+++ b/net/bridge/netfilter/ebt_dnat.c
@@ -21,7 +21,7 @@ static int ebt_target_dnat(struct sk_buf
struct ebt_nat_info *info = (struct ebt_nat_info *)data;
if (!skb_make_writable(skb, 0))
- return NF_DROP;
+ return EBT_DROP;
memcpy(eth_hdr(skb)->h_dest, info->mac, ETH_ALEN);
return info->target;
--- a/net/bridge/netfilter/ebt_redirect.c
+++ b/net/bridge/netfilter/ebt_redirect.c
@@ -22,7 +22,7 @@ static int ebt_target_redirect(struct sk
struct ebt_redirect_info *info = (struct ebt_redirect_info *)data;
if (!skb_make_writable(skb, 0))
- return NF_DROP;
+ return EBT_DROP;
if (hooknr != NF_BR_BROUTING)
memcpy(eth_hdr(skb)->h_dest,
--- a/net/bridge/netfilter/ebt_snat.c
+++ b/net/bridge/netfilter/ebt_snat.c
@@ -23,7 +23,7 @@ static int ebt_target_snat(struct sk_buf
struct ebt_nat_info *info = (struct ebt_nat_info *) data;
if (!skb_make_writable(skb, 0))
- return NF_DROP;
+ return EBT_DROP;
memcpy(eth_hdr(skb)->h_source, info->mac, ETH_ALEN);
if (!(info->target & NAT_ARP_BIT) &&
--
^ permalink raw reply [flat|nested] 100+ messages in thread
* [patch 41/76] SCSI advansys: fix overrun_buf aligned bug
2008-03-21 22:42 [patch 00/76] 2.6.24-stable review Chris Wright
` (39 preceding siblings ...)
2008-03-21 22:43 ` [patch 40/76] NETFILTER: fix ebtable targets return Chris Wright
@ 2008-03-21 22:43 ` Chris Wright
2008-03-21 22:43 ` [patch 42/76] pata_hpt*, pata_serverworks: fix UDMA masking Chris Wright
` (36 subsequent siblings)
77 siblings, 0 replies; 100+ messages in thread
From: Chris Wright @ 2008-03-21 22:43 UTC (permalink / raw)
To: linux-kernel, stable
Cc: Justin Forbes, Zwane Mwaikambo, Theodore Ts'o, Randy Dunlap,
Dave Jones, Chuck Wolber, Chris Wedgwood, Michael Krufky,
Chuck Ebbert, Domenico Andreoli, torvalds, akpm, alan,
FUJITA Tomonori, James.Bottomley, fujita.tomonori, matthew,
Greg Kroah-Hartman
[-- Attachment #1: scsi-advansys-fix-overrun_buf-aligned-bug.patch --]
[-- Type: text/plain, Size: 2708 bytes --]
-stable review patch. If anyone has any objections, please let us know.
---------------------
From: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
commit 7d5d408c77cee95d1380511de46b7a4c8dc2211d
struct asc_dvc_var needs overrun buffer to be placed on an 8 byte
boundary. advansys defines struct asc_dvc_var:
struct asc_dvc_var {
...
uchar overrun_buf[ASC_OVERRUN_BSIZE] __aligned(8);
The problem is that struct asc_dvc_var is placed on
shost->hostdata. So if the hostdata is not on an 8 byte boundary, the
advansys crashes. The hostdata is placed on a sizeof(unsigned long)
boundary so the 8 byte boundary is not garanteed with x86_32.
With 2.6.23 and 2.6.24, the hostdata is on an 8 byte boundary by
chance, but with the current git, it's not.
This patch removes overrun_buf static array and use kzalloc.
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
FUJITA Tomonori notes:
We thought that 2.6.24 doesn't have this bug, however it does.
Signed-off-by: Chris Wright <chrisw@sous-sol.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
---
drivers/scsi/advansys.c | 13 +++++++++++--
1 file changed, 11 insertions(+), 2 deletions(-)
--- a/drivers/scsi/advansys.c
+++ b/drivers/scsi/advansys.c
@@ -566,7 +566,7 @@ typedef struct asc_dvc_var {
ASC_SCSI_BIT_ID_TYPE unit_not_ready;
ASC_SCSI_BIT_ID_TYPE queue_full_or_busy;
ASC_SCSI_BIT_ID_TYPE start_motor;
- uchar overrun_buf[ASC_OVERRUN_BSIZE] __aligned(8);
+ uchar *overrun_buf;
dma_addr_t overrun_dma;
uchar scsi_reset_wait;
uchar chip_no;
@@ -13833,6 +13833,12 @@ static int __devinit advansys_board_foun
*/
if (ASC_NARROW_BOARD(boardp)) {
ASC_DBG(2, "AscInitAsc1000Driver()\n");
+
+ asc_dvc_varp->overrun_buf = kzalloc(ASC_OVERRUN_BSIZE, GFP_KERNEL);
+ if (!asc_dvc_varp->overrun_buf) {
+ ret = -ENOMEM;
+ goto err_free_wide_mem;
+ }
warn_code = AscInitAsc1000Driver(asc_dvc_varp);
if (warn_code || asc_dvc_varp->err_code) {
@@ -13840,8 +13846,10 @@ static int __devinit advansys_board_foun
"warn 0x%x, error 0x%x\n",
asc_dvc_varp->init_state, warn_code,
asc_dvc_varp->err_code);
- if (asc_dvc_varp->err_code)
+ if (asc_dvc_varp->err_code) {
ret = -ENODEV;
+ kfree(asc_dvc_varp->overrun_buf);
+ }
}
} else {
if (advansys_wide_init_chip(shost))
@@ -13894,6 +13902,7 @@ static int advansys_release(struct Scsi_
dma_unmap_single(board->dev,
board->dvc_var.asc_dvc_var.overrun_dma,
ASC_OVERRUN_BSIZE, DMA_FROM_DEVICE);
+ kfree(board->dvc_var.asc_dvc_var.overrun_buf);
} else {
iounmap(board->ioremap_addr);
advansys_wide_free_mem(board);
--
^ permalink raw reply [flat|nested] 100+ messages in thread
* [patch 42/76] pata_hpt*, pata_serverworks: fix UDMA masking
2008-03-21 22:42 [patch 00/76] 2.6.24-stable review Chris Wright
` (40 preceding siblings ...)
2008-03-21 22:43 ` [patch 41/76] SCSI advansys: fix overrun_buf aligned bug Chris Wright
@ 2008-03-21 22:43 ` Chris Wright
2008-03-21 22:43 ` [patch 43/76] moduleparam: fix alpha, ia64 and ppc64 compile failures Chris Wright
` (35 subsequent siblings)
77 siblings, 0 replies; 100+ messages in thread
From: Chris Wright @ 2008-03-21 22:43 UTC (permalink / raw)
To: linux-kernel, stable
Cc: Justin Forbes, Zwane Mwaikambo, Theodore Ts'o, Randy Dunlap,
Dave Jones, Chuck Wolber, Chris Wedgwood, Michael Krufky,
Chuck Ebbert, Domenico Andreoli, torvalds, akpm, alan, Alan Cox,
Jeff Garzik, Greg Kroah-Hartman
[-- Attachment #1: pata_hpt-pata_serverworks-fix-udma-masking.patch --]
[-- Type: text/plain, Size: 2637 bytes --]
-stable review patch. If anyone has any objections, please let us know.
---------------------
From: Alan Cox <alan@lxorguk.ukuu.org.uk>
[upstream commit: 6ddd6861]
When masking, mask out the modes that are unsupported not the ones
that are supported. This makes life happier.
Signed-off-by: Alan Cox <alan@redhat.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
Signed-off-by: Chris Wright <chrisw@sous-sol.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
---
drivers/ata/pata_hpt366.c | 6 +++---
drivers/ata/pata_hpt37x.c | 6 +++---
drivers/ata/pata_serverworks.c | 2 +-
3 files changed, 7 insertions(+), 7 deletions(-)
--- a/drivers/ata/pata_hpt366.c
+++ b/drivers/ata/pata_hpt366.c
@@ -27,7 +27,7 @@
#include <linux/libata.h>
#define DRV_NAME "pata_hpt366"
-#define DRV_VERSION "0.6.1"
+#define DRV_VERSION "0.6.2"
struct hpt_clock {
u8 xfer_speed;
@@ -180,9 +180,9 @@ static unsigned long hpt366_filter(struc
if (hpt_dma_blacklisted(adev, "UDMA", bad_ata33))
mask &= ~ATA_MASK_UDMA;
if (hpt_dma_blacklisted(adev, "UDMA3", bad_ata66_3))
- mask &= ~(0x07 << ATA_SHIFT_UDMA);
+ mask &= ~(0xF8 << ATA_SHIFT_UDMA);
if (hpt_dma_blacklisted(adev, "UDMA4", bad_ata66_4))
- mask &= ~(0x0F << ATA_SHIFT_UDMA);
+ mask &= ~(0xF0 << ATA_SHIFT_UDMA);
}
return ata_pci_default_filter(adev, mask);
}
--- a/drivers/ata/pata_hpt37x.c
+++ b/drivers/ata/pata_hpt37x.c
@@ -24,7 +24,7 @@
#include <linux/libata.h>
#define DRV_NAME "pata_hpt37x"
-#define DRV_VERSION "0.6.9"
+#define DRV_VERSION "0.6.11"
struct hpt_clock {
u8 xfer_speed;
@@ -281,7 +281,7 @@ static unsigned long hpt370_filter(struc
if (hpt_dma_blacklisted(adev, "UDMA", bad_ata33))
mask &= ~ATA_MASK_UDMA;
if (hpt_dma_blacklisted(adev, "UDMA100", bad_ata100_5))
- mask &= ~(0x1F << ATA_SHIFT_UDMA);
+ mask &= ~(0xE0 << ATA_SHIFT_UDMA);
}
return ata_pci_default_filter(adev, mask);
}
@@ -297,7 +297,7 @@ static unsigned long hpt370a_filter(stru
{
if (adev->class == ATA_DEV_ATA) {
if (hpt_dma_blacklisted(adev, "UDMA100", bad_ata100_5))
- mask &= ~ (0x1F << ATA_SHIFT_UDMA);
+ mask &= ~(0xE0 << ATA_SHIFT_UDMA);
}
return ata_pci_default_filter(adev, mask);
}
--- a/drivers/ata/pata_serverworks.c
+++ b/drivers/ata/pata_serverworks.c
@@ -226,7 +226,7 @@ static unsigned long serverworks_csb_fil
for (i = 0; (p = csb_bad_ata100[i]) != NULL; i++) {
if (!strcmp(p, model_num))
- mask &= ~(0x1F << ATA_SHIFT_UDMA);
+ mask &= ~(0xE0 << ATA_SHIFT_UDMA);
}
return ata_pci_default_filter(adev, mask);
}
--
^ permalink raw reply [flat|nested] 100+ messages in thread
* [patch 43/76] moduleparam: fix alpha, ia64 and ppc64 compile failures
2008-03-21 22:42 [patch 00/76] 2.6.24-stable review Chris Wright
` (41 preceding siblings ...)
2008-03-21 22:43 ` [patch 42/76] pata_hpt*, pata_serverworks: fix UDMA masking Chris Wright
@ 2008-03-21 22:43 ` Chris Wright
2008-03-21 22:43 ` [patch 44/76] PCI x86: always use conf1 to access config space below 256 bytes Chris Wright
` (34 subsequent siblings)
77 siblings, 0 replies; 100+ messages in thread
From: Chris Wright @ 2008-03-21 22:43 UTC (permalink / raw)
To: linux-kernel, stable
Cc: Justin Forbes, Zwane Mwaikambo, Theodore Ts'o, Randy Dunlap,
Dave Jones, Chuck Wolber, Chris Wedgwood, Michael Krufky,
Chuck Ebbert, Domenico Andreoli, torvalds, akpm, alan,
Ivan Kokshaysky, Richard Henderson, Tony Luck, Anton Blanchard,
Paul Mackerras, Adrian Bunk, Kamalesh Babulal, Rusty Russell,
Mike Pagano, Greg Kroah-Hartman
[-- Attachment #1: moduleparam-fix-alpha-ia64-and-ppc64-compile-failures.patch --]
[-- Type: text/plain, Size: 2603 bytes --]
-stable review patch. If anyone has any objections, please let us know.
---------------------
From: Ivan Kokshaysky <ink@jurassic.park.msu.ru>
[upstream commit: 91d35dd9]
On alpha, ia64 and ppc64 only relocations to local data can go into
read-only sections. The vast majority of module parameters use the global
generic param_set_*/param_get_* functions, so the 'const' attribute for
struct kernel_param is not only useless, but it also causes compile
failures due to 'section type conflict' in those rare cases where
param_set/get are local functions.
This fixes http://bugzilla.kernel.org/show_bug.cgi?id=8964
Signed-off-by: Ivan Kokshaysky <ink@jurassic.park.msu.ru>
Cc: Richard Henderson <rth@twiddle.net>
Cc: Tony Luck <tony.luck@intel.com>
Cc: Anton Blanchard <anton@samba.org>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Adrian Bunk <bunk@stusta.de>
Cc: Kamalesh Babulal <kamalesh@linux.vnet.ibm.com>
Cc: Rusty Russell <rusty@rustcorp.com.au>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Mike Pagano <mpagano@gentoo.org>
[chrisw@sous-sol.org: backport to 2.6.24.3]
Signed-off-by: Chris Wright <chrisw@sous-sol.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
---
include/linux/moduleparam.h | 12 +++++++++++-
1 file changed, 11 insertions(+), 1 deletion(-)
--- a/include/linux/moduleparam.h
+++ b/include/linux/moduleparam.h
@@ -62,6 +62,16 @@ struct kparam_array
void *elem;
};
+/* On alpha, ia64 and ppc64 relocations to global data cannot go into
+ read-only sections (which is part of respective UNIX ABI on these
+ platforms). So 'const' makes no sense and even causes compile failures
+ with some compilers. */
+#if defined(CONFIG_ALPHA) || defined(CONFIG_IA64) || defined(CONFIG_PPC64)
+#define __moduleparam_const
+#else
+#define __moduleparam_const const
+#endif
+
/* This is the fundamental function for registering boot/module
parameters. perm sets the visibility in sysfs: 000 means it's
not there, read bits mean it's readable, write bits mean it's
@@ -71,7 +81,7 @@ struct kparam_array
static int __param_perm_check_##name __attribute__((unused)) = \
BUILD_BUG_ON_ZERO((perm) < 0 || (perm) > 0777 || ((perm) & 2)); \
static const char __param_str_##name[] = prefix #name; \
- static struct kernel_param const __param_##name \
+ static struct kernel_param __moduleparam_const __param_##name \
__attribute_used__ \
__attribute__ ((unused,__section__ ("__param"),aligned(sizeof(void *)))) \
= { __param_str_##name, perm, set, get, { arg } }
--
^ permalink raw reply [flat|nested] 100+ messages in thread
* [patch 44/76] PCI x86: always use conf1 to access config space below 256 bytes
2008-03-21 22:42 [patch 00/76] 2.6.24-stable review Chris Wright
` (42 preceding siblings ...)
2008-03-21 22:43 ` [patch 43/76] moduleparam: fix alpha, ia64 and ppc64 compile failures Chris Wright
@ 2008-03-21 22:43 ` Chris Wright
2008-03-21 22:43 ` [patch 45/76] e1000e: Fix CRC stripping in hardware context bug Chris Wright
` (33 subsequent siblings)
77 siblings, 0 replies; 100+ messages in thread
From: Chris Wright @ 2008-03-21 22:43 UTC (permalink / raw)
To: linux-kernel, stable
Cc: Justin Forbes, Zwane Mwaikambo, Theodore Ts'o, Randy Dunlap,
Dave Jones, Chuck Wolber, Chris Wedgwood, Michael Krufky,
Chuck Ebbert, Domenico Andreoli, torvalds, akpm, alan,
Ivan Kokshaysky, Matthew Wilcox, Mike Pagano, Greg Kroah-Hartman
[-- Attachment #1: pci-x86-always-use-conf1-to-access-config-space-below-256-bytes.patch --]
[-- Type: text/plain, Size: 6766 bytes --]
-stable review patch. If anyone has any objections, please let us know.
---------------------
From: Ivan Kokshaysky <ink@jurassic.park.msu.ru>
[upsteam commit: a0ca9909]
Thanks to Loic Prylli <loic@myri.com>, who originally proposed
this idea.
Always using legacy configuration mechanism for the legacy config space
and extended mechanism (mmconf) for the extended config space is
a simple and very logical approach. It's supposed to resolve all
known mmconf problems. It still allows per-device quirks (tweaking
dev->cfg_size). It also allows to get rid of mmconf fallback code.
This patch fixes a boot hang on Intel Q35 chipset as detailed at:
http://bugs.gentoo.org/198810
Signed-off-by: Ivan Kokshaysky <ink@jurassic.park.msu.ru>
Signed-off-by: Matthew Wilcox <willy@linux.intel.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Mike Pagano <mpagano@gentoo.org>
Signed-off-by: Chris Wright <chrisw@sous-sol.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
---
arch/x86/pci/mmconfig-shared.c | 35 -----------------------------------
arch/x86/pci/mmconfig_32.c | 22 +++++++++-------------
arch/x86/pci/mmconfig_64.c | 22 ++++++++++------------
arch/x86/pci/pci.h | 7 -------
4 files changed, 19 insertions(+), 67 deletions(-)
--- a/arch/x86/pci/mmconfig-shared.c
+++ b/arch/x86/pci/mmconfig-shared.c
@@ -22,42 +22,9 @@
#define MMCONFIG_APER_MIN (2 * 1024*1024)
#define MMCONFIG_APER_MAX (256 * 1024*1024)
-DECLARE_BITMAP(pci_mmcfg_fallback_slots, 32*PCI_MMCFG_MAX_CHECK_BUS);
-
/* Indicate if the mmcfg resources have been placed into the resource table. */
static int __initdata pci_mmcfg_resources_inserted;
-/* K8 systems have some devices (typically in the builtin northbridge)
- that are only accessible using type1
- Normally this can be expressed in the MCFG by not listing them
- and assigning suitable _SEGs, but this isn't implemented in some BIOS.
- Instead try to discover all devices on bus 0 that are unreachable using MM
- and fallback for them. */
-static void __init unreachable_devices(void)
-{
- int i, bus;
- /* Use the max bus number from ACPI here? */
- for (bus = 0; bus < PCI_MMCFG_MAX_CHECK_BUS; bus++) {
- for (i = 0; i < 32; i++) {
- unsigned int devfn = PCI_DEVFN(i, 0);
- u32 val1, val2;
-
- pci_conf1_read(0, bus, devfn, 0, 4, &val1);
- if (val1 == 0xffffffff)
- continue;
-
- if (pci_mmcfg_arch_reachable(0, bus, devfn)) {
- raw_pci_ops->read(0, bus, devfn, 0, 4, &val2);
- if (val1 == val2)
- continue;
- }
- set_bit(i + 32 * bus, pci_mmcfg_fallback_slots);
- printk(KERN_NOTICE "PCI: No mmconfig possible on device"
- " %02x:%02x\n", bus, i);
- }
- }
-}
-
static const char __init *pci_mmcfg_e7520(void)
{
u32 win;
@@ -270,8 +237,6 @@ void __init pci_mmcfg_init(int type)
return;
if (pci_mmcfg_arch_init()) {
- if (type == 1)
- unreachable_devices();
if (known_bridge)
pci_mmcfg_insert_resources(IORESOURCE_BUSY);
pci_probe = (pci_probe & ~PCI_PROBE_MASK) | PCI_PROBE_MMCONF;
--- a/arch/x86/pci/mmconfig_32.c
+++ b/arch/x86/pci/mmconfig_32.c
@@ -30,10 +30,6 @@ static u32 get_base_addr(unsigned int se
struct acpi_mcfg_allocation *cfg;
int cfg_num;
- if (seg == 0 && bus < PCI_MMCFG_MAX_CHECK_BUS &&
- test_bit(PCI_SLOT(devfn) + 32*bus, pci_mmcfg_fallback_slots))
- return 0;
-
for (cfg_num = 0; cfg_num < pci_mmcfg_config_num; cfg_num++) {
cfg = &pci_mmcfg_config[cfg_num];
if (cfg->pci_segment == seg &&
@@ -68,13 +64,16 @@ static int pci_mmcfg_read(unsigned int s
u32 base;
if ((bus > 255) || (devfn > 255) || (reg > 4095)) {
- *value = -1;
+err: *value = -1;
return -EINVAL;
}
+ if (reg < 256)
+ return pci_conf1_read(seg,bus,devfn,reg,len,value);
+
base = get_base_addr(seg, bus, devfn);
if (!base)
- return pci_conf1_read(seg,bus,devfn,reg,len,value);
+ goto err;
spin_lock_irqsave(&pci_config_lock, flags);
@@ -105,9 +104,12 @@ static int pci_mmcfg_write(unsigned int
if ((bus > 255) || (devfn > 255) || (reg > 4095))
return -EINVAL;
+ if (reg < 256)
+ return pci_conf1_write(seg,bus,devfn,reg,len,value);
+
base = get_base_addr(seg, bus, devfn);
if (!base)
- return pci_conf1_write(seg,bus,devfn,reg,len,value);
+ return -EINVAL;
spin_lock_irqsave(&pci_config_lock, flags);
@@ -134,12 +136,6 @@ static struct pci_raw_ops pci_mmcfg = {
.write = pci_mmcfg_write,
};
-int __init pci_mmcfg_arch_reachable(unsigned int seg, unsigned int bus,
- unsigned int devfn)
-{
- return get_base_addr(seg, bus, devfn) != 0;
-}
-
int __init pci_mmcfg_arch_init(void)
{
printk(KERN_INFO "PCI: Using MMCONFIG\n");
--- a/arch/x86/pci/mmconfig_64.c
+++ b/arch/x86/pci/mmconfig_64.c
@@ -40,9 +40,7 @@ static char __iomem *get_virt(unsigned i
static char __iomem *pci_dev_base(unsigned int seg, unsigned int bus, unsigned int devfn)
{
char __iomem *addr;
- if (seg == 0 && bus < PCI_MMCFG_MAX_CHECK_BUS &&
- test_bit(32*bus + PCI_SLOT(devfn), pci_mmcfg_fallback_slots))
- return NULL;
+
addr = get_virt(seg, bus);
if (!addr)
return NULL;
@@ -56,13 +54,16 @@ static int pci_mmcfg_read(unsigned int s
/* Why do we have this when nobody checks it. How about a BUG()!? -AK */
if (unlikely((bus > 255) || (devfn > 255) || (reg > 4095))) {
- *value = -1;
+err: *value = -1;
return -EINVAL;
}
+ if (reg < 256)
+ return pci_conf1_read(seg,bus,devfn,reg,len,value);
+
addr = pci_dev_base(seg, bus, devfn);
if (!addr)
- return pci_conf1_read(seg,bus,devfn,reg,len,value);
+ goto err;
switch (len) {
case 1:
@@ -88,9 +89,12 @@ static int pci_mmcfg_write(unsigned int
if (unlikely((bus > 255) || (devfn > 255) || (reg > 4095)))
return -EINVAL;
+ if (reg < 256)
+ return pci_conf1_write(seg,bus,devfn,reg,len,value);
+
addr = pci_dev_base(seg, bus, devfn);
if (!addr)
- return pci_conf1_write(seg,bus,devfn,reg,len,value);
+ return -EINVAL;
switch (len) {
case 1:
@@ -126,12 +130,6 @@ static void __iomem * __init mcfg_iorema
return addr;
}
-int __init pci_mmcfg_arch_reachable(unsigned int seg, unsigned int bus,
- unsigned int devfn)
-{
- return pci_dev_base(seg, bus, devfn) != NULL;
-}
-
int __init pci_mmcfg_arch_init(void)
{
int i;
--- a/arch/x86/pci/pci.h
+++ b/arch/x86/pci/pci.h
@@ -98,13 +98,6 @@ extern void pcibios_sort(void);
/* pci-mmconfig.c */
-/* Verify the first 16 busses. We assume that systems with more busses
- get MCFG right. */
-#define PCI_MMCFG_MAX_CHECK_BUS 16
-extern DECLARE_BITMAP(pci_mmcfg_fallback_slots, 32*PCI_MMCFG_MAX_CHECK_BUS);
-
-extern int __init pci_mmcfg_arch_reachable(unsigned int seg, unsigned int bus,
- unsigned int devfn);
extern int __init pci_mmcfg_arch_init(void);
/*
--
^ permalink raw reply [flat|nested] 100+ messages in thread
* [patch 45/76] e1000e: Fix CRC stripping in hardware context bug
2008-03-21 22:42 [patch 00/76] 2.6.24-stable review Chris Wright
` (43 preceding siblings ...)
2008-03-21 22:43 ` [patch 44/76] PCI x86: always use conf1 to access config space below 256 bytes Chris Wright
@ 2008-03-21 22:43 ` Chris Wright
2008-03-21 22:43 ` [patch 46/76] arcmsr: fix IRQs disabled warning spew Chris Wright
` (32 subsequent siblings)
77 siblings, 0 replies; 100+ messages in thread
From: Chris Wright @ 2008-03-21 22:43 UTC (permalink / raw)
To: linux-kernel, stable
Cc: Justin Forbes, Zwane Mwaikambo, Theodore Ts'o, Randy Dunlap,
Dave Jones, Chuck Wolber, Chris Wedgwood, Michael Krufky,
Chuck Ebbert, Domenico Andreoli, torvalds, akpm, alan, Auke Kok,
Jeff Garzik, Mike Pagano, Greg Kroah-Hartman
[-- Attachment #1: e1000e-fix-crc-stripping-in-hardware-context-bug.patch --]
[-- Type: text/plain, Size: 1327 bytes --]
-stable review patch. If anyone has any objections, please let us know.
---------------------
From: Auke Kok <auke-jan.h.kok@intel.com>
CRC stripping was only correctly enabled for packet split recieves
which is used when receiving jumbo frames. Correctly enable SECRC
also for normal buffer packet receives.
Tested by Andy Gospodarek and Johan Andersson, see bugzilla #9940.
Signed-off-by: Auke Kok <auke-jan.h.kok@intel.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
Cc: Mike Pagano <mike@mpagano.com>
Signed-off-by: Chris Wright <chrisw@sous-sol.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
---
drivers/net/e1000e/netdev.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
--- a/drivers/net/e1000e/netdev.c
+++ b/drivers/net/e1000e/netdev.c
@@ -1686,6 +1686,9 @@ static void e1000_setup_rctl(struct e100
else
rctl |= E1000_RCTL_LPE;
+ /* Enable hardware CRC frame stripping */
+ rctl |= E1000_RCTL_SECRC;
+
/* Setup buffer sizes */
rctl &= ~E1000_RCTL_SZ_4096;
rctl |= E1000_RCTL_BSEX;
@@ -1751,9 +1754,6 @@ static void e1000_setup_rctl(struct e100
/* Enable Packet split descriptors */
rctl |= E1000_RCTL_DTYP_PS;
-
- /* Enable hardware CRC frame stripping */
- rctl |= E1000_RCTL_SECRC;
psrctl |= adapter->rx_ps_bsize0 >>
E1000_PSRCTL_BSIZE0_SHIFT;
--
^ permalink raw reply [flat|nested] 100+ messages in thread
* [patch 46/76] arcmsr: fix IRQs disabled warning spew
2008-03-21 22:42 [patch 00/76] 2.6.24-stable review Chris Wright
` (44 preceding siblings ...)
2008-03-21 22:43 ` [patch 45/76] e1000e: Fix CRC stripping in hardware context bug Chris Wright
@ 2008-03-21 22:43 ` Chris Wright
2008-03-21 22:43 ` [patch 47/76] b43: Backport bcm4311 fix Chris Wright
` (31 subsequent siblings)
77 siblings, 0 replies; 100+ messages in thread
From: Chris Wright @ 2008-03-21 22:43 UTC (permalink / raw)
To: linux-kernel, stable
Cc: Justin Forbes, Zwane Mwaikambo, Theodore Ts'o, Randy Dunlap,
Dave Jones, Chuck Wolber, Chris Wedgwood, Michael Krufky,
Chuck Ebbert, Domenico Andreoli, torvalds, akpm, alan,
Mike Pagano, kernel, dsd, Nick Cheng, James Bottomley,
Greg Kroah-Hartman
[-- Attachment #1: arcmsr-fix-irqs-disabled-warning-spew.patch --]
[-- Type: text/plain, Size: 3251 bytes --]
-stable review patch. If anyone has any objections, please let us know.
---------------------
From: Mike Pagano <mpagano@gentoo.org>
As of 2.6.24, running the archttp passthrough daemon with the arcmsr
driver produces an endless spew of dma_free_coherent warnings:
WARNING: at arch/x86/kernel/pci-dma_64.c:169 dma_free_coherent()
It turns out that coherent memory is not needed, so commit 76d78300 by
Nick Cheng <nick.cheng@areca.com.tw> switched it to kmalloc (as well as
making a lot of other changes which have not been included here).
James Bottomley pointed out that the new kmalloc usage was also wrong,
I corrected this in commit 69e562c2.
This patch combines both of the above for the purpose of fixing 2.6.24.
details in http://bugs.gentoo.org/208493.
Signed-off-by: Daniel Drake <dsd@gentoo.org>
Cc: Nick Cheng <nick.cheng@areca.com.tw>
Cc: James Bottomley <James.Bottomley@HansenPartnership.com>
Signed-off-by: Chris Wright <chrisw@sous-sol.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
---
drivers/scsi/arcmsr/arcmsr_hba.c | 20 +++++++++-----------
1 file changed, 9 insertions(+), 11 deletions(-)
--- a/drivers/scsi/arcmsr/arcmsr_hba.c
+++ b/drivers/scsi/arcmsr/arcmsr_hba.c
@@ -1380,17 +1380,16 @@ static int arcmsr_iop_message_xfer(struc
switch(controlcode) {
case ARCMSR_MESSAGE_READ_RQBUFFER: {
- unsigned long *ver_addr;
- dma_addr_t buf_handle;
+ unsigned char *ver_addr;
uint8_t *pQbuffer, *ptmpQbuffer;
int32_t allxfer_len = 0;
- ver_addr = pci_alloc_consistent(acb->pdev, 1032, &buf_handle);
+ ver_addr = kmalloc(1032, GFP_ATOMIC);
if (!ver_addr) {
retvalue = ARCMSR_MESSAGE_FAIL;
goto message_out;
}
- ptmpQbuffer = (uint8_t *) ver_addr;
+ ptmpQbuffer = ver_addr;
while ((acb->rqbuf_firstindex != acb->rqbuf_lastindex)
&& (allxfer_len < 1031)) {
pQbuffer = &acb->rqbuffer[acb->rqbuf_firstindex];
@@ -1419,25 +1418,24 @@ static int arcmsr_iop_message_xfer(struc
}
arcmsr_iop_message_read(acb);
}
- memcpy(pcmdmessagefld->messagedatabuffer, (uint8_t *)ver_addr, allxfer_len);
+ memcpy(pcmdmessagefld->messagedatabuffer, ver_addr, allxfer_len);
pcmdmessagefld->cmdmessage.Length = allxfer_len;
pcmdmessagefld->cmdmessage.ReturnCode = ARCMSR_MESSAGE_RETURNCODE_OK;
- pci_free_consistent(acb->pdev, 1032, ver_addr, buf_handle);
+ kfree(ver_addr);
}
break;
case ARCMSR_MESSAGE_WRITE_WQBUFFER: {
- unsigned long *ver_addr;
- dma_addr_t buf_handle;
+ unsigned char *ver_addr;
int32_t my_empty_len, user_len, wqbuf_firstindex, wqbuf_lastindex;
uint8_t *pQbuffer, *ptmpuserbuffer;
- ver_addr = pci_alloc_consistent(acb->pdev, 1032, &buf_handle);
+ ver_addr = kmalloc(1032, GFP_ATOMIC);
if (!ver_addr) {
retvalue = ARCMSR_MESSAGE_FAIL;
goto message_out;
}
- ptmpuserbuffer = (uint8_t *)ver_addr;
+ ptmpuserbuffer = ver_addr;
user_len = pcmdmessagefld->cmdmessage.Length;
memcpy(ptmpuserbuffer, pcmdmessagefld->messagedatabuffer, user_len);
wqbuf_lastindex = acb->wqbuf_lastindex;
@@ -1483,7 +1481,7 @@ static int arcmsr_iop_message_xfer(struc
retvalue = ARCMSR_MESSAGE_FAIL;
}
}
- pci_free_consistent(acb->pdev, 1032, ver_addr, buf_handle);
+ kfree(ver_addr);
}
break;
--
^ permalink raw reply [flat|nested] 100+ messages in thread
* [patch 47/76] b43: Backport bcm4311 fix
2008-03-21 22:42 [patch 00/76] 2.6.24-stable review Chris Wright
` (45 preceding siblings ...)
2008-03-21 22:43 ` [patch 46/76] arcmsr: fix IRQs disabled warning spew Chris Wright
@ 2008-03-21 22:43 ` Chris Wright
2008-03-21 22:43 ` [patch 48/76] atmel_spi: fix clock polarity Chris Wright
` (30 subsequent siblings)
77 siblings, 0 replies; 100+ messages in thread
From: Chris Wright @ 2008-03-21 22:43 UTC (permalink / raw)
To: linux-kernel, stable
Cc: Justin Forbes, Zwane Mwaikambo, Theodore Ts'o, Randy Dunlap,
Dave Jones, Chuck Wolber, Chris Wedgwood, Michael Krufky,
Chuck Ebbert, Domenico Andreoli, torvalds, akpm, alan,
Michael Buesch, Greg KH, linux-wireless, bcm43xx-dev,
alexey.zaytsev, Larry Finger, John W. Linville,
Greg Kroah-Hartman
[-- Attachment #1: b43-backport-bcm4311-fix.patch --]
[-- Type: text/plain, Size: 4818 bytes --]
-stable review patch. If anyone has any objections, please let us know.
---------------------
From: Michael Buesch <mb@bu3sch.de>
This is a backport of upstream commit 013978b6 ("b43: Changes to enable
BCM4311 rev 02 with wireless core revision 13") and the changes include
the following:
(1) Add the 802.11 rev 13 device to the ssb_device_id table to load b43.
(2) Add PHY revision 9 to the supported list.
(3) Change the 2-bit routing code for address extensions to 0b10 rather
than the 0b01 used for the 32-bit case.
(4) Remove some magic numbers in the DMA setup.
The DMA implementation for this chip supports full 64-bit addressing with
one exception. Whenever the Descriptor Ring Buffer is in high memory, a
fatal DMA error occurs. This problem was not present in 2.6.24-rc2 due
to code to "Bias the placement of kernel pages at lower PFNs". When
commit 44048d70 reverted that code, the DMA error appeared. As a "fix",
use the GFP_DMA flag when allocating the buffer for 64-bit DMA. At present,
this problem is thought to arise from a hardware error.
Signed-off-by: Michael Buesch <mb@bu3sch.de>
Cc: Larry Finger <Larry.Finger@lwfinger.net>
Cc: John W. Linville <linville@tuxdriver.com>
Cc: Alexey Zaytsev <alexey.zaytsev@gmail.com>
Signed-off-by: Chris Wright <chrisw@sous-sol.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
---
drivers/net/wireless/b43/dma.c | 30 ++++++++++++++++++++++--------
drivers/net/wireless/b43/main.c | 3 ++-
2 files changed, 24 insertions(+), 9 deletions(-)
--- a/drivers/net/wireless/b43/dma.c
+++ b/drivers/net/wireless/b43/dma.c
@@ -165,7 +165,7 @@ static void op64_fill_descriptor(struct
addrhi = (((u64) dmaaddr >> 32) & ~SSB_DMA_TRANSLATION_MASK);
addrext = (((u64) dmaaddr >> 32) & SSB_DMA_TRANSLATION_MASK)
>> SSB_DMA_TRANSLATION_SHIFT;
- addrhi |= ssb_dma_translation(ring->dev->dev);
+ addrhi |= (ssb_dma_translation(ring->dev->dev) << 1);
if (slot == ring->nr_slots - 1)
ctl0 |= B43_DMA64_DCTL0_DTABLEEND;
if (start)
@@ -426,9 +426,21 @@ static inline
static int alloc_ringmemory(struct b43_dmaring *ring)
{
struct device *dev = ring->dev->dev->dev;
+ gfp_t flags = GFP_KERNEL;
+ /* The specs call for 4K buffers for 30- and 32-bit DMA with 4K
+ * alignment and 8K buffers for 64-bit DMA with 8K alignment. Testing
+ * has shown that 4K is sufficient for the latter as long as the buffer
+ * does not cross an 8K boundary.
+ *
+ * For unknown reasons - possibly a hardware error - the BCM4311 rev
+ * 02, which uses 64-bit DMA, needs the ring buffer in very low memory,
+ * which accounts for the GFP_DMA flag below.
+ */
+ if (ring->dma64)
+ flags |= GFP_DMA;
ring->descbase = dma_alloc_coherent(dev, B43_DMA_RINGMEMSIZE,
- &(ring->dmabase), GFP_KERNEL);
+ &(ring->dmabase), flags);
if (!ring->descbase) {
b43err(ring->dev->wl, "DMA ringmemory allocation failed\n");
return -ENOMEM;
@@ -483,7 +495,7 @@ int b43_dmacontroller_rx_reset(struct b4
return 0;
}
-/* Reset the RX DMA channel */
+/* Reset the TX DMA channel */
int b43_dmacontroller_tx_reset(struct b43_wldev *dev, u16 mmio_base, int dma64)
{
int i;
@@ -647,7 +659,7 @@ static int dmacontroller_setup(struct b4
b43_dma_write(ring, B43_DMA64_TXRINGHI,
((ringbase >> 32) &
~SSB_DMA_TRANSLATION_MASK)
- | trans);
+ | (trans << 1));
} else {
u32 ringbase = (u32) (ring->dmabase);
@@ -680,8 +692,9 @@ static int dmacontroller_setup(struct b4
b43_dma_write(ring, B43_DMA64_RXRINGHI,
((ringbase >> 32) &
~SSB_DMA_TRANSLATION_MASK)
- | trans);
- b43_dma_write(ring, B43_DMA64_RXINDEX, 200);
+ | (trans << 1));
+ b43_dma_write(ring, B43_DMA64_RXINDEX, ring->nr_slots *
+ sizeof(struct b43_dmadesc64));
} else {
u32 ringbase = (u32) (ring->dmabase);
@@ -695,11 +708,12 @@ static int dmacontroller_setup(struct b4
b43_dma_write(ring, B43_DMA32_RXRING,
(ringbase & ~SSB_DMA_TRANSLATION_MASK)
| trans);
- b43_dma_write(ring, B43_DMA32_RXINDEX, 200);
+ b43_dma_write(ring, B43_DMA32_RXINDEX, ring->nr_slots *
+ sizeof(struct b43_dmadesc32));
}
}
- out:
+out:
return err;
}
--- a/drivers/net/wireless/b43/main.c
+++ b/drivers/net/wireless/b43/main.c
@@ -101,6 +101,7 @@ static const struct ssb_device_id b43_ss
SSB_DEVICE(SSB_VENDOR_BROADCOM, SSB_DEV_80211, 7),
SSB_DEVICE(SSB_VENDOR_BROADCOM, SSB_DEV_80211, 9),
SSB_DEVICE(SSB_VENDOR_BROADCOM, SSB_DEV_80211, 10),
+ SSB_DEVICE(SSB_VENDOR_BROADCOM, SSB_DEV_80211, 13),
SSB_DEVTABLE_END
};
@@ -3079,7 +3080,7 @@ static int b43_phy_versioning(struct b43
unsupported = 1;
break;
case B43_PHYTYPE_G:
- if (phy_rev > 8)
+ if (phy_rev > 9)
unsupported = 1;
break;
default:
--
^ permalink raw reply [flat|nested] 100+ messages in thread
* [patch 48/76] atmel_spi: fix clock polarity
2008-03-21 22:42 [patch 00/76] 2.6.24-stable review Chris Wright
` (46 preceding siblings ...)
2008-03-21 22:43 ` [patch 47/76] b43: Backport bcm4311 fix Chris Wright
@ 2008-03-21 22:43 ` Chris Wright
2008-03-21 22:43 ` [patch 49/76] x86: move out tick_nohz_stop_sched_tick() call from the loop Chris Wright
` (29 subsequent siblings)
77 siblings, 0 replies; 100+ messages in thread
From: Chris Wright @ 2008-03-21 22:43 UTC (permalink / raw)
To: linux-kernel, stable
Cc: Justin Forbes, Zwane Mwaikambo, Theodore Ts'o, Randy Dunlap,
Dave Jones, Chuck Wolber, Chris Wedgwood, Michael Krufky,
Chuck Ebbert, Domenico Andreoli, torvalds, akpm, alan,
Haavard Skinnemoen, david-b, anemo, Greg Kroah-Hartman
[-- Attachment #1: atmel_spi-fix-clock-polarity.patch --]
[-- Type: text/plain, Size: 2335 bytes --]
-stable review patch. If anyone has any objections, please let us know.
---------------------
From: Atsushi Nemoto <anemo@mba.ocn.ne.jp>
The atmel_spi driver does not initialize clock polarity correctly (except for
at91rm9200 CS0 channel) in some case.
The atmel_spi driver uses gpio-controlled chipselect. OTOH spi clock signal
is controlled by CSRn.CPOL bit, but this register controls clock signal
correctly only in 'real transfer' duration. At the time of cs_activate()
call, CSRn.CPOL will be initialized correctly, but the controller do not know
which channel is to be used next, so clock signal will stay at the inactive
state of last transfer. If clock polarity of new transfer and last transfer
was differ, new transfer will start with wrong clock signal state.
For example, if you started SPI MODE 2 or 3 transfer after SPI MODE 0 or 1
transfer, the clock signal state at the assertion of chipselect will be low.
Of course this will violates SPI transfer.
This patch is short term solution for this problem. It makes all CSRn.CPOL
match for the transfer before activating chipselect. For longer term, the
best fix might be to let NPCS0 stay selected permanently in MR and overwrite
CSR0 with to the new slave's settings before asserting CS.
Signed-off-by: Atsushi Nemoto <anemo@mba.ocn.ne.jp>
Acked-by: Haavard Skinnemoen <hskinnemoen@atmel.com>
Cc: David Brownell <david-b@pacbell.net>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Chris Wright <chrisw@sous-sol.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
---
drivers/spi/atmel_spi.c | 10 ++++++++++
1 file changed, 10 insertions(+)
--- a/drivers/spi/atmel_spi.c
+++ b/drivers/spi/atmel_spi.c
@@ -85,6 +85,16 @@ static void cs_activate(struct atmel_spi
unsigned gpio = (unsigned) spi->controller_data;
unsigned active = spi->mode & SPI_CS_HIGH;
u32 mr;
+ int i;
+ u32 csr;
+ u32 cpol = (spi->mode & SPI_CPOL) ? SPI_BIT(CPOL) : 0;
+
+ /* Make sure clock polarity is correct */
+ for (i = 0; i < spi->master->num_chipselect; i++) {
+ csr = spi_readl(as, CSR0 + 4 * i);
+ if ((csr ^ cpol) & SPI_BIT(CPOL))
+ spi_writel(as, CSR0 + 4 * i, csr ^ SPI_BIT(CPOL));
+ }
mr = spi_readl(as, MR);
mr = SPI_BFINS(PCS, ~(1 << spi->chip_select), mr);
--
^ permalink raw reply [flat|nested] 100+ messages in thread
* [patch 49/76] x86: move out tick_nohz_stop_sched_tick() call from the loop
2008-03-21 22:42 [patch 00/76] 2.6.24-stable review Chris Wright
` (47 preceding siblings ...)
2008-03-21 22:43 ` [patch 48/76] atmel_spi: fix clock polarity Chris Wright
@ 2008-03-21 22:43 ` Chris Wright
2008-03-21 22:43 ` [patch 50/76] macb: Fix speed setting Chris Wright
` (28 subsequent siblings)
77 siblings, 0 replies; 100+ messages in thread
From: Chris Wright @ 2008-03-21 22:43 UTC (permalink / raw)
To: linux-kernel, stable
Cc: Justin Forbes, Zwane Mwaikambo, Theodore Ts'o, Randy Dunlap,
Dave Jones, Chuck Wolber, Chris Wedgwood, Michael Krufky,
Chuck Ebbert, Domenico Andreoli, torvalds, akpm, alan,
Hiroshi Shimamoto, Ingo Molnar, Thomas Gleixner, Ed Tomlinson,
Greg Kroah-Hartman
[-- Attachment #1: x86-move-out-tick_nohz_stop_sched_tick-call-from-the-loop.patch --]
[-- Type: text/plain, Size: 1130 bytes --]
-stable review patch. If anyone has any objections, please let us know.
---------------------
From: Hiroshi Shimamoto <h-shimamoto@ct.jp.nec.com>
[upstream commit: 3d97775a]
Move out tick_nohz_stop_sched_tick() call from the loop in cpu_idle
same as 32-bit version.
Signed-off-by: Hiroshi Shimamoto <h-shimamoto@ct.jp.nec.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Cc: Ed Tomlinson <edt@aei.ca>
Signed-off-by: Chris Wright <chrisw@sous-sol.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
---
arch/x86/kernel/process_64.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
--- a/arch/x86/kernel/process_64.c
+++ b/arch/x86/kernel/process_64.c
@@ -212,14 +212,13 @@ void cpu_idle (void)
current_thread_info()->status |= TS_POLLING;
/* endless idle loop with no priority at all */
while (1) {
+ tick_nohz_stop_sched_tick();
while (!need_resched()) {
void (*idle)(void);
if (__get_cpu_var(cpu_idle_state))
__get_cpu_var(cpu_idle_state) = 0;
- tick_nohz_stop_sched_tick();
-
rmb();
idle = pm_idle;
if (!idle)
--
^ permalink raw reply [flat|nested] 100+ messages in thread
* [patch 50/76] macb: Fix speed setting
2008-03-21 22:42 [patch 00/76] 2.6.24-stable review Chris Wright
` (48 preceding siblings ...)
2008-03-21 22:43 ` [patch 49/76] x86: move out tick_nohz_stop_sched_tick() call from the loop Chris Wright
@ 2008-03-21 22:43 ` Chris Wright
2008-03-21 22:43 ` [patch 51/76] ioat: fix ack handling, driver must ensure that ack is zero Chris Wright
` (27 subsequent siblings)
77 siblings, 0 replies; 100+ messages in thread
From: Chris Wright @ 2008-03-21 22:43 UTC (permalink / raw)
To: linux-kernel, stable
Cc: Justin Forbes, Zwane Mwaikambo, Theodore Ts'o, Randy Dunlap,
Dave Jones, Chuck Wolber, Chris Wedgwood, Michael Krufky,
Chuck Ebbert, Domenico Andreoli, torvalds, akpm, alan,
Haavard Skinnemoen, anemo, jeff, Greg Kroah-Hartman
[-- Attachment #1: macb-fix-speed-setting.patch --]
[-- Type: text/plain, Size: 880 bytes --]
-stable review patch. If anyone has any objections, please let us know.
---------------------
From: Atsushi Nemoto <anemo@mba.ocn.ne.jp>
Fix NCFGR.SPD setting on 10Mbps. This bug was introduced by
conversion to generic PHY layer in kernel 2.6.23.
Signed-off-by: Atsushi Nemoto <anemo@mba.ocn.ne.jp>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
Signed-off-by: Haavard Skinnemoen <hskinnemoen@atmel.com>
Signed-off-by: Chris Wright <chrisw@sous-sol.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
---
drivers/net/macb.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- a/drivers/net/macb.c
+++ b/drivers/net/macb.c
@@ -148,7 +148,7 @@ static void macb_handle_link_change(stru
if (phydev->duplex)
reg |= MACB_BIT(FD);
- if (phydev->speed)
+ if (phydev->speed == SPEED_100)
reg |= MACB_BIT(SPD);
macb_writel(bp, NCFGR, reg);
--
^ permalink raw reply [flat|nested] 100+ messages in thread
* [patch 51/76] ioat: fix ack handling, driver must ensure that ack is zero
2008-03-21 22:42 [patch 00/76] 2.6.24-stable review Chris Wright
` (49 preceding siblings ...)
2008-03-21 22:43 ` [patch 50/76] macb: Fix speed setting Chris Wright
@ 2008-03-21 22:43 ` Chris Wright
2008-03-21 22:43 ` [patch 52/76] eCryptfs: make ecryptfs_prepare_write decrypt the page Chris Wright
` (26 subsequent siblings)
77 siblings, 0 replies; 100+ messages in thread
From: Chris Wright @ 2008-03-21 22:43 UTC (permalink / raw)
To: linux-kernel, stable, jejb
Cc: Justin Forbes, Zwane Mwaikambo, Theodore Ts'o, Randy Dunlap,
Dave Jones, Chuck Wolber, Chris Wedgwood, Michael Krufky,
Chuck Ebbert, Domenico Andreoli, torvalds, akpm, alan,
Dan Williams, Shannon Nelson, Greg Kroah-Hartman
[-- Attachment #1: ioat-fix-ack-handling-driver-must-ensure-that-ack-is-zero.patch --]
[-- Type: text/plain, Size: 1002 bytes --]
-stable review patch. If anyone has any objections, please let us know.
---------------------
From: Dan Williams <dan.j.williams@intel.com>
Initialize 'ack' to zero in case the descriptor has been recycled.
Prevents "kernel BUG at crypto/async_tx/async_xor.c:185!"
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Acked-by: Shannon Nelson <shannon.nelson@intel.com>
[chrisw@sous-sol.org: backport to 2.6.24.3]
Signed-off-by: Chris Wright <chrisw@sous-sol.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
---
drivers/dma/ioat_dma.c | 2 ++
1 file changed, 2 insertions(+)
--- a/drivers/dma/ioat_dma.c
+++ b/drivers/dma/ioat_dma.c
@@ -726,6 +726,7 @@ static struct dma_async_tx_descriptor *i
if (new) {
new->len = len;
+ new->async_tx.ack = 0;
return &new->async_tx;
} else
return NULL;
@@ -749,6 +750,7 @@ static struct dma_async_tx_descriptor *i
if (new) {
new->len = len;
+ new->async_tx.ack = 0;
return &new->async_tx;
} else
return NULL;
--
^ permalink raw reply [flat|nested] 100+ messages in thread
* [patch 52/76] eCryptfs: make ecryptfs_prepare_write decrypt the page
2008-03-21 22:42 [patch 00/76] 2.6.24-stable review Chris Wright
` (50 preceding siblings ...)
2008-03-21 22:43 ` [patch 51/76] ioat: fix ack handling, driver must ensure that ack is zero Chris Wright
@ 2008-03-21 22:43 ` Chris Wright
2008-03-21 22:43 ` [patch 53/76] VT notifier fix for VT switch Chris Wright
` (25 subsequent siblings)
77 siblings, 0 replies; 100+ messages in thread
From: Chris Wright @ 2008-03-21 22:43 UTC (permalink / raw)
To: linux-kernel, stable, jejb
Cc: Justin Forbes, Zwane Mwaikambo, Theodore Ts'o, Randy Dunlap,
Dave Jones, Chuck Wolber, Chris Wedgwood, Michael Krufky,
Chuck Ebbert, Domenico Andreoli, torvalds, akpm, alan,
Michael Halcrow, Benedikt Driessen, Greg Kroah-Hartman
[-- Attachment #1: ecryptfs-make-ecryptfs_prepare_write-decrypt-the-page.patch --]
[-- Type: text/plain, Size: 5260 bytes --]
-stable review patch. If anyone has any objections, please let us know.
---------------------
From: Michael Halcrow <mhalcrow@us.ibm.com>
When the page is not up to date, ecryptfs_prepare_write() should be
acting much like ecryptfs_readpage(). This includes the painfully
obvious step of actually decrypting the page contents read from the
lower encrypted file.
Note that this patch resolves a bug in eCryptfs in 2.6.24 that one can
produce with these steps:
# mount -t ecryptfs /secret /secret
# echo "abc" > /secret/file.txt
# umount /secret
# mount -t ecryptfs /secret /secret
# echo "def" >> /secret/file.txt
# cat /secret/file.txt
Without this patch, the resulting data returned from cat is likely to
be something other than "abc\ndef\n".
(Thanks to Benedikt Driessen for reporting this.)
Signed-off-by: Michael Halcrow <mhalcrow@us.ibm.com>
Cc: Benedikt Driessen <bdriessen@escrypt.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
[chrisw@sous-sol.org: backport to 2.6.24.3]
Signed-off-by: Chris Wright <chrisw@sous-sol.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
---
fs/ecryptfs/mmap.c | 102 +++++++++++++++++++++++++++++++++++++++--------------
1 file changed, 76 insertions(+), 26 deletions(-)
--- a/fs/ecryptfs/mmap.c
+++ b/fs/ecryptfs/mmap.c
@@ -263,52 +263,102 @@ out:
return 0;
}
-/* This function must zero any hole we create */
+/**
+ * ecryptfs_prepare_write
+ * @file: The eCryptfs file
+ * @page: The eCryptfs page
+ * @from: The start byte from which we will write
+ * @to: The end byte to which we will write
+ *
+ * This function must zero any hole we create
+ *
+ * Returns zero on success; non-zero otherwise
+ */
static int ecryptfs_prepare_write(struct file *file, struct page *page,
unsigned from, unsigned to)
{
- int rc = 0;
loff_t prev_page_end_size;
+ int rc = 0;
if (!PageUptodate(page)) {
- rc = ecryptfs_read_lower_page_segment(page, page->index, 0,
- PAGE_CACHE_SIZE,
- page->mapping->host);
- if (rc) {
- printk(KERN_ERR "%s: Error attemping to read lower "
- "page segment; rc = [%d]\n", __FUNCTION__, rc);
- ClearPageUptodate(page);
- goto out;
- } else
+ struct ecryptfs_crypt_stat *crypt_stat =
+ &ecryptfs_inode_to_private(
+ file->f_path.dentry->d_inode)->crypt_stat;
+
+ if (!(crypt_stat->flags & ECRYPTFS_ENCRYPTED)
+ || (crypt_stat->flags & ECRYPTFS_NEW_FILE)) {
+ rc = ecryptfs_read_lower_page_segment(
+ page, page->index, 0, PAGE_CACHE_SIZE,
+ page->mapping->host);
+ if (rc) {
+ printk(KERN_ERR "%s: Error attemping to read "
+ "lower page segment; rc = [%d]\n",
+ __FUNCTION__, rc);
+ ClearPageUptodate(page);
+ goto out;
+ } else
+ SetPageUptodate(page);
+ } else if (crypt_stat->flags & ECRYPTFS_VIEW_AS_ENCRYPTED) {
+ if (crypt_stat->flags & ECRYPTFS_METADATA_IN_XATTR) {
+ rc = ecryptfs_copy_up_encrypted_with_header(
+ page, crypt_stat);
+ if (rc) {
+ printk(KERN_ERR "%s: Error attempting "
+ "to copy the encrypted content "
+ "from the lower file whilst "
+ "inserting the metadata from "
+ "the xattr into the header; rc "
+ "= [%d]\n", __FUNCTION__, rc);
+ ClearPageUptodate(page);
+ goto out;
+ }
+ SetPageUptodate(page);
+ } else {
+ rc = ecryptfs_read_lower_page_segment(
+ page, page->index, 0, PAGE_CACHE_SIZE,
+ page->mapping->host);
+ if (rc) {
+ printk(KERN_ERR "%s: Error reading "
+ "page; rc = [%d]\n",
+ __FUNCTION__, rc);
+ ClearPageUptodate(page);
+ goto out;
+ }
+ SetPageUptodate(page);
+ }
+ } else {
+ rc = ecryptfs_decrypt_page(page);
+ if (rc) {
+ printk(KERN_ERR "%s: Error decrypting page "
+ "at index [%ld]; rc = [%d]\n",
+ __FUNCTION__, page->index, rc);
+ ClearPageUptodate(page);
+ goto out;
+ }
SetPageUptodate(page);
+ }
}
-
prev_page_end_size = ((loff_t)page->index << PAGE_CACHE_SHIFT);
-
- /*
- * If creating a page or more of holes, zero them out via truncate.
- * Note, this will increase i_size.
- */
+ /* If creating a page or more of holes, zero them out via truncate.
+ * Note, this will increase i_size. */
if (page->index != 0) {
if (prev_page_end_size > i_size_read(page->mapping->host)) {
rc = ecryptfs_truncate(file->f_path.dentry,
prev_page_end_size);
if (rc) {
- printk(KERN_ERR "Error on attempt to "
+ printk(KERN_ERR "%s: Error on attempt to "
"truncate to (higher) offset [%lld];"
- " rc = [%d]\n", prev_page_end_size, rc);
+ " rc = [%d]\n", __FUNCTION__,
+ prev_page_end_size, rc);
goto out;
}
}
}
- /*
- * Writing to a new page, and creating a small hole from start of page?
- * Zero it out.
- */
- if ((i_size_read(page->mapping->host) == prev_page_end_size) &&
- (from != 0)) {
+ /* Writing to a new page, and creating a small hole from start
+ * of page? Zero it out. */
+ if ((i_size_read(page->mapping->host) == prev_page_end_size)
+ && (from != 0))
zero_user_page(page, 0, PAGE_CACHE_SIZE, KM_USER0);
- }
out:
return rc;
}
--
^ permalink raw reply [flat|nested] 100+ messages in thread
* [patch 53/76] VT notifier fix for VT switch
2008-03-21 22:42 [patch 00/76] 2.6.24-stable review Chris Wright
` (51 preceding siblings ...)
2008-03-21 22:43 ` [patch 52/76] eCryptfs: make ecryptfs_prepare_write decrypt the page Chris Wright
@ 2008-03-21 22:43 ` Chris Wright
2008-03-21 22:43 ` [patch 54/76] USB: ftdi_sio: Workaround for broken Matrix Orbital serial port Chris Wright
` (24 subsequent siblings)
77 siblings, 0 replies; 100+ messages in thread
From: Chris Wright @ 2008-03-21 22:43 UTC (permalink / raw)
To: linux-kernel, stable, jejb
Cc: Justin Forbes, Zwane Mwaikambo, Theodore Ts'o, Randy Dunlap,
Dave Jones, Chuck Wolber, Chris Wedgwood, Michael Krufky,
Chuck Ebbert, Domenico Andreoli, torvalds, akpm, alan,
Samuel Thibault, Greg Kroah-Hartman
[-- Attachment #1: vt-notifier-fix-for-vt-switch.patch --]
[-- Type: text/plain, Size: 1028 bytes --]
-stable review patch. If anyone has any objections, please let us know.
---------------------
From: Samuel Thibault <samuel.thibault@ens-lyon.org>
VT notifier callbacks need to be aware of console switches. This is already
partially done from console_callback(), but at that time fg_console, cursor
positions, etc. are not yet updated and hence screen readers fetch the old
values.
This adds an update notify after all of the values are updated in
redraw_screen(vc, 1).
Signed-off-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Chris Wright <chrisw@sous-sol.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
---
drivers/char/vt.c | 1 +
1 file changed, 1 insertion(+)
--- a/drivers/char/vt.c
+++ b/drivers/char/vt.c
@@ -702,6 +702,7 @@ void redraw_screen(struct vc_data *vc, i
if (is_switch) {
set_leds();
compute_shiftstate();
+ notify_update(vc);
}
}
--
^ permalink raw reply [flat|nested] 100+ messages in thread
* [patch 54/76] USB: ftdi_sio: Workaround for broken Matrix Orbital serial port
2008-03-21 22:42 [patch 00/76] 2.6.24-stable review Chris Wright
` (52 preceding siblings ...)
2008-03-21 22:43 ` [patch 53/76] VT notifier fix for VT switch Chris Wright
@ 2008-03-21 22:43 ` Chris Wright
2008-03-21 22:43 ` [patch 55/76] USB: ftdi_sio - really enable EM1010PC Chris Wright
` (23 subsequent siblings)
77 siblings, 0 replies; 100+ messages in thread
From: Chris Wright @ 2008-03-21 22:43 UTC (permalink / raw)
To: linux-kernel, stable, jejb
Cc: Justin Forbes, Zwane Mwaikambo, Theodore Ts'o, Randy Dunlap,
Dave Jones, Chuck Wolber, Chris Wedgwood, Michael Krufky,
Chuck Ebbert, Domenico Andreoli, torvalds, akpm, alan,
Kevin Vance, Greg Kroah-Hartman
[-- Attachment #1: usb-ftdi_sio-workaround-for-broken-matrix-orbital-serial-port.patch --]
[-- Type: text/plain, Size: 3057 bytes --]
-stable review patch. If anyone has any objections, please let us know.
---------------------
From: Kevin Vance <kvance@kvance.com>
Workaround for the FT232RL-based, Matrix Orbital VK204-25-USB serial port
added to the ftdi_sio driver.
The device has an invalid endpoint descriptor, which must be modified
before it can be used.
Signed-off-by: Kevin Vance <kvance@kvance.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
[chrisw@sous-sol.org: backport to 2.6.24.3 w/out ftdi_jtag_probe]
Signed-off-by: Chris Wright <chrisw@sous-sol.org>
---
drivers/usb/serial/ftdi_sio.c | 24 ++++++++++++++++++++++++
drivers/usb/serial/ftdi_sio.h | 7 +++++++
2 files changed, 31 insertions(+)
--- a/drivers/usb/serial/ftdi_sio.c
+++ b/drivers/usb/serial/ftdi_sio.c
@@ -310,6 +310,7 @@ struct ftdi_sio_quirk {
};
static int ftdi_olimex_probe (struct usb_serial *serial);
+static int ftdi_mtxorb_hack_setup (struct usb_serial *serial);
static void ftdi_USB_UIRT_setup (struct ftdi_private *priv);
static void ftdi_HE_TIRA1_setup (struct ftdi_private *priv);
@@ -317,6 +318,10 @@ static struct ftdi_sio_quirk ftdi_olimex
.probe = ftdi_olimex_probe,
};
+static struct ftdi_sio_quirk ftdi_mtxorb_hack_quirk = {
+ .probe = ftdi_mtxorb_hack_setup,
+};
+
static struct ftdi_sio_quirk ftdi_USB_UIRT_quirk = {
.port_probe = ftdi_USB_UIRT_setup,
};
@@ -379,6 +384,8 @@ static struct usb_device_id id_table_com
{ USB_DEVICE(FTDI_VID, FTDI_MTXORB_4_PID) },
{ USB_DEVICE(FTDI_VID, FTDI_MTXORB_5_PID) },
{ USB_DEVICE(FTDI_VID, FTDI_MTXORB_6_PID) },
+ { USB_DEVICE(MTXORB_VK_VID, MTXORB_VK_PID),
+ .driver_info = (kernel_ulong_t)&ftdi_mtxorb_hack_quirk },
{ USB_DEVICE(FTDI_VID, FTDI_PERLE_ULTRAPORT_PID) },
{ USB_DEVICE(FTDI_VID, FTDI_PIEGROUP_PID) },
{ USB_DEVICE(FTDI_VID, FTDI_TNC_X_PID) },
@@ -1301,6 +1308,23 @@ static int ftdi_olimex_probe(struct usb_
return 0;
}
+/*
+ * The Matrix Orbital VK204-25-USB has an invalid IN endpoint.
+ * We have to correct it if we want to read from it.
+ */
+static int ftdi_mtxorb_hack_setup(struct usb_serial *serial)
+{
+ struct usb_host_endpoint *ep = serial->dev->ep_in[1];
+ struct usb_endpoint_descriptor *ep_desc = &ep->desc;
+
+ if (ep->enabled && ep_desc->wMaxPacketSize == 0) {
+ ep_desc->wMaxPacketSize = 0x40;
+ info("Fixing invalid wMaxPacketSize on read pipe");
+ }
+
+ return 0;
+}
+
/* ftdi_shutdown is called from usbserial:usb_serial_disconnect
* it is called when the usb device is disconnected
*
--- a/drivers/usb/serial/ftdi_sio.h
+++ b/drivers/usb/serial/ftdi_sio.h
@@ -98,6 +98,13 @@
#define FTDI_MTXORB_5_PID 0xFA05 /* Matrix Orbital Product Id */
#define FTDI_MTXORB_6_PID 0xFA06 /* Matrix Orbital Product Id */
+/*
+ * The following are the values for the Matrix Orbital VK204-25-USB
+ * display, which use the FT232RL.
+ */
+#define MTXORB_VK_VID 0x1b3d
+#define MTXORB_VK_PID 0x0158
+
/* Interbiometrics USB I/O Board */
/* Developed for Interbiometrics by Rudolf Gugler */
#define INTERBIOMETRICS_VID 0x1209
--
^ permalink raw reply [flat|nested] 100+ messages in thread
* [patch 55/76] USB: ftdi_sio - really enable EM1010PC
2008-03-21 22:42 [patch 00/76] 2.6.24-stable review Chris Wright
` (53 preceding siblings ...)
2008-03-21 22:43 ` [patch 54/76] USB: ftdi_sio: Workaround for broken Matrix Orbital serial port Chris Wright
@ 2008-03-21 22:43 ` Chris Wright
2008-03-21 22:43 ` [patch 56/76] USB: ehci: handle large bulk URBs correctly (again) Chris Wright
` (22 subsequent siblings)
77 siblings, 0 replies; 100+ messages in thread
From: Chris Wright @ 2008-03-21 22:43 UTC (permalink / raw)
To: linux-kernel, stable, gregkh
Cc: Justin Forbes, Zwane Mwaikambo, Theodore Ts'o, Randy Dunlap,
Dave Jones, Chuck Wolber, Chris Wedgwood, Michael Krufky,
Chuck Ebbert, Domenico Andreoli, torvalds, akpm, alan,
Sven Andersen
[-- Attachment #1: usb-ftdi_sio-really-enable-em1010pc.patch --]
[-- Type: text/plain, Size: 1000 bytes --]
-stable review patch. If anyone has any objections, please let us know.
---------------------
From: Sven Andersen <s.andersen@cryonet.de>
[upstream commit: 4ae897df]
Add EM1010PC to ftdi_sio.c
Signed-off-by: Sven Andersen <s.andersen@cryonet.de>
Cc: stable <stable@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: Chris Wright <chrisw@sous-sol.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
---
drivers/usb/serial/ftdi_sio.c | 1 +
1 file changed, 1 insertion(+)
--- a/drivers/usb/serial/ftdi_sio.c
+++ b/drivers/usb/serial/ftdi_sio.c
@@ -499,6 +499,7 @@ static struct usb_device_id id_table_com
{ USB_DEVICE(FTDI_VID, FTDI_ELV_FS20SIG_PID) },
{ USB_DEVICE(FTDI_VID, FTDI_ELV_WS300PC_PID) },
{ USB_DEVICE(FTDI_VID, FTDI_ELV_FHZ1300PC_PID) },
+ { USB_DEVICE(FTDI_VID, FTDI_ELV_EM1010PC_PID) },
{ USB_DEVICE(FTDI_VID, FTDI_ELV_WS500_PID) },
{ USB_DEVICE(FTDI_VID, LINX_SDMUSBQSS_PID) },
{ USB_DEVICE(FTDI_VID, LINX_MASTERDEVEL2_PID) },
--
^ permalink raw reply [flat|nested] 100+ messages in thread
* [patch 56/76] USB: ehci: handle large bulk URBs correctly (again)
2008-03-21 22:42 [patch 00/76] 2.6.24-stable review Chris Wright
` (54 preceding siblings ...)
2008-03-21 22:43 ` [patch 55/76] USB: ftdi_sio - really enable EM1010PC Chris Wright
@ 2008-03-21 22:43 ` Chris Wright
2008-03-21 22:43 ` [patch 57/76] SCSI: fix BUG when sum(scatterlist) > bufflen Chris Wright
` (21 subsequent siblings)
77 siblings, 0 replies; 100+ messages in thread
From: Chris Wright @ 2008-03-21 22:43 UTC (permalink / raw)
To: linux-kernel, stable, jejb
Cc: Justin Forbes, Zwane Mwaikambo, Theodore Ts'o, Randy Dunlap,
Dave Jones, Chuck Wolber, Chris Wedgwood, Michael Krufky,
Chuck Ebbert, Domenico Andreoli, torvalds, akpm, alan,
Misha Zhilin, David Brownell, Alan Stern, Greg Kroah-Hartman
[-- Attachment #1: usb-ehci-handle-large-bulk-urbs-correctly.patch --]
[-- Type: text/plain, Size: 1347 bytes --]
-stable review patch. If anyone has any objections, please let us know.
---------------------
From: Misha Zhilin <misha@epiphan.com>
When use of urb->status in the EHCI driver was reworked last August
(commit 14c04c0f88f228fee1f412be91d6edcb935c78aa), a bug was inserted
in the handling of early completion for bulk transactions that need
more than one qTD (e.g. more than 20KB in one URB).
This patch resolves that problem by ensuring that the early completion
status is preserved until the URB is handed back to its submitter,
instead of resetting it after each qTD.
Signed-off-by: Misha Zhilin <misha@epiphan.com>
Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Acked-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: Chris Wright <chrisw@sous-sol.org>
---
drivers/usb/host/ehci-q.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- a/drivers/usb/host/ehci-q.c
+++ b/drivers/usb/host/ehci-q.c
@@ -315,10 +315,10 @@ qh_completions (struct ehci_hcd *ehci, s
if (likely (last->urb != urb)) {
ehci_urb_done(ehci, last->urb, last_status);
count++;
+ last_status = -EINPROGRESS;
}
ehci_qtd_free (ehci, last);
last = NULL;
- last_status = -EINPROGRESS;
}
/* ignore urbs submitted during completions we reported */
--
^ permalink raw reply [flat|nested] 100+ messages in thread
* [patch 57/76] SCSI: fix BUG when sum(scatterlist) > bufflen
2008-03-21 22:42 [patch 00/76] 2.6.24-stable review Chris Wright
` (55 preceding siblings ...)
2008-03-21 22:43 ` [patch 56/76] USB: ehci: handle large bulk URBs correctly (again) Chris Wright
@ 2008-03-21 22:43 ` Chris Wright
2008-03-21 22:43 ` [patch 58/76] x86: dont use P6_NOPs if compiling with CONFIG_X86_GENERIC Chris Wright
` (20 subsequent siblings)
77 siblings, 0 replies; 100+ messages in thread
From: Chris Wright @ 2008-03-21 22:43 UTC (permalink / raw)
To: linux-kernel, stable
Cc: Justin Forbes, Zwane Mwaikambo, Theodore Ts'o, Randy Dunlap,
Dave Jones, Chuck Wolber, Chris Wedgwood, Michael Krufky,
Chuck Ebbert, Domenico Andreoli, torvalds, akpm, alan,
James Bottomley, Tony Battersby, Mike Christie,
Greg Kroah-Hartman
[-- Attachment #1: scsi-fix-bug-when-sum-bufflen.patch --]
[-- Type: text/plain, Size: 1693 bytes --]
-stable review patch. If anyone has any objections, please let us know.
---------------------
From: Tony Battersby <tonyb@cybernetics.com>
When sending a SCSI command to a tape drive via the SCSI Generic (sg)
driver, if the command has a data transfer length more than
scatter_elem_sz (32 KB default) and not a multiple of 512, then I either
hit BUG_ON(!valid_dma_direction(direction)) in dma_unmap_sg() or else
the command never completes (depending on the LLDD).
When constructing scatterlists, the sg driver rounds up the scatterlist
element sizes to be a multiple of 512. This can result in
sum(scatterlist lengths) > bufflen. In this case, scsi_req_map_sg()
incorrectly sets bio->bi_size to sum(scatterlist lengths) rather than to
bufflen. When the command completes, req_bio_endio() detects that
bio->bi_size != 0, and so it doesn't call bio_endio(). This causes the
command to be resubmitted, resulting in BUG_ON or the command never
completing.
This patch makes scsi_req_map_sg() set bio->bi_size to bufflen rather
than to sum(scatterlist lengths), which fixes the problem.
Signed-off-by: Tony Battersby <tonyb@cybernetics.com>
Acked-by: Mike Christie <michaelc@cs.wisc.edu>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
Signed-off-by: Chris Wright <chrisw@sous-sol.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
---
drivers/scsi/scsi_lib.c | 1 -
1 file changed, 1 deletion(-)
--- a/drivers/scsi/scsi_lib.c
+++ b/drivers/scsi/scsi_lib.c
@@ -298,7 +298,6 @@ static int scsi_req_map_sg(struct reques
page = sg_page(sg);
off = sg->offset;
len = sg->length;
- data_len += len;
while (len > 0 && data_len > 0) {
/*
--
^ permalink raw reply [flat|nested] 100+ messages in thread
* [patch 58/76] x86: dont use P6_NOPs if compiling with CONFIG_X86_GENERIC
2008-03-21 22:42 [patch 00/76] 2.6.24-stable review Chris Wright
` (56 preceding siblings ...)
2008-03-21 22:43 ` [patch 57/76] SCSI: fix BUG when sum(scatterlist) > bufflen Chris Wright
@ 2008-03-21 22:43 ` Chris Wright
2008-03-21 22:43 ` [patch 59/76] Fix default compose table initialization Chris Wright
` (19 subsequent siblings)
77 siblings, 0 replies; 100+ messages in thread
From: Chris Wright @ 2008-03-21 22:43 UTC (permalink / raw)
To: linux-kernel, stable
Cc: Justin Forbes, Zwane Mwaikambo, Theodore Ts'o, Randy Dunlap,
Dave Jones, Chuck Wolber, Chris Wedgwood, Michael Krufky,
Chuck Ebbert, Domenico Andreoli, torvalds, akpm, alan,
H. Peter Anvin, Ingo Molnar, Thomas Gleixner, Greg Kroah-Hartman
[-- Attachment #1: x86-don-t-use-p6_nops-if-compiling-with-config_x86_generic.patch --]
[-- Type: text/plain, Size: 1570 bytes --]
-stable review patch. If anyone has any objections, please let us know.
---------------------
From: H. Peter Anvin <hpa@zytor.com>
x86: don't use P6_NOPs if compiling with CONFIG_X86_GENERIC
P6_NOPs are definitely not supported on some VIA CPUs, and possibly
(unverified) on AMD K7s. It is also the only thing that prevents a
686 kernel from running on Transmeta TM3x00/5x00 (Crusoe) series.
The performance benefit over generic NOPs is very small, so when
building for generic consumption, avoid using them.
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
[cebbert@redhat.com: backport take 2, with parens this time]
Signed-off-by: Chris Wright <chrisw@sous-sol.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
---
include/asm-x86/processor_32.h | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
--- a/include/asm-x86/processor_32.h
+++ b/include/asm-x86/processor_32.h
@@ -712,9 +712,10 @@ static inline unsigned int cpuid_edx(uns
#define ASM_NOP6 K7_NOP6
#define ASM_NOP7 K7_NOP7
#define ASM_NOP8 K7_NOP8
-#elif defined(CONFIG_M686) || defined(CONFIG_MPENTIUMII) || \
+#elif (defined(CONFIG_M686) || defined(CONFIG_MPENTIUMII) || \
defined(CONFIG_MPENTIUMIII) || defined(CONFIG_MPENTIUMM) || \
- defined(CONFIG_MCORE2) || defined(CONFIG_PENTIUM4)
+ defined(CONFIG_MCORE2) || defined(CONFIG_PENTIUM4)) && \
+ !defined(CONFIG_X86_GENERIC)
#define ASM_NOP1 P6_NOP1
#define ASM_NOP2 P6_NOP2
#define ASM_NOP3 P6_NOP3
--
^ permalink raw reply [flat|nested] 100+ messages in thread
* [patch 59/76] Fix default compose table initialization
2008-03-21 22:42 [patch 00/76] 2.6.24-stable review Chris Wright
` (57 preceding siblings ...)
2008-03-21 22:43 ` [patch 58/76] x86: dont use P6_NOPs if compiling with CONFIG_X86_GENERIC Chris Wright
@ 2008-03-21 22:43 ` Chris Wright
2008-03-21 22:43 ` [patch 60/76] SCSI: gdth: bugfix for the at-exit problems Chris Wright
` (18 subsequent siblings)
77 siblings, 0 replies; 100+ messages in thread
From: Chris Wright @ 2008-03-21 22:43 UTC (permalink / raw)
To: linux-kernel, stable, torvalds
Cc: Justin Forbes, Zwane Mwaikambo, Theodore Ts'o, Randy Dunlap,
Dave Jones, Chuck Wolber, Chris Wedgwood, Michael Krufky,
Chuck Ebbert, Domenico Andreoli, torvalds, akpm, alan,
Samuel Thibault, Tony Breeds, Greg Kroah-Hartman
[-- Attachment #1: fix-default-compose-table-initialization.patch --]
[-- Type: text/plain, Size: 7716 bytes --]
-stable review patch. If anyone has any objections, please let us know.
---------------------
From: Samuel Thibault <samuel.thibault@ens-lyon.org>
Oddly enough, unsigned int c = '\300'; puts a "negative" value in c, not
0300... This fixes the default unicode compose table by using integers
instead of character constants.
Signed-off-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Fold in upstream commit 10a7f3135ac4937a3dc8ed11614a2b70cbd44728 (Build
fix for drivers/s390/char/defkeymap.c) from Tony Breeds.
Commit 5ce2087ed0eb424e0889bdc9102727f65d2ecdde (Fix default compose
table initialization) left a trailing quote.
CC drivers/s390/char/defkeymap.o
drivers/s390/char/defkeymap.c:155: error: missing terminating ' character
drivers/s390/char/defkeymap.c:156: error: syntax error before ';' token
make[3]: *** [drivers/s390/char/defkeymap.o] Error 1
Fix that.
Signed-off-by: Tony Breeds <tony@bakeyournoodle.com>
Signed-off-by: Chris Wright <chrisw@sous-sol.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
---
drivers/acorn/char/defkeymap-l7200.c | 68 +++++++++++++++++------------------
drivers/char/defkeymap.c_shipped | 68 +++++++++++++++++------------------
drivers/s390/char/defkeymap.c | 4 +-
3 files changed, 70 insertions(+), 70 deletions(-)
--- a/drivers/acorn/char/defkeymap-l7200.c
+++ b/drivers/acorn/char/defkeymap-l7200.c
@@ -347,40 +347,40 @@ char *func_table[MAX_NR_FUNC] = {
};
struct kbdiacruc accent_table[MAX_DIACR] = {
- {'`', 'A', '\300'}, {'`', 'a', '\340'},
- {'\'', 'A', '\301'}, {'\'', 'a', '\341'},
- {'^', 'A', '\302'}, {'^', 'a', '\342'},
- {'~', 'A', '\303'}, {'~', 'a', '\343'},
- {'"', 'A', '\304'}, {'"', 'a', '\344'},
- {'O', 'A', '\305'}, {'o', 'a', '\345'},
- {'0', 'A', '\305'}, {'0', 'a', '\345'},
- {'A', 'A', '\305'}, {'a', 'a', '\345'},
- {'A', 'E', '\306'}, {'a', 'e', '\346'},
- {',', 'C', '\307'}, {',', 'c', '\347'},
- {'`', 'E', '\310'}, {'`', 'e', '\350'},
- {'\'', 'E', '\311'}, {'\'', 'e', '\351'},
- {'^', 'E', '\312'}, {'^', 'e', '\352'},
- {'"', 'E', '\313'}, {'"', 'e', '\353'},
- {'`', 'I', '\314'}, {'`', 'i', '\354'},
- {'\'', 'I', '\315'}, {'\'', 'i', '\355'},
- {'^', 'I', '\316'}, {'^', 'i', '\356'},
- {'"', 'I', '\317'}, {'"', 'i', '\357'},
- {'-', 'D', '\320'}, {'-', 'd', '\360'},
- {'~', 'N', '\321'}, {'~', 'n', '\361'},
- {'`', 'O', '\322'}, {'`', 'o', '\362'},
- {'\'', 'O', '\323'}, {'\'', 'o', '\363'},
- {'^', 'O', '\324'}, {'^', 'o', '\364'},
- {'~', 'O', '\325'}, {'~', 'o', '\365'},
- {'"', 'O', '\326'}, {'"', 'o', '\366'},
- {'/', 'O', '\330'}, {'/', 'o', '\370'},
- {'`', 'U', '\331'}, {'`', 'u', '\371'},
- {'\'', 'U', '\332'}, {'\'', 'u', '\372'},
- {'^', 'U', '\333'}, {'^', 'u', '\373'},
- {'"', 'U', '\334'}, {'"', 'u', '\374'},
- {'\'', 'Y', '\335'}, {'\'', 'y', '\375'},
- {'T', 'H', '\336'}, {'t', 'h', '\376'},
- {'s', 's', '\337'}, {'"', 'y', '\377'},
- {'s', 'z', '\337'}, {'i', 'j', '\377'},
+ {'`', 'A', 0300}, {'`', 'a', 0340},
+ {'\'', 'A', 0301}, {'\'', 'a', 0341},
+ {'^', 'A', 0302}, {'^', 'a', 0342},
+ {'~', 'A', 0303}, {'~', 'a', 0343},
+ {'"', 'A', 0304}, {'"', 'a', 0344},
+ {'O', 'A', 0305}, {'o', 'a', 0345},
+ {'0', 'A', 0305}, {'0', 'a', 0345},
+ {'A', 'A', 0305}, {'a', 'a', 0345},
+ {'A', 'E', 0306}, {'a', 'e', 0346},
+ {',', 'C', 0307}, {',', 'c', 0347},
+ {'`', 'E', 0310}, {'`', 'e', 0350},
+ {'\'', 'E', 0311}, {'\'', 'e', 0351},
+ {'^', 'E', 0312}, {'^', 'e', 0352},
+ {'"', 'E', 0313}, {'"', 'e', 0353},
+ {'`', 'I', 0314}, {'`', 'i', 0354},
+ {'\'', 'I', 0315}, {'\'', 'i', 0355},
+ {'^', 'I', 0316}, {'^', 'i', 0356},
+ {'"', 'I', 0317}, {'"', 'i', 0357},
+ {'-', 'D', 0320}, {'-', 'd', 0360},
+ {'~', 'N', 0321}, {'~', 'n', 0361},
+ {'`', 'O', 0322}, {'`', 'o', 0362},
+ {'\'', 'O', 0323}, {'\'', 'o', 0363},
+ {'^', 'O', 0324}, {'^', 'o', 0364},
+ {'~', 'O', 0325}, {'~', 'o', 0365},
+ {'"', 'O', 0326}, {'"', 'o', 0366},
+ {'/', 'O', 0330}, {'/', 'o', 0370},
+ {'`', 'U', 0331}, {'`', 'u', 0371},
+ {'\'', 'U', 0332}, {'\'', 'u', 0372},
+ {'^', 'U', 0333}, {'^', 'u', 0373},
+ {'"', 'U', 0334}, {'"', 'u', 0374},
+ {'\'', 'Y', 0335}, {'\'', 'y', 0375},
+ {'T', 'H', 0336}, {'t', 'h', 0376},
+ {'s', 's', 0337}, {'"', 'y', 0377},
+ {'s', 'z', 0337}, {'i', 'j', 0377},
};
unsigned int accent_table_size = 68;
--- a/drivers/char/defkeymap.c_shipped
+++ b/drivers/char/defkeymap.c_shipped
@@ -223,40 +223,40 @@ char *func_table[MAX_NR_FUNC] = {
};
struct kbdiacruc accent_table[MAX_DIACR] = {
- {'`', 'A', '\300'}, {'`', 'a', '\340'},
- {'\'', 'A', '\301'}, {'\'', 'a', '\341'},
- {'^', 'A', '\302'}, {'^', 'a', '\342'},
- {'~', 'A', '\303'}, {'~', 'a', '\343'},
- {'"', 'A', '\304'}, {'"', 'a', '\344'},
- {'O', 'A', '\305'}, {'o', 'a', '\345'},
- {'0', 'A', '\305'}, {'0', 'a', '\345'},
- {'A', 'A', '\305'}, {'a', 'a', '\345'},
- {'A', 'E', '\306'}, {'a', 'e', '\346'},
- {',', 'C', '\307'}, {',', 'c', '\347'},
- {'`', 'E', '\310'}, {'`', 'e', '\350'},
- {'\'', 'E', '\311'}, {'\'', 'e', '\351'},
- {'^', 'E', '\312'}, {'^', 'e', '\352'},
- {'"', 'E', '\313'}, {'"', 'e', '\353'},
- {'`', 'I', '\314'}, {'`', 'i', '\354'},
- {'\'', 'I', '\315'}, {'\'', 'i', '\355'},
- {'^', 'I', '\316'}, {'^', 'i', '\356'},
- {'"', 'I', '\317'}, {'"', 'i', '\357'},
- {'-', 'D', '\320'}, {'-', 'd', '\360'},
- {'~', 'N', '\321'}, {'~', 'n', '\361'},
- {'`', 'O', '\322'}, {'`', 'o', '\362'},
- {'\'', 'O', '\323'}, {'\'', 'o', '\363'},
- {'^', 'O', '\324'}, {'^', 'o', '\364'},
- {'~', 'O', '\325'}, {'~', 'o', '\365'},
- {'"', 'O', '\326'}, {'"', 'o', '\366'},
- {'/', 'O', '\330'}, {'/', 'o', '\370'},
- {'`', 'U', '\331'}, {'`', 'u', '\371'},
- {'\'', 'U', '\332'}, {'\'', 'u', '\372'},
- {'^', 'U', '\333'}, {'^', 'u', '\373'},
- {'"', 'U', '\334'}, {'"', 'u', '\374'},
- {'\'', 'Y', '\335'}, {'\'', 'y', '\375'},
- {'T', 'H', '\336'}, {'t', 'h', '\376'},
- {'s', 's', '\337'}, {'"', 'y', '\377'},
- {'s', 'z', '\337'}, {'i', 'j', '\377'},
+ {'`', 'A', 0300}, {'`', 'a', 0340},
+ {'\'', 'A', 0301}, {'\'', 'a', 0341},
+ {'^', 'A', 0302}, {'^', 'a', 0342},
+ {'~', 'A', 0303}, {'~', 'a', 0343},
+ {'"', 'A', 0304}, {'"', 'a', 0344},
+ {'O', 'A', 0305}, {'o', 'a', 0345},
+ {'0', 'A', 0305}, {'0', 'a', 0345},
+ {'A', 'A', 0305}, {'a', 'a', 0345},
+ {'A', 'E', 0306}, {'a', 'e', 0346},
+ {',', 'C', 0307}, {',', 'c', 0347},
+ {'`', 'E', 0310}, {'`', 'e', 0350},
+ {'\'', 'E', 0311}, {'\'', 'e', 0351},
+ {'^', 'E', 0312}, {'^', 'e', 0352},
+ {'"', 'E', 0313}, {'"', 'e', 0353},
+ {'`', 'I', 0314}, {'`', 'i', 0354},
+ {'\'', 'I', 0315}, {'\'', 'i', 0355},
+ {'^', 'I', 0316}, {'^', 'i', 0356},
+ {'"', 'I', 0317}, {'"', 'i', 0357},
+ {'-', 'D', 0320}, {'-', 'd', 0360},
+ {'~', 'N', 0321}, {'~', 'n', 0361},
+ {'`', 'O', 0322}, {'`', 'o', 0362},
+ {'\'', 'O', 0323}, {'\'', 'o', 0363},
+ {'^', 'O', 0324}, {'^', 'o', 0364},
+ {'~', 'O', 0325}, {'~', 'o', 0365},
+ {'"', 'O', 0326}, {'"', 'o', 0366},
+ {'/', 'O', 0330}, {'/', 'o', 0370},
+ {'`', 'U', 0331}, {'`', 'u', 0371},
+ {'\'', 'U', 0332}, {'\'', 'u', 0372},
+ {'^', 'U', 0333}, {'^', 'u', 0373},
+ {'"', 'U', 0334}, {'"', 'u', 0374},
+ {'\'', 'Y', 0335}, {'\'', 'y', 0375},
+ {'T', 'H', 0336}, {'t', 'h', 0376},
+ {'s', 's', 0337}, {'"', 'y', 0377},
+ {'s', 'z', 0337}, {'i', 'j', 0377},
};
unsigned int accent_table_size = 68;
--- a/drivers/s390/char/defkeymap.c
+++ b/drivers/s390/char/defkeymap.c
@@ -151,8 +151,8 @@ char *func_table[MAX_NR_FUNC] = {
};
struct kbdiacruc accent_table[MAX_DIACR] = {
- {'^', 'c', '\003'}, {'^', 'd', '\004'},
- {'^', 'z', '\032'}, {'^', '\012', '\000'},
+ {'^', 'c', 0003}, {'^', 'd', 0004},
+ {'^', 'z', 0032}, {'^', 0012, 0000},
};
unsigned int accent_table_size = 4;
--
^ permalink raw reply [flat|nested] 100+ messages in thread
* [patch 60/76] SCSI: gdth: bugfix for the at-exit problems
2008-03-21 22:42 [patch 00/76] 2.6.24-stable review Chris Wright
` (58 preceding siblings ...)
2008-03-21 22:43 ` [patch 59/76] Fix default compose table initialization Chris Wright
@ 2008-03-21 22:43 ` Chris Wright
2008-03-21 22:43 ` [patch 61/76] SCSI: gdth: fix to internal commands execution Chris Wright
` (17 subsequent siblings)
77 siblings, 0 replies; 100+ messages in thread
From: Chris Wright @ 2008-03-21 22:43 UTC (permalink / raw)
To: linux-kernel, stable, jejb
Cc: Justin Forbes, Zwane Mwaikambo, Theodore Ts'o, Randy Dunlap,
Dave Jones, Chuck Wolber, Chris Wedgwood, Michael Krufky,
Chuck Ebbert, Domenico Andreoli, torvalds, akpm, alan,
Boaz Harrosh, James Bottomley, Greg Kroah-Hartman
[-- Attachment #1: scsi-gdth-bugfix-for-the-at-exit-problems.patch --]
[-- Type: text/plain, Size: 4873 bytes --]
-stable review patch. If anyone has any objections, please let us know.
---------------------
From: Boaz Harrosh <bharrosh@panasas.com>
gdth_exit would first remove all cards then stop the timer
and would not sync with the timer function. This caused a crash
in gdth_timer() when module was unloaded.
So del_timer_sync the timer before we delete the cards.
also the reboot notifier function would crash. So clean
that up and fix the crashes.
Signed-off-by: Boaz Harrosh <bharrosh@panasas.com>
Tested-by: Joerg Dorchain: <joerg@dorchain.net>
Tested-by: Stefan Priebe <s.priebe@allied-internet.ag>
Tested-by: Jon Chelton <jchelton@ffpglobal.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
Signed-off-by: Chris Wright <chrisw@sous-sol.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
---
drivers/scsi/gdth.c | 82 +++++++++++++++++-----------------------------------
1 file changed, 28 insertions(+), 54 deletions(-)
--- a/drivers/scsi/gdth.c
+++ b/drivers/scsi/gdth.c
@@ -183,7 +183,6 @@ static int gdth_ioctl(struct inode *inod
unsigned int cmd, unsigned long arg);
static void gdth_flush(gdth_ha_str *ha);
-static int gdth_halt(struct notifier_block *nb, ulong event, void *buf);
static int gdth_queuecommand(Scsi_Cmnd *scp,void (*done)(Scsi_Cmnd *));
static int __gdth_queuecommand(gdth_ha_str *ha, struct scsi_cmnd *scp,
struct gdth_cmndinfo *cmndinfo);
@@ -418,12 +417,6 @@ static inline void gdth_set_sglist(struc
#include "gdth_proc.h"
#include "gdth_proc.c"
-/* notifier block to get a notify on system shutdown/halt/reboot */
-static struct notifier_block gdth_notifier = {
- gdth_halt, NULL, 0
-};
-static int notifier_disabled = 0;
-
static gdth_ha_str *gdth_find_ha(int hanum)
{
gdth_ha_str *ha;
@@ -3793,6 +3786,8 @@ static void gdth_timeout(ulong data)
gdth_ha_str *ha;
ulong flags;
+ BUG_ON(list_empty(&gdth_instances));
+
ha = list_first_entry(&gdth_instances, gdth_ha_str, list);
spin_lock_irqsave(&ha->smp_lock, flags);
@@ -4668,45 +4663,6 @@ static void gdth_flush(gdth_ha_str *ha)
}
}
-/* shutdown routine */
-static int gdth_halt(struct notifier_block *nb, ulong event, void *buf)
-{
- gdth_ha_str *ha;
-#ifndef __alpha__
- gdth_cmd_str gdtcmd;
- char cmnd[MAX_COMMAND_SIZE];
-#endif
-
- if (notifier_disabled)
- return NOTIFY_OK;
-
- TRACE2(("gdth_halt() event %d\n",(int)event));
- if (event != SYS_RESTART && event != SYS_HALT && event != SYS_POWER_OFF)
- return NOTIFY_DONE;
-
- notifier_disabled = 1;
- printk("GDT-HA: Flushing all host drives .. ");
- list_for_each_entry(ha, &gdth_instances, list) {
- gdth_flush(ha);
-
-#ifndef __alpha__
- /* controller reset */
- memset(cmnd, 0xff, MAX_COMMAND_SIZE);
- gdtcmd.BoardNode = LOCALBOARD;
- gdtcmd.Service = CACHESERVICE;
- gdtcmd.OpCode = GDT_RESET;
- TRACE2(("gdth_halt(): reset controller %d\n", ha->hanum));
- gdth_execute(ha->shost, &gdtcmd, cmnd, 10, NULL);
-#endif
- }
- printk("Done.\n");
-
-#ifdef GDTH_STATISTICS
- del_timer(&gdth_timer);
-#endif
- return NOTIFY_OK;
-}
-
/* configure lun */
static int gdth_slave_configure(struct scsi_device *sdev)
{
@@ -5141,13 +5097,13 @@ static void gdth_remove_one(gdth_ha_str
scsi_remove_host(shp);
+ gdth_flush(ha);
+
if (ha->sdev) {
scsi_free_host_dev(ha->sdev);
ha->sdev = NULL;
}
- gdth_flush(ha);
-
if (shp->irq)
free_irq(shp->irq,ha);
@@ -5173,6 +5129,24 @@ static void gdth_remove_one(gdth_ha_str
scsi_host_put(shp);
}
+static int gdth_halt(struct notifier_block *nb, ulong event, void *buf)
+{
+ gdth_ha_str *ha;
+
+ TRACE2(("gdth_halt() event %d\n", (int)event));
+ if (event != SYS_RESTART && event != SYS_HALT && event != SYS_POWER_OFF)
+ return NOTIFY_DONE;
+
+ list_for_each_entry(ha, &gdth_instances, list)
+ gdth_flush(ha);
+
+ return NOTIFY_OK;
+}
+
+static struct notifier_block gdth_notifier = {
+ gdth_halt, NULL, 0
+};
+
static int __init gdth_init(void)
{
if (disable) {
@@ -5235,7 +5209,6 @@ static int __init gdth_init(void)
add_timer(&gdth_timer);
#endif
major = register_chrdev(0,"gdth", &gdth_fops);
- notifier_disabled = 0;
register_reboot_notifier(&gdth_notifier);
gdth_polling = FALSE;
return 0;
@@ -5245,14 +5218,15 @@ static void __exit gdth_exit(void)
{
gdth_ha_str *ha;
- list_for_each_entry(ha, &gdth_instances, list)
- gdth_remove_one(ha);
+ unregister_chrdev(major, "gdth");
+ unregister_reboot_notifier(&gdth_notifier);
#ifdef GDTH_STATISTICS
- del_timer(&gdth_timer);
+ del_timer_sync(&gdth_timer);
#endif
- unregister_chrdev(major,"gdth");
- unregister_reboot_notifier(&gdth_notifier);
+
+ list_for_each_entry(ha, &gdth_instances, list)
+ gdth_remove_one(ha);
}
module_init(gdth_init);
--
^ permalink raw reply [flat|nested] 100+ messages in thread
* [patch 61/76] SCSI: gdth: fix to internal commands execution
2008-03-21 22:42 [patch 00/76] 2.6.24-stable review Chris Wright
` (59 preceding siblings ...)
2008-03-21 22:43 ` [patch 60/76] SCSI: gdth: bugfix for the at-exit problems Chris Wright
@ 2008-03-21 22:43 ` Chris Wright
2008-03-21 22:43 ` [patch 62/76] SCSI: mpt fusion: dont oops if NumPhys==0 Chris Wright
` (16 subsequent siblings)
77 siblings, 0 replies; 100+ messages in thread
From: Chris Wright @ 2008-03-21 22:43 UTC (permalink / raw)
To: linux-kernel, stable, jejb
Cc: Justin Forbes, Zwane Mwaikambo, Theodore Ts'o, Randy Dunlap,
Dave Jones, Chuck Wolber, Chris Wedgwood, Michael Krufky,
Chuck Ebbert, Domenico Andreoli, torvalds, akpm, alan,
Boaz Harrosh, James Bottomley, Greg Kroah-Hartman
[-- Attachment #1: scsi-gdth-fix-to-internal-commands-execution.patch --]
[-- Type: text/plain, Size: 7206 bytes --]
-stable review patch. If anyone has any objections, please let us know.
---------------------
From: Boaz Harrosh <bharrosh@panasas.com>
The recent patch named:
[SCSI] gdth: !use_sg cleanup and use of scsi accessors
has done a bad job in handling internal commands issued by gdth_execute().
Internal commands are issued with device gdth_cmd_str ready made directly
to the card, without any mapping or translations of scsi commands. So here
I added a gdth_cmd_str pointer to the gdth_cmndinfo private structure which
is then copied directly to host.
following this patch is a cleanup that removes the home cooked accessors
and reverts them to regular scsi_cmnd accessors. Since they are not used
anymore. After review maybe the 2 patches should be squashed together.
FIXME: There is still a problem with gdth_get_info(). as reported there
is a WARN_ON trigerd in dma_free_coherent() when doing:
$ cat /proc/sys/gdth/0
Signed-off-by: Boaz Harrosh <bharrosh@panasas.com>
Tested-by: Joerg Dorchain: <joerg@dorchain.net>
Tested-by: Stefan Priebe <s.priebe@allied-internet.ag>
Tested-by: Jon Chelton <jchelton@ffpglobal.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
Signed-off-by: Chris Wright <chrisw@sous-sol.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
---
drivers/scsi/gdth.c | 30 ++++++++++++------------------
drivers/scsi/gdth.h | 1 +
2 files changed, 13 insertions(+), 18 deletions(-)
--- a/drivers/scsi/gdth.c
+++ b/drivers/scsi/gdth.c
@@ -160,7 +160,7 @@ static void gdth_readapp_event(gdth_ha_s
static void gdth_clear_events(void);
static void gdth_copy_internal_data(gdth_ha_str *ha, Scsi_Cmnd *scp,
- char *buffer, ushort count, int to_buffer);
+ char *buffer, ushort count);
static int gdth_internal_cache_cmd(gdth_ha_str *ha, Scsi_Cmnd *scp);
static int gdth_fill_cache_cmd(gdth_ha_str *ha, Scsi_Cmnd *scp, ushort hdrive);
@@ -439,8 +439,8 @@ static struct gdth_cmndinfo *gdth_get_cm
for (i=0; i<GDTH_MAXCMDS; ++i) {
if (ha->cmndinfo[i].index == 0) {
priv = &ha->cmndinfo[i];
- priv->index = i+1;
memset(priv, 0, sizeof(*priv));
+ priv->index = i+1;
break;
}
}
@@ -487,7 +487,6 @@ int __gdth_execute(struct scsi_device *s
gdth_ha_str *ha = shost_priv(sdev->host);
Scsi_Cmnd *scp;
struct gdth_cmndinfo cmndinfo;
- struct scatterlist one_sg;
DECLARE_COMPLETION_ONSTACK(wait);
int rval;
@@ -501,13 +500,10 @@ int __gdth_execute(struct scsi_device *s
/* use request field to save the ptr. to completion struct. */
scp->request = (struct request *)&wait;
scp->timeout_per_command = timeout*HZ;
- sg_init_one(&one_sg, gdtcmd, sizeof(*gdtcmd));
- gdth_set_sglist(scp, &one_sg);
- gdth_set_sg_count(scp, 1);
- gdth_set_bufflen(scp, sizeof(*gdtcmd));
scp->cmd_len = 12;
memcpy(scp->cmnd, cmnd, 12);
cmndinfo.priority = IOCTL_PRI;
+ cmndinfo.internal_cmd_str = gdtcmd;
cmndinfo.internal_command = 1;
TRACE(("__gdth_execute() cmd 0x%x\n", scp->cmnd[0]));
@@ -2348,7 +2344,7 @@ static void gdth_next(gdth_ha_str *ha)
* buffers, kmap_atomic() as needed.
*/
static void gdth_copy_internal_data(gdth_ha_str *ha, Scsi_Cmnd *scp,
- char *buffer, ushort count, int to_buffer)
+ char *buffer, ushort count)
{
ushort cpcount,i, max_sg = gdth_sg_count(scp);
ushort cpsum,cpnow;
@@ -2374,10 +2370,7 @@ static void gdth_copy_internal_data(gdth
}
local_irq_save(flags);
address = kmap_atomic(sg_page(sl), KM_BIO_SRC_IRQ) + sl->offset;
- if (to_buffer)
- memcpy(buffer, address, cpnow);
- else
- memcpy(address, buffer, cpnow);
+ memcpy(address, buffer, cpnow);
flush_dcache_page(sg_page(sl));
kunmap_atomic(address, KM_BIO_SRC_IRQ);
local_irq_restore(flags);
@@ -2431,7 +2424,7 @@ static int gdth_internal_cache_cmd(gdth_
strcpy(inq.vendor,ha->oem_name);
sprintf(inq.product,"Host Drive #%02d",t);
strcpy(inq.revision," ");
- gdth_copy_internal_data(ha, scp, (char*)&inq, sizeof(gdth_inq_data), 0);
+ gdth_copy_internal_data(ha, scp, (char*)&inq, sizeof(gdth_inq_data));
break;
case REQUEST_SENSE:
@@ -2441,7 +2434,7 @@ static int gdth_internal_cache_cmd(gdth_
sd.key = NO_SENSE;
sd.info = 0;
sd.add_length= 0;
- gdth_copy_internal_data(ha, scp, (char*)&sd, sizeof(gdth_sense_data), 0);
+ gdth_copy_internal_data(ha, scp, (char*)&sd, sizeof(gdth_sense_data));
break;
case MODE_SENSE:
@@ -2453,7 +2446,7 @@ static int gdth_internal_cache_cmd(gdth_
mpd.bd.block_length[0] = (SECTOR_SIZE & 0x00ff0000) >> 16;
mpd.bd.block_length[1] = (SECTOR_SIZE & 0x0000ff00) >> 8;
mpd.bd.block_length[2] = (SECTOR_SIZE & 0x000000ff);
- gdth_copy_internal_data(ha, scp, (char*)&mpd, sizeof(gdth_modep_data), 0);
+ gdth_copy_internal_data(ha, scp, (char*)&mpd, sizeof(gdth_modep_data));
break;
case READ_CAPACITY:
@@ -2463,7 +2456,7 @@ static int gdth_internal_cache_cmd(gdth_
else
rdc.last_block_no = cpu_to_be32(ha->hdr[t].size-1);
rdc.block_length = cpu_to_be32(SECTOR_SIZE);
- gdth_copy_internal_data(ha, scp, (char*)&rdc, sizeof(gdth_rdcap_data), 0);
+ gdth_copy_internal_data(ha, scp, (char*)&rdc, sizeof(gdth_rdcap_data));
break;
case SERVICE_ACTION_IN:
@@ -2475,7 +2468,7 @@ static int gdth_internal_cache_cmd(gdth_
rdc16.last_block_no = cpu_to_be64(ha->hdr[t].size-1);
rdc16.block_length = cpu_to_be32(SECTOR_SIZE);
gdth_copy_internal_data(ha, scp, (char*)&rdc16,
- sizeof(gdth_rdcap16_data), 0);
+ sizeof(gdth_rdcap16_data));
} else {
scp->result = DID_ABORT << 16;
}
@@ -2845,6 +2838,7 @@ static int gdth_fill_raw_cmd(gdth_ha_str
static int gdth_special_cmd(gdth_ha_str *ha, Scsi_Cmnd *scp)
{
register gdth_cmd_str *cmdp;
+ struct gdth_cmndinfo *cmndinfo = gdth_cmnd_priv(scp);
int cmd_index;
cmdp= ha->pccb;
@@ -2853,7 +2847,7 @@ static int gdth_special_cmd(gdth_ha_str
if (ha->type==GDT_EISA && ha->cmd_cnt>0)
return 0;
- gdth_copy_internal_data(ha, scp, (char *)cmdp, sizeof(gdth_cmd_str), 1);
+ *cmdp = *cmndinfo->internal_cmd_str;
cmdp->RequestBuffer = scp;
/* search free command index */
--- a/drivers/scsi/gdth.h
+++ b/drivers/scsi/gdth.h
@@ -915,6 +915,7 @@ typedef struct {
struct gdth_cmndinfo { /* per-command private info */
int index;
int internal_command; /* don't call scsi_done */
+ gdth_cmd_str *internal_cmd_str; /* crier for internal messages*/
dma_addr_t sense_paddr; /* sense dma-addr */
unchar priority;
int timeout;
--
^ permalink raw reply [flat|nested] 100+ messages in thread
* [patch 62/76] SCSI: mpt fusion: dont oops if NumPhys==0
2008-03-21 22:42 [patch 00/76] 2.6.24-stable review Chris Wright
` (60 preceding siblings ...)
2008-03-21 22:43 ` [patch 61/76] SCSI: gdth: fix to internal commands execution Chris Wright
@ 2008-03-21 22:43 ` Chris Wright
2008-03-21 22:43 ` [patch 63/76] sched: fix race in schedule() Chris Wright
` (15 subsequent siblings)
77 siblings, 0 replies; 100+ messages in thread
From: Chris Wright @ 2008-03-21 22:43 UTC (permalink / raw)
To: linux-kernel, stable
Cc: Justin Forbes, Zwane Mwaikambo, Theodore Ts'o, Randy Dunlap,
Dave Jones, Chuck Wolber, Chris Wedgwood, Michael Krufky,
Chuck Ebbert, Domenico Andreoli, torvalds, akpm, alan,
Krzysztof Oledzki, Krzysztof Piotr Oledzki, Eric Moore,
James Bottomley, Greg Kroah-Hartman
[-- Attachment #1: scsi-mpt-fusion-don-t-oops-if-numphys-0.patch --]
[-- Type: text/plain, Size: 1047 bytes --]
-stable review patch. If anyone has any objections, please let us know.
---------------------
From: Krzysztof Oledzki <olel@ans.pl>
Don't oops if NumPhys==0, instead return -ENODEV.
This patch fixes http://bugzilla.kernel.org/show_bug.cgi?id=9909
Signed-off-by: Krzysztof Piotr Oledzki <ole@ans.pl>
Acked-by: Eric Moore <Eric.Moore@lsi.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
Signed-off-by: Chris Wright <chrisw@sous-sol.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
---
drivers/message/fusion/mptsas.c | 5 +++++
1 file changed, 5 insertions(+)
--- a/drivers/message/fusion/mptsas.c
+++ b/drivers/message/fusion/mptsas.c
@@ -1699,6 +1699,11 @@ mptsas_sas_expander_pg0(MPT_ADAPTER *ioc
if (error)
goto out_free_consistent;
+ if (!buffer->NumPhys) {
+ error = -ENODEV;
+ goto out_free_consistent;
+ }
+
/* save config data */
port_info->num_phys = buffer->NumPhys;
port_info->phy_info = kcalloc(port_info->num_phys,
--
^ permalink raw reply [flat|nested] 100+ messages in thread
* [patch 63/76] sched: fix race in schedule()
2008-03-21 22:42 [patch 00/76] 2.6.24-stable review Chris Wright
` (61 preceding siblings ...)
2008-03-21 22:43 ` [patch 62/76] SCSI: mpt fusion: dont oops if NumPhys==0 Chris Wright
@ 2008-03-21 22:43 ` Chris Wright
2008-03-21 22:43 ` [patch 64/76] nfsd: fix oops on access from high-numbered ports Chris Wright
` (14 subsequent siblings)
77 siblings, 0 replies; 100+ messages in thread
From: Chris Wright @ 2008-03-21 22:43 UTC (permalink / raw)
To: linux-kernel, stable
Cc: Justin Forbes, Zwane Mwaikambo, Theodore Ts'o, Randy Dunlap,
Dave Jones, Chuck Wolber, Chris Wedgwood, Michael Krufky,
Chuck Ebbert, Domenico Andreoli, torvalds, akpm, alan,
Hiroshi Shimamoto
[-- Attachment #1: sched-fix-race-in-schedule.patch --]
[-- Type: text/plain, Size: 4377 bytes --]
-stable review patch. If anyone has any objections, please let us know.
---------------------
From: Hiroshi Shimamoto <h-shimamoto@ct.jp.nec.com>
Fix a hard to trigger crash seen in the -rt kernel that also affects
the vanilla scheduler.
There is a race condition between schedule() and some dequeue/enqueue
functions; rt_mutex_setprio(), __setscheduler() and sched_move_task().
When scheduling to idle, idle_balance() is called to pull tasks from
other busy processor. It might drop the rq lock. It means that those 3
functions encounter on_rq=0 and running=1. The current task should be
put when running.
Here is a possible scenario:
CPU0 CPU1
| schedule()
| ->deactivate_task()
| ->idle_balance()
| -->load_balance_newidle()
rt_mutex_setprio() |
| --->double_lock_balance()
*get lock *rel lock
* on_rq=0, ruuning=1 |
* sched_class is changed |
*rel lock *get lock
: |
:
->put_prev_task_rt()
->pick_next_task_fair()
=> panic
The current process of CPU1(P1) is scheduling. Deactivated P1, and the
scheduler looks for another process on other CPU's runqueue because CPU1
will be idle. idle_balance(), load_balance_newidle() and
double_lock_balance() are called and double_lock_balance() could drop
the rq lock. On the other hand, CPU0 is trying to boost the priority of
P1. The result of boosting only P1's prio and sched_class are changed to
RT. The sched entities of P1 and P1's group are never put. It makes
cfs_rq invalid, because the cfs_rq has curr and no leaf, but
pick_next_task_fair() is called, then the kernel panics.
Signed-off-by: Hiroshi Shimamoto <h-shimamoto@ct.jp.nec.com>
Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
[chrisw@sous-sol.org: backport to 2.6.24.3]
Signed-off-by: Chris Wright <chrisw@sous-sol.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
---
kernel/sched.c | 36 ++++++++++++++++--------------------
1 file changed, 16 insertions(+), 20 deletions(-)
--- a/kernel/sched.c
+++ b/kernel/sched.c
@@ -4028,11 +4028,10 @@ void rt_mutex_setprio(struct task_struct
oldprio = p->prio;
on_rq = p->se.on_rq;
running = task_current(rq, p);
- if (on_rq) {
+ if (on_rq)
dequeue_task(rq, p, 0);
- if (running)
- p->sched_class->put_prev_task(rq, p);
- }
+ if (running)
+ p->sched_class->put_prev_task(rq, p);
if (rt_prio(prio))
p->sched_class = &rt_sched_class;
@@ -4041,9 +4040,9 @@ void rt_mutex_setprio(struct task_struct
p->prio = prio;
+ if (running)
+ p->sched_class->set_curr_task(rq);
if (on_rq) {
- if (running)
- p->sched_class->set_curr_task(rq);
enqueue_task(rq, p, 0);
/*
* Reschedule if we are currently running on this runqueue and
@@ -4339,18 +4338,17 @@ recheck:
update_rq_clock(rq);
on_rq = p->se.on_rq;
running = task_current(rq, p);
- if (on_rq) {
+ if (on_rq)
deactivate_task(rq, p, 0);
- if (running)
- p->sched_class->put_prev_task(rq, p);
- }
+ if (running)
+ p->sched_class->put_prev_task(rq, p);
oldprio = p->prio;
__setscheduler(rq, p, policy, param->sched_priority);
+ if (running)
+ p->sched_class->set_curr_task(rq);
if (on_rq) {
- if (running)
- p->sched_class->set_curr_task(rq);
activate_task(rq, p, 0);
/*
* Reschedule if we are currently running on this runqueue and
@@ -7110,19 +7108,17 @@ void sched_move_task(struct task_struct
running = task_current(rq, tsk);
on_rq = tsk->se.on_rq;
- if (on_rq) {
+ if (on_rq)
dequeue_task(rq, tsk, 0);
- if (unlikely(running))
- tsk->sched_class->put_prev_task(rq, tsk);
- }
+ if (unlikely(running))
+ tsk->sched_class->put_prev_task(rq, tsk);
set_task_cfs_rq(tsk, task_cpu(tsk));
- if (on_rq) {
- if (unlikely(running))
- tsk->sched_class->set_curr_task(rq);
+ if (unlikely(running))
+ tsk->sched_class->set_curr_task(rq);
+ if (on_rq)
enqueue_task(rq, tsk, 0);
- }
done:
task_rq_unlock(rq, &flags);
--
^ permalink raw reply [flat|nested] 100+ messages in thread
* [patch 64/76] nfsd: fix oops on access from high-numbered ports
2008-03-21 22:42 [patch 00/76] 2.6.24-stable review Chris Wright
` (62 preceding siblings ...)
2008-03-21 22:43 ` [patch 63/76] sched: fix race in schedule() Chris Wright
@ 2008-03-21 22:43 ` Chris Wright
2008-03-21 22:43 ` [patch 65/76] sched_nr_migrate wrong mode bits Chris Wright
` (13 subsequent siblings)
77 siblings, 0 replies; 100+ messages in thread
From: Chris Wright @ 2008-03-21 22:43 UTC (permalink / raw)
To: linux-kernel, stable
Cc: Justin Forbes, Zwane Mwaikambo, Theodore Ts'o, Randy Dunlap,
Dave Jones, Chuck Wolber, Chris Wedgwood, Michael Krufky,
Chuck Ebbert, Domenico Andreoli, torvalds, akpm, alan,
J. Bruce Fields, Lukas Hejtmanek, Greg Kroah-Hartman
[-- Attachment #1: nfsd-fix-oops-on-access-from-high-numbered-ports.patch --]
[-- Type: text/plain, Size: 1876 bytes --]
-stable review patch. If anyone has any objections, please let us know.
---------------------
From: J. Bruce Fields <bfields@citi.umich.edu>
This bug was always here, but before my commit 6fa02839bf9412e18e77
("recheck for secure ports in fh_verify"), it could only be triggered by
failure of a kmalloc(). After that commit it could be triggered by a
client making a request from a non-reserved port for access to an export
marked "secure". (Exports are "secure" by default.)
The result is a struct svc_export with a reference count one too low,
resulting in likely oopses next time the export is accessed.
The reference counting here is not straightforward; a later patch will
clean up fh_verify().
Thanks to Lukas Hejtmanek for the bug report and followup.
Signed-off-by: J. Bruce Fields <bfields@citi.umich.edu>
Cc: Lukas Hejtmanek <xhejtman@ics.muni.cz>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Chris Wright <chrisw@sous-sol.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
---
fs/nfsd/nfsfh.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
--- a/fs/nfsd/nfsfh.c
+++ b/fs/nfsd/nfsfh.c
@@ -231,6 +231,7 @@ fh_verify(struct svc_rqst *rqstp, struct
fhp->fh_dentry = dentry;
fhp->fh_export = exp;
nfsd_nr_verified++;
+ cache_get(&exp->h);
} else {
/*
* just rechecking permissions
@@ -240,6 +241,7 @@ fh_verify(struct svc_rqst *rqstp, struct
dprintk("nfsd: fh_verify - just checking\n");
dentry = fhp->fh_dentry;
exp = fhp->fh_export;
+ cache_get(&exp->h);
/*
* Set user creds for this exportpoint; necessary even
* in the "just checking" case because this may be a
@@ -251,8 +253,6 @@ fh_verify(struct svc_rqst *rqstp, struct
if (error)
goto out;
}
- cache_get(&exp->h);
-
error = nfsd_mode_check(rqstp, dentry->d_inode->i_mode, type);
if (error)
--
^ permalink raw reply [flat|nested] 100+ messages in thread
* [patch 65/76] sched_nr_migrate wrong mode bits
2008-03-21 22:42 [patch 00/76] 2.6.24-stable review Chris Wright
` (63 preceding siblings ...)
2008-03-21 22:43 ` [patch 64/76] nfsd: fix oops on access from high-numbered ports Chris Wright
@ 2008-03-21 22:43 ` Chris Wright
2008-03-21 22:43 ` [patch 66/76] NETFILTER: xt_time: fix failure to match on Sundays Chris Wright
` (12 subsequent siblings)
77 siblings, 0 replies; 100+ messages in thread
From: Chris Wright @ 2008-03-21 22:43 UTC (permalink / raw)
To: linux-kernel, stable
Cc: Justin Forbes, Zwane Mwaikambo, Theodore Ts'o, Randy Dunlap,
Dave Jones, Chuck Wolber, Chris Wedgwood, Michael Krufky,
Chuck Ebbert, Domenico Andreoli, torvalds, akpm, alan,
Michal Schmidt, Peter Zijlstra
[-- Attachment #1: sched_nr_migrate-wrong-mode-bits.patch --]
[-- Type: text/plain, Size: 1058 bytes --]
-stable review patch. If anyone has any objections, please let us know.
---------------------
From: Michal Schmidt <mschmidt@redhat.com>
sched_nr_migrate has strange permission bits:
$ ls -l /proc/sys/kernel/sched_nr_migrate
--w----r-T 1 root root 0 2008-03-17 23:31 /proc/sys/kernel/sched_nr_migrate
The bug is an obvious decimal/octal confusion.
Fixed (collaterally) in Linus's tree by Peter Zijlstra with commit fa85ae241
"sched: rt time limit" (in 2.6.25-rc1).
Signed-off-by: Michal Schmidt <mschmidt@redhat.com>
Acked-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
Signed-off-by: Chris Wright <chrisw@sous-sol.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
---
kernel/sysctl.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- a/kernel/sysctl.c
+++ b/kernel/sysctl.c
@@ -306,7 +306,7 @@ static struct ctl_table kern_table[] = {
.procname = "sched_nr_migrate",
.data = &sysctl_sched_nr_migrate,
.maxlen = sizeof(unsigned int),
- .mode = 644,
+ .mode = 0644,
.proc_handler = &proc_dointvec,
},
#endif
--
^ permalink raw reply [flat|nested] 100+ messages in thread
* [patch 66/76] NETFILTER: xt_time: fix failure to match on Sundays
2008-03-21 22:42 [patch 00/76] 2.6.24-stable review Chris Wright
` (64 preceding siblings ...)
2008-03-21 22:43 ` [patch 65/76] sched_nr_migrate wrong mode bits Chris Wright
@ 2008-03-21 22:43 ` Chris Wright
2008-03-21 22:43 ` [patch 67/76] NETFILTER: nfnetlink_queue: fix computation of allocated size for netlink skb Chris Wright
` (11 subsequent siblings)
77 siblings, 0 replies; 100+ messages in thread
From: Chris Wright @ 2008-03-21 22:43 UTC (permalink / raw)
To: linux-kernel, stable
Cc: Justin Forbes, Zwane Mwaikambo, Theodore Ts'o, Randy Dunlap,
Dave Jones, Chuck Wolber, Chris Wedgwood, Michael Krufky,
Chuck Ebbert, Domenico Andreoli, torvalds, akpm, alan,
Patrick McHardy, netfilter-devel, davem, Jan Engelhardt,
Greg Kroah-Hartman
[-- Attachment #1: netfilter-xt_time-fix-failure-to-match-on-sundays.patch --]
[-- Type: text/plain, Size: 1562 bytes --]
-stable review patch. If anyone has any objections, please let us know.
---------------------
From: Jan Engelhardt <jengelh@computergmbh.de>
Upstream commit 4f4c9430:
xt_time_match() in net/netfilter/xt_time.c in kernel 2.6.24 never
matches on Sundays. On my host I have a rule like
iptables -A OUTPUT -m time --weekdays Sun -j REJECT
and it never matches. The problem is in localtime_2(), which uses
r->weekday = (4 + r->dse) % 7;
to map the epoch day onto a weekday in {0,...,6}. In particular this
gives 0 for Sundays. But 0 has to be wrong; a weekday of 0 can never
match. xt_time_match() has
if (!(info->weekdays_match & (1 << current_time.weekday)))
return false;
and when current_time.weekday = 0, the result of the & is always
zero, even when info->weekdays_match = XT_TIME_ALL_WEEKDAYS = 0xFE.
Signed-off-by: Jan Engelhardt <jengelh@computergmbh.de>
Signed-off-by: Patrick McHardy <kaber@trash.net>
Signed-off-by: Chris Wright <chrisw@sous-sol.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
---
net/netfilter/xt_time.c | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
--- a/net/netfilter/xt_time.c
+++ b/net/netfilter/xt_time.c
@@ -95,8 +95,11 @@ static inline void localtime_2(struct xt
*/
r->dse = time / 86400;
- /* 1970-01-01 (w=0) was a Thursday (4). */
- r->weekday = (4 + r->dse) % 7;
+ /*
+ * 1970-01-01 (w=0) was a Thursday (4).
+ * -1 and +1 map Sunday properly onto 7.
+ */
+ r->weekday = (4 + r->dse - 1) % 7 + 1;
}
static void localtime_3(struct xtm *r, time_t time)
--
^ permalink raw reply [flat|nested] 100+ messages in thread
* [patch 67/76] NETFILTER: nfnetlink_queue: fix computation of allocated size for netlink skb
2008-03-21 22:42 [patch 00/76] 2.6.24-stable review Chris Wright
` (65 preceding siblings ...)
2008-03-21 22:43 ` [patch 66/76] NETFILTER: xt_time: fix failure to match on Sundays Chris Wright
@ 2008-03-21 22:43 ` Chris Wright
2008-03-21 22:43 ` [patch 68/76] NETFILTER: nfnetlink_log: fix computation of netlink skb size Chris Wright
` (10 subsequent siblings)
77 siblings, 0 replies; 100+ messages in thread
From: Chris Wright @ 2008-03-21 22:43 UTC (permalink / raw)
To: linux-kernel, stable
Cc: Justin Forbes, Zwane Mwaikambo, Theodore Ts'o, Randy Dunlap,
Dave Jones, Chuck Wolber, Chris Wedgwood, Michael Krufky,
Chuck Ebbert, Domenico Andreoli, torvalds, akpm, alan,
Patrick McHardy, netfilter-devel, davem, Eric Leblond,
Greg Kroah-Hartman
[-- Attachment #1: netfilter-nfnetlink_queue-fix-computation-of-allocated-size-for-netlink-skb.patch --]
[-- Type: text/plain, Size: 1273 bytes --]
-stable review patch. If anyone has any objections, please let us know.
---------------------
From: Eric Leblond <eric@inl.fr>
Upstream commit cabaa9bf:
Size of the netlink skb was wrongly computed because the formula was using
NLMSG_ALIGN instead of NLMSG_SPACE. NLMSG_ALIGN does not add the room for
netlink header as NLMSG_SPACE does. This was causing a failure of message
building in some cases.
On my test system, all messages for packets in range [8*k+41, 8*k+48] where k
is an integer were invalid and the corresponding packets were dropped.
Signed-off-by: Eric Leblond <eric@inl.fr>
Signed-off-by: Patrick McHardy <kaber@trash.net>
Signed-off-by: Chris Wright <chrisw@sous-sol.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
---
net/netfilter/nfnetlink_queue.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- a/net/netfilter/nfnetlink_queue.c
+++ b/net/netfilter/nfnetlink_queue.c
@@ -353,7 +353,7 @@ nfqnl_build_packet_message(struct nfqnl_
QDEBUG("entered\n");
- size = NLMSG_ALIGN(sizeof(struct nfgenmsg))
+ size = NLMSG_SPACE(sizeof(struct nfgenmsg))
+ nla_total_size(sizeof(struct nfqnl_msg_packet_hdr))
+ nla_total_size(sizeof(u_int32_t)) /* ifindex */
+ nla_total_size(sizeof(u_int32_t)) /* ifindex */
--
^ permalink raw reply [flat|nested] 100+ messages in thread
* [patch 68/76] NETFILTER: nfnetlink_log: fix computation of netlink skb size
2008-03-21 22:42 [patch 00/76] 2.6.24-stable review Chris Wright
` (66 preceding siblings ...)
2008-03-21 22:43 ` [patch 67/76] NETFILTER: nfnetlink_queue: fix computation of allocated size for netlink skb Chris Wright
@ 2008-03-21 22:43 ` Chris Wright
2008-03-21 22:43 ` [patch 69/76] zisofs: fix readpage() outside i_size Chris Wright
` (9 subsequent siblings)
77 siblings, 0 replies; 100+ messages in thread
From: Chris Wright @ 2008-03-21 22:43 UTC (permalink / raw)
To: linux-kernel, stable
Cc: Justin Forbes, Zwane Mwaikambo, Theodore Ts'o, Randy Dunlap,
Dave Jones, Chuck Wolber, Chris Wedgwood, Michael Krufky,
Chuck Ebbert, Domenico Andreoli, torvalds, akpm, alan,
Patrick McHardy, netfilter-devel, davem, Eric Leblond,
Greg Kroah-Hartman
[-- Attachment #1: netfilter-nfnetlink_log-fix-computation-of-netlink-skb-size.patch --]
[-- Type: text/plain, Size: 1140 bytes --]
-stable review patch. If anyone has any objections, please let us know.
---------------------
From: Eric Leblond <eric@inl.fr>
Upstream commit 7000d38d:
This patch is similar to nfnetlink_queue fixes. It fixes the computation
of skb size by using NLMSG_SPACE instead of NLMSG_ALIGN.
Signed-off-by: Eric Leblond <eric@inl.fr>
Signed-off-by: Patrick McHardy <kaber@trash.net>
Signed-off-by: Chris Wright <chrisw@sous-sol.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
---
net/netfilter/nfnetlink_log.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- a/net/netfilter/nfnetlink_log.c
+++ b/net/netfilter/nfnetlink_log.c
@@ -594,7 +594,7 @@ nfulnl_log_packet(unsigned int pf,
/* FIXME: do we want to make the size calculation conditional based on
* what is actually present? way more branches and checks, but more
* memory efficient... */
- size = NLMSG_ALIGN(sizeof(struct nfgenmsg))
+ size = NLMSG_SPACE(sizeof(struct nfgenmsg))
+ nla_total_size(sizeof(struct nfulnl_msg_packet_hdr))
+ nla_total_size(sizeof(u_int32_t)) /* ifindex */
+ nla_total_size(sizeof(u_int32_t)) /* ifindex */
--
^ permalink raw reply [flat|nested] 100+ messages in thread
* [patch 69/76] zisofs: fix readpage() outside i_size
2008-03-21 22:42 [patch 00/76] 2.6.24-stable review Chris Wright
` (67 preceding siblings ...)
2008-03-21 22:43 ` [patch 68/76] NETFILTER: nfnetlink_log: fix computation of netlink skb size Chris Wright
@ 2008-03-21 22:43 ` Chris Wright
2008-03-21 22:44 ` [patch 70/76] jbd2: correctly unescape journal data blocks Chris Wright
` (8 subsequent siblings)
77 siblings, 0 replies; 100+ messages in thread
From: Chris Wright @ 2008-03-21 22:43 UTC (permalink / raw)
To: linux-kernel, stable, jejb
Cc: Justin Forbes, Zwane Mwaikambo, Theodore Ts'o, Randy Dunlap,
Dave Jones, Chuck Wolber, Chris Wedgwood, Michael Krufky,
Chuck Ebbert, Domenico Andreoli, torvalds, akpm, alan, Dave Young,
Jan Kara, Greg Kroah-Hartman
[-- Attachment #1: zisofs-fix-readpage-outside-i_size.patch --]
[-- Type: text/plain, Size: 1488 bytes --]
-stable review patch. If anyone has any objections, please let us know.
---------------------
From: Dave Young <hidave.darkstar@gmail.com>
A read request outside i_size will be handled in do_generic_file_read(). So
we just return 0 to avoid getting -EIO as normal reading, let
do_generic_file_read do the rest.
At the same time we need unlock the page to avoid system stuck.
Fixes http://bugzilla.kernel.org/show_bug.cgi?id=10227
Signed-off-by: Dave Young <hidave.darkstar@gmail.com>
Acked-by: Jan Kara <jack@suse.cz>
Report-by: Christian Perle <chris@linuxinfotag.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Chris Wright <chrisw@sous-sol.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
---
fs/isofs/compress.c | 11 +++++++++++
1 file changed, 11 insertions(+)
--- a/fs/isofs/compress.c
+++ b/fs/isofs/compress.c
@@ -72,6 +72,17 @@ static int zisofs_readpage(struct file *
offset = index & ~zisofs_block_page_mask;
blockindex = offset >> zisofs_block_page_shift;
maxpage = (inode->i_size + PAGE_CACHE_SIZE - 1) >> PAGE_CACHE_SHIFT;
+
+ /*
+ * If this page is wholly outside i_size we just return zero;
+ * do_generic_file_read() will handle this for us
+ */
+ if (page->index >= maxpage) {
+ SetPageUptodate(page);
+ unlock_page(page);
+ return 0;
+ }
+
maxpage = min(zisofs_block_pages, maxpage-offset);
for ( i = 0 ; i < maxpage ; i++, offset++ ) {
--
^ permalink raw reply [flat|nested] 100+ messages in thread
* [patch 70/76] jbd2: correctly unescape journal data blocks
2008-03-21 22:42 [patch 00/76] 2.6.24-stable review Chris Wright
` (68 preceding siblings ...)
2008-03-21 22:43 ` [patch 69/76] zisofs: fix readpage() outside i_size Chris Wright
@ 2008-03-21 22:44 ` Chris Wright
2008-03-21 22:44 ` [patch 71/76] jbd: " Chris Wright
` (7 subsequent siblings)
77 siblings, 0 replies; 100+ messages in thread
From: Chris Wright @ 2008-03-21 22:44 UTC (permalink / raw)
To: linux-kernel, stable, jejb
Cc: Justin Forbes, Zwane Mwaikambo, Theodore Ts'o, Randy Dunlap,
Dave Jones, Chuck Wolber, Chris Wedgwood, Michael Krufky,
Chuck Ebbert, Domenico Andreoli, torvalds, akpm, alan,
Duane Griffin, Jan Kara, linux-ext4, Greg Kroah-Hartman
[-- Attachment #1: jbd2-correctly-unescape-journal-data-blocks.patch --]
[-- Type: text/plain, Size: 1350 bytes --]
-stable review patch. If anyone has any objections, please let us know.
---------------------
From: Duane Griffin <duaneg@dghda.com>
Fix a long-standing typo (predating git) that will cause data corruption if a
journal data block needs unescaping. At the moment the wrong buffer head's
data is being unescaped.
To test this case mount a filesystem with data=journal, start creating and
deleting a bunch of files containing only JBD2_MAGIC_NUMBER (0xc03b3998), then
pull the plug on the device. Without this patch the files will contain zeros
instead of the correct data after recovery.
Signed-off-by: Duane Griffin <duaneg@dghda.com>
Acked-by: Jan Kara <jack@suse.cz>
Cc: <linux-ext4@vger.kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Chris Wright <chrisw@sous-sol.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
---
fs/jbd2/recovery.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- a/fs/jbd2/recovery.c
+++ b/fs/jbd2/recovery.c
@@ -488,7 +488,7 @@ static int do_one_pass(journal_t *journa
memcpy(nbh->b_data, obh->b_data,
journal->j_blocksize);
if (flags & JBD2_FLAG_ESCAPE) {
- *((__be32 *)bh->b_data) =
+ *((__be32 *)nbh->b_data) =
cpu_to_be32(JBD2_MAGIC_NUMBER);
}
--
^ permalink raw reply [flat|nested] 100+ messages in thread
* [patch 71/76] jbd: correctly unescape journal data blocks
2008-03-21 22:42 [patch 00/76] 2.6.24-stable review Chris Wright
` (69 preceding siblings ...)
2008-03-21 22:44 ` [patch 70/76] jbd2: correctly unescape journal data blocks Chris Wright
@ 2008-03-21 22:44 ` Chris Wright
2008-03-21 22:44 ` [patch 72/76] aio: bad AIO race in aio_complete() leads to process hang Chris Wright
` (6 subsequent siblings)
77 siblings, 0 replies; 100+ messages in thread
From: Chris Wright @ 2008-03-21 22:44 UTC (permalink / raw)
To: linux-kernel, stable, jejb
Cc: Justin Forbes, Zwane Mwaikambo, Theodore Ts'o, Randy Dunlap,
Dave Jones, Chuck Wolber, Chris Wedgwood, Michael Krufky,
Chuck Ebbert, Domenico Andreoli, torvalds, akpm, alan,
Duane Griffin, Jan Kara, linux-ext4, Greg Kroah-Hartman
[-- Attachment #1: jbd-correctly-unescape-journal-data-blocks.patch --]
[-- Type: text/plain, Size: 1344 bytes --]
-stable review patch. If anyone has any objections, please let us know.
---------------------
From: Duane Griffin <duaneg@dghda.com>
Fix a long-standing typo (predating git) that will cause data corruption if a
journal data block needs unescaping. At the moment the wrong buffer head's
data is being unescaped.
To test this case mount a filesystem with data=journal, start creating and
deleting a bunch of files containing only JFS_MAGIC_NUMBER (0xc03b3998), then
pull the plug on the device. Without this patch the files will contain zeros
instead of the correct data after recovery.
Signed-off-by: Duane Griffin <duaneg@dghda.com>
Acked-by: Jan Kara <jack@suse.cz>
Cc: <linux-ext4@vger.kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Chris Wright <chrisw@sous-sol.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
---
fs/jbd/recovery.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- a/fs/jbd/recovery.c
+++ b/fs/jbd/recovery.c
@@ -478,7 +478,7 @@ static int do_one_pass(journal_t *journa
memcpy(nbh->b_data, obh->b_data,
journal->j_blocksize);
if (flags & JFS_FLAG_ESCAPE) {
- *((__be32 *)bh->b_data) =
+ *((__be32 *)nbh->b_data) =
cpu_to_be32(JFS_MAGIC_NUMBER);
}
--
^ permalink raw reply [flat|nested] 100+ messages in thread
* [patch 72/76] aio: bad AIO race in aio_complete() leads to process hang
2008-03-21 22:42 [patch 00/76] 2.6.24-stable review Chris Wright
` (70 preceding siblings ...)
2008-03-21 22:44 ` [patch 71/76] jbd: " Chris Wright
@ 2008-03-21 22:44 ` Chris Wright
2008-03-21 22:44 ` [patch 73/76] async_tx: avoid the async xor_zero_sum path when src_cnt > device->max_xor Chris Wright
` (5 subsequent siblings)
77 siblings, 0 replies; 100+ messages in thread
From: Chris Wright @ 2008-03-21 22:44 UTC (permalink / raw)
To: linux-kernel, stable, jejb
Cc: Justin Forbes, Zwane Mwaikambo, Theodore Ts'o, Randy Dunlap,
Dave Jones, Chuck Wolber, Chris Wedgwood, Michael Krufky,
Chuck Ebbert, Domenico Andreoli, torvalds, akpm, alan,
Quentin Barnes, Benjamin LaHaise, Nick Piggin, Greg Kroah-Hartman
[-- Attachment #1: aio-bad-aio-race-in-aio_complete-leads-to-process-hang.patch --]
[-- Type: text/plain, Size: 3347 bytes --]
-stable review patch. If anyone has any objections, please let us know.
---------------------
From: Quentin Barnes <qbarnes+linux@yahoo-inc.com>
My group ran into a AIO process hang on a 2.6.24 kernel with the process
sleeping indefinitely in io_getevents(2) waiting for the last wakeup to come
and it never would.
We ran the tests on x86_64 SMP. The hang only occurred on a Xeon box
("Clovertown") but not a Core2Duo ("Conroe"). On the Xeon, the L2 cache isn't
shared between all eight processors, but is L2 is shared between between all
two processors on the Core2Duo we use.
My analysis of the hang is if you go down to the second while-loop
in read_events(), what happens on processor #1:
1) add_wait_queue_exclusive() adds thread to ctx->wait
2) aio_read_evt() to check tail
3) if aio_read_evt() returned 0, call [io_]schedule() and sleep
In aio_complete() with processor #2:
A) info->tail = tail;
B) waitqueue_active(&ctx->wait)
C) if waitqueue_active() returned non-0, call wake_up()
The way the code is written, step 1 must be seen by all other processors
before processor 1 checks for pending events in step 2 (that were recorded by
step A) and step A by processor 2 must be seen by all other processors
(checked in step 2) before step B is done.
The race I believed I was seeing is that steps 1 and 2 were
effectively swapped due to the __list_add() being delayed by the L2
cache not shared by some of the other processors. Imagine:
proc 2: just before step A
proc 1, step 1: adds to ctx->wait, but is not visible by other processors yet
proc 1, step 2: checks tail and sees no pending events
proc 2, step A: updates tail
proc 1, step 3: calls [io_]schedule() and sleeps
proc 2, step B: checks ctx->wait, but sees no one waiting, skips wakeup
so proc 1 sleeps indefinitely
My patch adds a memory barrier between steps A and B. It ensures that the
update in step 1 gets seen on processor 2 before continuing. If processor 1
was just before step 1, the memory barrier makes sure that step A (update
tail) gets seen by the time processor 1 makes it to step 2 (check tail).
Before the patch our AIO process would hang virtually 100% of the time. After
the patch, we have yet to see the process ever hang.
Signed-off-by: Quentin Barnes <qbarnes+linux@yahoo-inc.com>
Reviewed-by: Zach Brown <zach.brown@oracle.com>
Cc: Benjamin LaHaise <bcrl@kvack.org>
Cc: <stable@kernel.org>
Cc: Nick Piggin <nickpiggin@yahoo.com.au>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
[ We should probably disallow that "if (waitqueue_active()) wake_up()"
coding pattern, because it's so often buggy wrt memory ordering ]
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Chris Wright <chrisw@sous-sol.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
---
fs/aio.c | 8 ++++++++
1 file changed, 8 insertions(+)
--- a/fs/aio.c
+++ b/fs/aio.c
@@ -997,6 +997,14 @@ put_rq:
/* everything turned out well, dispose of the aiocb. */
ret = __aio_put_req(ctx, iocb);
+ /*
+ * We have to order our ring_info tail store above and test
+ * of the wait list below outside the wait lock. This is
+ * like in wake_up_bit() where clearing a bit has to be
+ * ordered with the unlocked test.
+ */
+ smp_mb();
+
if (waitqueue_active(&ctx->wait))
wake_up(&ctx->wait);
--
^ permalink raw reply [flat|nested] 100+ messages in thread
* [patch 73/76] async_tx: avoid the async xor_zero_sum path when src_cnt > device->max_xor
2008-03-21 22:42 [patch 00/76] 2.6.24-stable review Chris Wright
` (71 preceding siblings ...)
2008-03-21 22:44 ` [patch 72/76] aio: bad AIO race in aio_complete() leads to process hang Chris Wright
@ 2008-03-21 22:44 ` Chris Wright
2008-03-21 22:44 ` [patch 74/76] SCSI advansys: Fix bug in AdvLoadMicrocode Chris Wright
` (4 subsequent siblings)
77 siblings, 0 replies; 100+ messages in thread
From: Chris Wright @ 2008-03-21 22:44 UTC (permalink / raw)
To: linux-kernel, stable, jejb
Cc: Justin Forbes, Zwane Mwaikambo, Theodore Ts'o, Randy Dunlap,
Dave Jones, Chuck Wolber, Chris Wedgwood, Michael Krufky,
Chuck Ebbert, Domenico Andreoli, torvalds, akpm, alan,
Dan Williams, Neil Brown, Greg Kroah-Hartman
[-- Attachment #1: async_tx-avoid-the-async-xor_zero_sum-path-when-src_cnt-device-max_xor.patch --]
[-- Type: text/plain, Size: 1030 bytes --]
-stable review patch. If anyone has any objections, please let us know.
---------------------
From: Dan Williams <dan.j.williams@intel.com>
If the channel cannot perform the operation in one call to
->device_prep_dma_zero_sum, then fallback to the xor+page_is_zero path.
This only affects users with arrays larger than 16 devices on iop13xx or
32 devices on iop3xx.
Cc: <stable@kernel.org>
Cc: Neil Brown <neilb@suse.de>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
[chrisw@sous-sol.org: backport to 2.6.24.3]
Signed-off-by: Chris Wright <chrisw@sous-sol.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
---
please verify the backport makes sense
crypto/async_tx/async_xor.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- a/crypto/async_tx/async_xor.c
+++ b/crypto/async_tx/async_xor.c
@@ -264,7 +264,7 @@ async_xor_zero_sum(struct page *dest, st
BUG_ON(src_cnt <= 1);
- if (tx) {
+ if (tx && src_cnt <= device->max_xor) {
dma_addr_t dma_addr;
enum dma_data_direction dir;
--
^ permalink raw reply [flat|nested] 100+ messages in thread
* [patch 74/76] SCSI advansys: Fix bug in AdvLoadMicrocode
2008-03-21 22:42 [patch 00/76] 2.6.24-stable review Chris Wright
` (72 preceding siblings ...)
2008-03-21 22:44 ` [patch 73/76] async_tx: avoid the async xor_zero_sum path when src_cnt > device->max_xor Chris Wright
@ 2008-03-21 22:44 ` Chris Wright
2008-03-21 22:44 ` [patch 75/76] BLUETOOTH: Fix bugs in previous conn add/del workqueue changes Chris Wright
` (3 subsequent siblings)
77 siblings, 0 replies; 100+ messages in thread
From: Chris Wright @ 2008-03-21 22:44 UTC (permalink / raw)
To: linux-kernel, stable, jejb
Cc: Justin Forbes, Zwane Mwaikambo, Theodore Ts'o, Randy Dunlap,
Dave Jones, Chuck Wolber, Chris Wedgwood, Michael Krufky,
Chuck Ebbert, Domenico Andreoli, torvalds, akpm, alan,
Matthew Wilcox, Matthew Wilcox, James Bottomley,
Greg Kroah-Hartman
[-- Attachment #1: scsi-advansys-fix-bug-in-advloadmicrocode.patch --]
[-- Type: text/plain, Size: 968 bytes --]
-stable review patch. If anyone has any objections, please let us know.
---------------------
From: Matthew Wilcox <matthew@wil.cx>
buf[i] can be up to 0xfd, so doubling it and assigning the result to an
unsigned char truncates the value. Just use an unsigned int instead;
it's only a temporary.
Signed-off-by: Matthew Wilcox <willy@linux.intel.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
Signed-off-by: Chris Wright <chrisw@sous-sol.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
---
drivers/scsi/advansys.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- a/drivers/scsi/advansys.c
+++ b/drivers/scsi/advansys.c
@@ -6439,7 +6439,7 @@ static int AdvLoadMicrocode(AdvPortAddr
i += 2;
len += 2;
} else {
- unsigned char off = buf[i] * 2;
+ unsigned int off = buf[i] * 2;
unsigned short word = (buf[off + 1] << 8) | buf[off];
AdvWriteWordAutoIncLram(iop_base, word);
len += 2;
--
^ permalink raw reply [flat|nested] 100+ messages in thread
* [patch 75/76] BLUETOOTH: Fix bugs in previous conn add/del workqueue changes.
2008-03-21 22:42 [patch 00/76] 2.6.24-stable review Chris Wright
` (73 preceding siblings ...)
2008-03-21 22:44 ` [patch 74/76] SCSI advansys: Fix bug in AdvLoadMicrocode Chris Wright
@ 2008-03-21 22:44 ` Chris Wright
2008-03-21 22:44 ` [patch 76/76] relay: fix subbuf_splice_actor() adding too many pages Chris Wright
` (2 subsequent siblings)
77 siblings, 0 replies; 100+ messages in thread
From: Chris Wright @ 2008-03-21 22:44 UTC (permalink / raw)
To: linux-kernel, stable
Cc: Justin Forbes, Zwane Mwaikambo, Theodore Ts'o, Randy Dunlap,
Dave Jones, Chuck Wolber, Chris Wedgwood, Michael Krufky,
Chuck Ebbert, Domenico Andreoli, torvalds, akpm, alan, Dave Young,
David S Miller, Greg Kroah-Hartman
[-- Attachment #1: bluetooth-fix-bugs-in-previous-conn-add-del-workqueue-changes.patch --]
[-- Type: text/plain, Size: 1667 bytes --]
-stable review patch. If anyone has any objections, please let us know.
---------------------
From: Dave Young <hidave.darkstar@gmail.com>
Jens Axboe noticed that we were queueing &conn->work on both btaddconn
and keventd_wq.
Signed-off-by: Dave Young <hidave.darkstar@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: Chris Wright <chrisw@sous-sol.org>
---
net/bluetooth/hci_sysfs.c | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
--- a/net/bluetooth/hci_sysfs.c
+++ b/net/bluetooth/hci_sysfs.c
@@ -282,6 +282,7 @@ static void add_conn(struct work_struct
int i;
flush_workqueue(btdelconn);
+
if (device_add(&conn->dev) < 0) {
BT_ERR("Failed to register connection device");
return;
@@ -317,7 +318,6 @@ void hci_conn_add_sysfs(struct hci_conn
INIT_WORK(&conn->work, add_conn);
queue_work(btaddconn, &conn->work);
- schedule_work(&conn->work);
}
static int __match_tty(struct device *dev, void *data)
@@ -354,7 +354,6 @@ void hci_conn_del_sysfs(struct hci_conn
INIT_WORK(&conn->work, del_conn);
queue_work(btdelconn, &conn->work);
- schedule_work(&conn->work);
}
int hci_register_sysfs(struct hci_dev *hdev)
@@ -408,6 +407,7 @@ int __init bt_sysfs_init(void)
err = -ENOMEM;
goto out;
}
+
btdelconn = create_singlethread_workqueue("btdelconn");
if (!btdelconn) {
err = -ENOMEM;
@@ -447,8 +447,12 @@ out:
void bt_sysfs_cleanup(void)
{
destroy_workqueue(btaddconn);
+
destroy_workqueue(btdelconn);
+
class_destroy(bt_class);
+
bus_unregister(&bt_bus);
+
platform_device_unregister(bt_platform);
}
--
^ permalink raw reply [flat|nested] 100+ messages in thread
* [patch 76/76] relay: fix subbuf_splice_actor() adding too many pages
2008-03-21 22:42 [patch 00/76] 2.6.24-stable review Chris Wright
` (74 preceding siblings ...)
2008-03-21 22:44 ` [patch 75/76] BLUETOOTH: Fix bugs in previous conn add/del workqueue changes Chris Wright
@ 2008-03-21 22:44 ` Chris Wright
2008-03-22 1:02 ` [patch 00/76] 2.6.24-stable review Joe Korty
2008-03-22 18:28 ` Chris Wright
77 siblings, 0 replies; 100+ messages in thread
From: Chris Wright @ 2008-03-21 22:44 UTC (permalink / raw)
To: linux-kernel, stable
Cc: Justin Forbes, Zwane Mwaikambo, Theodore Ts'o, Randy Dunlap,
Dave Jones, Chuck Wolber, Chris Wedgwood, Michael Krufky,
Chuck Ebbert, Domenico Andreoli, torvalds, akpm, alan, Jens Axboe,
Greg Kroah-Hartman
[-- Attachment #1: relay-fix-subbuf_splice_actor-adding-too-many-pages.patch --]
[-- Type: text/plain, Size: 1446 bytes --]
-stable review patch. If anyone has any objections, please let us know.
---------------------
From: Jens Axboe <jens.axboe@oracle.com>
If subbuf_pages was larger than the max number of pages the pipe
buffer will hold, subbuf_splice_actor() would happily go beyond
the array size.
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: Chris Wright <chrisw@sous-sol.org>
---
kernel/relay.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
--- a/kernel/relay.c
+++ b/kernel/relay.c
@@ -1072,7 +1072,7 @@ static int subbuf_splice_actor(struct fi
unsigned int flags,
int *nonpad_ret)
{
- unsigned int pidx, poff, total_len, subbuf_pages, ret;
+ unsigned int pidx, poff, total_len, subbuf_pages, nr_pages, ret;
struct rchan_buf *rbuf = in->private_data;
unsigned int subbuf_size = rbuf->chan->subbuf_size;
uint64_t pos = (uint64_t) *ppos;
@@ -1103,8 +1103,9 @@ static int subbuf_splice_actor(struct fi
subbuf_pages = rbuf->chan->alloc_size >> PAGE_SHIFT;
pidx = (read_start / PAGE_SIZE) % subbuf_pages;
poff = read_start & ~PAGE_MASK;
+ nr_pages = min_t(unsigned int, subbuf_pages, PIPE_BUFFERS);
- for (total_len = 0; spd.nr_pages < subbuf_pages; spd.nr_pages++) {
+ for (total_len = 0; spd.nr_pages < nr_pages; spd.nr_pages++) {
unsigned int this_len, this_end, private;
unsigned int cur_pos = read_start + total_len;
--
^ permalink raw reply [flat|nested] 100+ messages in thread
* Re: [patch 07/76] NIU: Bump driver version and release date.
2008-03-21 22:42 ` [patch 07/76] NIU: Bump driver version and release date Chris Wright
@ 2008-03-22 0:10 ` Jesper Juhl
2008-03-22 0:14 ` David Miller
0 siblings, 1 reply; 100+ messages in thread
From: Jesper Juhl @ 2008-03-22 0:10 UTC (permalink / raw)
To: Chris Wright
Cc: linux-kernel, stable, Justin Forbes, Zwane Mwaikambo,
Theodore Ts'o, Randy Dunlap, Dave Jones, Chuck Wolber,
Chris Wedgwood, Michael Krufky, Chuck Ebbert, Domenico Andreoli,
torvalds, akpm, alan, David S. Miller, Greg Kroah-Hartman
On 21/03/2008, Chris Wright <chrisw@sous-sol.org> wrote:
> -stable review patch. If anyone has any objections, please let us know.
> ---------------------
>
I don't see how this one fits this criteria from
Documentation/stable_kernel_rules.txt :
...
- It must fix a real bug that bothers people (not a, "This could be a
problem..." type thing).
...
As I see it, this patch is quite trivial and does not fix any "real problem".
How come this is suitable for -stable?
I have no objections to the patch "as such", I just don't think it
makes sense for -stable.
> From: David S. Miller <davem@davemloft.net>
>
> Upstream commit: a442585952f137bd4cdb1f2f3166e4157d383b82
>
> Signed-off-by: David S. Miller <davem@davemloft.net>
> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
> Signed-off-by: Chris Wright <chrisw@sous-sol.org>
>
> ---
> drivers/net/niu.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> --- a/drivers/net/niu.c
> +++ b/drivers/net/niu.c
> @@ -33,8 +33,8 @@
>
> #define DRV_MODULE_NAME "niu"
> #define PFX DRV_MODULE_NAME ": "
> -#define DRV_MODULE_VERSION "0.6"
> -#define DRV_MODULE_RELDATE "January 5, 2008"
> +#define DRV_MODULE_VERSION "0.7"
> +#define DRV_MODULE_RELDATE "February 18, 2008"
>
> static char version[] __devinitdata =
> DRV_MODULE_NAME ".c:v" DRV_MODULE_VERSION " (" DRV_MODULE_RELDATE ")\n";
>
--
Jesper Juhl <jesper.juhl@gmail.com>
Don't top-post http://www.catb.org/~esr/jargon/html/T/top-post.html
Plain text mails only, please http://www.expita.com/nomime.html
^ permalink raw reply [flat|nested] 100+ messages in thread
* Re: [patch 07/76] NIU: Bump driver version and release date.
2008-03-22 0:10 ` Jesper Juhl
@ 2008-03-22 0:14 ` David Miller
2008-03-22 0:16 ` Jesper Juhl
` (2 more replies)
0 siblings, 3 replies; 100+ messages in thread
From: David Miller @ 2008-03-22 0:14 UTC (permalink / raw)
To: jesper.juhl
Cc: chrisw, linux-kernel, stable, jmforbes, zwane, tytso, rdunlap,
davej, chuckw, reviews, mkrufky, cebbert, cavokz, torvalds, akpm,
alan, gregkh
From: "Jesper Juhl" <jesper.juhl@gmail.com>
Date: Sat, 22 Mar 2008 01:10:40 +0100
> As I see it, this patch is quite trivial and does not fix any "real problem".
> How come this is suitable for -stable?
>
> I have no objections to the patch "as such", I just don't think it
> makes sense for -stable.
It makes a difference for driver maintainers when users
report bugs and we ask them for the version printed
by the driver so that we know which fixes have been
applied.
You know, if people are going to be jerky about this,
I'll just include the version bump in the actual bug
fixes which I sometimes do anyways.
Thanks for bringing this up, it's a useful use of
everyone's time :-/
^ permalink raw reply [flat|nested] 100+ messages in thread
* Re: [patch 07/76] NIU: Bump driver version and release date.
2008-03-22 0:14 ` David Miller
@ 2008-03-22 0:16 ` Jesper Juhl
2008-03-26 21:28 ` Jesper Juhl
2008-03-22 2:35 ` Roland Dreier
2008-03-22 22:57 ` Pekka Enberg
2 siblings, 1 reply; 100+ messages in thread
From: Jesper Juhl @ 2008-03-22 0:16 UTC (permalink / raw)
To: David Miller
Cc: chrisw, linux-kernel, stable, jmforbes, zwane, tytso, rdunlap,
davej, chuckw, reviews, mkrufky, cebbert, cavokz, torvalds, akpm,
alan, gregkh
On 22/03/2008, David Miller <davem@davemloft.net> wrote:
> From: "Jesper Juhl" <jesper.juhl@gmail.com>
> Date: Sat, 22 Mar 2008 01:10:40 +0100
>
>
> > As I see it, this patch is quite trivial and does not fix any "real problem".
> > How come this is suitable for -stable?
> >
> > I have no objections to the patch "as such", I just don't think it
> > makes sense for -stable.
>
>
> It makes a difference for driver maintainers when users
> report bugs and we ask them for the version printed
> by the driver so that we know which fixes have been
> applied.
>
Ok, fair enough.
> You know, if people are going to be jerky about this,
> I'll just include the version bump in the actual bug
> fixes which I sometimes do anyways.
>
> Thanks for bringing this up, it's a useful use of
> everyone's time :-/
>
Excuse me for reading patches, trying to spot problems and thinking
about where they are applied and what rules apply etc.
--
Jesper Juhl <jesper.juhl@gmail.com>
Don't top-post http://www.catb.org/~esr/jargon/html/T/top-post.html
Plain text mails only, please http://www.expita.com/nomime.html
^ permalink raw reply [flat|nested] 100+ messages in thread
* Re: [patch 00/76] 2.6.24-stable review
2008-03-21 22:42 [patch 00/76] 2.6.24-stable review Chris Wright
` (75 preceding siblings ...)
2008-03-21 22:44 ` [patch 76/76] relay: fix subbuf_splice_actor() adding too many pages Chris Wright
@ 2008-03-22 1:02 ` Joe Korty
2008-03-22 18:26 ` Chris Wright
2008-03-22 18:28 ` Chris Wright
77 siblings, 1 reply; 100+ messages in thread
From: Joe Korty @ 2008-03-22 1:02 UTC (permalink / raw)
To: Chris Wright
Cc: linux-kernel, stable, Justin Forbes, Zwane Mwaikambo,
Theodore Ts'o, Randy Dunlap, Dave Jones, Chuck Wolber,
Chris Wedgwood, Michael Krufky, Chuck Ebbert, Domenico Andreoli,
torvalds, akpm, alan
On Fri, Mar 21, 2008 at 03:42:50PM -0700, Chris Wright wrote:
> This is the start of the stable review cycle for the 2.6.24.4 release.
Hi Chris,
The below is also a candidate for 2.6.24.4. It should apply cleanly.
Joe
Gitweb: http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=6d2144d355d2a532e5cc3fc12a6ba2a8d4ef15e4
Commit: 6d2144d355d2a532e5cc3fc12a6ba2a8d4ef15e4
Parent: b6210386787728b84db25adc4f1eba70440a4c73
Author: Joe Korty <joe.korty@ccur.com>
AuthorDate: Wed Mar 5 15:04:59 2008 -0800
Committer: Christoph Lameter <clameter@sgi.com>
CommitDate: Thu Mar 6 16:21:50 2008 -0800
slab: NUMA slab allocator migration bugfix
NUMA slab allocator cpu migration bugfix
The NUMA slab allocator (specifically, cache_alloc_refill)
is not refreshing its local copies of what cpu and what
numa node it is on, when it drops and reacquires the irq
block that it inherited from its caller. As a result
those values become invalid if an attempt to migrate the
process to another numa node occured while the irq block
had been dropped.
The solution is to make cache_alloc_refill reload these
variables whenever it drops and reacquires the irq block.
The error is very difficult to hit. When it does occur,
one gets the following oops + stack traceback bits in
check_spinlock_acquired:
kernel BUG at mm/slab.c:2417
cache_alloc_refill+0xe6
kmem_cache_alloc+0xd0
...
This patch was developed against 2.6.23, ported to and
compiled-tested only against 2.6.25-rc4.
Signed-off-by: Joe Korty <joe.korty@ccur.com>
Signed-off-by: Christoph Lameter <clameter@sgi.com>
---
mm/slab.c | 5 ++---
1 files changed, 2 insertions(+), 3 deletions(-)
diff --git a/mm/slab.c b/mm/slab.c
index f7faff7..e6c698f 100644
--- a/mm/slab.c
+++ b/mm/slab.c
@@ -2964,11 +2964,10 @@ static void *cache_alloc_refill(struct kmem_cache *cachep, gfp_t flags)
struct array_cache *ac;
int node;
- node = numa_node_id();
-
+retry:
check_irq_off();
+ node = numa_node_id();
ac = cpu_cache_get(cachep);
-retry:
batchcount = ac->batchcount;
if (!ac->touched && batchcount > BATCHREFILL_LIMIT) {
/*
^ permalink raw reply related [flat|nested] 100+ messages in thread
* Re: [patch 07/76] NIU: Bump driver version and release date.
2008-03-22 0:14 ` David Miller
2008-03-22 0:16 ` Jesper Juhl
@ 2008-03-22 2:35 ` Roland Dreier
2008-03-22 5:21 ` David Miller
2008-03-22 22:57 ` Pekka Enberg
2 siblings, 1 reply; 100+ messages in thread
From: Roland Dreier @ 2008-03-22 2:35 UTC (permalink / raw)
To: David Miller
Cc: jesper.juhl, chrisw, linux-kernel, stable, jmforbes, zwane, tytso,
rdunlap, davej, chuckw, reviews, mkrufky, cebbert, cavokz,
torvalds, akpm, alan, gregkh
> It makes a difference for driver maintainers when users
> report bugs and we ask them for the version printed
> by the driver so that we know which fixes have been
> applied.
I'm not sure if this series of patches really accomplishes that...
you're leaving out some patches such as "[NIU]: Fix 1G PHY link state
handling." that are in the real 0.7. So the 2.6.24.stable version 0.7
has a different set of fixes than the 2.6.25 version 0.7.
- R.
^ permalink raw reply [flat|nested] 100+ messages in thread
* Re: [patch 07/76] NIU: Bump driver version and release date.
2008-03-22 2:35 ` Roland Dreier
@ 2008-03-22 5:21 ` David Miller
2008-03-22 22:46 ` David Miller
0 siblings, 1 reply; 100+ messages in thread
From: David Miller @ 2008-03-22 5:21 UTC (permalink / raw)
To: rdreier
Cc: jesper.juhl, chrisw, linux-kernel, stable, jmforbes, zwane, tytso,
rdunlap, davej, chuckw, reviews, mkrufky, cebbert, cavokz,
torvalds, akpm, alan, gregkh
From: Roland Dreier <rdreier@cisco.com>
Date: Fri, 21 Mar 2008 19:35:40 -0700
> > It makes a difference for driver maintainers when users
> > report bugs and we ask them for the version printed
> > by the driver so that we know which fixes have been
> > applied.
>
> I'm not sure if this series of patches really accomplishes that...
> you're leaving out some patches such as "[NIU]: Fix 1G PHY link state
> handling." that are in the real 0.7. So the 2.6.24.stable version 0.7
> has a different set of fixes than the 2.6.25 version 0.7.
That was an oversight and not intentional, thanks for
for catching that.
^ permalink raw reply [flat|nested] 100+ messages in thread
* Re: [patch 33/76] futex: runtime enable pi and robust functionality
2008-03-21 22:43 ` [patch 33/76] futex: runtime enable pi and robust functionality Chris Wright
@ 2008-03-22 7:37 ` Thomas Gleixner
2008-03-22 16:19 ` Heiko Carstens
2008-03-22 22:05 ` David Miller
2008-03-27 3:28 ` Benjamin Herrenschmidt
1 sibling, 2 replies; 100+ messages in thread
From: Thomas Gleixner @ 2008-03-22 7:37 UTC (permalink / raw)
To: Chris Wright
Cc: linux-kernel, stable, jejb, Justin Forbes, Zwane Mwaikambo,
Theodore Ts'o, Randy Dunlap, Dave Jones, Chuck Wolber,
Chris Wedgwood, Michael Krufky, Chuck Ebbert, Domenico Andreoli,
torvalds, akpm, alan, Ingo Molnar, Lennert Buytenhek, Riku Voipio,
Greg Kroah-Hartman
On Fri, 21 Mar 2008, Chris Wright wrote:
> -stable review patch. If anyone has any objections, please let us know.
> ---------------------
For this one you need the S390 fixes:
504e75d0ed3389747e40a4aaa4b1f4e569576665
Author: Heiko Carstens <heiko.carstens@de.ibm.com>
Date: Thu Mar 20 17:33:38 2008 +0100
[S390] futex: let futex_atomic_cmpxchg_pt survive early functional tests.
commit d5b02b3ff1d9a2e1074f559c84ed378cfa6fc3c0
Author: Heiko Carstens <heiko.carstens@de.ibm.com>
Date: Tue Feb 19 15:29:34 2008 +0100
[S390] Fix futex_atomic_cmpxchg_std inline assembly.
Thanks,
tglx
^ permalink raw reply [flat|nested] 100+ messages in thread
* Re: [patch 33/76] futex: runtime enable pi and robust functionality
2008-03-22 7:37 ` Thomas Gleixner
@ 2008-03-22 16:19 ` Heiko Carstens
2008-03-22 18:27 ` Chris Wright
2008-03-22 22:05 ` David Miller
1 sibling, 1 reply; 100+ messages in thread
From: Heiko Carstens @ 2008-03-22 16:19 UTC (permalink / raw)
To: Thomas Gleixner
Cc: Chris Wright, linux-kernel, stable, jejb, Justin Forbes,
Zwane Mwaikambo, Theodore Ts'o, Randy Dunlap, Dave Jones,
Chuck Wolber, Chris Wedgwood, Michael Krufky, Chuck Ebbert,
Domenico Andreoli, torvalds, akpm, alan, Ingo Molnar,
Lennert Buytenhek, Riku Voipio, Greg Kroah-Hartman
On Sat, Mar 22, 2008 at 08:37:07AM +0100, Thomas Gleixner wrote:
> On Fri, 21 Mar 2008, Chris Wright wrote:
>
> > -stable review patch. If anyone has any objections, please let us know.
> > ---------------------
>
> For this one you need the S390 fixes:
>
> 504e75d0ed3389747e40a4aaa4b1f4e569576665
> Author: Heiko Carstens <heiko.carstens@de.ibm.com>
> Date: Thu Mar 20 17:33:38 2008 +0100
>
> [S390] futex: let futex_atomic_cmpxchg_pt survive early functional tests.
Yes, forgot to add -stable to the cc list. Sorry.
> commit d5b02b3ff1d9a2e1074f559c84ed378cfa6fc3c0
> Author: Heiko Carstens <heiko.carstens@de.ibm.com>
> Date: Tue Feb 19 15:29:34 2008 +0100
>
> [S390] Fix futex_atomic_cmpxchg_std inline assembly.
This one is already in 2.6.24.3.
^ permalink raw reply [flat|nested] 100+ messages in thread
* Re: [patch 00/76] 2.6.24-stable review
2008-03-22 1:02 ` [patch 00/76] 2.6.24-stable review Joe Korty
@ 2008-03-22 18:26 ` Chris Wright
0 siblings, 0 replies; 100+ messages in thread
From: Chris Wright @ 2008-03-22 18:26 UTC (permalink / raw)
To: Joe Korty
Cc: Chris Wright, linux-kernel, stable, Justin Forbes,
Zwane Mwaikambo, Theodore Ts'o, Randy Dunlap, Dave Jones,
Chuck Wolber, Chris Wedgwood, Michael Krufky, Chuck Ebbert,
Domenico Andreoli, torvalds, akpm, alan
* Joe Korty (joe.korty@ccur.com) wrote:
> The below is also a candidate for 2.6.24.4. It should apply cleanly.
>
> Gitweb: http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=6d2144d355d2a532e5cc3fc12a6ba2a8d4ef15e4
> Commit: 6d2144d355d2a532e5cc3fc12a6ba2a8d4ef15e4
> Parent: b6210386787728b84db25adc4f1eba70440a4c73
> Author: Joe Korty <joe.korty@ccur.com>
> AuthorDate: Wed Mar 5 15:04:59 2008 -0800
> Committer: Christoph Lameter <clameter@sgi.com>
> CommitDate: Thu Mar 6 16:21:50 2008 -0800
>
> slab: NUMA slab allocator migration bugfix
Got it, thanks.
-chris
^ permalink raw reply [flat|nested] 100+ messages in thread
* Re: [patch 33/76] futex: runtime enable pi and robust functionality
2008-03-22 16:19 ` Heiko Carstens
@ 2008-03-22 18:27 ` Chris Wright
0 siblings, 0 replies; 100+ messages in thread
From: Chris Wright @ 2008-03-22 18:27 UTC (permalink / raw)
To: Heiko Carstens
Cc: Thomas Gleixner, Chris Wright, linux-kernel, stable, jejb,
Justin Forbes, Zwane Mwaikambo, Theodore Ts'o, Randy Dunlap,
Dave Jones, Chuck Wolber, Chris Wedgwood, Michael Krufky,
Chuck Ebbert, Domenico Andreoli, torvalds, akpm, alan,
Ingo Molnar, Lennert Buytenhek, Riku Voipio, Greg Kroah-Hartman
* Heiko Carstens (heiko.carstens@de.ibm.com) wrote:
> > 504e75d0ed3389747e40a4aaa4b1f4e569576665
> > Author: Heiko Carstens <heiko.carstens@de.ibm.com>
> > Date: Thu Mar 20 17:33:38 2008 +0100
> >
> > [S390] futex: let futex_atomic_cmpxchg_pt survive early functional tests.
>
> Yes, forgot to add -stable to the cc list. Sorry.
Got it, thanks.
-chris
^ permalink raw reply [flat|nested] 100+ messages in thread
* Re: [patch 00/76] 2.6.24-stable review
2008-03-21 22:42 [patch 00/76] 2.6.24-stable review Chris Wright
` (76 preceding siblings ...)
2008-03-22 1:02 ` [patch 00/76] 2.6.24-stable review Joe Korty
@ 2008-03-22 18:28 ` Chris Wright
77 siblings, 0 replies; 100+ messages in thread
From: Chris Wright @ 2008-03-22 18:28 UTC (permalink / raw)
To: linux-kernel, stable
Cc: Justin Forbes, Zwane Mwaikambo, Theodore Ts'o, Randy Dunlap,
Dave Jones, Chuck Wolber, Chris Wedgwood, Michael Krufky,
Chuck Ebbert, Domenico Andreoli, torvalds, akpm, alan, Joe Korty,
Christoph Lameter, Heiko Carstens, Thomas Gleixner
* Chris Wright (chrisw@sous-sol.org) wrote:
> The whole patch series can be found in one patch at:
> kernel.org/pub/linux/kernel/v2.6/stable-review/patch-2.6.24.4-rc1.gz
Updated with couple late comers from Joe and Heiko to:
kernel.org/pub/linux/kernel/v2.6/stable-review/patch-2.6.24.4-rc3.gz
thanks,
-chris
^ permalink raw reply [flat|nested] 100+ messages in thread
* Re: [patch 33/76] futex: runtime enable pi and robust functionality
2008-03-22 7:37 ` Thomas Gleixner
2008-03-22 16:19 ` Heiko Carstens
@ 2008-03-22 22:05 ` David Miller
1 sibling, 0 replies; 100+ messages in thread
From: David Miller @ 2008-03-22 22:05 UTC (permalink / raw)
To: tglx
Cc: chrisw, linux-kernel, stable, jejb, jmforbes, zwane, tytso,
rdunlap, davej, chuckw, reviews, mkrufky, cebbert, cavokz,
torvalds, akpm, alan, mingo, buytenh, riku.voipio, gregkh
From: Thomas Gleixner <tglx@linutronix.de>
Date: Sat, 22 Mar 2008 08:37:07 +0100 (CET)
> On Fri, 21 Mar 2008, Chris Wright wrote:
>
> > -stable review patch. If anyone has any objections, please let us know.
> > ---------------------
>
> For this one you need the S390 fixes:
And sparc64 needed similar fixes, but they did get submitted in time
thankfully.
I think this futex change should have gotten more exposure, and proper
coordination with arch maintainers so that it didn't go into -stable
unless the necessary arch level fixups were known to go in at the same
time.
^ permalink raw reply [flat|nested] 100+ messages in thread
* Re: [patch 07/76] NIU: Bump driver version and release date.
2008-03-22 5:21 ` David Miller
@ 2008-03-22 22:46 ` David Miller
2008-03-23 4:20 ` Roland Dreier
0 siblings, 1 reply; 100+ messages in thread
From: David Miller @ 2008-03-22 22:46 UTC (permalink / raw)
To: rdreier
Cc: jesper.juhl, chrisw, linux-kernel, stable, jmforbes, zwane, tytso,
rdunlap, davej, chuckw, reviews, mkrufky, cebbert, cavokz,
torvalds, akpm, alan, gregkh
From: David Miller <davem@davemloft.net>
Date: Fri, 21 Mar 2008 22:21:25 -0700 (PDT)
> From: Roland Dreier <rdreier@cisco.com>
> Date: Fri, 21 Mar 2008 19:35:40 -0700
>
> > > It makes a difference for driver maintainers when users
> > > report bugs and we ask them for the version printed
> > > by the driver so that we know which fixes have been
> > > applied.
> >
> > I'm not sure if this series of patches really accomplishes that...
> > you're leaving out some patches such as "[NIU]: Fix 1G PHY link state
> > handling." that are in the real 0.7. So the 2.6.24.stable version 0.7
> > has a different set of fixes than the 2.6.25 version 0.7.
>
> That was an oversight and not intentional, thanks for
> for catching that.
Actually Roland, that 1G fix you mention was put in during the
2.6.23 development series.
If you ask git for all the NIU driver changes since 2.6.24
you get:
davem@sunset:~/src/GIT/linux-2.6$ git log v2.6.24.. drivers/net/niu.[ch]
commit fa907895b7b776208a1406efe5ba7ffe0f49f507
Author: Matheos Worku <Matheos.Worku@Sun.COM>
Date: Wed Feb 20 00:18:09 2008 -0800
[NIU]: More BMAC alt MAC address fixes.
From: Matheos Worku <Matheos.Worku@Sun.COM>
1) niu_enable_alt_mac() needs to be adjusted so that the mask
is computed properly for the BMAC case.
2) BMAC has 6 alt MAC addresses available, not 7.
Signed-off-by: David S. Miller <davem@davemloft.net>
commit a442585952f137bd4cdb1f2f3166e4157d383b82
Author: David S. Miller <davem@davemloft.net>
Date: Mon Feb 18 21:30:48 2008 -0800
[NIU]: Bump driver version and release date.
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 3b5bcedeeb755b6e813537fcf4c32f010b490aef
Author: Matheos Worku <matheos.worku@sun.com>
Date: Mon Feb 18 21:30:03 2008 -0800
[NIU]: Fix BMAC alternate MAC address indexing.
BMAC port alternate MAC address index needs to start at 1. Index 0 is
used for the main MAC address.
Signed-off-by: Matheos Worku <matheos.worku@sun.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 2caf62f6cae46e36b1c4a1b0f2d9ef82af89cad2
Author: Joe Perches <joe@perches.com>
Date: Thu Dec 20 04:07:35 2007 -0800
[NIU]: Use print_mac
Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
davem@sunset:~/src/GIT/linux-2.6$
Since using print_mac is a one-liner cleanup rather than a bug fix,
it's reasonable to leave it out for 2.6.24-stable
What's left is exactly what I submitted for -stable.
^ permalink raw reply [flat|nested] 100+ messages in thread
* Re: [patch 07/76] NIU: Bump driver version and release date.
2008-03-22 0:14 ` David Miller
2008-03-22 0:16 ` Jesper Juhl
2008-03-22 2:35 ` Roland Dreier
@ 2008-03-22 22:57 ` Pekka Enberg
2008-03-22 23:26 ` David Miller
` (2 more replies)
2 siblings, 3 replies; 100+ messages in thread
From: Pekka Enberg @ 2008-03-22 22:57 UTC (permalink / raw)
To: David Miller
Cc: jesper.juhl, chrisw, linux-kernel, stable, jmforbes, zwane, tytso,
rdunlap, davej, chuckw, reviews, mkrufky, cebbert, cavokz,
torvalds, akpm, alan, gregkh
Hi David,
On Sat, Mar 22, 2008 at 2:14 AM, David Miller <davem@davemloft.net> wrote:
> It makes a difference for driver maintainers when users
> report bugs and we ask them for the version printed
> by the driver so that we know which fixes have been
> applied.
>
> You know, if people are going to be jerky about this,
> I'll just include the version bump in the actual bug
> fixes which I sometimes do anyways.
>
> Thanks for bringing this up, it's a useful use of
> everyone's time :-/
Uhm, Jesper was asking a relevant question and definitely not being
"jerky". As you probably know, many of us are dropping explicit driver
versions from the code for the exact reason why you're trying to patch
the stable tree now. They get out of sync real easy and the kernel
version already provides the same information so why bother.
Furthermore, I honestly don't see how your patch meets the (rather
strict) requirements of stable series either. So it would be nice if
one of the stable maintainers stepped up to say that these kind of
patches are okay to set a precedent for others as well.
Pekka
^ permalink raw reply [flat|nested] 100+ messages in thread
* Re: [patch 07/76] NIU: Bump driver version and release date.
2008-03-22 22:57 ` Pekka Enberg
@ 2008-03-22 23:26 ` David Miller
2008-03-23 8:42 ` Pekka Enberg
2008-03-23 4:13 ` Greg KH
2008-03-24 22:23 ` Adrian Bunk
2 siblings, 1 reply; 100+ messages in thread
From: David Miller @ 2008-03-22 23:26 UTC (permalink / raw)
To: penberg
Cc: jesper.juhl, chrisw, linux-kernel, stable, jmforbes, zwane, tytso,
rdunlap, davej, chuckw, reviews, mkrufky, cebbert, cavokz,
torvalds, akpm, alan, gregkh
From: "Pekka Enberg" <penberg@cs.helsinki.fi>
Date: Sun, 23 Mar 2008 00:57:29 +0200
> Furthermore, I honestly don't see how your patch meets the (rather
> strict) requirements of stable series either.
Show how changing a version string can cause a regression for
a user.
Then I'll stop being angry about all the time that is being wasted on
this topic.
^ permalink raw reply [flat|nested] 100+ messages in thread
* Re: [patch 07/76] NIU: Bump driver version and release date.
2008-03-22 22:57 ` Pekka Enberg
2008-03-22 23:26 ` David Miller
@ 2008-03-23 4:13 ` Greg KH
2008-03-23 8:08 ` Chris Wright
2008-03-24 22:23 ` Adrian Bunk
2 siblings, 1 reply; 100+ messages in thread
From: Greg KH @ 2008-03-23 4:13 UTC (permalink / raw)
To: Pekka Enberg
Cc: David Miller, jesper.juhl, chrisw, linux-kernel, stable, jmforbes,
zwane, tytso, rdunlap, davej, chuckw, reviews, mkrufky, cebbert,
cavokz, torvalds, akpm, alan
On Sun, Mar 23, 2008 at 12:57:29AM +0200, Pekka Enberg wrote:
> Furthermore, I honestly don't see how your patch meets the (rather
> strict) requirements of stable series either. So it would be nice if
> one of the stable maintainers stepped up to say that these kind of
> patches are okay to set a precedent for others as well.
These kind of patches are perfectly fine. We trust the maintainers of
drivers and subsystems to tell the -stable maintainers what they want
added to the tree, and if that includes a version number update to make
their lives easier, who are we to say no to that.
Becides, it's not the first time patches like this have been accepted.
thanks,
greg k-h
^ permalink raw reply [flat|nested] 100+ messages in thread
* Re: [patch 07/76] NIU: Bump driver version and release date.
2008-03-22 22:46 ` David Miller
@ 2008-03-23 4:20 ` Roland Dreier
0 siblings, 0 replies; 100+ messages in thread
From: Roland Dreier @ 2008-03-23 4:20 UTC (permalink / raw)
To: David Miller
Cc: jesper.juhl, chrisw, linux-kernel, stable, jmforbes, zwane, tytso,
rdunlap, davej, chuckw, reviews, mkrufky, cebbert, cavokz,
torvalds, akpm, alan, gregkh
> Actually Roland, that 1G fix you mention was put in during the
> 2.6.23 development series.
>
> If you ask git for all the NIU driver changes since 2.6.24
> you get:
Sorry for the noise... I did
git log cb77df3e..a4425859 drivers/net/niu.c
to get all the niu changes between when you bumped the version to 0.6
and when you bumped it to 0.7. I didn't think to check which post-0.6
changes were already in 2.6.24.
As long as the version helps you out, I guess it's all good.
- R.
^ permalink raw reply [flat|nested] 100+ messages in thread
* Re: [patch 07/76] NIU: Bump driver version and release date.
2008-03-23 4:13 ` Greg KH
@ 2008-03-23 8:08 ` Chris Wright
0 siblings, 0 replies; 100+ messages in thread
From: Chris Wright @ 2008-03-23 8:08 UTC (permalink / raw)
To: Greg KH
Cc: Pekka Enberg, David Miller, jesper.juhl, chrisw, linux-kernel,
stable, jmforbes, zwane, tytso, rdunlap, davej, chuckw, reviews,
mkrufky, cebbert, cavokz, torvalds, akpm, alan
* Greg KH (gregkh@suse.de) wrote:
> On Sun, Mar 23, 2008 at 12:57:29AM +0200, Pekka Enberg wrote:
> > Furthermore, I honestly don't see how your patch meets the (rather
> > strict) requirements of stable series either. So it would be nice if
> > one of the stable maintainers stepped up to say that these kind of
> > patches are okay to set a precedent for others as well.
>
> These kind of patches are perfectly fine. We trust the maintainers of
> drivers and subsystems to tell the -stable maintainers what they want
> added to the tree, and if that includes a version number update to make
> their lives easier, who are we to say no to that.
I completely agree. The -stable rules are guidelines, primarily to help
us say no. When it's submitted by a maintainer as something that helps
them support their code (esp a no risk change like version bump to keep
things in line), there's little reason to reject. Consider the version
bump part of the bug fixes.
thanks,
-chris
^ permalink raw reply [flat|nested] 100+ messages in thread
* Re: [patch 07/76] NIU: Bump driver version and release date.
2008-03-22 23:26 ` David Miller
@ 2008-03-23 8:42 ` Pekka Enberg
2008-03-23 10:18 ` David Miller
0 siblings, 1 reply; 100+ messages in thread
From: Pekka Enberg @ 2008-03-23 8:42 UTC (permalink / raw)
To: David Miller
Cc: jesper.juhl, chrisw, linux-kernel, stable, jmforbes, zwane, tytso,
rdunlap, davej, chuckw, reviews, mkrufky, cebbert, cavokz,
torvalds, akpm, alan, gregkh
Hi David,
On Sun, Mar 23, 2008 at 1:26 AM, David Miller <davem@davemloft.net> wrote:
> Show how changing a version string can cause a regression for
> a user.
It obviously can't but then again, we don't put comment or
documentation fixes in the stable tree either just because. But agreed
this is pointless now as Chris and Greg have explicitly said they're
ok.
Pekka
^ permalink raw reply [flat|nested] 100+ messages in thread
* Re: [patch 07/76] NIU: Bump driver version and release date.
2008-03-23 8:42 ` Pekka Enberg
@ 2008-03-23 10:18 ` David Miller
0 siblings, 0 replies; 100+ messages in thread
From: David Miller @ 2008-03-23 10:18 UTC (permalink / raw)
To: penberg
Cc: jesper.juhl, chrisw, linux-kernel, stable, jmforbes, zwane, tytso,
rdunlap, davej, chuckw, reviews, mkrufky, cebbert, cavokz,
torvalds, akpm, alan, gregkh
From: "Pekka Enberg" <penberg@cs.helsinki.fi>
Date: Sun, 23 Mar 2008 10:42:46 +0200
> It obviously can't but then again, we don't put comment or
> documentation fixes in the stable tree either just because. But agreed
> this is pointless now as Chris and Greg have explicitly said they're
> ok.
Thus, thanks for continuing to waste everyone's time.
^ permalink raw reply [flat|nested] 100+ messages in thread
* Re: [patch 07/76] NIU: Bump driver version and release date.
2008-03-22 22:57 ` Pekka Enberg
2008-03-22 23:26 ` David Miller
2008-03-23 4:13 ` Greg KH
@ 2008-03-24 22:23 ` Adrian Bunk
2 siblings, 0 replies; 100+ messages in thread
From: Adrian Bunk @ 2008-03-24 22:23 UTC (permalink / raw)
To: Pekka Enberg
Cc: David Miller, jesper.juhl, chrisw, linux-kernel, stable, jmforbes,
zwane, tytso, rdunlap, davej, chuckw, reviews, mkrufky, cebbert,
cavokz, torvalds, akpm, alan, gregkh
On Sun, Mar 23, 2008 at 12:57:29AM +0200, Pekka Enberg wrote:
> Hi David,
>
> On Sat, Mar 22, 2008 at 2:14 AM, David Miller <davem@davemloft.net> wrote:
> > It makes a difference for driver maintainers when users
> > report bugs and we ask them for the version printed
> > by the driver so that we know which fixes have been
> > applied.
> >
> > You know, if people are going to be jerky about this,
> > I'll just include the version bump in the actual bug
> > fixes which I sometimes do anyways.
> >
> > Thanks for bringing this up, it's a useful use of
> > everyone's time :-/
>
> Uhm, Jesper was asking a relevant question and definitely not being
> "jerky". As you probably know, many of us are dropping explicit driver
> versions from the code for the exact reason why you're trying to patch
> the stable tree now. They get out of sync real easy and the kernel
> version already provides the same information so why bother.
>...
There are two completely different cases one mustn't confuse:
> 90% of all version numbers, cvs tags,... in the kernel haven't been
updated for ages and should be removed.
But there are some drivers and ALSA that have an active maintainer, an
actively maintained version number, and tend to often be backported into
distribution kernels.
> Pekka
cu
Adrian
--
"Is there not promise of rain?" Ling Tan asked suddenly out
of the darkness. There had been need of rain for many days.
"Only a promise," Lao Er said.
Pearl S. Buck - Dragon Seed
^ permalink raw reply [flat|nested] 100+ messages in thread
* Re: [patch 07/76] NIU: Bump driver version and release date.
2008-03-22 0:16 ` Jesper Juhl
@ 2008-03-26 21:28 ` Jesper Juhl
0 siblings, 0 replies; 100+ messages in thread
From: Jesper Juhl @ 2008-03-26 21:28 UTC (permalink / raw)
To: David Miller
Cc: chrisw, linux-kernel, stable, jmforbes, zwane, tytso, rdunlap,
davej, chuckw, reviews, mkrufky, cebbert, cavokz, torvalds, akpm,
alan, gregkh
David,
When I made the reply below I was rather tired and edgy. I would like
to explain why I commented as I did and offer an appology for wasting
your time and/or annoying you - that was never my intention.
I try to participate constructively where and when I can and one of
the ways I try to do so is by reading patches that people submit. Most
of the time I'm not qualified to comment on them and I try not to.
In this specific case I felt I knew the -stable rules well enough and
could understand the patch well enough to offer up a constructive
comment, so I did.
My Intention was simply to point out that the patch *seemed* to fall
outside what the -stable rules allowed, and my understanding was that
the rules were there for a reason - to keep -stable patches to the
very minimum required to fix bugs and only that.
When you replied the way you did I got rather irritated by the fact
that you chose to see it as an attempt to waste peoples time rather
than see it how I intended it; as an attempt to help out by reviewing
patches and point out any oddities/guideline-deviation I observed.
I should have waited to respond and certainly not written my response
while still being annoyed.
I realize now that patches like this are acceptable for -stable, so
I'll refrain from commenting on them in the future.
I hope you can accept an appology and see that I did not intend to
waste anyones time.
Kind regards,
Jesper Juhl
On 22/03/2008, Jesper Juhl <jesper.juhl@gmail.com> wrote:
> On 22/03/2008, David Miller <davem@davemloft.net> wrote:
> > From: "Jesper Juhl" <jesper.juhl@gmail.com>
> > Date: Sat, 22 Mar 2008 01:10:40 +0100
> >
> >
> > > As I see it, this patch is quite trivial and does not fix any "real problem".
> > > How come this is suitable for -stable?
> > >
> > > I have no objections to the patch "as such", I just don't think it
> > > makes sense for -stable.
> >
> >
> > It makes a difference for driver maintainers when users
> > report bugs and we ask them for the version printed
> > by the driver so that we know which fixes have been
> > applied.
> >
>
> Ok, fair enough.
>
>
> > You know, if people are going to be jerky about this,
> > I'll just include the version bump in the actual bug
> > fixes which I sometimes do anyways.
> >
> > Thanks for bringing this up, it's a useful use of
> > everyone's time :-/
> >
>
> Excuse me for reading patches, trying to spot problems and thinking
> about where they are applied and what rules apply etc.
>
>
> --
>
> Jesper Juhl <jesper.juhl@gmail.com>
>
> Don't top-post http://www.catb.org/~esr/jargon/html/T/top-post.html
> Plain text mails only, please http://www.expita.com/nomime.html
>
--
Jesper Juhl <jesper.juhl@gmail.com>
Don't top-post http://www.catb.org/~esr/jargon/html/T/top-post.html
Plain text mails only, please http://www.expita.com/nomime.html
^ permalink raw reply [flat|nested] 100+ messages in thread
* Re: [patch 33/76] futex: runtime enable pi and robust functionality
2008-03-21 22:43 ` [patch 33/76] futex: runtime enable pi and robust functionality Chris Wright
2008-03-22 7:37 ` Thomas Gleixner
@ 2008-03-27 3:28 ` Benjamin Herrenschmidt
1 sibling, 0 replies; 100+ messages in thread
From: Benjamin Herrenschmidt @ 2008-03-27 3:28 UTC (permalink / raw)
To: Chris Wright
Cc: linux-kernel, stable, jejb, Justin Forbes, Zwane Mwaikambo,
Theodore Ts'o, Randy Dunlap, Dave Jones, Chuck Wolber,
Chris Wedgwood, Michael Krufky, Chuck Ebbert, Domenico Andreoli,
torvalds, akpm, alan, Thomas Gleixner, Ingo Molnar,
Lennert Buytenhek, Riku Voipio, Greg Kroah-Hartman
On Fri, 2008-03-21 at 15:43 -0700, Chris Wright wrote:
> plain text document attachment
> (futex-runtime-enable-pi-and-robust-functionality.patch)
> -stable review patch. If anyone has any objections, please let us know.
> ---------------------
>
> From: Thomas Gleixner <tglx@linutronix.de>
>
> Not all architectures implement futex_atomic_cmpxchg_inatomic(). The default
> implementation returns -ENOSYS, which is currently not handled inside of the
> futex guts.
I think that breaks some embedded PowerPC platforms. It's also very
fishy... So early, we haven't activated an mm yet, it's like trying
to access user memory from a kernel thread... might happen to give
you -EFAULT on x86 but you are making pretty big assumptions on how
low level mm works in architectures...
Ben.
> Futex PI calls and robust list exits with a held futex result in an endless
> loop in the futex code on architectures which have no support.
>
> Fixing up every place where futex_atomic_cmpxchg_inatomic() is called would
> add a fair amount of extra if/else constructs to the already complex code. It
> is also not possible to disable the robust feature before user space tries to
> register robust lists.
>
> Compile time disabling is not a good idea either, as there are already
> architectures with runtime detection of futex_atomic_cmpxchg_inatomic support.
>
> Detect the functionality at runtime instead by calling
> cmpxchg_futex_value_locked() with a NULL pointer from the futex initialization
> code. This is guaranteed to fail, but the call of
> futex_atomic_cmpxchg_inatomic() happens with pagefaults disabled.
>
> On architectures, which use the asm-generic implementation or have a runtime
> CPU feature detection, a -ENOSYS return value disables the PI/robust features.
>
> On architectures with a working implementation the call returns -EFAULT and
> the PI/robust features are enabled.
>
> The relevant syscalls return -ENOSYS and the robust list exit code is blocked,
> when the detection fails.
>
> Fixes http://lkml.org/lkml/2008/2/11/149
> Originally reported by: Lennart Buytenhek
>
> Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
> Acked-by: Ingo Molnar <mingo@elte.hu>
> Cc: Lennert Buytenhek <buytenh@wantstofly.org>
> Cc: Riku Voipio <riku.voipio@movial.fi>
> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
> Signed-off-by: Chris Wright <chrisw@sous-sol.org>
> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
> ---
> include/linux/futex.h | 1 +
> kernel/futex.c | 38 ++++++++++++++++++++++++++++++++++----
> kernel/futex_compat.c | 9 +++++++++
> 3 files changed, 44 insertions(+), 4 deletions(-)
>
> --- a/include/linux/futex.h
> +++ b/include/linux/futex.h
> @@ -153,6 +153,7 @@ union futex_key {
> #ifdef CONFIG_FUTEX
> extern void exit_robust_list(struct task_struct *curr);
> extern void exit_pi_state_list(struct task_struct *curr);
> +extern int futex_cmpxchg_enabled;
> #else
> static inline void exit_robust_list(struct task_struct *curr)
> {
> --- a/kernel/futex.c
> +++ b/kernel/futex.c
> @@ -60,6 +60,8 @@
>
> #include "rtmutex_common.h"
>
> +int __read_mostly futex_cmpxchg_enabled;
> +
> #define FUTEX_HASHBITS (CONFIG_BASE_SMALL ? 4 : 8)
>
> /*
> @@ -466,6 +468,8 @@ void exit_pi_state_list(struct task_stru
> struct futex_hash_bucket *hb;
> union futex_key key;
>
> + if (!futex_cmpxchg_enabled)
> + return;
> /*
> * We are a ZOMBIE and nobody can enqueue itself on
> * pi_state_list anymore, but we have to be careful
> @@ -1854,6 +1858,8 @@ asmlinkage long
> sys_set_robust_list(struct robust_list_head __user *head,
> size_t len)
> {
> + if (!futex_cmpxchg_enabled)
> + return -ENOSYS;
> /*
> * The kernel knows only one size for now:
> */
> @@ -1878,6 +1884,9 @@ sys_get_robust_list(int pid, struct robu
> struct robust_list_head __user *head;
> unsigned long ret;
>
> + if (!futex_cmpxchg_enabled)
> + return -ENOSYS;
> +
> if (!pid)
> head = current->robust_list;
> else {
> @@ -1980,6 +1989,9 @@ void exit_robust_list(struct task_struct
> unsigned long futex_offset;
> int rc;
>
> + if (!futex_cmpxchg_enabled)
> + return;
> +
> /*
> * Fetch the list head (which was registered earlier, via
> * sys_set_robust_list()):
> @@ -2034,7 +2046,7 @@ void exit_robust_list(struct task_struct
> long do_futex(u32 __user *uaddr, int op, u32 val, ktime_t *timeout,
> u32 __user *uaddr2, u32 val2, u32 val3)
> {
> - int ret;
> + int ret = -ENOSYS;
> int cmd = op & FUTEX_CMD_MASK;
> struct rw_semaphore *fshared = NULL;
>
> @@ -2062,13 +2074,16 @@ long do_futex(u32 __user *uaddr, int op,
> ret = futex_wake_op(uaddr, fshared, uaddr2, val, val2, val3);
> break;
> case FUTEX_LOCK_PI:
> - ret = futex_lock_pi(uaddr, fshared, val, timeout, 0);
> + if (futex_cmpxchg_enabled)
> + ret = futex_lock_pi(uaddr, fshared, val, timeout, 0);
> break;
> case FUTEX_UNLOCK_PI:
> - ret = futex_unlock_pi(uaddr, fshared);
> + if (futex_cmpxchg_enabled)
> + ret = futex_unlock_pi(uaddr, fshared);
> break;
> case FUTEX_TRYLOCK_PI:
> - ret = futex_lock_pi(uaddr, fshared, 0, timeout, 1);
> + if (futex_cmpxchg_enabled)
> + ret = futex_lock_pi(uaddr, fshared, 0, timeout, 1);
> break;
> default:
> ret = -ENOSYS;
> @@ -2123,8 +2138,23 @@ static struct file_system_type futex_fs_
>
> static int __init init(void)
> {
> + u32 curval;
> int i;
>
> + /*
> + * This will fail and we want it. Some arch implementations do
> + * runtime detection of the futex_atomic_cmpxchg_inatomic()
> + * functionality. We want to know that before we call in any
> + * of the complex code paths. Also we want to prevent
> + * registration of robust lists in that case. NULL is
> + * guaranteed to fault and we get -EFAULT on functional
> + * implementation, the non functional ones will return
> + * -ENOSYS.
> + */
> + curval = cmpxchg_futex_value_locked(NULL, 0, 0);
> + if (curval == -EFAULT)
> + futex_cmpxchg_enabled = 1;
> +
> for (i = 0; i < ARRAY_SIZE(futex_queues); i++) {
> plist_head_init(&futex_queues[i].chain, &futex_queues[i].lock);
> spin_lock_init(&futex_queues[i].lock);
> --- a/kernel/futex_compat.c
> +++ b/kernel/futex_compat.c
> @@ -54,6 +54,9 @@ void compat_exit_robust_list(struct task
> compat_long_t futex_offset;
> int rc;
>
> + if (!futex_cmpxchg_enabled)
> + return;
> +
> /*
> * Fetch the list head (which was registered earlier, via
> * sys_set_robust_list()):
> @@ -115,6 +118,9 @@ asmlinkage long
> compat_sys_set_robust_list(struct compat_robust_list_head __user *head,
> compat_size_t len)
> {
> + if (!futex_cmpxchg_enabled)
> + return -ENOSYS;
> +
> if (unlikely(len != sizeof(*head)))
> return -EINVAL;
>
> @@ -130,6 +136,9 @@ compat_sys_get_robust_list(int pid, comp
> struct compat_robust_list_head __user *head;
> unsigned long ret;
>
> + if (!futex_cmpxchg_enabled)
> + return -ENOSYS;
> +
> if (!pid)
> head = current->compat_robust_list;
> else {
>
^ permalink raw reply [flat|nested] 100+ messages in thread
end of thread, other threads:[~2008-03-27 3:32 UTC | newest]
Thread overview: 100+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-03-21 22:42 [patch 00/76] 2.6.24-stable review Chris Wright
2008-03-21 22:42 ` [patch 01/76] Revert "NET: Add if_addrlabel.h to sanitized headers." Chris Wright
2008-03-21 22:42 ` [patch 02/76] SPARC64: Loosen checks in exception table handling Chris Wright
2008-03-21 22:42 ` [patch 03/76] SPARC: Fix link errors with gcc-4.3 Chris Wright
2008-03-21 22:42 ` [patch 04/76] TCP: Improve ipv4 established hash function Chris Wright
2008-03-21 22:42 ` [patch 05/76] NIU: More BMAC alt MAC address fixes Chris Wright
2008-03-21 22:42 ` [patch 06/76] NIU: Fix BMAC alternate MAC address indexing Chris Wright
2008-03-21 22:42 ` [patch 07/76] NIU: Bump driver version and release date Chris Wright
2008-03-22 0:10 ` Jesper Juhl
2008-03-22 0:14 ` David Miller
2008-03-22 0:16 ` Jesper Juhl
2008-03-26 21:28 ` Jesper Juhl
2008-03-22 2:35 ` Roland Dreier
2008-03-22 5:21 ` David Miller
2008-03-22 22:46 ` David Miller
2008-03-23 4:20 ` Roland Dreier
2008-03-22 22:57 ` Pekka Enberg
2008-03-22 23:26 ` David Miller
2008-03-23 8:42 ` Pekka Enberg
2008-03-23 10:18 ` David Miller
2008-03-23 4:13 ` Greg KH
2008-03-23 8:08 ` Chris Wright
2008-03-24 22:23 ` Adrian Bunk
2008-03-21 22:42 ` [patch 08/76] NET: Messed multicast lists after dev_mc_sync/unsync Chris Wright
2008-03-21 22:42 ` [patch 09/76] NET: Fix race in dev_close(). (Bug 9750) Chris Wright
2008-03-21 22:43 ` [patch 10/76] IPV6: Fix IPsec datagram fragmentation Chris Wright
2008-03-21 22:43 ` [patch 11/76] IPV6: dst_entry leak in ip4ip6_err Chris Wright
2008-03-21 22:43 ` [patch 12/76] IPV4: Remove IP_TOS setting privilege checks Chris Wright
2008-03-21 22:43 ` [patch 13/76] IPCONFIG: The kernel gets no IP from some DHCP servers Chris Wright
2008-03-21 22:43 ` [patch 14/76] IPCOMP: Disable BH on output when using shared tfm Chris Wright
2008-03-21 22:43 ` [patch 15/76] IRQ_NOPROBE helper functions Chris Wright
2008-03-21 22:43 ` [patch 16/76] MIPS: Mark all but i8259 interrupts as no-probe Chris Wright
2008-03-21 22:43 ` [patch 17/76] ub: fix up the conversion to sg_init_table() Chris Wright
2008-03-21 22:43 ` [patch 18/76] x86: Clear DF before calling signal handler Chris Wright
2008-03-21 22:43 ` [patch 19/76] iov_iter_advance() fix Chris Wright
2008-03-21 22:43 ` [patch 20/76] drivers: fix dma_get_required_mask Chris Wright
2008-03-21 22:43 ` [patch 21/76] x86: adjust enable_NMI_through_LVT0() Chris Wright
2008-03-21 22:43 ` [patch 22/76] SCSI ips: handle scsi_add_host() failure, and other err cleanups Chris Wright
2008-03-21 22:43 ` [patch 23/76] CRYPTO xcbc: Fix crash with IPsec Chris Wright
2008-03-21 22:43 ` [patch 24/76] CRYPTO xts: Use proper alignment Chris Wright
2008-03-21 22:43 ` [patch 25/76] fuse: fix permission checking Chris Wright
2008-03-21 22:43 ` [patch 26/76] usb-storage: dont access beyond the end of the sg buffer Chris Wright
2008-03-21 22:43 ` [patch 27/76] SCSI ips: fix data buffer accessors conversion bug Chris Wright
2008-03-21 22:43 ` [patch 28/76] SCSI gdth: dont call pci_free_consistent under spinlock Chris Wright
2008-03-21 22:43 ` [patch 29/76] SCSI aic94xx: fix REQ_TASK_ABORT and REQ_DEVICE_RESET Chris Wright
2008-03-21 22:43 ` [patch 30/76] x86: replace LOCK_PREFIX in futex.h Chris Wright
2008-03-21 22:43 ` [patch 31/76] ARM pxa: fix clock lookup to find specific device clocks Chris Wright
2008-03-21 22:43 ` [patch 32/76] futex: fix init order Chris Wright
2008-03-21 22:43 ` [patch 33/76] futex: runtime enable pi and robust functionality Chris Wright
2008-03-22 7:37 ` Thomas Gleixner
2008-03-22 16:19 ` Heiko Carstens
2008-03-22 18:27 ` Chris Wright
2008-03-22 22:05 ` David Miller
2008-03-27 3:28 ` Benjamin Herrenschmidt
2008-03-21 22:43 ` [patch 34/76] file capabilities: simplify signal check Chris Wright
2008-03-21 22:43 ` [patch 35/76] hugetlb: ensure we do not reference a surplus page after handing it to buddy Chris Wright
2008-03-21 22:43 ` [patch 36/76] ufs: fix parenthesisation in ufs_set_fs_state() Chris Wright
2008-03-21 22:43 ` [patch 37/76] spi: pxa2xx_spi clock polarity fix Chris Wright
2008-03-21 22:43 ` [patch 38/76] NETFILTER: nfnetlink_queue: fix SKB_LINEAR_ASSERT when mangling packet data Chris Wright
2008-03-21 22:43 ` [patch 39/76] NETFILTER: Fix incorrect use of skb_make_writable Chris Wright
2008-03-21 22:43 ` [patch 40/76] NETFILTER: fix ebtable targets return Chris Wright
2008-03-21 22:43 ` [patch 41/76] SCSI advansys: fix overrun_buf aligned bug Chris Wright
2008-03-21 22:43 ` [patch 42/76] pata_hpt*, pata_serverworks: fix UDMA masking Chris Wright
2008-03-21 22:43 ` [patch 43/76] moduleparam: fix alpha, ia64 and ppc64 compile failures Chris Wright
2008-03-21 22:43 ` [patch 44/76] PCI x86: always use conf1 to access config space below 256 bytes Chris Wright
2008-03-21 22:43 ` [patch 45/76] e1000e: Fix CRC stripping in hardware context bug Chris Wright
2008-03-21 22:43 ` [patch 46/76] arcmsr: fix IRQs disabled warning spew Chris Wright
2008-03-21 22:43 ` [patch 47/76] b43: Backport bcm4311 fix Chris Wright
2008-03-21 22:43 ` [patch 48/76] atmel_spi: fix clock polarity Chris Wright
2008-03-21 22:43 ` [patch 49/76] x86: move out tick_nohz_stop_sched_tick() call from the loop Chris Wright
2008-03-21 22:43 ` [patch 50/76] macb: Fix speed setting Chris Wright
2008-03-21 22:43 ` [patch 51/76] ioat: fix ack handling, driver must ensure that ack is zero Chris Wright
2008-03-21 22:43 ` [patch 52/76] eCryptfs: make ecryptfs_prepare_write decrypt the page Chris Wright
2008-03-21 22:43 ` [patch 53/76] VT notifier fix for VT switch Chris Wright
2008-03-21 22:43 ` [patch 54/76] USB: ftdi_sio: Workaround for broken Matrix Orbital serial port Chris Wright
2008-03-21 22:43 ` [patch 55/76] USB: ftdi_sio - really enable EM1010PC Chris Wright
2008-03-21 22:43 ` [patch 56/76] USB: ehci: handle large bulk URBs correctly (again) Chris Wright
2008-03-21 22:43 ` [patch 57/76] SCSI: fix BUG when sum(scatterlist) > bufflen Chris Wright
2008-03-21 22:43 ` [patch 58/76] x86: dont use P6_NOPs if compiling with CONFIG_X86_GENERIC Chris Wright
2008-03-21 22:43 ` [patch 59/76] Fix default compose table initialization Chris Wright
2008-03-21 22:43 ` [patch 60/76] SCSI: gdth: bugfix for the at-exit problems Chris Wright
2008-03-21 22:43 ` [patch 61/76] SCSI: gdth: fix to internal commands execution Chris Wright
2008-03-21 22:43 ` [patch 62/76] SCSI: mpt fusion: dont oops if NumPhys==0 Chris Wright
2008-03-21 22:43 ` [patch 63/76] sched: fix race in schedule() Chris Wright
2008-03-21 22:43 ` [patch 64/76] nfsd: fix oops on access from high-numbered ports Chris Wright
2008-03-21 22:43 ` [patch 65/76] sched_nr_migrate wrong mode bits Chris Wright
2008-03-21 22:43 ` [patch 66/76] NETFILTER: xt_time: fix failure to match on Sundays Chris Wright
2008-03-21 22:43 ` [patch 67/76] NETFILTER: nfnetlink_queue: fix computation of allocated size for netlink skb Chris Wright
2008-03-21 22:43 ` [patch 68/76] NETFILTER: nfnetlink_log: fix computation of netlink skb size Chris Wright
2008-03-21 22:43 ` [patch 69/76] zisofs: fix readpage() outside i_size Chris Wright
2008-03-21 22:44 ` [patch 70/76] jbd2: correctly unescape journal data blocks Chris Wright
2008-03-21 22:44 ` [patch 71/76] jbd: " Chris Wright
2008-03-21 22:44 ` [patch 72/76] aio: bad AIO race in aio_complete() leads to process hang Chris Wright
2008-03-21 22:44 ` [patch 73/76] async_tx: avoid the async xor_zero_sum path when src_cnt > device->max_xor Chris Wright
2008-03-21 22:44 ` [patch 74/76] SCSI advansys: Fix bug in AdvLoadMicrocode Chris Wright
2008-03-21 22:44 ` [patch 75/76] BLUETOOTH: Fix bugs in previous conn add/del workqueue changes Chris Wright
2008-03-21 22:44 ` [patch 76/76] relay: fix subbuf_splice_actor() adding too many pages Chris Wright
2008-03-22 1:02 ` [patch 00/76] 2.6.24-stable review Joe Korty
2008-03-22 18:26 ` Chris Wright
2008-03-22 18:28 ` Chris Wright
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox