linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] [0/139] 2.6.35.11 longterm review
@ 2011-02-02  0:43 Andi Kleen
  2011-02-02  0:43 ` [PATCH] [1/139] x86, hotplug: Use mwait to offline a processor, fix the legacy case Andi Kleen
                   ` (139 more replies)
  0 siblings, 140 replies; 149+ messages in thread
From: Andi Kleen @ 2011-02-02  0:43 UTC (permalink / raw)
  To: linux-kernel, stable


This is the start of the longterm review cycle for the 2.6.35.10 release.
There are a large number of 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 me 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.

The full quilt queue can be found at
git://git.kernel.org/pub/scm/linux/kernel/git/longterm/longterm-queue-2.6.35

Responses should be made within 48 hours.

 Documentation/kernel-parameters.txt         |    1 +
 Documentation/power/runtime_pm.txt          |    4 +-
 Makefile                                    |    2 +-
 arch/arm/mach-at91/include/mach/at91_mci.h  |    2 +
 arch/arm/mm/cache-v6.S                      |   28 ++++--
 arch/sparc/include/asm/openprom.h           |    2 +-
 arch/sparc/include/asm/oplib_32.h           |   35 +------
 arch/sparc/include/asm/oplib_64.h           |   46 +--------
 arch/sparc/kernel/leon_kernel.c             |    4 +-
 arch/sparc/prom/Makefile                    |    1 -
 arch/sparc/prom/console_32.c                |   65 ++---------
 arch/sparc/prom/console_64.c                |   81 +++-----------
 arch/sparc/prom/devops_32.c                 |   87 ---------------
 arch/sparc/prom/devops_64.c                 |   67 ------------
 arch/sparc/prom/misc_64.c                   |   16 +---
 arch/sparc/prom/printf.c                    |   35 +++++-
 arch/sparc/prom/tree_32.c                   |   15 ---
 arch/sparc/prom/tree_64.c                   |   18 ---
 arch/x86/include/asm/processor.h            |   23 ----
 arch/x86/kernel/apic/apic.c                 |    8 ++
 arch/x86/kernel/apic/io_apic.c              |    1 +
 arch/x86/kernel/apic/probe_64.c             |    7 --
 arch/x86/kernel/cpu/amd.c                   |    3 +-
 arch/x86/kernel/microcode_intel.c           |   16 +--
 arch/x86/kernel/smpboot.c                   |   85 ++++++++++++++-
 arch/x86/kernel/xsave.c                     |    3 +-
 arch/x86/oprofile/op_model_amd.c            |   24 +++--
 arch/x86/vdso/Makefile                      |    4 +-
 block/blk-merge.c                           |    6 +-
 block/blk-settings.c                        |   25 +----
 block/blk-sysfs.c                           |    2 +-
 drivers/acpi/acpica/dswexec.c               |   19 +++-
 drivers/acpi/ec.c                           |    3 +
 drivers/ata/libata-sff.c                    |    7 +-
 drivers/block/xen-blkfront.c                |    2 +-
 drivers/char/n_gsm.c                        |    6 +-
 drivers/char/ramoops.c                      |   12 ++-
 drivers/dma/mv_xor.c                        |    2 +-
 drivers/edac/amd64_edac.c                   |    2 +-
 drivers/edac/edac_mc.c                      |   10 +-
 drivers/gpio/cs5535-gpio.c                  |   19 +++-
 drivers/gpio/rdc321x-gpio.c                 |    2 +-
 drivers/gpu/drm/drm_crtc.c                  |   10 +-
 drivers/gpu/drm/i915/intel_dp.c             |   37 +++++--
 drivers/gpu/drm/nouveau/nouveau_drv.h       |    6 +
 drivers/gpu/drm/nouveau/nouveau_irq.c       |    1 +
 drivers/gpu/drm/nouveau/nv50_display.c      |   35 +++++--
 drivers/gpu/drm/radeon/atombios_crtc.c      |    3 +-
 drivers/gpu/drm/radeon/evergreen.c          |   25 ++---
 drivers/gpu/drm/radeon/r600.c               |   24 +++--
 drivers/gpu/drm/radeon/radeon_device.c      |    9 +-
 drivers/gpu/drm/radeon/rv770.c              |    9 +-
 drivers/hwmon/adm1026.c                     |   20 ++--
 drivers/infiniband/core/uverbs_cmd.c        |  101 ++++++++++--------
 drivers/input/mouse/synaptics.h             |    3 +-
 drivers/input/serio/i8042-x86ia64io.h       |   21 ++++
 drivers/input/serio/i8042.c                 |    6 +-
 drivers/md/dm-table.c                       |    5 -
 drivers/md/md.c                             |   15 ++--
 drivers/md/raid10.c                         |    2 +-
 drivers/media/video/gspca/sonixj.c          |   17 +++-
 drivers/mfd/wm831x-core.c                   |    8 +-
 drivers/mmc/core/core.c                     |    1 +
 drivers/mmc/host/at91_mci.c                 |   13 ++-
 drivers/mmc/host/atmel-mci.c                |   18 ++-
 drivers/net/8139cp.c                        |   10 +-
 drivers/net/benet/be_cmds.c                 |    2 +-
 drivers/net/bonding/bonding.h               |    4 +-
 drivers/net/ifb.c                           |    2 +
 drivers/net/r8169.c                         |    4 +-
 drivers/net/tehuti.c                        |    4 +-
 drivers/net/wireless/ath/ath9k/eeprom_def.c |   12 ++-
 drivers/net/wireless/ath/ath9k/main.c       |   11 ++-
 drivers/net/wireless/orinoco/main.c         |    6 +
 drivers/net/wireless/orinoco/wext.c         |    4 +-
 drivers/net/wireless/p54/p54usb.c           |    6 +
 drivers/net/wireless/rt2x00/rt2400pci.c     |    6 +-
 drivers/net/wireless/rt2x00/rt2500pci.c     |   12 ++-
 drivers/net/wireless/rt2x00/rt2500usb.c     |   12 ++-
 drivers/net/wireless/rt2x00/rt2800.h        |    7 ++
 drivers/net/wireless/rt2x00/rt2800lib.c     |   59 ++++++----
 drivers/net/wireless/rt2x00/rt2x00.h        |    5 +-
 drivers/net/wireless/rt2x00/rt2x00dev.c     |    2 +-
 drivers/net/wireless/rt2x00/rt61pci.c       |   12 ++-
 drivers/net/wireless/rt2x00/rt73usb.c       |   12 ++-
 drivers/net/xen-netfront.c                  |    4 +-
 drivers/pci/dmar.c                          |    5 +
 drivers/pci/quirks.c                        |   23 ++++
 drivers/rtc/rtc-rs5c372.c                   |    2 +-
 drivers/scsi/qla2xxx/qla_iocb.c             |    1 +
 drivers/scsi/qla2xxx/qla_nx.c               |    1 +
 drivers/scsi/qla2xxx/qla_os.c               |    1 +
 drivers/scsi/scsi_lib.c                     |    3 +-
 drivers/usb/gadget/composite.c              |   16 ++--
 drivers/usb/host/xhci-mem.c                 |   25 +++--
 drivers/usb/misc/uss720.c                   |    4 +-
 drivers/usb/serial/ftdi_sio.c               |    1 +
 drivers/usb/serial/ftdi_sio_ids.h           |    5 +
 drivers/usb/storage/unusual_devs.h          |    7 ++
 drivers/watchdog/rdc321x_wdt.c              |    2 +-
 fs/exec.c                                   |    5 +
 fs/fuse/file.c                              |   72 +++++++++++-
 fs/nfs/file.c                               |    2 +
 fs/nfs/mount_clnt.c                         |    4 +-
 fs/nfsd/nfs3xdr.c                           |    6 +-
 fs/nfsd/xdr4.h                              |   21 ++--
 fs/notify/inotify/inotify_user.c            |    1 +
 include/linux/blkdev.h                      |    9 +-
 include/linux/bootmem.h                     |    2 +
 include/linux/mfd/wm8994/pdata.h            |    2 +-
 include/linux/pm_runtime.h                  |    3 +-
 include/linux/sched.h                       |    2 +-
 include/linux/socket.h                      |    5 +
 include/linux/user_namespace.h              |   14 +++
 include/net/af_unix.h                       |    6 +-
 include/net/scm.h                           |   28 ++++-
 include/net/sock.h                          |    4 +-
 include/xen/interface/io/ring.h             |   11 ++-
 kernel/exit.c                               |    8 ++
 kernel/fork.c                               |    1 +
 kernel/power/user.c                         |    2 +-
 kernel/printk.c                             |    4 +-
 kernel/sched.c                              |  156 ++++++++++++++++++++++++---
 kernel/timer.c                              |    8 ++-
 kernel/trace/trace.c                        |   10 ++-
 kernel/user.c                               |    1 +
 kernel/user_namespace.c                     |   44 ++++++++
 mm/mmap.c                                   |   16 ++-
 net/ax25/af_ax25.c                          |    2 +-
 net/bridge/br_multicast.c                   |    2 +-
 net/core/dst.c                              |    1 +
 net/core/filter.c                           |   19 +---
 net/core/scm.c                              |   24 ++++
 net/core/sock.c                             |   15 +++
 net/econet/af_econet.c                      |   12 ++-
 net/ipv4/tcp.c                              |    2 +-
 net/ipv4/tcp_ipv4.c                         |    8 +-
 net/ipv4/tcp_output.c                       |   42 ++++----
 net/l2tp/l2tp_ip.c                          |    6 +-
 net/llc/af_llc.c                            |    5 +-
 net/mac80211/agg-tx.c                       |    2 +-
 net/mac80211/rx.c                           |    5 +-
 net/mac80211/tx.c                           |   21 +++-
 net/packet/af_packet.c                      |    7 +-
 net/sched/cls_cgroup.c                      |    2 -
 net/sunrpc/svc_xprt.c                       |    9 ++-
 net/unix/af_unix.c                          |   86 +++++++++++-----
 net/unix/garbage.c                          |    9 ++-
 net/x25/x25_link.c                          |    1 +
 security/integrity/ima/ima_policy.c         |    2 +
 sound/oss/soundcard.c                       |    4 +-
 sound/pci/hda/hda_intel.c                   |    2 +
 sound/pci/hda/patch_conexant.c              |    4 +-
 sound/pci/hda/patch_realtek.c               |    1 +
 sound/soc/codecs/wm8580.c                   |    2 +-
 sound/soc/codecs/wm8904.c                   |    3 +-
 sound/soc/codecs/wm8955.c                   |    3 +-
 sound/soc/codecs/wm_hubs.c                  |    2 +-
 158 files changed, 1324 insertions(+), 907 deletions(-)

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

* [PATCH] [1/139] x86, hotplug: Use mwait to offline a processor, fix the legacy case
  2011-02-02  0:43 [PATCH] [0/139] 2.6.35.11 longterm review Andi Kleen
@ 2011-02-02  0:43 ` Andi Kleen
  2011-02-02  0:43 ` [PATCH] [2/139] fuse: verify ioctl retries Andi Kleen
                   ` (138 subsequent siblings)
  139 siblings, 0 replies; 149+ messages in thread
From: Andi Kleen @ 2011-02-02  0:43 UTC (permalink / raw)
  To: lenb, linux-pm, x86, hpa, len.brown, gregkh, ak, linux-kernel, stable

2.6.35-longterm review patch.  If anyone has any objections, please let me know.

------------------

From: H. Peter Anvin <hpa@linux.intel.com>

upstream ea53069231f9317062910d6e772cca4ce93de8c8
x86, hotplug: Use mwait to offline a processor, fix the legacy case

Here included also some small follow-on patches to the same code:

upstream a68e5c94f7d3dd64fef34dd5d97e365cae4bb42a
x86, hotplug: Move WBINVD back outside the play_dead loop

upstream ce5f68246bf2385d6174856708d0b746dc378f20
x86, hotplug: In the MWAIT case of play_dead, CLFLUSH the cache line

https://bugzilla.kernel.org/show_bug.cgi?id=5471

Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: Andi Kleen <ak@linux.intel.com>

---
 arch/x86/include/asm/processor.h |   23 ----------
 arch/x86/kernel/smpboot.c        |   85 ++++++++++++++++++++++++++++++++++++++-
 2 files changed, 84 insertions(+), 24 deletions(-)

Index: linux-2.6.35.y/arch/x86/include/asm/processor.h
===================================================================
--- linux-2.6.35.y.orig/arch/x86/include/asm/processor.h
+++ linux-2.6.35.y/arch/x86/include/asm/processor.h
@@ -763,29 +763,6 @@ extern unsigned long		boot_option_idle_o
 extern unsigned long		idle_halt;
 extern unsigned long		idle_nomwait;
 
-/*
- * on systems with caches, caches must be flashed as the absolute
- * last instruction before going into a suspended halt.  Otherwise,
- * dirty data can linger in the cache and become stale on resume,
- * leading to strange errors.
- *
- * perform a variety of operations to guarantee that the compiler
- * will not reorder instructions.  wbinvd itself is serializing
- * so the processor will not reorder.
- *
- * Systems without cache can just go into halt.
- */
-static inline void wbinvd_halt(void)
-{
-	mb();
-	/* check for clflush to determine if wbinvd is legal */
-	if (cpu_has_clflush)
-		asm volatile("cli; wbinvd; 1: hlt; jmp 1b" : : : "memory");
-	else
-		while (1)
-			halt();
-}
-
 extern void enable_sep_cpu(void);
 extern int sysenter_setup(void);
 
Index: linux-2.6.35.y/arch/x86/kernel/smpboot.c
===================================================================
--- linux-2.6.35.y.orig/arch/x86/kernel/smpboot.c
+++ linux-2.6.35.y/arch/x86/kernel/smpboot.c
@@ -1387,11 +1387,94 @@ void play_dead_common(void)
 	local_irq_disable();
 }
 
+#define MWAIT_SUBSTATE_MASK		0xf
+#define MWAIT_SUBSTATE_SIZE		4
+
+#define CPUID_MWAIT_LEAF		5
+#define CPUID5_ECX_EXTENSIONS_SUPPORTED 0x1
+
+/*
+ * We need to flush the caches before going to sleep, lest we have
+ * dirty data in our caches when we come back up.
+ */
+static inline void mwait_play_dead(void)
+{
+	unsigned int eax, ebx, ecx, edx;
+	unsigned int highest_cstate = 0;
+	unsigned int highest_subcstate = 0;
+	int i;
+	void *mwait_ptr;
+
+	if (!cpu_has(&current_cpu_data, X86_FEATURE_MWAIT))
+		return;
+	if (!cpu_has(&current_cpu_data, X86_FEATURE_CLFLSH))
+		return;
+	if (current_cpu_data.cpuid_level < CPUID_MWAIT_LEAF)
+		return;
+
+	eax = CPUID_MWAIT_LEAF;
+	ecx = 0;
+	native_cpuid(&eax, &ebx, &ecx, &edx);
+
+	/*
+	 * eax will be 0 if EDX enumeration is not valid.
+	 * Initialized below to cstate, sub_cstate value when EDX is valid.
+	 */
+	if (!(ecx & CPUID5_ECX_EXTENSIONS_SUPPORTED)) {
+		eax = 0;
+	} else {
+		edx >>= MWAIT_SUBSTATE_SIZE;
+		for (i = 0; i < 7 && edx; i++, edx >>= MWAIT_SUBSTATE_SIZE) {
+			if (edx & MWAIT_SUBSTATE_MASK) {
+				highest_cstate = i;
+				highest_subcstate = edx & MWAIT_SUBSTATE_MASK;
+			}
+		}
+		eax = (highest_cstate << MWAIT_SUBSTATE_SIZE) |
+			(highest_subcstate - 1);
+	}
+
+	/*
+	 * This should be a memory location in a cache line which is
+	 * unlikely to be touched by other processors.  The actual
+	 * content is immaterial as it is not actually modified in any way.
+	 */
+	mwait_ptr = &current_thread_info()->flags;
+
+	wbinvd();
+
+	while (1) {
+		/*
+		 * The CLFLUSH is a workaround for erratum AAI65 for
+		 * the Xeon 7400 series.  It's not clear it is actually
+		 * needed, but it should be harmless in either case.
+		 * The WBINVD is insufficient due to the spurious-wakeup
+		 * case where we return around the loop.
+		 */
+		clflush(mwait_ptr);
+		__monitor(mwait_ptr, 0, 0);
+		mb();
+		__mwait(eax, 0);
+	}
+}
+
+static inline void hlt_play_dead(void)
+{
+	if (current_cpu_data.x86 >= 4)
+		wbinvd();
+
+	while (1) {
+		native_halt();
+	}
+}
+
 void native_play_dead(void)
 {
 	play_dead_common();
 	tboot_shutdown(TB_SHUTDOWN_WFS);
-	wbinvd_halt();
+
+	mwait_play_dead();	/* Only returns on failure */
+	hlt_play_dead();
 }
 
 #else /* ... !CONFIG_HOTPLUG_CPU */

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

* [PATCH] [2/139] fuse: verify ioctl retries
  2011-02-02  0:43 [PATCH] [0/139] 2.6.35.11 longterm review Andi Kleen
  2011-02-02  0:43 ` [PATCH] [1/139] x86, hotplug: Use mwait to offline a processor, fix the legacy case Andi Kleen
@ 2011-02-02  0:43 ` Andi Kleen
  2011-02-02  0:43 ` [PATCH] [3/139] fuse: fix ioctl when server is 32bit Andi Kleen
                   ` (137 subsequent siblings)
  139 siblings, 0 replies; 149+ messages in thread
From: Andi Kleen @ 2011-02-02  0:43 UTC (permalink / raw)
  To: mszeredi, ak, tj, gregkh, linux-kernel, stable

2.6.35-longterm review patch.  If anyone has any objections, please let me know.

------------------
From: Miklos Szeredi <mszeredi@suse.cz>

commit 7572777eef78ebdee1ecb7c258c0ef94d35bad16 upstream.

Verify that the total length of the iovec returned in FUSE_IOCTL_RETRY
doesn't overflow iov_length().

Signed-off-by: Miklos Szeredi <mszeredi@suse.cz>
Signed-off-by: Andi Kleen <ak@linux.intel.com>
CC: Tejun Heo <tj@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

---
 fs/fuse/file.c |   22 ++++++++++++++++++++++
 1 file changed, 22 insertions(+)

Index: linux-2.6.35.y/fs/fuse/file.c
===================================================================
--- linux-2.6.35.y.orig/fs/fuse/file.c
+++ linux-2.6.35.y/fs/fuse/file.c
@@ -1627,6 +1627,20 @@ static int fuse_ioctl_copy_user(struct p
 	return 0;
 }
 
+/* Make sure iov_length() won't overflow */
+static int fuse_verify_ioctl_iov(struct iovec *iov, size_t count)
+{
+	size_t n;
+	u32 max = FUSE_MAX_PAGES_PER_REQ << PAGE_SHIFT;
+
+	for (n = 0; n < count; n++) {
+		if (iov->iov_len > (size_t) max)
+			return -ENOMEM;
+		max -= iov->iov_len;
+	}
+	return 0;
+}
+
 /*
  * For ioctls, there is no generic way to determine how much memory
  * needs to be read and/or written.  Furthermore, ioctls are allowed
@@ -1820,6 +1834,14 @@ long fuse_do_ioctl(struct file *file, un
 		in_iov = page_address(iov_page);
 		out_iov = in_iov + in_iovs;
 
+		err = fuse_verify_ioctl_iov(in_iov, in_iovs);
+		if (err)
+			goto out;
+
+		err = fuse_verify_ioctl_iov(out_iov, out_iovs);
+		if (err)
+			goto out;
+
 		goto retry;
 	}
 

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

* [PATCH] [3/139] fuse: fix ioctl when server is 32bit
  2011-02-02  0:43 [PATCH] [0/139] 2.6.35.11 longterm review Andi Kleen
  2011-02-02  0:43 ` [PATCH] [1/139] x86, hotplug: Use mwait to offline a processor, fix the legacy case Andi Kleen
  2011-02-02  0:43 ` [PATCH] [2/139] fuse: verify ioctl retries Andi Kleen
@ 2011-02-02  0:43 ` Andi Kleen
  2011-02-02  0:43 ` [PATCH] [4/139] ALSA: HDA: Quirk for Dell Vostro 320 to make microphone work Andi Kleen
                   ` (136 subsequent siblings)
  139 siblings, 0 replies; 149+ messages in thread
From: Andi Kleen @ 2011-02-02  0:43 UTC (permalink / raw)
  To: mszeredi, ak, tj, gregkh, linux-kernel, stable

2.6.35-longterm review patch.  If anyone has any objections, please let me know.

------------------
From: Miklos Szeredi <mszeredi@suse.cz>

commit d9d318d39dd5cb686660504a3565aac453709ccc upstream.

If a 32bit CUSE server is run on 64bit this results in EIO being
returned to the caller.

The reason is that FUSE_IOCTL_RETRY reply was defined to use 'struct
iovec', which is different on 32bit and 64bit archs.

Work around this by looking at the size of the reply to determine
which struct was used.  This is only needed if CONFIG_COMPAT is
defined.

A more permanent fix for the interface will be to use the same struct
on both 32bit and 64bit.

Reported-by: "ccmail111" <ccmail111@yahoo.com>
Signed-off-by: Miklos Szeredi <mszeredi@suse.cz>
Signed-off-by: Andi Kleen <ak@linux.intel.com>
CC: Tejun Heo <tj@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

---
 fs/fuse/file.c |   50 ++++++++++++++++++++++++++++++++++++++++++++------
 1 file changed, 44 insertions(+), 6 deletions(-)

Index: linux-2.6.35.y/fs/fuse/file.c
===================================================================
--- linux-2.6.35.y.orig/fs/fuse/file.c
+++ linux-2.6.35.y/fs/fuse/file.c
@@ -13,6 +13,7 @@
 #include <linux/kernel.h>
 #include <linux/sched.h>
 #include <linux/module.h>
+#include <linux/compat.h>
 
 static const struct file_operations fuse_direct_io_file_operations;
 
@@ -1642,6 +1643,44 @@ static int fuse_verify_ioctl_iov(struct 
 }
 
 /*
+ * CUSE servers compiled on 32bit broke on 64bit kernels because the
+ * ABI was defined to be 'struct iovec' which is different on 32bit
+ * and 64bit.  Fortunately we can determine which structure the server
+ * used from the size of the reply.
+ */
+static int fuse_copy_ioctl_iovec(struct iovec *dst, void *src,
+				 size_t transferred, unsigned count,
+				 bool is_compat)
+{
+#ifdef CONFIG_COMPAT
+	if (count * sizeof(struct compat_iovec) == transferred) {
+		struct compat_iovec *ciov = src;
+		unsigned i;
+
+		/*
+		 * With this interface a 32bit server cannot support
+		 * non-compat (i.e. ones coming from 64bit apps) ioctl
+		 * requests
+		 */
+		if (!is_compat)
+			return -EINVAL;
+
+		for (i = 0; i < count; i++) {
+			dst[i].iov_base = compat_ptr(ciov[i].iov_base);
+			dst[i].iov_len = ciov[i].iov_len;
+		}
+		return 0;
+	}
+#endif
+
+	if (count * sizeof(struct iovec) != transferred)
+		return -EIO;
+
+	memcpy(dst, src, transferred);
+	return 0;
+}
+
+/*
  * For ioctls, there is no generic way to determine how much memory
  * needs to be read and/or written.  Furthermore, ioctls are allowed
  * to dereference the passed pointer, so the parameter requires deep
@@ -1822,14 +1861,13 @@ long fuse_do_ioctl(struct file *file, un
 		    in_iovs + out_iovs > FUSE_IOCTL_MAX_IOV)
 			goto out;
 
-		err = -EIO;
-		if ((in_iovs + out_iovs) * sizeof(struct iovec) != transferred)
-			goto out;
-
-		/* okay, copy in iovs and retry */
 		vaddr = kmap_atomic(pages[0], KM_USER0);
-		memcpy(page_address(iov_page), vaddr, transferred);
+		err = fuse_copy_ioctl_iovec(page_address(iov_page), vaddr,
+					    transferred, in_iovs + out_iovs,
+					    (flags & FUSE_IOCTL_COMPAT) != 0);
 		kunmap_atomic(vaddr, KM_USER0);
+		if (err)
+			goto out;
 
 		in_iov = page_address(iov_page);
 		out_iov = in_iov + in_iovs;

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

* [PATCH] [4/139] ALSA: HDA: Quirk for Dell Vostro 320 to make microphone work
  2011-02-02  0:43 [PATCH] [0/139] 2.6.35.11 longterm review Andi Kleen
                   ` (2 preceding siblings ...)
  2011-02-02  0:43 ` [PATCH] [3/139] fuse: fix ioctl when server is 32bit Andi Kleen
@ 2011-02-02  0:43 ` Andi Kleen
  2011-02-02  0:43 ` [PATCH] [5/139] ALSA: hda: Use position_fix=1 for Acer Aspire 5538 to enable capture on internal mic Andi Kleen
                   ` (135 subsequent siblings)
  139 siblings, 0 replies; 149+ messages in thread
From: Andi Kleen @ 2011-02-02  0:43 UTC (permalink / raw)
  To: david.henningsson, tiwai, gregkh, ak, linux-kernel, stable

2.6.35-longterm review patch.  If anyone has any objections, please let me know.

------------------
From: David Henningsson <david.henningsson@canonical.com>

commit 8a96b1e02029aa512199b1b6d281dcede9ed81f1 upstream.

BugLink: http://launchpad.net/497546

Confirmed that the ideapad model works better than the current
quirk for Dell Vostro 320.

Signed-off-by: David Henningsson <david.henningsson@canonical.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: Andi Kleen <ak@linux.intel.com>

---
 sound/pci/hda/patch_conexant.c |    3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

Index: linux-2.6.35.y/sound/pci/hda/patch_conexant.c
===================================================================
--- linux-2.6.35.y.orig/sound/pci/hda/patch_conexant.c
+++ linux-2.6.35.y/sound/pci/hda/patch_conexant.c
@@ -3026,8 +3026,7 @@ static const char *cxt5066_models[CXT506
 static struct snd_pci_quirk cxt5066_cfg_tbl[] = {
 	SND_PCI_QUIRK(0x14f1, 0x0101, "Conexant Reference board",
 		      CXT5066_LAPTOP),
-	SND_PCI_QUIRK(0x1028, 0x02f5, "Dell",
-		      CXT5066_DELL_LAPTOP),
+	SND_PCI_QUIRK(0x1028, 0x02f5, "Dell Vostro 320", CXT5066_IDEAPAD),
 	SND_PCI_QUIRK(0x152d, 0x0833, "OLPC XO-1.5", CXT5066_OLPC_XO_1_5),
 	SND_PCI_QUIRK(0x1028, 0x02d8, "Dell Vostro", CXT5066_DELL_VOSTO),
 	SND_PCI_QUIRK(0x1028, 0x0402, "Dell Vostro", CXT5066_DELL_VOSTO),

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

* [PATCH] [5/139] ALSA: hda: Use position_fix=1 for Acer Aspire 5538 to enable capture on internal mic
  2011-02-02  0:43 [PATCH] [0/139] 2.6.35.11 longterm review Andi Kleen
                   ` (3 preceding siblings ...)
  2011-02-02  0:43 ` [PATCH] [4/139] ALSA: HDA: Quirk for Dell Vostro 320 to make microphone work Andi Kleen
@ 2011-02-02  0:43 ` Andi Kleen
  2011-02-02  0:43 ` [PATCH] [6/139] ALSA: hda: Use model=lg quirk for LG P1 Express to enable playback and capture Andi Kleen
                   ` (134 subsequent siblings)
  139 siblings, 0 replies; 149+ messages in thread
From: Andi Kleen @ 2011-02-02  0:43 UTC (permalink / raw)
  To: crimsun, tiwai, gregkh, ak, linux-kernel, stable

2.6.35-longterm review patch.  If anyone has any objections, please let me know.

------------------
From: Daniel T Chen <crimsun@ubuntu.com>

commit dd5a089edfa51a74692604b4b427953d8e16bc35 upstream.

BugLink: https://launchpad.net/bugs/685161

The reporter of the bug states that he must use position_fix=1 to enable
capture for the internal microphone, so set it for his machine's PCI
SSID.  Verified using 2.6.35 and the 2010-12-04 alsa-driver build.

Reported-and-tested-by: Ralph Wabel <rwabel@gmx.net>
Signed-off-by: Daniel T Chen <crimsun@ubuntu.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: Andi Kleen <ak@linux.intel.com>

---
 sound/pci/hda/hda_intel.c |    1 +
 1 file changed, 1 insertion(+)

Index: linux-2.6.35.y/sound/pci/hda/hda_intel.c
===================================================================
--- linux-2.6.35.y.orig/sound/pci/hda/hda_intel.c
+++ linux-2.6.35.y/sound/pci/hda/hda_intel.c
@@ -2291,6 +2291,7 @@ static int azx_dev_free(struct snd_devic
  */
 static struct snd_pci_quirk position_fix_list[] __devinitdata = {
 	SND_PCI_QUIRK(0x1025, 0x009f, "Acer Aspire 5110", POS_FIX_LPIB),
+	SND_PCI_QUIRK(0x1025, 0x026f, "Acer Aspire 5538", POS_FIX_LPIB),
 	SND_PCI_QUIRK(0x1028, 0x01cc, "Dell D820", POS_FIX_LPIB),
 	SND_PCI_QUIRK(0x1028, 0x01de, "Dell Precision 390", POS_FIX_LPIB),
 	SND_PCI_QUIRK(0x1028, 0x01f6, "Dell Latitude 131L", POS_FIX_LPIB),

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

* [PATCH] [6/139] ALSA: hda: Use model=lg quirk for LG P1 Express to enable playback and capture
  2011-02-02  0:43 [PATCH] [0/139] 2.6.35.11 longterm review Andi Kleen
                   ` (4 preceding siblings ...)
  2011-02-02  0:43 ` [PATCH] [5/139] ALSA: hda: Use position_fix=1 for Acer Aspire 5538 to enable capture on internal mic Andi Kleen
@ 2011-02-02  0:43 ` Andi Kleen
  2011-02-02  0:43 ` [PATCH] [7/139] drm/radeon/kms: don't apply 7xx HDP flush workaround on AGP Andi Kleen
                   ` (133 subsequent siblings)
  139 siblings, 0 replies; 149+ messages in thread
From: Andi Kleen @ 2011-02-02  0:43 UTC (permalink / raw)
  To: crimsun, nikhov, tiwai, gregkh, ak, linux-kernel, stable

2.6.35-longterm review patch.  If anyone has any objections, please let me know.

------------------
From: Daniel T Chen <crimsun@ubuntu.com>

commit 77c4d5cdb81d25a45fbdfb84dd3348121219a072 upstream.

BugLink: https://launchpad.net/bugs/595482

The original reporter states that audible playback from the internal
speaker is inaudible despite the hardware being properly detected.  To
work around this symptom, he uses the model=lg quirk to properly enable
both playback, capture, and jack sense.  Another user corroborates this
workaround on separate hardware.  Add this PCI SSID to the quirk table
to enable it for further LG P1 Expresses.

Reported-and-tested-by: Philip Peitsch <philip.peitsch@gmail.com>
Tested-by: nikhov
Signed-off-by: Daniel T Chen <crimsun@ubuntu.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: Andi Kleen <ak@linux.intel.com>

---
 sound/pci/hda/patch_realtek.c |    1 +
 1 file changed, 1 insertion(+)

Index: linux-2.6.35.y/sound/pci/hda/patch_realtek.c
===================================================================
--- linux-2.6.35.y.orig/sound/pci/hda/patch_realtek.c
+++ linux-2.6.35.y/sound/pci/hda/patch_realtek.c
@@ -4240,6 +4240,7 @@ static struct snd_pci_quirk alc880_cfg_t
 	SND_PCI_QUIRK(0x1734, 0x10b0, "Fujitsu", ALC880_FUJITSU),
 	SND_PCI_QUIRK(0x1854, 0x0018, "LG LW20", ALC880_LG_LW),
 	SND_PCI_QUIRK(0x1854, 0x003b, "LG", ALC880_LG),
+	SND_PCI_QUIRK(0x1854, 0x005f, "LG P1 Express", ALC880_LG),
 	SND_PCI_QUIRK(0x1854, 0x0068, "LG w1", ALC880_LG),
 	SND_PCI_QUIRK(0x1854, 0x0077, "LG LW25", ALC880_LG_LW),
 	SND_PCI_QUIRK(0x19db, 0x4188, "TCL S700", ALC880_TCL_S700),

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

* [PATCH] [7/139] drm/radeon/kms: don't apply 7xx HDP flush workaround on AGP
  2011-02-02  0:43 [PATCH] [0/139] 2.6.35.11 longterm review Andi Kleen
                   ` (5 preceding siblings ...)
  2011-02-02  0:43 ` [PATCH] [6/139] ALSA: hda: Use model=lg quirk for LG P1 Express to enable playback and capture Andi Kleen
@ 2011-02-02  0:43 ` Andi Kleen
  2011-02-02  0:43 ` [PATCH] [8/139] drm/kms: remove spaces from connector names (v2) Andi Kleen
                   ` (132 subsequent siblings)
  139 siblings, 0 replies; 149+ messages in thread
From: Andi Kleen @ 2011-02-02  0:43 UTC (permalink / raw)
  To: alexdeucher, ak, airlied, gregkh, linux-kernel, stable

2.6.35-longterm review patch.  If anyone has any objections, please let me know.

------------------
From: Alex Deucher <alexdeucher@gmail.com>

commit f3886f85cfde578f1d0ba6e40ac5f9d70043923b upstream.

It should be required for all 7xx asics, but seems to cause
problems on some AGP 7xx chips.

Fixes:
https://bugzilla.kernel.org/show_bug.cgi?id=19002

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
Signed-off-by: Andi Kleen <ak@linux.intel.com>
Reported-and-Tested-by: Duncan <1i5t5.duncan@cox.net>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

---
 drivers/gpu/drm/radeon/r600.c |   11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)

Index: linux-2.6.35.y/drivers/gpu/drm/radeon/r600.c
===================================================================
--- linux-2.6.35.y.orig/drivers/gpu/drm/radeon/r600.c
+++ linux-2.6.35.y/drivers/gpu/drm/radeon/r600.c
@@ -869,12 +869,15 @@ void r600_pcie_gart_tlb_flush(struct rad
 	u32 tmp;
 
 	/* flush hdp cache so updates hit vram */
-	if ((rdev->family >= CHIP_RV770) && (rdev->family <= CHIP_RV740)) {
+	if ((rdev->family >= CHIP_RV770) && (rdev->family <= CHIP_RV740) &&
+	    !(rdev->flags & RADEON_IS_AGP)) {
 		void __iomem *ptr = (void *)rdev->gart.table.vram.ptr;
 		u32 tmp;
 
 		/* r7xx hw bug.  write to HDP_DEBUG1 followed by fb read
 		 * rather than write to HDP_REG_COHERENCY_FLUSH_CNTL
+		 * This seems to cause problems on some AGP cards. Just use the old
+		 * method for them.
 		 */
 		WREG32(HDP_DEBUG1, 0);
 		tmp = readl((void __iomem *)ptr);
@@ -3523,10 +3526,12 @@ int r600_debugfs_mc_info_init(struct rad
 void r600_ioctl_wait_idle(struct radeon_device *rdev, struct radeon_bo *bo)
 {
 	/* r7xx hw bug.  write to HDP_DEBUG1 followed by fb read
-	 * rather than write to HDP_REG_COHERENCY_FLUSH_CNTL
+	 * rather than write to HDP_REG_COHERENCY_FLUSH_CNTL.
+	 * This seems to cause problems on some AGP cards. Just use the old
+	 * method for them.
 	 */
 	if ((rdev->family >= CHIP_RV770) && (rdev->family <= CHIP_RV740) &&
-	    rdev->vram_scratch.ptr) {
+	    rdev->vram_scratch.ptr && !(rdev->flags & RADEON_IS_AGP)) {
 		void __iomem *ptr = (void *)rdev->vram_scratch.ptr;
 		u32 tmp;
 

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

* [PATCH] [8/139] drm/kms: remove spaces from connector names (v2)
  2011-02-02  0:43 [PATCH] [0/139] 2.6.35.11 longterm review Andi Kleen
                   ` (6 preceding siblings ...)
  2011-02-02  0:43 ` [PATCH] [7/139] drm/radeon/kms: don't apply 7xx HDP flush workaround on AGP Andi Kleen
@ 2011-02-02  0:43 ` Andi Kleen
  2011-02-02  0:43 ` [PATCH] [9/139] drm/radeon/kms: fix vram base calculation on rs780/rs880 Andi Kleen
                   ` (131 subsequent siblings)
  139 siblings, 0 replies; 149+ messages in thread
From: Andi Kleen @ 2011-02-02  0:43 UTC (permalink / raw)
  To: alexdeucher, ml, airlied, gregkh, ak, linux-kernel, stable

2.6.35-longterm review patch.  If anyone has any objections, please let me know.

------------------
From: Alex Deucher <alexdeucher@gmail.com>

commit e76116ca9671e2e5239054a40303b94feab585ad upstream.

Grub doesn't parse spaces in parameters correctly, so
this makes it impossible to force video= parameters
for kms on the grub kernel command line.

v2: shorten the names to make them easier to type.

Reported-by: Sergej Pupykin <ml@sergej.pp.ru>

Cc: Sergej Pupykin <ml@sergej.pp.ru>
Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: Andi Kleen <ak@linux.intel.com>

---
 drivers/gpu/drm/drm_crtc.c |   10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

Index: linux-2.6.35.y/drivers/gpu/drm/drm_crtc.c
===================================================================
--- linux-2.6.35.y.orig/drivers/gpu/drm/drm_crtc.c
+++ linux-2.6.35.y/drivers/gpu/drm/drm_crtc.c
@@ -155,12 +155,12 @@ static struct drm_conn_prop_enum_list dr
 	{ DRM_MODE_CONNECTOR_SVIDEO, "SVIDEO", 0 },
 	{ DRM_MODE_CONNECTOR_LVDS, "LVDS", 0 },
 	{ DRM_MODE_CONNECTOR_Component, "Component", 0 },
-	{ DRM_MODE_CONNECTOR_9PinDIN, "9-pin DIN", 0 },
-	{ DRM_MODE_CONNECTOR_DisplayPort, "DisplayPort", 0 },
-	{ DRM_MODE_CONNECTOR_HDMIA, "HDMI Type A", 0 },
-	{ DRM_MODE_CONNECTOR_HDMIB, "HDMI Type B", 0 },
+	{ DRM_MODE_CONNECTOR_9PinDIN, "DIN", 0 },
+	{ DRM_MODE_CONNECTOR_DisplayPort, "DP", 0 },
+	{ DRM_MODE_CONNECTOR_HDMIA, "HDMI-A", 0 },
+	{ DRM_MODE_CONNECTOR_HDMIB, "HDMI-B", 0 },
 	{ DRM_MODE_CONNECTOR_TV, "TV", 0 },
-	{ DRM_MODE_CONNECTOR_eDP, "Embedded DisplayPort", 0 },
+	{ DRM_MODE_CONNECTOR_eDP, "eDP", 0 },
 };
 
 static struct drm_prop_enum_list drm_encoder_enum_list[] =

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

* [PATCH] [9/139] drm/radeon/kms: fix vram base calculation on rs780/rs880
  2011-02-02  0:43 [PATCH] [0/139] 2.6.35.11 longterm review Andi Kleen
                   ` (7 preceding siblings ...)
  2011-02-02  0:43 ` [PATCH] [8/139] drm/kms: remove spaces from connector names (v2) Andi Kleen
@ 2011-02-02  0:43 ` Andi Kleen
  2011-02-02  0:43 ` [PATCH] [10/139] nohz: Fix printk_needs_cpu() return value on offline cpus Andi Kleen
                   ` (130 subsequent siblings)
  139 siblings, 0 replies; 149+ messages in thread
From: Andi Kleen @ 2011-02-02  0:43 UTC (permalink / raw)
  To: alexdeucher, airlied, gregkh, ak, linux-kernel, stable

2.6.35-longterm review patch.  If anyone has any objections, please let me know.

------------------
From: Alex Deucher <alexdeucher@gmail.com>

commit 8961d52d4cc52edf5672f8f2712c57162b736793 upstream.

Avoid overflowing a 32 bit value.

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: Andi Kleen <ak@linux.intel.com>

---
 drivers/gpu/drm/radeon/r600.c |    6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

Index: linux-2.6.35.y/drivers/gpu/drm/radeon/r600.c
===================================================================
--- linux-2.6.35.y.orig/drivers/gpu/drm/radeon/r600.c
+++ linux-2.6.35.y/drivers/gpu/drm/radeon/r600.c
@@ -1189,8 +1189,10 @@ void r600_vram_gtt_location(struct radeo
 				mc->vram_end, mc->real_vram_size >> 20);
 	} else {
 		u64 base = 0;
-		if (rdev->flags & RADEON_IS_IGP)
-			base = (RREG32(MC_VM_FB_LOCATION) & 0xFFFF) << 24;
+		if (rdev->flags & RADEON_IS_IGP) {
+			base = RREG32(MC_VM_FB_LOCATION) & 0xFFFF;
+			base <<= 24;
+		}
 		radeon_vram_location(rdev, &rdev->mc, base);
 		rdev->mc.gtt_base_align = 0;
 		radeon_gtt_location(rdev, mc);

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

* [PATCH] [10/139] nohz: Fix printk_needs_cpu() return value on offline cpus
  2011-02-02  0:43 [PATCH] [0/139] 2.6.35.11 longterm review Andi Kleen
                   ` (8 preceding siblings ...)
  2011-02-02  0:43 ` [PATCH] [9/139] drm/radeon/kms: fix vram base calculation on rs780/rs880 Andi Kleen
@ 2011-02-02  0:43 ` Andi Kleen
  2011-02-02  0:43 ` [PATCH] [11/139] nohz: Fix get_next_timer_interrupt() vs cpu hotplug Andi Kleen
                   ` (129 subsequent siblings)
  139 siblings, 0 replies; 149+ messages in thread
From: Andi Kleen @ 2011-02-02  0:43 UTC (permalink / raw)
  To: heiko.carstens, a.p.zijlstra, ak, mingo, gregkh, linux-kernel, stable

2.6.35-longterm review patch.  If anyone has any objections, please let me know.

------------------
From: Heiko Carstens <heiko.carstens@de.ibm.com>

commit 61ab25447ad6334a74e32f60efb135a3467223f8 upstream.

This patch fixes a hang observed with 2.6.32 kernels where timers got enqueued
on offline cpus.

printk_needs_cpu() may return 1 if called on offline cpus. When a cpu gets
offlined it schedules the idle process which, before killing its own cpu, will
call tick_nohz_stop_sched_tick(). That function in turn will call
printk_needs_cpu() in order to check if the local tick can be disabled. On
offline cpus this function should naturally return 0 since regardless if the
tick gets disabled or not the cpu will be dead short after. That is besides the
fact that __cpu_disable() should already have made sure that no interrupts on
the offlined cpu will be delivered anyway.

In this case it prevents tick_nohz_stop_sched_tick() to call
select_nohz_load_balancer(). No idea if that really is a problem. However what
made me debug this is that on 2.6.32 the function get_nohz_load_balancer() is
used within __mod_timer() to select a cpu on which a timer gets enqueued. If
printk_needs_cpu() returns 1 then the nohz_load_balancer cpu doesn't get
updated when a cpu gets offlined. It may contain the cpu number of an offline
cpu. In turn timers get enqueued on an offline cpu and not very surprisingly
they never expire and cause system hangs.

This has been observed 2.6.32 kernels. On current kernels __mod_timer() uses
get_nohz_timer_target() which doesn't have that problem. However there might be
other problems because of the too early exit tick_nohz_stop_sched_tick() in
case a cpu goes offline.

Easiest way to fix this is just to test if the current cpu is offline and call
printk_tick() directly which clears the condition.

Alternatively I tried a cpu hotplug notifier which would clear the condition,
however between calling the notifier function and printk_needs_cpu() something
could have called printk() again and the problem is back again. This seems to
be the safest fix.

Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
Signed-off-by: Andi Kleen <ak@linux.intel.com>
LKML-Reference: <20101126120235.406766476@de.ibm.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

---
 kernel/printk.c |    2 ++
 1 file changed, 2 insertions(+)

Index: linux-2.6.35.y/kernel/printk.c
===================================================================
--- linux-2.6.35.y.orig/kernel/printk.c
+++ linux-2.6.35.y/kernel/printk.c
@@ -1034,6 +1034,8 @@ void printk_tick(void)
 
 int printk_needs_cpu(int cpu)
 {
+	if (unlikely(cpu_is_offline(cpu)))
+		printk_tick();
 	return per_cpu(printk_pending, cpu);
 }
 

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

* [PATCH] [11/139] nohz: Fix get_next_timer_interrupt() vs cpu hotplug
  2011-02-02  0:43 [PATCH] [0/139] 2.6.35.11 longterm review Andi Kleen
                   ` (9 preceding siblings ...)
  2011-02-02  0:43 ` [PATCH] [10/139] nohz: Fix printk_needs_cpu() return value on offline cpus Andi Kleen
@ 2011-02-02  0:43 ` Andi Kleen
  2011-02-02  0:43 ` [PATCH] [12/139] NFS: Fix panic after nfs_umount() Andi Kleen
                   ` (128 subsequent siblings)
  139 siblings, 0 replies; 149+ messages in thread
From: Andi Kleen @ 2011-02-02  0:43 UTC (permalink / raw)
  To: heiko.carstens, a.p.zijlstra, ak, mingo, gregkh, linux-kernel, stable

2.6.35-longterm review patch.  If anyone has any objections, please let me know.

------------------
From: Heiko Carstens <heiko.carstens@de.ibm.com>

commit dbd87b5af055a0cc9bba17795c9a2b0d17795389 upstream.

This fixes a bug as seen on 2.6.32 based kernels where timers got
enqueued on offline cpus.

If a cpu goes offline it might still have pending timers. These will
be migrated during CPU_DEAD handling after the cpu is offline.
However while the cpu is going offline it will schedule the idle task
which will then call tick_nohz_stop_sched_tick().

That function in turn will call get_next_timer_intterupt() to figure
out if the tick of the cpu can be stopped or not. If it turns out that
the next tick is just one jiffy off (delta_jiffies == 1)
tick_nohz_stop_sched_tick() incorrectly assumes that the tick should
not stop and takes an early exit and thus it won't update the load
balancer cpu.

Just afterwards the cpu will be killed and the load balancer cpu could
be the offline cpu.

On 2.6.32 based kernel get_nohz_load_balancer() gets called to decide
on which cpu a timer should be enqueued (see __mod_timer()). Which
leads to the possibility that timers get enqueued on an offline cpu.
These will never expire and can cause a system hang.

This has been observed 2.6.32 kernels. On current kernels
__mod_timer() uses get_nohz_timer_target() which doesn't have that
problem. However there might be other problems because of the too
early exit tick_nohz_stop_sched_tick() in case a cpu goes offline.

The easiest and probably safest fix seems to be to let
get_next_timer_interrupt() just lie and let it say there isn't any
pending timer if the current cpu is offline.

I also thought of moving migrate_[hr]timers() from CPU_DEAD to
CPU_DYING, but seeing that there already have been fixes at least in
the hrtimer code in this area I'm afraid that this could add new
subtle bugs.

Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
Signed-off-by: Andi Kleen <ak@linux.intel.com>
LKML-Reference: <20101201091109.GA8984@osiris.boeblingen.de.ibm.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

---
 kernel/timer.c |    6 ++++++
 1 file changed, 6 insertions(+)

Index: linux-2.6.35.y/kernel/timer.c
===================================================================
--- linux-2.6.35.y.orig/kernel/timer.c
+++ linux-2.6.35.y/kernel/timer.c
@@ -1237,6 +1237,12 @@ unsigned long get_next_timer_interrupt(u
 	struct tvec_base *base = __get_cpu_var(tvec_bases);
 	unsigned long expires;
 
+	/*
+	 * Pretend that there is no timer pending if the cpu is offline.
+	 * Possible pending timers will be migrated later to an active cpu.
+	 */
+	if (cpu_is_offline(smp_processor_id()))
+		return now + NEXT_TIMER_MAX_DELTA;
 	spin_lock(&base->lock);
 	if (time_before_eq(base->next_timer, base->timer_jiffies))
 		base->next_timer = __next_timer_interrupt(base);

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

* [PATCH] [12/139] NFS: Fix panic after nfs_umount()
  2011-02-02  0:43 [PATCH] [0/139] 2.6.35.11 longterm review Andi Kleen
                   ` (10 preceding siblings ...)
  2011-02-02  0:43 ` [PATCH] [11/139] nohz: Fix get_next_timer_interrupt() vs cpu hotplug Andi Kleen
@ 2011-02-02  0:43 ` Andi Kleen
  2011-02-02  0:43 ` [PATCH] [13/139] nfsd: Fix possible BUG_ON firing in set_change_info Andi Kleen
                   ` (127 subsequent siblings)
  139 siblings, 0 replies; 149+ messages in thread
From: Andi Kleen @ 2011-02-02  0:43 UTC (permalink / raw)
  To: chuck.lever, stefan.bader, Trond.Myklebust, gregkh, ak,
	linux-kernel, stable

2.6.35-longterm review patch.  If anyone has any objections, please let me know.

------------------
From: Chuck Lever <chuck.lever@oracle.com>

commit 5b362ac3799ff4225c40935500f520cad4d7ed66 upstream.

After a few unsuccessful NFS mount attempts in which the client and
server cannot agree on an authentication flavor both support, the
client panics.  nfs_umount() is invoked in the kernel in this case.

Turns out nfs_umount()'s UMNT RPC invocation causes the RPC client to
write off the end of the rpc_clnt's iostat array.  This is because the
mount client's nrprocs field is initialized with the count of defined
procedures (two: MNT and UMNT), rather than the size of the client's
proc array (four).

The fix is to use the same initialization technique used by most other
upper layer clients in the kernel.

Introduced by commit 0b524123, which failed to update nrprocs when
support was added for UMNT in the kernel.

BugLink: https://bugzilla.kernel.org/show_bug.cgi?id=24302
BugLink: http://bugs.launchpad.net/bugs/683938

Reported-by: Stefan Bader <stefan.bader@canonical.com>
Tested-by: Stefan Bader <stefan.bader@canonical.com>
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: Andi Kleen <ak@linux.intel.com>

---
 fs/nfs/mount_clnt.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Index: linux-2.6.35.y/fs/nfs/mount_clnt.c
===================================================================
--- linux-2.6.35.y.orig/fs/nfs/mount_clnt.c
+++ linux-2.6.35.y/fs/nfs/mount_clnt.c
@@ -503,13 +503,13 @@ static struct rpc_procinfo mnt3_procedur
 
 static struct rpc_version mnt_version1 = {
 	.number		= 1,
-	.nrprocs	= 2,
+	.nrprocs	= ARRAY_SIZE(mnt_procedures),
 	.procs		= mnt_procedures,
 };
 
 static struct rpc_version mnt_version3 = {
 	.number		= 3,
-	.nrprocs	= 2,
+	.nrprocs	= ARRAY_SIZE(mnt3_procedures),
 	.procs		= mnt3_procedures,
 };
 

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

* [PATCH] [13/139] nfsd: Fix possible BUG_ON firing in set_change_info
  2011-02-02  0:43 [PATCH] [0/139] 2.6.35.11 longterm review Andi Kleen
                   ` (11 preceding siblings ...)
  2011-02-02  0:43 ` [PATCH] [12/139] NFS: Fix panic after nfs_umount() Andi Kleen
@ 2011-02-02  0:43 ` Andi Kleen
  2011-02-02  0:43 ` [PATCH] [14/139] NFS: Fix fcntl F_GETLK not reporting some conflicts Andi Kleen
                   ` (126 subsequent siblings)
  139 siblings, 0 replies; 149+ messages in thread
From: Andi Kleen @ 2011-02-02  0:43 UTC (permalink / raw)
  To: neilb, bfields, gregkh, ak, linux-kernel, stable

2.6.35-longterm review patch.  If anyone has any objections, please let me know.

------------------
From: Neil Brown <neilb@suse.de>

commit c1ac3ffcd0bc7e9617f62be8c7043d53ab84deac upstream.

If vfs_getattr in fill_post_wcc returns an error, we don't
set fh_post_change.
For NFSv4, this can result in set_change_info triggering a BUG_ON.
i.e. fh_post_saved being zero isn't really a bug.

So:
 - instead of BUGging when fh_post_saved is zero, just clear ->atomic.
 - if vfs_getattr fails in fill_post_wcc, take a copy of i_ctime anyway.
   This will be used i seg_change_info, but not overly trusted.
 - While we are there, remove the pointless 'if' statements in set_change_info.
   There is no harm setting all the values.

Signed-off-by: NeilBrown <neilb@suse.de>
Signed-off-by: J. Bruce Fields <bfields@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: Andi Kleen <ak@linux.intel.com>

---
 fs/nfsd/nfs3xdr.c |    6 ++++--
 fs/nfsd/xdr4.h    |   21 ++++++++++-----------
 2 files changed, 14 insertions(+), 13 deletions(-)

Index: linux-2.6.35.y/fs/nfsd/nfs3xdr.c
===================================================================
--- linux-2.6.35.y.orig/fs/nfsd/nfs3xdr.c
+++ linux-2.6.35.y/fs/nfsd/nfs3xdr.c
@@ -260,9 +260,11 @@ void fill_post_wcc(struct svc_fh *fhp)
 	err = vfs_getattr(fhp->fh_export->ex_path.mnt, fhp->fh_dentry,
 			&fhp->fh_post_attr);
 	fhp->fh_post_change = fhp->fh_dentry->d_inode->i_version;
-	if (err)
+	if (err) {
 		fhp->fh_post_saved = 0;
-	else
+		/* Grab the ctime anyway - set_change_info might use it */
+		fhp->fh_post_attr.ctime = fhp->fh_dentry->d_inode->i_ctime;
+	} else
 		fhp->fh_post_saved = 1;
 }
 
Index: linux-2.6.35.y/fs/nfsd/xdr4.h
===================================================================
--- linux-2.6.35.y.orig/fs/nfsd/xdr4.h
+++ linux-2.6.35.y/fs/nfsd/xdr4.h
@@ -484,18 +484,17 @@ static inline bool nfsd4_not_cached(stru
 static inline void
 set_change_info(struct nfsd4_change_info *cinfo, struct svc_fh *fhp)
 {
-	BUG_ON(!fhp->fh_pre_saved || !fhp->fh_post_saved);
-	cinfo->atomic = 1;
+	BUG_ON(!fhp->fh_pre_saved);
+	cinfo->atomic = fhp->fh_post_saved;
 	cinfo->change_supported = IS_I_VERSION(fhp->fh_dentry->d_inode);
-	if (cinfo->change_supported) {
-		cinfo->before_change = fhp->fh_pre_change;
-		cinfo->after_change = fhp->fh_post_change;
-	} else {
-		cinfo->before_ctime_sec = fhp->fh_pre_ctime.tv_sec;
-		cinfo->before_ctime_nsec = fhp->fh_pre_ctime.tv_nsec;
-		cinfo->after_ctime_sec = fhp->fh_post_attr.ctime.tv_sec;
-		cinfo->after_ctime_nsec = fhp->fh_post_attr.ctime.tv_nsec;
-	}
+
+	cinfo->before_change = fhp->fh_pre_change;
+	cinfo->after_change = fhp->fh_post_change;
+	cinfo->before_ctime_sec = fhp->fh_pre_ctime.tv_sec;
+	cinfo->before_ctime_nsec = fhp->fh_pre_ctime.tv_nsec;
+	cinfo->after_ctime_sec = fhp->fh_post_attr.ctime.tv_sec;
+	cinfo->after_ctime_nsec = fhp->fh_post_attr.ctime.tv_nsec;
+
 }
 
 int nfs4svc_encode_voidres(struct svc_rqst *, __be32 *, void *);

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

* [PATCH] [14/139] NFS: Fix fcntl F_GETLK not reporting some conflicts
  2011-02-02  0:43 [PATCH] [0/139] 2.6.35.11 longterm review Andi Kleen
                   ` (12 preceding siblings ...)
  2011-02-02  0:43 ` [PATCH] [13/139] nfsd: Fix possible BUG_ON firing in set_change_info Andi Kleen
@ 2011-02-02  0:43 ` Andi Kleen
  2011-02-02  0:43 ` [PATCH] [15/139] sunrpc: prevent use-after-free on clearing XPT_BUSY Andi Kleen
                   ` (125 subsequent siblings)
  139 siblings, 0 replies; 149+ messages in thread
From: Andi Kleen @ 2011-02-02  0:43 UTC (permalink / raw)
  To: vsu, amorozov, Trond.Myklebust, gregkh, ak, linux-kernel, stable

2.6.35-longterm review patch.  If anyone has any objections, please let me know.

------------------
From: Sergey Vlasov <vsu@altlinux.ru>

commit 21ac19d484a8ffb66f64487846c8d53afef04d2b upstream.

The commit 129a84de2347002f09721cda3155ccfd19fade40 (locks: fix F_GETLK
regression (failure to find conflicts)) fixed the posix_test_lock()
function by itself, however, its usage in NFS changed by the commit
9d6a8c5c213e34c475e72b245a8eb709258e968c (locks: give posix_test_lock
same interface as ->lock) remained broken - subsequent NFS-specific
locking code received F_UNLCK instead of the user-specified lock type.
To fix the problem, fl->fl_type needs to be saved before the
posix_test_lock() call and restored if no local conflicts were reported.

Reference: https://bugzilla.kernel.org/show_bug.cgi?id=23892
Tested-by: Alexander Morozov <amorozov@etersoft.ru>
Signed-off-by: Sergey Vlasov <vsu@altlinux.ru>
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: Andi Kleen <ak@linux.intel.com>

---
 fs/nfs/file.c |    2 ++
 1 file changed, 2 insertions(+)

Index: linux-2.6.35.y/fs/nfs/file.c
===================================================================
--- linux-2.6.35.y.orig/fs/nfs/file.c
+++ linux-2.6.35.y/fs/nfs/file.c
@@ -696,6 +696,7 @@ static int do_getlk(struct file *filp, i
 {
 	struct inode *inode = filp->f_mapping->host;
 	int status = 0;
+	unsigned int saved_type = fl->fl_type;
 
 	/* Try local locking first */
 	posix_test_lock(filp, fl);
@@ -703,6 +704,7 @@ static int do_getlk(struct file *filp, i
 		/* found a conflict */
 		goto out;
 	}
+	fl->fl_type = saved_type;
 
 	if (nfs_have_delegation(inode, FMODE_READ))
 		goto out_noconflict;

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

* [PATCH] [15/139] sunrpc: prevent use-after-free on clearing XPT_BUSY
  2011-02-02  0:43 [PATCH] [0/139] 2.6.35.11 longterm review Andi Kleen
                   ` (13 preceding siblings ...)
  2011-02-02  0:43 ` [PATCH] [14/139] NFS: Fix fcntl F_GETLK not reporting some conflicts Andi Kleen
@ 2011-02-02  0:43 ` Andi Kleen
  2011-02-02  0:43 ` [PATCH] [16/139] hwmon: (adm1026) Allow 1 as a valid divider value Andi Kleen
                   ` (124 subsequent siblings)
  139 siblings, 0 replies; 149+ messages in thread
From: Andi Kleen @ 2011-02-02  0:43 UTC (permalink / raw)
  To: neilb, bfields, gregkh, ak, linux-kernel, stable

2.6.35-longterm review patch.  If anyone has any objections, please let me know.

------------------
From: NeilBrown <neilb@suse.de>

commit ed2849d3ecfa339435818eeff28f6c3424300cec upstream.

When an xprt is created, it has a refcount of 1, and XPT_BUSY is set.
The refcount is *not* owned by the thread that created the xprt
(as is clear from the fact that creators never put the reference).
Rather, it is owned by the absence of XPT_DEAD.  Once XPT_DEAD is set,
(And XPT_BUSY is clear) that initial reference is dropped and the xprt
can be freed.

So when a creator clears XPT_BUSY it is dropping its only reference and
so must not touch the xprt again.

However svc_recv, after calling ->xpo_accept (and so getting an XPT_BUSY
reference on a new xprt), calls svc_xprt_recieved.  This clears
XPT_BUSY and then svc_xprt_enqueue - this last without owning a reference.
This is dangerous and has been seen to leave svc_xprt_enqueue working
with an xprt containing garbage.

So we need to hold an extra counted reference over that call to
svc_xprt_received.

For safety, any time we clear XPT_BUSY and then use the xprt again, we
first get a reference, and the put it again afterwards.

Note that svc_close_all does not need this extra protection as there are
no threads running, and the final free can only be called asynchronously
from such a thread.

Signed-off-by: NeilBrown <neilb@suse.de>
Signed-off-by: J. Bruce Fields <bfields@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: Andi Kleen <ak@linux.intel.com>

---
 net/sunrpc/svc_xprt.c |    9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

Index: linux-2.6.35.y/net/sunrpc/svc_xprt.c
===================================================================
--- linux-2.6.35.y.orig/net/sunrpc/svc_xprt.c
+++ linux-2.6.35.y/net/sunrpc/svc_xprt.c
@@ -212,6 +212,7 @@ int svc_create_xprt(struct svc_serv *ser
 	spin_lock(&svc_xprt_class_lock);
 	list_for_each_entry(xcl, &svc_xprt_class_list, xcl_list) {
 		struct svc_xprt *newxprt;
+		unsigned short newport;
 
 		if (strcmp(xprt_name, xcl->xcl_name))
 			continue;
@@ -230,8 +231,9 @@ int svc_create_xprt(struct svc_serv *ser
 		spin_lock_bh(&serv->sv_lock);
 		list_add(&newxprt->xpt_list, &serv->sv_permsocks);
 		spin_unlock_bh(&serv->sv_lock);
+		newport = svc_xprt_local_port(newxprt);
 		clear_bit(XPT_BUSY, &newxprt->xpt_flags);
-		return svc_xprt_local_port(newxprt);
+		return newport;
 	}
  err:
 	spin_unlock(&svc_xprt_class_lock);
@@ -431,8 +433,13 @@ void svc_xprt_received(struct svc_xprt *
 {
 	BUG_ON(!test_bit(XPT_BUSY, &xprt->xpt_flags));
 	xprt->xpt_pool = NULL;
+	/* As soon as we clear busy, the xprt could be closed and
+	 * 'put', so we need a reference to call svc_xprt_enqueue with:
+	 */
+	svc_xprt_get(xprt);
 	clear_bit(XPT_BUSY, &xprt->xpt_flags);
 	svc_xprt_enqueue(xprt);
+	svc_xprt_put(xprt);
 }
 EXPORT_SYMBOL_GPL(svc_xprt_received);
 

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

* [PATCH] [16/139] hwmon: (adm1026) Allow 1 as a valid divider value
  2011-02-02  0:43 [PATCH] [0/139] 2.6.35.11 longterm review Andi Kleen
                   ` (14 preceding siblings ...)
  2011-02-02  0:43 ` [PATCH] [15/139] sunrpc: prevent use-after-free on clearing XPT_BUSY Andi Kleen
@ 2011-02-02  0:43 ` Andi Kleen
  2011-02-02  0:43 ` [PATCH] [17/139] hwmon: (adm1026) Fix setting fan_div Andi Kleen
                   ` (123 subsequent siblings)
  139 siblings, 0 replies; 149+ messages in thread
From: Andi Kleen @ 2011-02-02  0:43 UTC (permalink / raw)
  To: gorlik, khali, gregkh, ak, linux-kernel, stable

2.6.35-longterm review patch.  If anyone has any objections, please let me know.

------------------
From: Gabriele Gorla <gorlik@penguintown.net>

commit 8b0f1840a46449e1946fc88860ef3ec8d6b1c2c7 upstream.

Allow 1 as a valid div value as specified in the ADM1026 datasheet.

Signed-off-by: Gabriele Gorla <gorlik@penguintown.net>
Signed-off-by: Jean Delvare <khali@linux-fr.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: Andi Kleen <ak@linux.intel.com>

---
 drivers/hwmon/adm1026.c |    4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

Index: linux-2.6.35.y/drivers/hwmon/adm1026.c
===================================================================
--- linux-2.6.35.y.orig/drivers/hwmon/adm1026.c
+++ linux-2.6.35.y/drivers/hwmon/adm1026.c
@@ -920,9 +920,7 @@ static ssize_t set_fan_div(struct device
 
 	val = simple_strtol(buf, NULL, 10);
 	new_div = DIV_TO_REG(val);
-	if (new_div == 0) {
-		return -EINVAL;
-	}
+
 	mutex_lock(&data->update_lock);
 	orig_div = data->fan_div[nr];
 	data->fan_div[nr] = DIV_FROM_REG(new_div);

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

* [PATCH] [17/139] hwmon: (adm1026) Fix setting fan_div
  2011-02-02  0:43 [PATCH] [0/139] 2.6.35.11 longterm review Andi Kleen
                   ` (15 preceding siblings ...)
  2011-02-02  0:43 ` [PATCH] [16/139] hwmon: (adm1026) Allow 1 as a valid divider value Andi Kleen
@ 2011-02-02  0:43 ` Andi Kleen
  2011-02-02  0:43 ` [PATCH] [18/139] EDAC: Fix workqueue-related crashes Andi Kleen
                   ` (122 subsequent siblings)
  139 siblings, 0 replies; 149+ messages in thread
From: Andi Kleen @ 2011-02-02  0:43 UTC (permalink / raw)
  To: gorlik, khali, gregkh, ak, linux-kernel, stable

2.6.35-longterm review patch.  If anyone has any objections, please let me know.

------------------
From: Gabriele Gorla <gorlik@penguintown.net>

commit 52bc9802ce849d0d287cc5fe76d06b0daa3986ca upstream.

Prevent setting fan_div from stomping on other fans that share the
same I2C register.

Signed-off-by: Gabriele Gorla <gorlik@penguintown.net>
Signed-off-by: Jean Delvare <khali@linux-fr.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: Andi Kleen <ak@linux.intel.com>

---
 drivers/hwmon/adm1026.c |   16 +++++++++-------
 1 file changed, 9 insertions(+), 7 deletions(-)

Index: linux-2.6.35.y/drivers/hwmon/adm1026.c
===================================================================
--- linux-2.6.35.y.orig/drivers/hwmon/adm1026.c
+++ linux-2.6.35.y/drivers/hwmon/adm1026.c
@@ -916,7 +916,7 @@ static ssize_t set_fan_div(struct device
 	int nr = sensor_attr->index;
 	struct i2c_client *client = to_i2c_client(dev);
 	struct adm1026_data *data = i2c_get_clientdata(client);
-	int val, orig_div, new_div, shift;
+	int val, orig_div, new_div;
 
 	val = simple_strtol(buf, NULL, 10);
 	new_div = DIV_TO_REG(val);
@@ -926,15 +926,17 @@ static ssize_t set_fan_div(struct device
 	data->fan_div[nr] = DIV_FROM_REG(new_div);
 
 	if (nr < 4) { /* 0 <= nr < 4 */
-		shift = 2 * nr;
 		adm1026_write_value(client, ADM1026_REG_FAN_DIV_0_3,
-			((DIV_TO_REG(orig_div) & (~(0x03 << shift))) |
-			(new_div << shift)));
+				    (DIV_TO_REG(data->fan_div[0]) << 0) |
+				    (DIV_TO_REG(data->fan_div[1]) << 2) |
+				    (DIV_TO_REG(data->fan_div[2]) << 4) |
+				    (DIV_TO_REG(data->fan_div[3]) << 6));
 	} else { /* 3 < nr < 8 */
-		shift = 2 * (nr - 4);
 		adm1026_write_value(client, ADM1026_REG_FAN_DIV_4_7,
-			((DIV_TO_REG(orig_div) & (~(0x03 << (2 * shift)))) |
-			(new_div << shift)));
+				    (DIV_TO_REG(data->fan_div[4]) << 0) |
+				    (DIV_TO_REG(data->fan_div[5]) << 2) |
+				    (DIV_TO_REG(data->fan_div[6]) << 4) |
+				    (DIV_TO_REG(data->fan_div[7]) << 6));
 	}
 
 	if (data->fan_div[nr] != orig_div) {

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

* [PATCH] [18/139] EDAC: Fix workqueue-related crashes
  2011-02-02  0:43 [PATCH] [0/139] 2.6.35.11 longterm review Andi Kleen
                   ` (16 preceding siblings ...)
  2011-02-02  0:43 ` [PATCH] [17/139] hwmon: (adm1026) Fix setting fan_div Andi Kleen
@ 2011-02-02  0:43 ` Andi Kleen
  2011-02-02  0:43 ` [PATCH] [19/139] amd64_edac: Fix interleaving check Andi Kleen
                   ` (121 subsequent siblings)
  139 siblings, 0 replies; 149+ messages in thread
From: Andi Kleen @ 2011-02-02  0:43 UTC (permalink / raw)
  To: borislav.petkov, gregkh, ak, linux-kernel, stable

2.6.35-longterm review patch.  If anyone has any objections, please let me know.

------------------
From: Borislav Petkov <borislav.petkov@amd.com>

commit bb31b3122c0dd07d2d958da17a50ad771ce79e2b upstream.

00740c58541b6087d78418cebca1fcb86dc6077d changed edac_core to
un-/register a workqueue item only if a lowlevel driver supplies a
polling routine. Normally, when we remove a polling low-level driver, we
go and cancel all the queued work. However, the workqueue unreg happens
based on the ->op_state setting, and edac_mc_del_mc() sets this to
OP_OFFLINE _before_ we cancel the work item, leading to NULL ptr oops on
the workqueue list.

Fix it by putting the unreg stuff in proper order.

Reported-and-tested-by: Tobias Karnat <tobias.karnat@googlemail.com>
LKML-Reference: <1291201307.3029.21.camel@Tobias-Karnat>
Signed-off-by: Borislav Petkov <borislav.petkov@amd.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: Andi Kleen <ak@linux.intel.com>

---
 drivers/edac/edac_mc.c |   10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

Index: linux-2.6.35.y/drivers/edac/edac_mc.c
===================================================================
--- linux-2.6.35.y.orig/drivers/edac/edac_mc.c
+++ linux-2.6.35.y/drivers/edac/edac_mc.c
@@ -575,14 +575,16 @@ struct mem_ctl_info *edac_mc_del_mc(stru
 		return NULL;
 	}
 
-	/* marking MCI offline */
-	mci->op_state = OP_OFFLINE;
-
 	del_mc_from_global_list(mci);
 	mutex_unlock(&mem_ctls_mutex);
 
-	/* flush workq processes and remove sysfs */
+	/* flush workq processes */
 	edac_mc_workq_teardown(mci);
+
+	/* marking MCI offline */
+	mci->op_state = OP_OFFLINE;
+
+	/* remove from sysfs */
 	edac_remove_sysfs_mci_device(mci);
 
 	edac_printk(KERN_INFO, EDAC_MC,

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

* [PATCH] [19/139] amd64_edac: Fix interleaving check
  2011-02-02  0:43 [PATCH] [0/139] 2.6.35.11 longterm review Andi Kleen
                   ` (17 preceding siblings ...)
  2011-02-02  0:43 ` [PATCH] [18/139] EDAC: Fix workqueue-related crashes Andi Kleen
@ 2011-02-02  0:43 ` Andi Kleen
  2011-02-02  0:43 ` [PATCH] [20/139] ASoC: Fix swap of left and right channels for WM8993/4 speaker boost gain Andi Kleen
                   ` (120 subsequent siblings)
  139 siblings, 0 replies; 149+ messages in thread
From: Andi Kleen @ 2011-02-02  0:43 UTC (permalink / raw)
  To: borislav.petkov, gregkh, ak, linux-kernel, stable

2.6.35-longterm review patch.  If anyone has any objections, please let me know.

------------------
From: Borislav Petkov <borislav.petkov@amd.com>

commit e726f3c368e7c1919a7166ec09c5705759f1a69d upstream.

When matching error address to the range contained by one memory node,
we're in valid range when node interleaving

1. is disabled, or
2. enabled and when the address bits we interleave on match the
interleave selector on this node (see the "Node Interleaving" section in
the BKDG for an enlightening example).

Thus, when we early-exit, we need to reverse the compound logic
statement properly.

Signed-off-by: Borislav Petkov <borislav.petkov@amd.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: Andi Kleen <ak@linux.intel.com>

---
 drivers/edac/amd64_edac.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Index: linux-2.6.35.y/drivers/edac/amd64_edac.c
===================================================================
--- linux-2.6.35.y.orig/drivers/edac/amd64_edac.c
+++ linux-2.6.35.y/drivers/edac/amd64_edac.c
@@ -1567,7 +1567,7 @@ static int f10_match_to_this_node(struct
 	debugf1("   HoleOffset=0x%x  HoleValid=0x%x IntlvSel=0x%x\n",
 			hole_off, hole_valid, intlv_sel);
 
-	if (intlv_en ||
+	if (intlv_en &&
 	    (intlv_sel != ((sys_addr >> 12) & intlv_en)))
 		return -EINVAL;
 

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

* [PATCH] [20/139] ASoC: Fix swap of left and right channels for WM8993/4 speaker boost gain
  2011-02-02  0:43 [PATCH] [0/139] 2.6.35.11 longterm review Andi Kleen
                   ` (18 preceding siblings ...)
  2011-02-02  0:43 ` [PATCH] [19/139] amd64_edac: Fix interleaving check Andi Kleen
@ 2011-02-02  0:43 ` Andi Kleen
  2011-02-02  0:43 ` [PATCH] [21/139] ASoC: Fix off by one error in WM8994 EQ register bank size Andi Kleen
                   ` (119 subsequent siblings)
  139 siblings, 0 replies; 149+ messages in thread
From: Andi Kleen @ 2011-02-02  0:43 UTC (permalink / raw)
  To: w0806.kim, lrg, broonie, gregkh, ak, linux-kernel, stable

2.6.35-longterm review patch.  If anyone has any objections, please let me know.

------------------
From: Uk Kim <w0806.kim@samsung.com>

commit ed8cc471d75365f8590c76f580def899d58028c0 upstream.

SPKOUTL_BOOST start from third bit, SPKOUTLR_BOOST start from 0 bit.

Signed-off-by: Uk Kim <w0806.kim@samsung.com>
Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: Andi Kleen <ak@linux.intel.com>

---
 sound/soc/codecs/wm_hubs.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Index: linux-2.6.35.y/sound/soc/codecs/wm_hubs.c
===================================================================
--- linux-2.6.35.y.orig/sound/soc/codecs/wm_hubs.c
+++ linux-2.6.35.y/sound/soc/codecs/wm_hubs.c
@@ -293,7 +293,7 @@ SOC_DOUBLE_R("Speaker Switch",
 SOC_DOUBLE_R("Speaker ZC Switch",
 	     WM8993_SPEAKER_VOLUME_LEFT, WM8993_SPEAKER_VOLUME_RIGHT,
 	     7, 1, 0),
-SOC_DOUBLE_TLV("Speaker Boost Volume", WM8993_SPKOUT_BOOST, 0, 3, 7, 0,
+SOC_DOUBLE_TLV("Speaker Boost Volume", WM8993_SPKOUT_BOOST, 3, 0, 7, 0,
 	       spkboost_tlv),
 SOC_ENUM("Speaker Reference", speaker_ref),
 SOC_ENUM("Speaker Mode", speaker_mode),

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

* [PATCH] [21/139] ASoC: Fix off by one error in WM8994 EQ register bank size
  2011-02-02  0:43 [PATCH] [0/139] 2.6.35.11 longterm review Andi Kleen
                   ` (19 preceding siblings ...)
  2011-02-02  0:43 ` [PATCH] [20/139] ASoC: Fix swap of left and right channels for WM8993/4 speaker boost gain Andi Kleen
@ 2011-02-02  0:43 ` Andi Kleen
  2011-02-02  0:43 ` [PATCH] [22/139] ASoC: WM8580: Fix R8 initial value Andi Kleen
                   ` (118 subsequent siblings)
  139 siblings, 0 replies; 149+ messages in thread
From: Andi Kleen @ 2011-02-02  0:43 UTC (permalink / raw)
  To: w0806.kim, lrg, broonie, gregkh, ak, linux-kernel, stable

2.6.35-longterm review patch.  If anyone has any objections, please let me know.

------------------
From: Uk Kim <w0806.kim@samsung.com>

commit 3fcc0afbb9c93f3599ba03273e59915670b6c2c2 upstream.

Signed-off-by: Uk Kim <w0806.kim@samsung.com>
Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: Andi Kleen <ak@linux.intel.com>

---
 include/linux/mfd/wm8994/pdata.h |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Index: linux-2.6.35.y/include/linux/mfd/wm8994/pdata.h
===================================================================
--- linux-2.6.35.y.orig/include/linux/mfd/wm8994/pdata.h
+++ linux-2.6.35.y/include/linux/mfd/wm8994/pdata.h
@@ -29,7 +29,7 @@ struct wm8994_ldo_pdata {
 #define WM8994_CONFIGURE_GPIO 0x8000
 
 #define WM8994_DRC_REGS 5
-#define WM8994_EQ_REGS  19
+#define WM8994_EQ_REGS  20
 
 /**
  * DRC configurations are specified with a label and a set of register

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

* [PATCH] [22/139] ASoC: WM8580: Fix R8 initial value
  2011-02-02  0:43 [PATCH] [0/139] 2.6.35.11 longterm review Andi Kleen
                   ` (20 preceding siblings ...)
  2011-02-02  0:43 ` [PATCH] [21/139] ASoC: Fix off by one error in WM8994 EQ register bank size Andi Kleen
@ 2011-02-02  0:43 ` Andi Kleen
  2011-02-02  0:43 ` [PATCH] [23/139] ASoC: fix deemphasis control in wm8904/55/60 codecs Andi Kleen
                   ` (117 subsequent siblings)
  139 siblings, 0 replies; 149+ messages in thread
From: Andi Kleen @ 2011-02-02  0:43 UTC (permalink / raw)
  To: sw.youn, lrg, broonie, gregkh, ak, linux-kernel, stable

2.6.35-longterm review patch.  If anyone has any objections, please let me know.

------------------
From: Seungwhan Youn <sw.youn@samsung.com>

commit a0968628097380be52db8b4664da98fc425546a5 upstream.

Acc to WM8580 manual, the default value for R8 is 0x10, not 0x1c.

Signed-off-by: Seungwhan Youn <sw.youn@samsung.com>
Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: Andi Kleen <ak@linux.intel.com>

---
 sound/soc/codecs/wm8580.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Index: linux-2.6.35.y/sound/soc/codecs/wm8580.c
===================================================================
--- linux-2.6.35.y.orig/sound/soc/codecs/wm8580.c
+++ linux-2.6.35.y/sound/soc/codecs/wm8580.c
@@ -171,7 +171,7 @@
 static const u16 wm8580_reg[] = {
 	0x0121, 0x017e, 0x007d, 0x0014, /*R3*/
 	0x0121, 0x017e, 0x007d, 0x0194, /*R7*/
-	0x001c, 0x0002, 0x0002, 0x00c2, /*R11*/
+	0x0010, 0x0002, 0x0002, 0x00c2, /*R11*/
 	0x0182, 0x0082, 0x000a, 0x0024, /*R15*/
 	0x0009, 0x0000, 0x00ff, 0x0000, /*R19*/
 	0x00ff, 0x00ff, 0x00ff, 0x00ff, /*R23*/

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

* [PATCH] [23/139] ASoC: fix deemphasis control in wm8904/55/60 codecs
  2011-02-02  0:43 [PATCH] [0/139] 2.6.35.11 longterm review Andi Kleen
                   ` (21 preceding siblings ...)
  2011-02-02  0:43 ` [PATCH] [22/139] ASoC: WM8580: Fix R8 initial value Andi Kleen
@ 2011-02-02  0:43 ` Andi Kleen
  2011-02-02  0:43 ` [PATCH] [24/139] bootmem: Add alloc_bootmem_align() Andi Kleen
                   ` (116 subsequent siblings)
  139 siblings, 0 replies; 149+ messages in thread
From: Andi Kleen @ 2011-02-02  0:43 UTC (permalink / raw)
  To: mad_soft, lrg, broonie, gregkh, ak, linux-kernel, stable

2.6.35-longterm review patch.  If anyone has any objections, please let me know.

------------------
From: Dmitry Artamonow <mad_soft@inbox.ru>

commit 3f343f8512c7882a3637d9aea4ec6b3801cbcdc5 upstream.

Deemphasis control's .get callback should update control's value instead
of returning it - return value of callback function is used for indicating
error or success of operation.

Signed-off-by: Dmitry Artamonow <mad_soft@inbox.ru>
Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: Andi Kleen <ak@linux.intel.com>

---
 sound/soc/codecs/wm8904.c |    3 ++-
 sound/soc/codecs/wm8955.c |    3 ++-
 sound/soc/codecs/wm8960.c |    3 ++-
 3 files changed, 6 insertions(+), 3 deletions(-)

Index: linux-2.6.35.y/sound/soc/codecs/wm8904.c
===================================================================
--- linux-2.6.35.y.orig/sound/soc/codecs/wm8904.c
+++ linux-2.6.35.y/sound/soc/codecs/wm8904.c
@@ -820,7 +820,8 @@ static int wm8904_get_deemph(struct snd_
 	struct snd_soc_codec *codec = snd_kcontrol_chip(kcontrol);
 	struct wm8904_priv *wm8904 = snd_soc_codec_get_drvdata(codec);
 
-	return wm8904->deemph;
+	ucontrol->value.enumerated.item[0] = wm8904->deemph;
+	return 0;
 }
 
 static int wm8904_put_deemph(struct snd_kcontrol *kcontrol,
Index: linux-2.6.35.y/sound/soc/codecs/wm8955.c
===================================================================
--- linux-2.6.35.y.orig/sound/soc/codecs/wm8955.c
+++ linux-2.6.35.y/sound/soc/codecs/wm8955.c
@@ -384,7 +384,8 @@ static int wm8955_get_deemph(struct snd_
 	struct snd_soc_codec *codec = snd_kcontrol_chip(kcontrol);
 	struct wm8955_priv *wm8955 = snd_soc_codec_get_drvdata(codec);
 
-	return wm8955->deemph;
+	ucontrol->value.enumerated.item[0] = wm8955->deemph;
+	return 0;
 }
 
 static int wm8955_put_deemph(struct snd_kcontrol *kcontrol,

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

* [PATCH] [24/139] bootmem: Add alloc_bootmem_align()
  2011-02-02  0:43 [PATCH] [0/139] 2.6.35.11 longterm review Andi Kleen
                   ` (22 preceding siblings ...)
  2011-02-02  0:43 ` [PATCH] [23/139] ASoC: fix deemphasis control in wm8904/55/60 codecs Andi Kleen
@ 2011-02-02  0:43 ` Andi Kleen
  2011-02-02  0:43 ` [PATCH] [25/139] x86, xsave: Use alloc_bootmem_align() instead of alloc_bootmem() Andi Kleen
                   ` (115 subsequent siblings)
  139 siblings, 0 replies; 149+ messages in thread
From: Andi Kleen @ 2011-02-02  0:43 UTC (permalink / raw)
  To: suresh.b.siddha, ak, hpa, gregkh, linux-kernel, stable

2.6.35-longterm review patch.  If anyone has any objections, please let me know.

------------------
From: Suresh Siddha <suresh.b.siddha@intel.com>

commit 53dde5f385bc56e312f78b7cb25ffaf8efd4735d upstream.

Add an alloc_bootmem_align() interface to allocate bootmem with
specified alignment.  This is necessary to be able to allocate the
xsave area in a subsequent patch.

Signed-off-by: Suresh Siddha <suresh.b.siddha@intel.com>
Signed-off-by: Andi Kleen <ak@linux.intel.com>
LKML-Reference: <20101116212441.977574826@sbsiddha-MOBL3.sc.intel.com>
Acked-by: H. Peter Anvin <hpa@linux.intel.com>
Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

---
 include/linux/bootmem.h |    2 ++
 1 file changed, 2 insertions(+)

Index: linux-2.6.35.y/include/linux/bootmem.h
===================================================================
--- linux-2.6.35.y.orig/include/linux/bootmem.h
+++ linux-2.6.35.y/include/linux/bootmem.h
@@ -105,6 +105,8 @@ extern void *__alloc_bootmem_low_node(pg
 
 #define alloc_bootmem(x) \
 	__alloc_bootmem(x, SMP_CACHE_BYTES, __pa(MAX_DMA_ADDRESS))
+#define alloc_bootmem_align(x, align) \
+	__alloc_bootmem(x, align, __pa(MAX_DMA_ADDRESS))
 #define alloc_bootmem_nopanic(x) \
 	__alloc_bootmem_nopanic(x, SMP_CACHE_BYTES, __pa(MAX_DMA_ADDRESS))
 #define alloc_bootmem_pages(x) \

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

* [PATCH] [25/139] x86, xsave: Use alloc_bootmem_align() instead of alloc_bootmem()
  2011-02-02  0:43 [PATCH] [0/139] 2.6.35.11 longterm review Andi Kleen
                   ` (23 preceding siblings ...)
  2011-02-02  0:43 ` [PATCH] [24/139] bootmem: Add alloc_bootmem_align() Andi Kleen
@ 2011-02-02  0:43 ` Andi Kleen
  2011-02-02  0:43 ` [PATCH] [26/139] IB/uverbs: Handle large number of entries in poll CQ Andi Kleen
                   ` (114 subsequent siblings)
  139 siblings, 0 replies; 149+ messages in thread
From: Andi Kleen @ 2011-02-02  0:43 UTC (permalink / raw)
  To: suresh.b.siddha, ak, hpa, gregkh, linux-kernel, stable

2.6.35-longterm review patch.  If anyone has any objections, please let me know.

------------------
From: Suresh Siddha <suresh.b.siddha@intel.com>

commit 10340ae130fb70352eae1ae8a00b7906d91bf166 upstream.

Alignment of alloc_bootmem() depends on the value of
L1_CACHE_SHIFT. What we need here, however, is 64 byte alignment.  Use
alloc_bootmem_align() and explicitly specify the alignment instead.

This fixes a kernel boot crash reported by Jody when the cpu in .config
is set to MPENTIUMII but the kernel is booted on a xsave-capable CPU.

Reported-by: Jody Bruchon <jody@nctritech.com>
Signed-off-by: Suresh Siddha <suresh.b.siddha@intel.com>
Signed-off-by: Andi Kleen <ak@linux.intel.com>
LKML-Reference: <20101116212442.059967454@sbsiddha-MOBL3.sc.intel.com>
Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

---
 arch/x86/kernel/xsave.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Index: linux-2.6.35.y/arch/x86/kernel/xsave.c
===================================================================
--- linux-2.6.35.y.orig/arch/x86/kernel/xsave.c
+++ linux-2.6.35.y/arch/x86/kernel/xsave.c
@@ -305,7 +305,8 @@ void __cpuinit xsave_init(void)
  */
 static void __init setup_xstate_init(void)
 {
-	init_xstate_buf = alloc_bootmem(xstate_size);
+	init_xstate_buf = alloc_bootmem_align(xstate_size,
+			      __alignof__(struct xsave_struct));
 	init_xstate_buf->i387.mxcsr = MXCSR_DEFAULT;
 }
 

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

* [PATCH] [26/139] IB/uverbs: Handle large number of entries in poll CQ
  2011-02-02  0:43 [PATCH] [0/139] 2.6.35.11 longterm review Andi Kleen
                   ` (24 preceding siblings ...)
  2011-02-02  0:43 ` [PATCH] [25/139] x86, xsave: Use alloc_bootmem_align() instead of alloc_bootmem() Andi Kleen
@ 2011-02-02  0:43 ` Andi Kleen
  2011-02-02  0:43 ` [PATCH] [27/139] PM / Hibernate: Fix PM_POST_* notification with user-space suspend Andi Kleen
                   ` (113 subsequent siblings)
  139 siblings, 0 replies; 149+ messages in thread
From: Andi Kleen @ 2011-02-02  0:43 UTC (permalink / raw)
  To: error27, ak, rolandd, gregkh, linux-kernel, stable

2.6.35-longterm review patch.  If anyone has any objections, please let me know.

------------------
From: Dan Carpenter <error27@gmail.com>

commit 7182afea8d1afd432a17c18162cc3fd441d0da93 upstream.

In ib_uverbs_poll_cq() code there is a potential integer overflow if
userspace passes in a large cmd.ne.  The calls to kmalloc() would
allocate smaller buffers than intended, leading to memory corruption.
There iss also an information leak if resp wasn't all used.
Unprivileged userspace may call this function, although only if an
RDMA device that uses this function is present.

Fix this by copying CQ entries one at a time, which avoids the
allocation entirely, and also by moving this copying into a function
that makes sure to initialize all memory copied to userspace.

Special thanks to Jason Gunthorpe <jgunthorpe@obsidianresearch.com>
for his help and advice.

Signed-off-by: Dan Carpenter <error27@gmail.com>
Signed-off-by: Andi Kleen <ak@linux.intel.com>

[ Monkey around with things a bit to avoid bad code generation by gcc
  when designated initializers are used.  - Roland ]

Signed-off-by: Roland Dreier <rolandd@cisco.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

---
 drivers/infiniband/core/uverbs_cmd.c |  101 +++++++++++++++++++----------------
 1 file changed, 57 insertions(+), 44 deletions(-)

Index: linux-2.6.35.y/drivers/infiniband/core/uverbs_cmd.c
===================================================================
--- linux-2.6.35.y.orig/drivers/infiniband/core/uverbs_cmd.c
+++ linux-2.6.35.y/drivers/infiniband/core/uverbs_cmd.c
@@ -891,68 +891,81 @@ out:
 	return ret ? ret : in_len;
 }
 
+static int copy_wc_to_user(void __user *dest, struct ib_wc *wc)
+{
+	struct ib_uverbs_wc tmp;
+
+	tmp.wr_id		= wc->wr_id;
+	tmp.status		= wc->status;
+	tmp.opcode		= wc->opcode;
+	tmp.vendor_err		= wc->vendor_err;
+	tmp.byte_len		= wc->byte_len;
+	tmp.ex.imm_data		= (__u32 __force) wc->ex.imm_data;
+	tmp.qp_num		= wc->qp->qp_num;
+	tmp.src_qp		= wc->src_qp;
+	tmp.wc_flags		= wc->wc_flags;
+	tmp.pkey_index		= wc->pkey_index;
+	tmp.slid		= wc->slid;
+	tmp.sl			= wc->sl;
+	tmp.dlid_path_bits	= wc->dlid_path_bits;
+	tmp.port_num		= wc->port_num;
+	tmp.reserved		= 0;
+
+	if (copy_to_user(dest, &tmp, sizeof tmp))
+		return -EFAULT;
+
+	return 0;
+}
+
 ssize_t ib_uverbs_poll_cq(struct ib_uverbs_file *file,
 			  const char __user *buf, int in_len,
 			  int out_len)
 {
 	struct ib_uverbs_poll_cq       cmd;
-	struct ib_uverbs_poll_cq_resp *resp;
+	struct ib_uverbs_poll_cq_resp  resp;
+	u8 __user                     *header_ptr;
+	u8 __user                     *data_ptr;
 	struct ib_cq                  *cq;
-	struct ib_wc                  *wc;
-	int                            ret = 0;
-	int                            i;
-	int                            rsize;
+	struct ib_wc                   wc;
+	int                            ret;
 
 	if (copy_from_user(&cmd, buf, sizeof cmd))
 		return -EFAULT;
 
-	wc = kmalloc(cmd.ne * sizeof *wc, GFP_KERNEL);
-	if (!wc)
-		return -ENOMEM;
-
-	rsize = sizeof *resp + cmd.ne * sizeof(struct ib_uverbs_wc);
-	resp = kmalloc(rsize, GFP_KERNEL);
-	if (!resp) {
-		ret = -ENOMEM;
-		goto out_wc;
-	}
-
 	cq = idr_read_cq(cmd.cq_handle, file->ucontext, 0);
-	if (!cq) {
-		ret = -EINVAL;
-		goto out;
-	}
+	if (!cq)
+		return -EINVAL;
 
-	resp->count = ib_poll_cq(cq, cmd.ne, wc);
+	/* we copy a struct ib_uverbs_poll_cq_resp to user space */
+	header_ptr = (void __user *)(unsigned long) cmd.response;
+	data_ptr = header_ptr + sizeof resp;
 
-	put_cq_read(cq);
+	memset(&resp, 0, sizeof resp);
+	while (resp.count < cmd.ne) {
+		ret = ib_poll_cq(cq, 1, &wc);
+		if (ret < 0)
+			goto out_put;
+		if (!ret)
+			break;
+
+		ret = copy_wc_to_user(data_ptr, &wc);
+		if (ret)
+			goto out_put;
 
-	for (i = 0; i < resp->count; i++) {
-		resp->wc[i].wr_id 	   = wc[i].wr_id;
-		resp->wc[i].status 	   = wc[i].status;
-		resp->wc[i].opcode 	   = wc[i].opcode;
-		resp->wc[i].vendor_err 	   = wc[i].vendor_err;
-		resp->wc[i].byte_len 	   = wc[i].byte_len;
-		resp->wc[i].ex.imm_data    = (__u32 __force) wc[i].ex.imm_data;
-		resp->wc[i].qp_num 	   = wc[i].qp->qp_num;
-		resp->wc[i].src_qp 	   = wc[i].src_qp;
-		resp->wc[i].wc_flags 	   = wc[i].wc_flags;
-		resp->wc[i].pkey_index 	   = wc[i].pkey_index;
-		resp->wc[i].slid 	   = wc[i].slid;
-		resp->wc[i].sl 		   = wc[i].sl;
-		resp->wc[i].dlid_path_bits = wc[i].dlid_path_bits;
-		resp->wc[i].port_num 	   = wc[i].port_num;
+		data_ptr += sizeof(struct ib_uverbs_wc);
+		++resp.count;
 	}
 
-	if (copy_to_user((void __user *) (unsigned long) cmd.response, resp, rsize))
+	if (copy_to_user(header_ptr, &resp, sizeof resp)) {
 		ret = -EFAULT;
+		goto out_put;
+	}
 
-out:
-	kfree(resp);
+	ret = in_len;
 
-out_wc:
-	kfree(wc);
-	return ret ? ret : in_len;
+out_put:
+	put_cq_read(cq);
+	return ret;
 }
 
 ssize_t ib_uverbs_req_notify_cq(struct ib_uverbs_file *file,

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

* [PATCH] [27/139] PM / Hibernate: Fix PM_POST_* notification with user-space suspend
  2011-02-02  0:43 [PATCH] [0/139] 2.6.35.11 longterm review Andi Kleen
                   ` (25 preceding siblings ...)
  2011-02-02  0:43 ` [PATCH] [26/139] IB/uverbs: Handle large number of entries in poll CQ Andi Kleen
@ 2011-02-02  0:43 ` Andi Kleen
  2011-02-02  0:43 ` [PATCH] [28/139] ARM: 6535/1: V6 MPCore v6_dma_inv_range and v6_dma_flush_range RWFO fix Andi Kleen
                   ` (112 subsequent siblings)
  139 siblings, 0 replies; 149+ messages in thread
From: Andi Kleen @ 2011-02-02  0:43 UTC (permalink / raw)
  To: tiwai, rjw, gregkh, ak, linux-kernel, stable

2.6.35-longterm review patch.  If anyone has any objections, please let me know.

------------------
From: Takashi Iwai <tiwai@suse.de>

commit 1497dd1d29c6a53fcd3c80f7ac8d0e0239e7389e upstream.

The user-space hibernation sends a wrong notification after the image
restoration because of thinko for the file flag check.  RDONLY
corresponds to hibernation and WRONLY to restoration, confusingly.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: Andi Kleen <ak@linux.intel.com>

---
 kernel/power/user.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Index: linux-2.6.35.y/kernel/power/user.c
===================================================================
--- linux-2.6.35.y.orig/kernel/power/user.c
+++ linux-2.6.35.y/kernel/power/user.c
@@ -137,7 +137,7 @@ static int snapshot_release(struct inode
 	free_all_swap_pages(data->swap);
 	if (data->frozen)
 		thaw_processes();
-	pm_notifier_call_chain(data->mode == O_WRONLY ?
+	pm_notifier_call_chain(data->mode == O_RDONLY ?
 			PM_POST_HIBERNATION : PM_POST_RESTORE);
 	atomic_inc(&snapshot_device_available);
 

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

* [PATCH] [28/139] ARM: 6535/1: V6 MPCore v6_dma_inv_range and v6_dma_flush_range RWFO fix
  2011-02-02  0:43 [PATCH] [0/139] 2.6.35.11 longterm review Andi Kleen
                   ` (26 preceding siblings ...)
  2011-02-02  0:43 ` [PATCH] [27/139] PM / Hibernate: Fix PM_POST_* notification with user-space suspend Andi Kleen
@ 2011-02-02  0:43 ` Andi Kleen
  2011-02-02  0:43 ` [PATCH] [29/139] qla2xxx: Correct issue where NPIV-config data was not being allocated for 82xx parts Andi Kleen
                   ` (111 subsequent siblings)
  139 siblings, 0 replies; 149+ messages in thread
From: Andi Kleen @ 2011-02-02  0:43 UTC (permalink / raw)
  To: vbarshak, gdavis, catalin.marinas, rmk+kernel, gregkh, ak,
	linux-kernel, stable

2.6.35-longterm review patch.  If anyone has any objections, please let me know.

------------------
From: Valentine Barshak <vbarshak@mvista.com>

commit 85b093bcc5322baa811a03ec73de0909c157f181 upstream.

Cache ownership must be acquired by reading/writing data from the
cache line to make cache operation have the desired effect on the
SMP MPCore CPU. However, the ownership is never acquired in the
v6_dma_inv_range function when cleaning the first line and
flushing the last one, in case the address is not aligned
to D_CACHE_LINE_SIZE boundary.
Fix this by reading/writing data if needed, before performing
cache operations.
While at it, fix v6_dma_flush_range to prevent RWFO outside
the buffer.

Signed-off-by: Valentine Barshak <vbarshak@mvista.com>
Signed-off-by: George G. Davis <gdavis@mvista.com>
Acked-by: Catalin Marinas <catalin.marinas@arm.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: Andi Kleen <ak@linux.intel.com>

---
 arch/arm/mm/cache-v6.S |   28 ++++++++++++++++++++--------
 1 file changed, 20 insertions(+), 8 deletions(-)

Index: linux-2.6.35.y/arch/arm/mm/cache-v6.S
===================================================================
--- linux-2.6.35.y.orig/arch/arm/mm/cache-v6.S
+++ linux-2.6.35.y/arch/arm/mm/cache-v6.S
@@ -196,6 +196,10 @@ ENTRY(v6_flush_kern_dcache_area)
  *	- end     - virtual end address of region
  */
 v6_dma_inv_range:
+#ifdef CONFIG_DMA_CACHE_RWFO
+	ldrb	r2, [r0]			@ read for ownership
+	strb	r2, [r0]			@ write for ownership
+#endif
 	tst	r0, #D_CACHE_LINE_SIZE - 1
 	bic	r0, r0, #D_CACHE_LINE_SIZE - 1
 #ifdef HARVARD_CACHE
@@ -204,6 +208,10 @@ v6_dma_inv_range:
 	mcrne	p15, 0, r0, c7, c11, 1		@ clean unified line
 #endif
 	tst	r1, #D_CACHE_LINE_SIZE - 1
+#ifdef CONFIG_DMA_CACHE_RWFO
+	ldrneb	r2, [r1, #-1]			@ read for ownership
+	strneb	r2, [r1, #-1]			@ write for ownership
+#endif
 	bic	r1, r1, #D_CACHE_LINE_SIZE - 1
 #ifdef HARVARD_CACHE
 	mcrne	p15, 0, r1, c7, c14, 1		@ clean & invalidate D line
@@ -211,10 +219,6 @@ v6_dma_inv_range:
 	mcrne	p15, 0, r1, c7, c15, 1		@ clean & invalidate unified line
 #endif
 1:
-#ifdef CONFIG_DMA_CACHE_RWFO
-	ldr	r2, [r0]			@ read for ownership
-	str	r2, [r0]			@ write for ownership
-#endif
 #ifdef HARVARD_CACHE
 	mcr	p15, 0, r0, c7, c6, 1		@ invalidate D line
 #else
@@ -222,6 +226,10 @@ v6_dma_inv_range:
 #endif
 	add	r0, r0, #D_CACHE_LINE_SIZE
 	cmp	r0, r1
+#ifdef CONFIG_DMA_CACHE_RWFO
+	ldrlo	r2, [r0]			@ read for ownership
+	strlo	r2, [r0]			@ write for ownership
+#endif
 	blo	1b
 	mov	r0, #0
 	mcr	p15, 0, r0, c7, c10, 4		@ drain write buffer
@@ -256,12 +264,12 @@ v6_dma_clean_range:
  *	- end     - virtual end address of region
  */
 ENTRY(v6_dma_flush_range)
-	bic	r0, r0, #D_CACHE_LINE_SIZE - 1
-1:
 #ifdef CONFIG_DMA_CACHE_RWFO
-	ldr	r2, [r0]			@ read for ownership
-	str	r2, [r0]			@ write for ownership
+	ldrb	r2, [r0]		@ read for ownership
+	strb	r2, [r0]		@ write for ownership
 #endif
+	bic	r0, r0, #D_CACHE_LINE_SIZE - 1
+1:
 #ifdef HARVARD_CACHE
 	mcr	p15, 0, r0, c7, c14, 1		@ clean & invalidate D line
 #else
@@ -269,6 +277,10 @@ ENTRY(v6_dma_flush_range)
 #endif
 	add	r0, r0, #D_CACHE_LINE_SIZE
 	cmp	r0, r1
+#ifdef CONFIG_DMA_CACHE_RWFO
+	ldrlob	r2, [r0]			@ read for ownership
+	strlob	r2, [r0]			@ write for ownership
+#endif
 	blo	1b
 	mov	r0, #0
 	mcr	p15, 0, r0, c7, c10, 4		@ drain write buffer

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

* [PATCH] [29/139] qla2xxx: Correct issue where NPIV-config data was not being allocated for 82xx parts.
  2011-02-02  0:43 [PATCH] [0/139] 2.6.35.11 longterm review Andi Kleen
                   ` (27 preceding siblings ...)
  2011-02-02  0:43 ` [PATCH] [28/139] ARM: 6535/1: V6 MPCore v6_dma_inv_range and v6_dma_flush_range RWFO fix Andi Kleen
@ 2011-02-02  0:43 ` Andi Kleen
  2011-02-02  0:43 ` [PATCH] [30/139] qla2xxx: Populate Command Type 6 LUN field properly Andi Kleen
                   ` (110 subsequent siblings)
  139 siblings, 0 replies; 149+ messages in thread
From: Andi Kleen @ 2011-02-02  0:43 UTC (permalink / raw)
  To: andrew.vasquez, Madhu.Iyengar, James.Bottomley, gregkh, ak,
	linux-kernel, stable

2.6.35-longterm review patch.  If anyone has any objections, please let me know.

------------------
From: Andrew Vasquez <andrew.vasquez@qlogic.com>

commit 087c621e22f49c326cdc65d98c6fc0737ac13533 upstream.

This would cause a panic while reading the NPIV-config data.

Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: Madhuranath Iyengar <Madhu.Iyengar@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: Andi Kleen <ak@linux.intel.com>

---
 drivers/scsi/qla2xxx/qla_os.c |    1 +
 1 file changed, 1 insertion(+)

Index: linux-2.6.35.y/drivers/scsi/qla2xxx/qla_os.c
===================================================================
--- linux-2.6.35.y.orig/drivers/scsi/qla2xxx/qla_os.c
+++ linux-2.6.35.y/drivers/scsi/qla2xxx/qla_os.c
@@ -2102,6 +2102,7 @@ qla2x00_probe_one(struct pci_dev *pdev, 
 		ha->init_cb_size = sizeof(struct mid_init_cb_81xx);
 		ha->gid_list_info_size = 8;
 		ha->optrom_size = OPTROM_SIZE_82XX;
+		ha->nvram_npiv_size = QLA_MAX_VPORTS_QLA25XX;
 		ha->isp_ops = &qla82xx_isp_ops;
 		ha->flash_conf_off = FARX_ACCESS_FLASH_CONF;
 		ha->flash_data_off = FARX_ACCESS_FLASH_DATA;

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

* [PATCH] [30/139] qla2xxx: Populate Command Type 6 LUN field properly.
  2011-02-02  0:43 [PATCH] [0/139] 2.6.35.11 longterm review Andi Kleen
                   ` (28 preceding siblings ...)
  2011-02-02  0:43 ` [PATCH] [29/139] qla2xxx: Correct issue where NPIV-config data was not being allocated for 82xx parts Andi Kleen
@ 2011-02-02  0:43 ` Andi Kleen
  2011-02-02  0:43 ` [PATCH] [31/139] llc: fix a device refcount imbalance Andi Kleen
                   ` (109 subsequent siblings)
  139 siblings, 0 replies; 149+ messages in thread
From: Andi Kleen @ 2011-02-02  0:43 UTC (permalink / raw)
  To: michael.hernandez, Madhu.Iyengar, James.Bottomley, gregkh, ak,
	linux-kernel, stable

2.6.35-longterm review patch.  If anyone has any objections, please let me know.

------------------
From: Mike Hernandez <michael.hernandez@qlogic.com>

commit 85727e1f78bd8392a0657ad6a4ff85fef1cc4a6d upstream.

Use the host_to_fcp_swap call to correctly populate the LUN field
in the Command Type 6 path.  This field is used during LUN reset
cleanup and must match the field used in the FCP command.

Signed-off-by: Mike Hernandez <michael.hernandez@qlogic.com>
Signed-off-by: Madhuranath Iyengar <Madhu.Iyengar@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: Andi Kleen <ak@linux.intel.com>

---
 drivers/scsi/qla2xxx/qla_iocb.c |    1 +
 drivers/scsi/qla2xxx/qla_nx.c   |    1 +
 2 files changed, 2 insertions(+)

Index: linux-2.6.35.y/drivers/scsi/qla2xxx/qla_iocb.c
===================================================================
--- linux-2.6.35.y.orig/drivers/scsi/qla2xxx/qla_iocb.c
+++ linux-2.6.35.y/drivers/scsi/qla2xxx/qla_iocb.c
@@ -1122,6 +1122,7 @@ qla24xx_build_scsi_crc_2_iocbs(srb_t *sp
 		fcp_cmnd->additional_cdb_len |= 2;
 
 	int_to_scsilun(sp->cmd->device->lun, &fcp_cmnd->lun);
+	host_to_fcp_swap((uint8_t *)&fcp_cmnd->lun, sizeof(fcp_cmnd->lun));
 	memcpy(fcp_cmnd->cdb, cmd->cmnd, cmd->cmd_len);
 	cmd_pkt->fcp_cmnd_dseg_len = cpu_to_le16(fcp_cmnd_len);
 	cmd_pkt->fcp_cmnd_dseg_address[0] = cpu_to_le32(
Index: linux-2.6.35.y/drivers/scsi/qla2xxx/qla_nx.c
===================================================================
--- linux-2.6.35.y.orig/drivers/scsi/qla2xxx/qla_nx.c
+++ linux-2.6.35.y/drivers/scsi/qla2xxx/qla_nx.c
@@ -2798,6 +2798,7 @@ sufficient_dsds:
 			goto queuing_error_fcp_cmnd;
 
 		int_to_scsilun(sp->cmd->device->lun, &cmd_pkt->lun);
+		host_to_fcp_swap((uint8_t *)&cmd_pkt->lun, sizeof(cmd_pkt->lun));
 
 		/* build FCP_CMND IU */
 		memset(ctx->fcp_cmnd, 0, sizeof(struct fcp_cmnd));

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

* [PATCH] [31/139] llc: fix a device refcount imbalance
  2011-02-02  0:43 [PATCH] [0/139] 2.6.35.11 longterm review Andi Kleen
                   ` (29 preceding siblings ...)
  2011-02-02  0:43 ` [PATCH] [30/139] qla2xxx: Populate Command Type 6 LUN field properly Andi Kleen
@ 2011-02-02  0:43 ` Andi Kleen
  2011-02-02  0:43 ` [PATCH] [32/139] ath9k: Disable SWBA interrupt on remove_interface Andi Kleen
                   ` (108 subsequent siblings)
  139 siblings, 0 replies; 149+ messages in thread
From: Andi Kleen @ 2011-02-02  0:43 UTC (permalink / raw)
  To: eric.dumazet, ak, opurdila, davem, gregkh, linux-kernel, stable

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 2649 bytes --]

2.6.35-longterm review patch.  If anyone has any objections, please let me know.

------------------
From: Eric Dumazet <eric.dumazet@gmail.com>

commit 35d9b0c906ad92d32a0b8db5daa6fabfcc2f068d upstream.

Le dimanche 05 décembre 2010 à 12:23 +0100, Eric Dumazet a écrit :
> Le dimanche 05 décembre 2010 à 09:19 +0100, Eric Dumazet a écrit :
>
> > Hmm..
> >
> > If somebody can explain why RTNL is held in arp_ioctl() (and therefore
> > in arp_req_delete()), we might first remove RTNL use in arp_ioctl() so
> > that your patch can be applied.
> >
> > Right now it is not good, because RTNL wont be necessarly held when you
> > are going to call arp_invalidate() ?
>
> While doing this analysis, I found a refcount bug in llc, I'll send a
> patch for net-2.6

Oh well, of course I must first fix the bug in net-2.6, and wait David
pull the fix in net-next-2.6 before sending this rcu conversion.

Note: this patch should be sent to stable teams (2.6.34 and up)

[PATCH net-2.6] llc: fix a device refcount imbalance

commit abf9d537fea225 (llc: add support for SO_BINDTODEVICE) added one
refcount imbalance in llc_ui_bind(), because dev_getbyhwaddr() doesnt
take a reference on device, while dev_get_by_index() does.

Fix this using RCU locking. And since an RCU conversion will be done for
2.6.38 for dev_getbyhwaddr(), put the rcu_read_lock/unlock exactly at
their final place.

Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: Andi Kleen <ak@linux.intel.com>
Cc: Octavian Purdila <opurdila@ixiacom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

---
 net/llc/af_llc.c |    5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

Index: linux-2.6.35.y/net/llc/af_llc.c
===================================================================
--- linux-2.6.35.y.orig/net/llc/af_llc.c
+++ linux-2.6.35.y/net/llc/af_llc.c
@@ -317,8 +317,9 @@ static int llc_ui_bind(struct socket *so
 		goto out;
 	rc = -ENODEV;
 	rtnl_lock();
+	rcu_read_lock();
 	if (sk->sk_bound_dev_if) {
-		llc->dev = dev_get_by_index(&init_net, sk->sk_bound_dev_if);
+		llc->dev = dev_get_by_index_rcu(&init_net, sk->sk_bound_dev_if);
 		if (llc->dev) {
 			if (!addr->sllc_arphrd)
 				addr->sllc_arphrd = llc->dev->type;
@@ -329,13 +330,13 @@ static int llc_ui_bind(struct socket *so
 			    !llc_mac_match(addr->sllc_mac,
 					   llc->dev->dev_addr)) {
 				rc = -EINVAL;
-				dev_put(llc->dev);
 				llc->dev = NULL;
 			}
 		}
 	} else
 		llc->dev = dev_getbyhwaddr(&init_net, addr->sllc_arphrd,
 					   addr->sllc_mac);
+	rcu_read_unlock();
 	rtnl_unlock();
 	if (!llc->dev)
 		goto out;

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

* [PATCH] [32/139] ath9k: Disable SWBA interrupt on remove_interface
  2011-02-02  0:43 [PATCH] [0/139] 2.6.35.11 longterm review Andi Kleen
                   ` (30 preceding siblings ...)
  2011-02-02  0:43 ` [PATCH] [31/139] llc: fix a device refcount imbalance Andi Kleen
@ 2011-02-02  0:43 ` Andi Kleen
  2011-02-02  0:43 ` [PATCH] [33/139] ath9k: fix bug in tx power Andi Kleen
                   ` (107 subsequent siblings)
  139 siblings, 0 replies; 149+ messages in thread
From: Andi Kleen @ 2011-02-02  0:43 UTC (permalink / raw)
  To: rmanoharan, linville, gregkh, ak, linux-kernel, stable

2.6.35-longterm review patch.  If anyone has any objections, please let me know.

------------------
From: Rajkumar Manoharan <rmanoharan@atheros.com>

commit 46047784b8cdcfc916f6c1cccee0c18dd1223dfd upstream.

while removing beaconing mode interface, SWBA interrupt
was never disabled when there are no other beaconing interfaces.

Signed-off-by: Rajkumar Manoharan <rmanoharan@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: Andi Kleen <ak@linux.intel.com>

---
 drivers/net/wireless/ath/ath9k/main.c |   11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)

Index: linux-2.6.35.y/drivers/net/wireless/ath/ath9k/main.c
===================================================================
--- linux-2.6.35.y.orig/drivers/net/wireless/ath/ath9k/main.c
+++ linux-2.6.35.y/drivers/net/wireless/ath/ath9k/main.c
@@ -1501,6 +1501,7 @@ static void ath9k_remove_interface(struc
 	struct ath_softc *sc = aphy->sc;
 	struct ath_common *common = ath9k_hw_common(sc->sc_ah);
 	struct ath_vif *avp = (void *)vif->drv_priv;
+	bool bs_valid = false;
 	int i;
 
 	ath_print(common, ATH_DBG_CONFIG, "Detach Interface\n");
@@ -1529,7 +1530,15 @@ static void ath9k_remove_interface(struc
 			       "slot\n", __func__);
 			sc->beacon.bslot[i] = NULL;
 			sc->beacon.bslot_aphy[i] = NULL;
-		}
+		} else if (sc->beacon.bslot[i])
+			bs_valid = true;
+	}
+	if (!bs_valid && (sc->sc_ah->imask & ATH9K_INT_SWBA)) {
+		/* Disable SWBA interrupt */
+		sc->sc_ah->imask &= ~ATH9K_INT_SWBA;
+		ath9k_ps_wakeup(sc);
+		ath9k_hw_set_interrupts(sc->sc_ah, sc->sc_ah->imask);
+		ath9k_ps_restore(sc);
 	}
 
 	sc->nvifs--;

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

* [PATCH] [33/139] ath9k: fix bug in tx power
  2011-02-02  0:43 [PATCH] [0/139] 2.6.35.11 longterm review Andi Kleen
                   ` (31 preceding siblings ...)
  2011-02-02  0:43 ` [PATCH] [32/139] ath9k: Disable SWBA interrupt on remove_interface Andi Kleen
@ 2011-02-02  0:43 ` Andi Kleen
  2011-02-02  0:43 ` [PATCH] [34/139] mac80211: Fix BUG in pskb_expand_head when transmitting shared skbs Andi Kleen
                   ` (106 subsequent siblings)
  139 siblings, 0 replies; 149+ messages in thread
From: Andi Kleen @ 2011-02-02  0:43 UTC (permalink / raw)
  To: technoboy85, matteo, linville, gregkh, ak, linux-kernel, stable

2.6.35-longterm review patch.  If anyone has any objections, please let me know.

------------------
From: Matteo Croce <technoboy85@gmail.com>

commit 841051602e3fa18ea468fe5a177aa92b6eb44b56 upstream.

The ath9k driver subtracts 3 dBm to the txpower as with two radios the
signal power is doubled.
The resulting value is assigned in an u16 which overflows and makes
the card work at full power.

Signed-off-by: Matteo Croce <matteo@openwrt.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: Andi Kleen <ak@linux.intel.com>

---
 drivers/net/wireless/ath/ath9k/eeprom_def.c |   12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)

Index: linux-2.6.35.y/drivers/net/wireless/ath/ath9k/eeprom_def.c
===================================================================
--- linux-2.6.35.y.orig/drivers/net/wireless/ath/ath9k/eeprom_def.c
+++ linux-2.6.35.y/drivers/net/wireless/ath/ath9k/eeprom_def.c
@@ -1064,15 +1064,19 @@ static void ath9k_hw_set_def_power_per_r
 	case 1:
 		break;
 	case 2:
-		scaledPower -= REDUCE_SCALED_POWER_BY_TWO_CHAIN;
+		if (scaledPower > REDUCE_SCALED_POWER_BY_TWO_CHAIN)
+			scaledPower -= REDUCE_SCALED_POWER_BY_TWO_CHAIN;
+		else
+			scaledPower = 0;
 		break;
 	case 3:
-		scaledPower -= REDUCE_SCALED_POWER_BY_THREE_CHAIN;
+		if (scaledPower > REDUCE_SCALED_POWER_BY_THREE_CHAIN)
+			scaledPower -= REDUCE_SCALED_POWER_BY_THREE_CHAIN;
+		else
+			scaledPower = 0;
 		break;
 	}
 
-	scaledPower = max((u16)0, scaledPower);
-
 	if (IS_CHAN_2GHZ(chan)) {
 		numCtlModes = ARRAY_SIZE(ctlModesFor11g) -
 			SUB_NUM_CTL_MODES_AT_2G_40;

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

* [PATCH] [34/139] mac80211: Fix BUG in pskb_expand_head when transmitting shared skbs
  2011-02-02  0:43 [PATCH] [0/139] 2.6.35.11 longterm review Andi Kleen
                   ` (32 preceding siblings ...)
  2011-02-02  0:43 ` [PATCH] [33/139] ath9k: fix bug in tx power Andi Kleen
@ 2011-02-02  0:43 ` Andi Kleen
  2011-02-02 10:53   ` Helmut Schaa
  2011-02-02  0:43 ` [PATCH] [35/139] SPARC/LEON: removed constant timer initialization as if HZ=100, now it reflects the value of HZ Andi Kleen
                   ` (105 subsequent siblings)
  139 siblings, 1 reply; 149+ messages in thread
From: Andi Kleen @ 2011-02-02  0:43 UTC (permalink / raw)
  To: helmut.schaa, johannes, linville, gregkh, ak, linux-kernel, stable

2.6.35-longterm review patch.  If anyone has any objections, please let me know.

------------------
From: Helmut Schaa <helmut.schaa@googlemail.com>

commit 7e2447075690860e2cea96b119fc9cadbaa7e83c upstream.

mac80211 doesn't handle shared skbs correctly at the moment. As a result
a possible resize can trigger a BUG in pskb_expand_head.

[  676.030000] Kernel bug detected[#1]:
[  676.030000] Cpu 0
[  676.030000] $ 0   : 00000000 00000000 819662ff 00000002
[  676.030000] $ 4   : 81966200 00000020 00000000 00000020
[  676.030000] $ 8   : 819662e0 800043c0 00000002 00020000
[  676.030000] $12   : 3b9aca00 00000000 00000000 00470000
[  676.030000] $16   : 80ea2000 00000000 00000000 00000000
[  676.030000] $20   : 818aa200 80ea2018 80ea2000 00000008
[  676.030000] $24   : 00000002 800ace5c
[  676.030000] $28   : 8199a000 8199bd20 81938f88 80f180d4
[  676.030000] Hi    : 0000026e
[  676.030000] Lo    : 0000757e
[  676.030000] epc   : 801245e4 pskb_expand_head+0x44/0x1d8
[  676.030000]     Not tainted
[  676.030000] ra    : 80f180d4 ieee80211_skb_resize+0xb0/0x114 [mac80211]
[  676.030000] Status: 1000a403    KERNEL EXL IE
[  676.030000] Cause : 10800024
[  676.030000] PrId  : 0001964c (MIPS 24Kc)
[  676.030000] Modules linked in: mac80211_hwsim rt2800lib rt2x00soc rt2x00pci rt2x00lib mac80211 crc_itu_t crc_ccitt cfg80211 compat arc4 aes_generic deflate ecb cbc [last unloaded: rt2800pci]
[  676.030000] Process kpktgend_0 (pid: 97, threadinfo=8199a000, task=81879f48, tls=00000000)
[  676.030000] Stack : ffffffff 00000000 00000000 00000014 00000004 80ea2000 00000000 00000000
[  676.030000]         818aa200 80f180d4 ffffffff 0000000a 81879f78 81879f48 81879f48 00000018
[  676.030000]         81966246 80ea2000 818432e0 80f1a420 80203050 81814d98 00000001 81879f48
[  676.030000]         81879f48 00000018 81966246 818432e0 0000001a 8199bdd4 0000001c 80f1b72c
[  676.030000]         80203020 8001292c 80ef4aa2 7f10b55d 801ab5b8 81879f48 00000188 80005c90
[  676.030000]         ...
[  676.030000] Call Trace:
[  676.030000] [<801245e4>] pskb_expand_head+0x44/0x1d8
[  676.030000] [<80f180d4>] ieee80211_skb_resize+0xb0/0x114 [mac80211]
[  676.030000] [<80f1a420>] ieee80211_xmit+0x150/0x22c [mac80211]
[  676.030000] [<80f1b72c>] ieee80211_subif_start_xmit+0x6f4/0x73c [mac80211]
[  676.030000] [<8014361c>] pktgen_thread_worker+0xfac/0x16f8
[  676.030000] [<8002ebe8>] kthread+0x7c/0x88
[  676.030000] [<80008e0c>] kernel_thread_helper+0x10/0x18
[  676.030000]
[  676.030000]
[  676.030000] Code: 24020001  10620005  2502001f <0200000d> 0804917a  00000000  2502001f  00441023  00531021

Fix this by making a local copy of shared skbs prior to mangeling them.
To avoid copying the skb unnecessarily move the skb_copy call below the
checks that don't need write access to the skb.

Also, move the assignment of nh_pos and h_pos below the skb_copy to point
to the correct skb.

It would be possible to avoid another resize of the copied skb by using
skb_copy_expand instead of skb_copy but that would make the patch more
complex. Also, shared skbs are a corner case right now, so the resize
shouldn't matter much.

Cc: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: Helmut Schaa <helmut.schaa@googlemail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: Andi Kleen <ak@linux.intel.com>

---
 net/mac80211/tx.c |   21 ++++++++++++++++++---
 1 file changed, 18 insertions(+), 3 deletions(-)

Index: linux-2.6.35.y/net/mac80211/tx.c
===================================================================
--- linux-2.6.35.y.orig/net/mac80211/tx.c
+++ linux-2.6.35.y/net/mac80211/tx.c
@@ -1679,15 +1679,13 @@ netdev_tx_t ieee80211_subif_start_xmit(s
 	int nh_pos, h_pos;
 	struct sta_info *sta = NULL;
 	u32 sta_flags = 0;
+	struct sk_buff *tmp_skb;
 
 	if (unlikely(skb->len < ETH_HLEN)) {
 		ret = NETDEV_TX_OK;
 		goto fail;
 	}
 
-	nh_pos = skb_network_header(skb) - skb->data;
-	h_pos = skb_transport_header(skb) - skb->data;
-
 	/* convert Ethernet header to proper 802.11 header (based on
 	 * operation mode) */
 	ethertype = (skb->data[12] << 8) | skb->data[13];
@@ -1859,6 +1857,20 @@ netdev_tx_t ieee80211_subif_start_xmit(s
 		goto fail;
 	}
 
+	/*
+	 * If the skb is shared we need to obtain our own copy.
+	 */
+	if (skb_shared(skb)) {
+		tmp_skb = skb;
+		skb = skb_copy(skb, GFP_ATOMIC);
+		kfree_skb(tmp_skb);
+
+		if (!skb) {
+			ret = NETDEV_TX_OK;
+			goto fail;
+		}
+	}
+
 	hdr.frame_control = fc;
 	hdr.duration_id = 0;
 	hdr.seq_ctrl = 0;
@@ -1877,6 +1889,9 @@ netdev_tx_t ieee80211_subif_start_xmit(s
 		encaps_len = 0;
 	}
 
+	nh_pos = skb_network_header(skb) - skb->data;
+	h_pos = skb_transport_header(skb) - skb->data;
+
 	skb_pull(skb, skip_header_bytes);
 	nh_pos -= skip_header_bytes;
 	h_pos -= skip_header_bytes;

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

* [PATCH] [35/139] SPARC/LEON: removed constant timer initialization as if HZ=100, now it reflects the value of HZ
  2011-02-02  0:43 [PATCH] [0/139] 2.6.35.11 longterm review Andi Kleen
                   ` (33 preceding siblings ...)
  2011-02-02  0:43 ` [PATCH] [34/139] mac80211: Fix BUG in pskb_expand_head when transmitting shared skbs Andi Kleen
@ 2011-02-02  0:43 ` Andi Kleen
  2011-02-02  0:43 ` [PATCH] [36/139] sparc64: Delete prom_puts() unused Andi Kleen
                   ` (104 subsequent siblings)
  139 siblings, 0 replies; 149+ messages in thread
From: Andi Kleen @ 2011-02-02  0:43 UTC (permalink / raw)
  To: daniel, davem, gregkh, ak, linux-kernel, stable

2.6.35-longterm review patch.  If anyone has any objections, please let me know.

------------------

From: Daniel Hellstrom <daniel@gaisler.com>

[ Upstream commit b690c425fe07c725e7f1f7d40303588416cba67f ]

Signed-off-by: Daniel Hellstrom <daniel@gaisler.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: Andi Kleen <ak@linux.intel.com>

---
 arch/sparc/kernel/leon_kernel.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Index: linux-2.6.35.y/arch/sparc/kernel/leon_kernel.c
===================================================================
--- linux-2.6.35.y.orig/arch/sparc/kernel/leon_kernel.c
+++ linux-2.6.35.y/arch/sparc/kernel/leon_kernel.c
@@ -114,7 +114,7 @@ void __init leon_init_timers(irq_handler
 	if (leon3_gptimer_regs && leon3_irqctrl_regs) {
 		LEON3_BYPASS_STORE_PA(&leon3_gptimer_regs->e[0].val, 0);
 		LEON3_BYPASS_STORE_PA(&leon3_gptimer_regs->e[0].rld,
-				      (((1000000 / 100) - 1)));
+				      (((1000000 / HZ) - 1)));
 		LEON3_BYPASS_STORE_PA(&leon3_gptimer_regs->e[0].ctrl, 0);
 
 #ifdef CONFIG_SMP
@@ -128,7 +128,7 @@ void __init leon_init_timers(irq_handler
 		}
 
 		LEON3_BYPASS_STORE_PA(&leon3_gptimer_regs->e[1].val, 0);
-		LEON3_BYPASS_STORE_PA(&leon3_gptimer_regs->e[1].rld, (((1000000/100) - 1)));
+		LEON3_BYPASS_STORE_PA(&leon3_gptimer_regs->e[1].rld, (((1000000/HZ) - 1)));
 		LEON3_BYPASS_STORE_PA(&leon3_gptimer_regs->e[1].ctrl, 0);
 # endif
 

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

* [PATCH] [36/139] sparc64: Delete prom_puts() unused.
  2011-02-02  0:43 [PATCH] [0/139] 2.6.35.11 longterm review Andi Kleen
                   ` (34 preceding siblings ...)
  2011-02-02  0:43 ` [PATCH] [35/139] SPARC/LEON: removed constant timer initialization as if HZ=100, now it reflects the value of HZ Andi Kleen
@ 2011-02-02  0:43 ` Andi Kleen
  2011-02-02  0:43 ` [PATCH] [37/139] sparc: Remove prom_pathtoinode() Andi Kleen
                   ` (103 subsequent siblings)
  139 siblings, 0 replies; 149+ messages in thread
From: Andi Kleen @ 2011-02-02  0:43 UTC (permalink / raw)
  To: davem, gregkh, ak, linux-kernel, stable

2.6.35-longterm review patch.  If anyone has any objections, please let me know.

------------------

From: David S. Miller <davem@davemloft.net>

[ Upstream commit ce05a94efaf71d562eeefd30d6bbc2ab42b06bac ]

Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: Andi Kleen <ak@linux.intel.com>

---
 arch/sparc/prom/console_64.c |   16 ----------------
 1 file changed, 16 deletions(-)

Index: linux-2.6.35.y/arch/sparc/prom/console_64.c
===================================================================
--- linux-2.6.35.y.orig/arch/sparc/prom/console_64.c
+++ linux-2.6.35.y/arch/sparc/prom/console_64.c
@@ -81,19 +81,3 @@ prom_putchar(char c)
 {
 	prom_nbputchar(c);
 }
-
-void
-prom_puts(const char *s, int len)
-{
-	unsigned long args[7];
-
-	args[0] = (unsigned long) "write";
-	args[1] = 3;
-	args[2] = 1;
-	args[3] = (unsigned int) prom_stdout;
-	args[4] = (unsigned long) s;
-	args[5] = len;
-	args[6] = (unsigned long) -1;
-
-	p1275_cmd_direct(args);
-}

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

* [PATCH] [37/139] sparc: Remove prom_pathtoinode()
  2011-02-02  0:43 [PATCH] [0/139] 2.6.35.11 longterm review Andi Kleen
                   ` (35 preceding siblings ...)
  2011-02-02  0:43 ` [PATCH] [36/139] sparc64: Delete prom_puts() unused Andi Kleen
@ 2011-02-02  0:43 ` Andi Kleen
  2011-02-02  0:43 ` [PATCH] [38/139] sparc: Kill prom devops_{32,64}.c Andi Kleen
                   ` (102 subsequent siblings)
  139 siblings, 0 replies; 149+ messages in thread
From: Andi Kleen @ 2011-02-02  0:43 UTC (permalink / raw)
  To: davem, gregkh, ak, linux-kernel, stable

2.6.35-longterm review patch.  If anyone has any objections, please let me know.

------------------

From: David S. Miller <davem@davemloft.net>

[ Upstream commit 17d70d6df0c4ea7a203b444001572a91ad9c2bef ]

Unused.

Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: Andi Kleen <ak@linux.intel.com>

---
 arch/sparc/include/asm/oplib_32.h |    1 -
 arch/sparc/include/asm/oplib_64.h |    1 -
 arch/sparc/prom/tree_32.c         |   15 ---------------
 arch/sparc/prom/tree_64.c         |   18 ------------------
 4 files changed, 35 deletions(-)

Index: linux-2.6.35.y/arch/sparc/include/asm/oplib_32.h
===================================================================
--- linux-2.6.35.y.orig/arch/sparc/include/asm/oplib_32.h
+++ linux-2.6.35.y/arch/sparc/include/asm/oplib_32.h
@@ -238,7 +238,6 @@ extern int prom_node_has_property(int no
 extern int prom_setprop(int node, const char *prop_name, char *prop_value,
 			int value_size);
 
-extern int prom_pathtoinode(char *path);
 extern int prom_inst2pkg(int);
 
 /* Dorking with Bus ranges... */
Index: linux-2.6.35.y/arch/sparc/include/asm/oplib_64.h
===================================================================
--- linux-2.6.35.y.orig/arch/sparc/include/asm/oplib_64.h
+++ linux-2.6.35.y/arch/sparc/include/asm/oplib_64.h
@@ -278,7 +278,6 @@ extern int prom_finddevice(const char *n
 extern int prom_setprop(int node, const char *prop_name, char *prop_value,
 			int value_size);
 
-extern int prom_pathtoinode(const char *path);
 extern int prom_inst2pkg(int);
 extern int prom_service_exists(const char *service_name);
 extern void prom_sun4v_guest_soft_state(void);
Index: linux-2.6.35.y/arch/sparc/prom/tree_32.c
===================================================================
--- linux-2.6.35.y.orig/arch/sparc/prom/tree_32.c
+++ linux-2.6.35.y/arch/sparc/prom/tree_32.c
@@ -341,18 +341,3 @@ int prom_inst2pkg(int inst)
 	if (node == -1) return 0;
 	return node;
 }
-
-/* Return 'node' assigned to a particular prom 'path'
- * FIXME: Should work for v0 as well
- */
-int prom_pathtoinode(char *path)
-{
-	int node, inst;
-	
-	inst = prom_devopen (path);
-	if (inst == -1) return 0;
-	node = prom_inst2pkg (inst);
-	prom_devclose (inst);
-	if (node == -1) return 0;
-	return node;
-}
Index: linux-2.6.35.y/arch/sparc/prom/tree_64.c
===================================================================
--- linux-2.6.35.y.orig/arch/sparc/prom/tree_64.c
+++ linux-2.6.35.y/arch/sparc/prom/tree_64.c
@@ -374,24 +374,6 @@ inline int prom_inst2pkg(int inst)
 	return node;
 }
 
-/* Return 'node' assigned to a particular prom 'path'
- * FIXME: Should work for v0 as well
- */
-int
-prom_pathtoinode(const char *path)
-{
-	int node, inst;
-
-	inst = prom_devopen (path);
-	if (inst == 0)
-		return 0;
-	node = prom_inst2pkg(inst);
-	prom_devclose(inst);
-	if (node == -1)
-		return 0;
-	return node;
-}
-
 int prom_ihandle2path(int handle, char *buffer, int bufsize)
 {
 	unsigned long args[7];

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

* [PATCH] [38/139] sparc: Kill prom devops_{32,64}.c
  2011-02-02  0:43 [PATCH] [0/139] 2.6.35.11 longterm review Andi Kleen
                   ` (36 preceding siblings ...)
  2011-02-02  0:43 ` [PATCH] [37/139] sparc: Remove prom_pathtoinode() Andi Kleen
@ 2011-02-02  0:43 ` Andi Kleen
  2011-02-02  0:43 ` [PATCH] [39/139] sparc64: Unexport prom_service_exists() Andi Kleen
                   ` (101 subsequent siblings)
  139 siblings, 0 replies; 149+ messages in thread
From: Andi Kleen @ 2011-02-02  0:43 UTC (permalink / raw)
  To: davem, gregkh, ak, linux-kernel, stable

2.6.35-longterm review patch.  If anyone has any objections, please let me know.

------------------

From: David S. Miller <davem@davemloft.net>

[ Upstream commit b148246912bea92bde2a0cba125ca94f1f776b12 ]

Completely unused.

Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: Andi Kleen <ak@linux.intel.com>

---
 arch/sparc/include/asm/oplib_32.h |   19 --------
 arch/sparc/include/asm/oplib_64.h |   21 ---------
 arch/sparc/prom/Makefile          |    1 
 arch/sparc/prom/devops_32.c       |   87 --------------------------------------
 arch/sparc/prom/devops_64.c       |   67 -----------------------------
 5 files changed, 195 deletions(-)
 delete mode 100644 arch/sparc/prom/devops_32.c
 delete mode 100644 arch/sparc/prom/devops_64.c

Index: linux-2.6.35.y/arch/sparc/include/asm/oplib_32.h
===================================================================
--- linux-2.6.35.y.orig/arch/sparc/include/asm/oplib_32.h
+++ linux-2.6.35.y/arch/sparc/include/asm/oplib_32.h
@@ -60,25 +60,6 @@ extern char *prom_getbootargs(void);
 extern char *prom_mapio(char *virt_hint, int io_space, unsigned int phys_addr, unsigned int num_bytes);
 extern void prom_unmapio(char *virt_addr, unsigned int num_bytes);
 
-/* Device operations. */
-
-/* Open the device described by the passed string.  Note, that the format
- * of the string is different on V0 vs. V2->higher proms.  The caller must
- * know what he/she is doing!  Returns the device descriptor, an int.
- */
-extern int prom_devopen(char *device_string);
-
-/* Close a previously opened device described by the passed integer
- * descriptor.
- */
-extern int prom_devclose(int device_handle);
-
-/* Do a seek operation on the device described by the passed integer
- * descriptor.
- */
-extern void prom_seek(int device_handle, unsigned int seek_hival,
-		      unsigned int seek_lowval);
-
 /* Miscellaneous routines, don't really fit in any category per se. */
 
 /* Reboot the machine with the command line passed. */
Index: linux-2.6.35.y/arch/sparc/include/asm/oplib_64.h
===================================================================
--- linux-2.6.35.y.orig/arch/sparc/include/asm/oplib_64.h
+++ linux-2.6.35.y/arch/sparc/include/asm/oplib_64.h
@@ -67,27 +67,6 @@ extern void prom_init(void *cif_handler,
 /* Boot argument acquisition, returns the boot command line string. */
 extern char *prom_getbootargs(void);
 
-/* Device utilities. */
-
-/* Device operations. */
-
-/* Open the device described by the passed string.  Note, that the format
- * of the string is different on V0 vs. V2->higher proms.  The caller must
- * know what he/she is doing!  Returns the device descriptor, an int.
- */
-extern int prom_devopen(const char *device_string);
-
-/* Close a previously opened device described by the passed integer
- * descriptor.
- */
-extern int prom_devclose(int device_handle);
-
-/* Do a seek operation on the device described by the passed integer
- * descriptor.
- */
-extern void prom_seek(int device_handle, unsigned int seek_hival,
-		      unsigned int seek_lowval);
-
 /* Miscellaneous routines, don't really fit in any category per se. */
 
 /* Reboot the machine with the command line passed. */
Index: linux-2.6.35.y/arch/sparc/prom/Makefile
===================================================================
--- linux-2.6.35.y.orig/arch/sparc/prom/Makefile
+++ linux-2.6.35.y/arch/sparc/prom/Makefile
@@ -6,7 +6,6 @@ ccflags := -Werror
 
 lib-y                 := bootstr_$(BITS).o
 lib-$(CONFIG_SPARC32) += devmap.o
-lib-y                 += devops_$(BITS).o
 lib-y                 += init_$(BITS).o
 lib-$(CONFIG_SPARC32) += memory.o
 lib-y                 += misc_$(BITS).o
Index: linux-2.6.35.y/arch/sparc/prom/devops_32.c
===================================================================
--- linux-2.6.35.y.orig/arch/sparc/prom/devops_32.c
+++ /dev/null
@@ -1,87 +0,0 @@
-/*
- * devops.c:  Device operations using the PROM.
- *
- * Copyright (C) 1995 David S. Miller (davem@caip.rutgers.edu)
- */
-#include <linux/types.h>
-#include <linux/kernel.h>
-#include <linux/sched.h>
-
-#include <asm/openprom.h>
-#include <asm/oplib.h>
-
-extern void restore_current(void);
-
-/* Open the device described by the string 'dstr'.  Returns the handle
- * to that device used for subsequent operations on that device.
- * Returns -1 on failure.
- */
-int
-prom_devopen(char *dstr)
-{
-	int handle;
-	unsigned long flags;
-	spin_lock_irqsave(&prom_lock, flags);
-	switch(prom_vers) {
-	case PROM_V0:
-		handle = (*(romvec->pv_v0devops.v0_devopen))(dstr);
-		if(handle == 0) handle = -1;
-		break;
-	case PROM_V2:
-	case PROM_V3:
-		handle = (*(romvec->pv_v2devops.v2_dev_open))(dstr);
-		break;
-	default:
-		handle = -1;
-		break;
-	};
-	restore_current();
-	spin_unlock_irqrestore(&prom_lock, flags);
-
-	return handle;
-}
-
-/* Close the device described by device handle 'dhandle'. */
-int
-prom_devclose(int dhandle)
-{
-	unsigned long flags;
-	spin_lock_irqsave(&prom_lock, flags);
-	switch(prom_vers) {
-	case PROM_V0:
-		(*(romvec->pv_v0devops.v0_devclose))(dhandle);
-		break;
-	case PROM_V2:
-	case PROM_V3:
-		(*(romvec->pv_v2devops.v2_dev_close))(dhandle);
-		break;
-	default:
-		break;
-	};
-	restore_current();
-	spin_unlock_irqrestore(&prom_lock, flags);
-	return 0;
-}
-
-/* Seek to specified location described by 'seekhi' and 'seeklo'
- * for device 'dhandle'.
- */
-void
-prom_seek(int dhandle, unsigned int seekhi, unsigned int seeklo)
-{
-	unsigned long flags;
-	spin_lock_irqsave(&prom_lock, flags);
-	switch(prom_vers) {
-	case PROM_V0:
-		(*(romvec->pv_v0devops.v0_seekdev))(dhandle, seekhi, seeklo);
-		break;
-	case PROM_V2:
-	case PROM_V3:
-		(*(romvec->pv_v2devops.v2_dev_seek))(dhandle, seekhi, seeklo);
-		break;
-	default:
-		break;
-	};
-	restore_current();
-	spin_unlock_irqrestore(&prom_lock, flags);
-}
Index: linux-2.6.35.y/arch/sparc/prom/devops_64.c
===================================================================
--- linux-2.6.35.y.orig/arch/sparc/prom/devops_64.c
+++ /dev/null
@@ -1,67 +0,0 @@
-/*
- * devops.c:  Device operations using the PROM.
- *
- * Copyright (C) 1995 David S. Miller (davem@caip.rutgers.edu)
- * Copyright (C) 1996,1997 Jakub Jelinek (jj@sunsite.mff.cuni.cz)
- */
-#include <linux/types.h>
-#include <linux/kernel.h>
-#include <linux/sched.h>
-
-#include <asm/openprom.h>
-#include <asm/oplib.h>
-
-/* Open the device described by the string 'dstr'.  Returns the handle
- * to that device used for subsequent operations on that device.
- * Returns 0 on failure.
- */
-int
-prom_devopen(const char *dstr)
-{
-	unsigned long args[5];
-
-	args[0] = (unsigned long) "open";
-	args[1] = 1;
-	args[2] = 1;
-	args[3] = (unsigned long) dstr;
-	args[4] = (unsigned long) -1;
-
-	p1275_cmd_direct(args);
-
-	return (int) args[4];
-}
-
-/* Close the device described by device handle 'dhandle'. */
-int
-prom_devclose(int dhandle)
-{
-	unsigned long args[4];
-
-	args[0] = (unsigned long) "close";
-	args[1] = 1;
-	args[2] = 0;
-	args[3] = (unsigned int) dhandle;
-
-	p1275_cmd_direct(args);
-
-	return 0;
-}
-
-/* Seek to specified location described by 'seekhi' and 'seeklo'
- * for device 'dhandle'.
- */
-void
-prom_seek(int dhandle, unsigned int seekhi, unsigned int seeklo)
-{
-	unsigned long args[7];
-
-	args[0] = (unsigned long) "seek";
-	args[1] = 3;
-	args[2] = 1;
-	args[3] = (unsigned int) dhandle;
-	args[4] = seekhi;
-	args[5] = seeklo;
-	args[6] = (unsigned long) -1;
-
-	p1275_cmd_direct(args);
-}

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

* [PATCH] [39/139] sparc64: Unexport prom_service_exists().
  2011-02-02  0:43 [PATCH] [0/139] 2.6.35.11 longterm review Andi Kleen
                   ` (37 preceding siblings ...)
  2011-02-02  0:43 ` [PATCH] [38/139] sparc: Kill prom devops_{32,64}.c Andi Kleen
@ 2011-02-02  0:43 ` Andi Kleen
  2011-02-02  0:43 ` [PATCH] [40/139] sparc64: Delete prom_setcallback() Andi Kleen
                   ` (100 subsequent siblings)
  139 siblings, 0 replies; 149+ messages in thread
From: Andi Kleen @ 2011-02-02  0:43 UTC (permalink / raw)
  To: davem, gregkh, ak, linux-kernel, stable

2.6.35-longterm review patch.  If anyone has any objections, please let me know.

------------------

From: David S. Miller <davem@davemloft.net>

[ Upstream commit f7b5f55ac1623dfde24ef5319ad77c1746645f3f ]

Only used by functions in misc_64.c so make it private
to that file.

Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: Andi Kleen <ak@linux.intel.com>

---
 arch/sparc/include/asm/oplib_64.h |    1 -
 arch/sparc/prom/misc_64.c         |    2 +-
 2 files changed, 1 insertion(+), 2 deletions(-)

Index: linux-2.6.35.y/arch/sparc/include/asm/oplib_64.h
===================================================================
--- linux-2.6.35.y.orig/arch/sparc/include/asm/oplib_64.h
+++ linux-2.6.35.y/arch/sparc/include/asm/oplib_64.h
@@ -258,7 +258,6 @@ extern int prom_setprop(int node, const 
 			int value_size);
 
 extern int prom_inst2pkg(int);
-extern int prom_service_exists(const char *service_name);
 extern void prom_sun4v_guest_soft_state(void);
 
 extern int prom_ihandle2path(int handle, char *buffer, int bufsize);
Index: linux-2.6.35.y/arch/sparc/prom/misc_64.c
===================================================================
--- linux-2.6.35.y.orig/arch/sparc/prom/misc_64.c
+++ linux-2.6.35.y/arch/sparc/prom/misc_64.c
@@ -18,7 +18,7 @@
 #include <asm/system.h>
 #include <asm/ldc.h>
 
-int prom_service_exists(const char *service_name)
+static int prom_service_exists(const char *service_name)
 {
 	unsigned long args[5];
 

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

* [PATCH] [40/139] sparc64: Delete prom_setcallback().
  2011-02-02  0:43 [PATCH] [0/139] 2.6.35.11 longterm review Andi Kleen
                   ` (38 preceding siblings ...)
  2011-02-02  0:43 ` [PATCH] [39/139] sparc64: Unexport prom_service_exists() Andi Kleen
@ 2011-02-02  0:43 ` Andi Kleen
  2011-02-02  0:43 ` [PATCH] [41/139] sparc: Do not export prom_nb{get,put}char() Andi Kleen
                   ` (99 subsequent siblings)
  139 siblings, 0 replies; 149+ messages in thread
From: Andi Kleen @ 2011-02-02  0:43 UTC (permalink / raw)
  To: davem, gregkh, ak, linux-kernel, stable

2.6.35-longterm review patch.  If anyone has any objections, please let me know.

------------------

From: David S. Miller <davem@davemloft.net>

[ Upstream commit c540ee70e49b573535c7ddfd0e9a0fc9d549c8b7 ]

Unused.

Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: Andi Kleen <ak@linux.intel.com>

---
 arch/sparc/include/asm/oplib_64.h |    8 --------
 arch/sparc/prom/misc_64.c         |   14 --------------
 2 files changed, 22 deletions(-)

Index: linux-2.6.35.y/arch/sparc/include/asm/oplib_64.h
===================================================================
--- linux-2.6.35.y.orig/arch/sparc/include/asm/oplib_64.h
+++ linux-2.6.35.y/arch/sparc/include/asm/oplib_64.h
@@ -88,14 +88,6 @@ extern void prom_halt(void) __attribute_
 /* Halt and power-off the machine. */
 extern void prom_halt_power_off(void) __attribute__ ((noreturn));
 
-/* Set the PROM 'sync' callback function to the passed function pointer.
- * When the user gives the 'sync' command at the prom prompt while the
- * kernel is still active, the prom will call this routine.
- *
- */
-typedef int (*callback_func_t)(long *cmd);
-extern void prom_setcallback(callback_func_t func_ptr);
-
 /* Acquire the IDPROM of the root node in the prom device tree.  This
  * gets passed a buffer where you would like it stuffed.  The return value
  * is the format type of this idprom or 0xff on error.
Index: linux-2.6.35.y/arch/sparc/prom/misc_64.c
===================================================================
--- linux-2.6.35.y.orig/arch/sparc/prom/misc_64.c
+++ linux-2.6.35.y/arch/sparc/prom/misc_64.c
@@ -150,20 +150,6 @@ void prom_halt_power_off(void)
 	prom_halt();
 }
 
-/* Set prom sync handler to call function 'funcp'. */
-void prom_setcallback(callback_func_t funcp)
-{
-	unsigned long args[5];
-	if (!funcp)
-		return;
-	args[0] = (unsigned long) "set-callback";
-	args[1] = 1;
-	args[2] = 1;
-	args[3] = (unsigned long) funcp;
-	args[4] = (unsigned long) -1;
-	p1275_cmd_direct(args);
-}
-
 /* Get the idprom and stuff it into buffer 'idbuf'.  Returns the
  * format type.  'num_bytes' is the number of bytes that your idbuf
  * has space for.  Returns 0xff on error.

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

* [PATCH] [41/139] sparc: Do not export prom_nb{get,put}char().
  2011-02-02  0:43 [PATCH] [0/139] 2.6.35.11 longterm review Andi Kleen
                   ` (39 preceding siblings ...)
  2011-02-02  0:43 ` [PATCH] [40/139] sparc64: Delete prom_setcallback() Andi Kleen
@ 2011-02-02  0:43 ` Andi Kleen
  2011-02-02  0:43 ` [PATCH] [42/139] sparc: Pass buffer pointer all the way down to prom_{get,put}char() Andi Kleen
                   ` (98 subsequent siblings)
  139 siblings, 0 replies; 149+ messages in thread
From: Andi Kleen @ 2011-02-02  0:43 UTC (permalink / raw)
  To: davem, gregkh, ak, linux-kernel, stable

2.6.35-longterm review patch.  If anyone has any objections, please let me know.

------------------

From: David S. Miller <davem@davemloft.net>

[ Upstream commit 91921fef7c658b12de53376b312d071d757f7770 ]

Never used outside of console_{32,64}.c

Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: Andi Kleen <ak@linux.intel.com>

---
 arch/sparc/include/asm/oplib_32.h |    6 ------
 arch/sparc/include/asm/oplib_64.h |    6 ------
 arch/sparc/prom/console_32.c      |    6 ++----
 arch/sparc/prom/console_64.c      |    6 ++----
 4 files changed, 4 insertions(+), 20 deletions(-)

Index: linux-2.6.35.y/arch/sparc/include/asm/oplib_32.h
===================================================================
--- linux-2.6.35.y.orig/arch/sparc/include/asm/oplib_32.h
+++ linux-2.6.35.y/arch/sparc/include/asm/oplib_32.h
@@ -104,12 +104,6 @@ extern int prom_getprev(void);
 
 /* Character operations to/from the console.... */
 
-/* Non-blocking get character from console. */
-extern int prom_nbgetchar(void);
-
-/* Non-blocking put character to console. */
-extern int prom_nbputchar(char character);
-
 /* Blocking get character from console. */
 extern char prom_getchar(void);
 
Index: linux-2.6.35.y/arch/sparc/include/asm/oplib_64.h
===================================================================
--- linux-2.6.35.y.orig/arch/sparc/include/asm/oplib_64.h
+++ linux-2.6.35.y/arch/sparc/include/asm/oplib_64.h
@@ -96,12 +96,6 @@ extern unsigned char prom_get_idprom(cha
 
 /* Character operations to/from the console.... */
 
-/* Non-blocking get character from console. */
-extern int prom_nbgetchar(void);
-
-/* Non-blocking put character to console. */
-extern int prom_nbputchar(char character);
-
 /* Blocking get character from console. */
 extern char prom_getchar(void);
 
Index: linux-2.6.35.y/arch/sparc/prom/console_32.c
===================================================================
--- linux-2.6.35.y.orig/arch/sparc/prom/console_32.c
+++ linux-2.6.35.y/arch/sparc/prom/console_32.c
@@ -19,8 +19,7 @@ extern void restore_current(void);
 /* Non blocking get character from console input device, returns -1
  * if no input was taken.  This can be used for polling.
  */
-int
-prom_nbgetchar(void)
+static int prom_nbgetchar(void)
 {
 	static char inc;
 	int i = -1;
@@ -51,8 +50,7 @@ prom_nbgetchar(void)
 /* Non blocking put character to console device, returns -1 if
  * unsuccessful.
  */
-int
-prom_nbputchar(char c)
+static int prom_nbputchar(char c)
 {
 	static char outc;
 	unsigned long flags;
Index: linux-2.6.35.y/arch/sparc/prom/console_64.c
===================================================================
--- linux-2.6.35.y.orig/arch/sparc/prom/console_64.c
+++ linux-2.6.35.y/arch/sparc/prom/console_64.c
@@ -18,8 +18,7 @@ extern int prom_stdin, prom_stdout;
 /* Non blocking get character from console input device, returns -1
  * if no input was taken.  This can be used for polling.
  */
-inline int
-prom_nbgetchar(void)
+static int prom_nbgetchar(void)
 {
 	unsigned long args[7];
 	char inc;
@@ -42,8 +41,7 @@ prom_nbgetchar(void)
 /* Non blocking put character to console device, returns -1 if
  * unsuccessful.
  */
-inline int
-prom_nbputchar(char c)
+static int prom_nbputchar(char c)
 {
 	unsigned long args[7];
 	char outc;

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

* [PATCH] [42/139] sparc: Pass buffer pointer all the way down to prom_{get,put}char().
  2011-02-02  0:43 [PATCH] [0/139] 2.6.35.11 longterm review Andi Kleen
                   ` (40 preceding siblings ...)
  2011-02-02  0:43 ` [PATCH] [41/139] sparc: Do not export prom_nb{get,put}char() Andi Kleen
@ 2011-02-02  0:43 ` Andi Kleen
  2011-02-02  0:43 ` [PATCH] [43/139] sparc: Delete prom_*getchar() Andi Kleen
                   ` (97 subsequent siblings)
  139 siblings, 0 replies; 149+ messages in thread
From: Andi Kleen @ 2011-02-02  0:43 UTC (permalink / raw)
  To: davem, gregkh, ak, linux-kernel, stable

2.6.35-longterm review patch.  If anyone has any objections, please let me know.

------------------

From: David S. Miller <davem@davemloft.net>

[ Upstream commit e62cac1fd035b4cde707285008499dbe71955a86 ]

This gets us closer to being able to eliminate the use
of dynamic and stack based buffers, so that we can adhere
to the "no buffer addresses above 4GB" rule for PROM calls.

Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: Andi Kleen <ak@linux.intel.com>

---
 arch/sparc/include/asm/openprom.h |    2 -
 arch/sparc/include/asm/oplib_32.h |    4 +--
 arch/sparc/include/asm/oplib_64.h |    4 +--
 arch/sparc/prom/console_32.c      |   50 +++++++++++++++++++-------------------
 arch/sparc/prom/console_64.c      |   34 ++++++++++++-------------
 arch/sparc/prom/printf.c          |   15 ++++++-----
 6 files changed, 55 insertions(+), 54 deletions(-)

Index: linux-2.6.35.y/arch/sparc/include/asm/openprom.h
===================================================================
--- linux-2.6.35.y.orig/arch/sparc/include/asm/openprom.h
+++ linux-2.6.35.y/arch/sparc/include/asm/openprom.h
@@ -37,7 +37,7 @@ struct linux_dev_v2_funcs {
 	int (*v2_dev_open)(char *devpath);
 	void (*v2_dev_close)(int d);
 	int (*v2_dev_read)(int d, char *buf, int nbytes);
-	int (*v2_dev_write)(int d, char *buf, int nbytes);
+	int (*v2_dev_write)(int d, const char *buf, int nbytes);
 	int (*v2_dev_seek)(int d, int hi, int lo);
 
 	/* Never issued (multistage load support) */
Index: linux-2.6.35.y/arch/sparc/include/asm/oplib_32.h
===================================================================
--- linux-2.6.35.y.orig/arch/sparc/include/asm/oplib_32.h
+++ linux-2.6.35.y/arch/sparc/include/asm/oplib_32.h
@@ -105,10 +105,10 @@ extern int prom_getprev(void);
 /* Character operations to/from the console.... */
 
 /* Blocking get character from console. */
-extern char prom_getchar(void);
+extern void prom_getchar(char *buf);
 
 /* Blocking put character to console. */
-extern void prom_putchar(char character);
+extern void prom_putchar(const char *buf);
 
 /* Prom's internal routines, don't use in kernel/boot code. */
 extern void prom_printf(const char *fmt, ...);
Index: linux-2.6.35.y/arch/sparc/include/asm/oplib_64.h
===================================================================
--- linux-2.6.35.y.orig/arch/sparc/include/asm/oplib_64.h
+++ linux-2.6.35.y/arch/sparc/include/asm/oplib_64.h
@@ -97,10 +97,10 @@ extern unsigned char prom_get_idprom(cha
 /* Character operations to/from the console.... */
 
 /* Blocking get character from console. */
-extern char prom_getchar(void);
+extern void prom_getchar(char *buf);
 
 /* Blocking put character to console. */
-extern void prom_putchar(char character);
+extern void prom_putchar(const char *buf);
 
 /* Prom's internal routines, don't use in kernel/boot code. */
 extern void prom_printf(const char *fmt, ...);
Index: linux-2.6.35.y/arch/sparc/prom/console_32.c
===================================================================
--- linux-2.6.35.y.orig/arch/sparc/prom/console_32.c
+++ linux-2.6.35.y/arch/sparc/prom/console_32.c
@@ -19,27 +19,27 @@ extern void restore_current(void);
 /* Non blocking get character from console input device, returns -1
  * if no input was taken.  This can be used for polling.
  */
-static int prom_nbgetchar(void)
+static int prom_nbgetchar(char *buf)
 {
-	static char inc;
-	int i = -1;
 	unsigned long flags;
+	int i = -1;
 
 	spin_lock_irqsave(&prom_lock, flags);
 	switch(prom_vers) {
 	case PROM_V0:
 		i = (*(romvec->pv_nbgetchar))();
+		if (i != -1) {
+			*buf = i;
+			i = 0;
+		}
 		break;
 	case PROM_V2:
 	case PROM_V3:
-		if( (*(romvec->pv_v2devops).v2_dev_read)(*romvec->pv_v2bootargs.fd_stdin , &inc, 0x1) == 1) {
-			i = inc;
-		} else {
-			i = -1;
-		}
+		if ((*(romvec->pv_v2devops).v2_dev_read)(*romvec->pv_v2bootargs.fd_stdin,
+							 buf, 0x1) == 1)
+			i = 0;
 		break;
 	default:
-		i = -1;
 		break;
 	};
 	restore_current();
@@ -50,27 +50,23 @@ static int prom_nbgetchar(void)
 /* Non blocking put character to console device, returns -1 if
  * unsuccessful.
  */
-static int prom_nbputchar(char c)
+static int prom_nbputchar(const char *buf)
 {
-	static char outc;
 	unsigned long flags;
 	int i = -1;
 
 	spin_lock_irqsave(&prom_lock, flags);
 	switch(prom_vers) {
 	case PROM_V0:
-		i = (*(romvec->pv_nbputchar))(c);
+		i = (*(romvec->pv_nbputchar))(*buf);
 		break;
 	case PROM_V2:
 	case PROM_V3:
-		outc = c;
-		if( (*(romvec->pv_v2devops).v2_dev_write)(*romvec->pv_v2bootargs.fd_stdout, &outc, 0x1) == 1)
+		if ((*(romvec->pv_v2devops).v2_dev_write)(*romvec->pv_v2bootargs.fd_stdout,
+							  buf, 0x1) == 1)
 			i = 0;
-		else
-			i = -1;
 		break;
 	default:
-		i = -1;
 		break;
 	};
 	restore_current();
@@ -79,17 +75,21 @@ static int prom_nbputchar(char c)
 }
 
 /* Blocking version of get character routine above. */
-char
-prom_getchar(void)
+void prom_getchar(char *buf)
 {
-	int character;
-	while((character = prom_nbgetchar()) == -1) ;
-	return (char) character;
+	while (1) {
+		int err = prom_nbgetchar(buf);
+		if (!err)
+			break;
+	}
 }
 
 /* Blocking version of put character routine above. */
-void
-prom_putchar(char c)
+void prom_putchar(const char *buf)
 {
-	while(prom_nbputchar(c) == -1) ;
+	while (1) {
+		int err = prom_nbputchar(buf);
+		if (!err)
+			break;
+	}
 }
Index: linux-2.6.35.y/arch/sparc/prom/console_64.c
===================================================================
--- linux-2.6.35.y.orig/arch/sparc/prom/console_64.c
+++ linux-2.6.35.y/arch/sparc/prom/console_64.c
@@ -18,41 +18,37 @@ extern int prom_stdin, prom_stdout;
 /* Non blocking get character from console input device, returns -1
  * if no input was taken.  This can be used for polling.
  */
-static int prom_nbgetchar(void)
+static int prom_nbgetchar(char *buf)
 {
 	unsigned long args[7];
-	char inc;
 
 	args[0] = (unsigned long) "read";
 	args[1] = 3;
 	args[2] = 1;
 	args[3] = (unsigned int) prom_stdin;
-	args[4] = (unsigned long) &inc;
+	args[4] = (unsigned long) buf;
 	args[5] = 1;
 	args[6] = (unsigned long) -1;
 
 	p1275_cmd_direct(args);
 
 	if (args[6] == 1)
-		return inc;
+		return 0;
 	return -1;
 }
 
 /* Non blocking put character to console device, returns -1 if
  * unsuccessful.
  */
-static int prom_nbputchar(char c)
+static int prom_nbputchar(const char *buf)
 {
 	unsigned long args[7];
-	char outc;
-	
-	outc = c;
 
 	args[0] = (unsigned long) "write";
 	args[1] = 3;
 	args[2] = 1;
 	args[3] = (unsigned int) prom_stdout;
-	args[4] = (unsigned long) &outc;
+	args[4] = (unsigned long) buf;
 	args[5] = 1;
 	args[6] = (unsigned long) -1;
 
@@ -65,17 +61,21 @@ static int prom_nbputchar(char c)
 }
 
 /* Blocking version of get character routine above. */
-char
-prom_getchar(void)
+void prom_getchar(char *buf)
 {
-	int character;
-	while((character = prom_nbgetchar()) == -1) ;
-	return (char) character;
+	while (1) {
+		int err = prom_nbgetchar(buf);
+		if (!err)
+			break;
+	}
 }
 
 /* Blocking version of put character routine above. */
-void
-prom_putchar(char c)
+void prom_putchar(const char *buf)
 {
-	prom_nbputchar(c);
+	while (1) {
+		int err = prom_nbputchar(buf);
+		if (!err)
+			break;
+	}
 }
Index: linux-2.6.35.y/arch/sparc/prom/printf.c
===================================================================
--- linux-2.6.35.y.orig/arch/sparc/prom/printf.c
+++ linux-2.6.35.y/arch/sparc/prom/printf.c
@@ -23,13 +23,14 @@ static char ppbuf[1024];
 
 void notrace prom_write(const char *buf, unsigned int n)
 {
-	char ch;
-
-	while (n != 0) {
-		--n;
-		if ((ch = *buf++) == '\n')
-			prom_putchar('\r');
-		prom_putchar(ch);
+	while (n-- != 0) {
+		char ch = *buf;
+		if (ch == '\n') {
+			char tmp = '\r';
+			prom_putchar(&tmp);
+		}
+		prom_putchar(buf);
+		buf++;
 	}
 }
 

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

* [PATCH] [43/139] sparc: Delete prom_*getchar().
  2011-02-02  0:43 [PATCH] [0/139] 2.6.35.11 longterm review Andi Kleen
                   ` (41 preceding siblings ...)
  2011-02-02  0:43 ` [PATCH] [42/139] sparc: Pass buffer pointer all the way down to prom_{get,put}char() Andi Kleen
@ 2011-02-02  0:43 ` Andi Kleen
  2011-02-02  0:43 ` [PATCH] [44/139] sparc: Write to prom console using indirect buffer Andi Kleen
                   ` (96 subsequent siblings)
  139 siblings, 0 replies; 149+ messages in thread
From: Andi Kleen @ 2011-02-02  0:43 UTC (permalink / raw)
  To: davem, gregkh, ak, linux-kernel, stable

2.6.35-longterm review patch.  If anyone has any objections, please let me know.

------------------

From: David S. Miller <davem@davemloft.net>

[ Upstream commit 12c7a35ee6a1c605e740733f2cbd5b5079f09f0f ]

Completely unused.

Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: Andi Kleen <ak@linux.intel.com>

---
 arch/sparc/include/asm/oplib_32.h |    5 ----
 arch/sparc/include/asm/oplib_64.h |    5 ----
 arch/sparc/prom/console_32.c      |   41 --------------------------------------
 arch/sparc/prom/console_64.c      |   32 -----------------------------
 4 files changed, 83 deletions(-)

Index: linux-2.6.35.y/arch/sparc/include/asm/oplib_32.h
===================================================================
--- linux-2.6.35.y.orig/arch/sparc/include/asm/oplib_32.h
+++ linux-2.6.35.y/arch/sparc/include/asm/oplib_32.h
@@ -102,11 +102,6 @@ extern int prom_getrev(void);
 /* Get the prom firmware revision. */
 extern int prom_getprev(void);
 
-/* Character operations to/from the console.... */
-
-/* Blocking get character from console. */
-extern void prom_getchar(char *buf);
-
 /* Blocking put character to console. */
 extern void prom_putchar(const char *buf);
 
Index: linux-2.6.35.y/arch/sparc/include/asm/oplib_64.h
===================================================================
--- linux-2.6.35.y.orig/arch/sparc/include/asm/oplib_64.h
+++ linux-2.6.35.y/arch/sparc/include/asm/oplib_64.h
@@ -94,11 +94,6 @@ extern void prom_halt_power_off(void) __
  */
 extern unsigned char prom_get_idprom(char *idp_buffer, int idpbuf_size);
 
-/* Character operations to/from the console.... */
-
-/* Blocking get character from console. */
-extern void prom_getchar(char *buf);
-
 /* Blocking put character to console. */
 extern void prom_putchar(const char *buf);
 
Index: linux-2.6.35.y/arch/sparc/prom/console_32.c
===================================================================
--- linux-2.6.35.y.orig/arch/sparc/prom/console_32.c
+++ linux-2.6.35.y/arch/sparc/prom/console_32.c
@@ -16,37 +16,6 @@
 
 extern void restore_current(void);
 
-/* Non blocking get character from console input device, returns -1
- * if no input was taken.  This can be used for polling.
- */
-static int prom_nbgetchar(char *buf)
-{
-	unsigned long flags;
-	int i = -1;
-
-	spin_lock_irqsave(&prom_lock, flags);
-	switch(prom_vers) {
-	case PROM_V0:
-		i = (*(romvec->pv_nbgetchar))();
-		if (i != -1) {
-			*buf = i;
-			i = 0;
-		}
-		break;
-	case PROM_V2:
-	case PROM_V3:
-		if ((*(romvec->pv_v2devops).v2_dev_read)(*romvec->pv_v2bootargs.fd_stdin,
-							 buf, 0x1) == 1)
-			i = 0;
-		break;
-	default:
-		break;
-	};
-	restore_current();
-	spin_unlock_irqrestore(&prom_lock, flags);
-	return i; /* Ugh, we could spin forever on unsupported proms ;( */
-}
-
 /* Non blocking put character to console device, returns -1 if
  * unsuccessful.
  */
@@ -74,16 +43,6 @@ static int prom_nbputchar(const char *bu
 	return i; /* Ugh, we could spin forever on unsupported proms ;( */
 }
 
-/* Blocking version of get character routine above. */
-void prom_getchar(char *buf)
-{
-	while (1) {
-		int err = prom_nbgetchar(buf);
-		if (!err)
-			break;
-	}
-}
-
 /* Blocking version of put character routine above. */
 void prom_putchar(const char *buf)
 {
Index: linux-2.6.35.y/arch/sparc/prom/console_64.c
===================================================================
--- linux-2.6.35.y.orig/arch/sparc/prom/console_64.c
+++ linux-2.6.35.y/arch/sparc/prom/console_64.c
@@ -15,28 +15,6 @@
 
 extern int prom_stdin, prom_stdout;
 
-/* Non blocking get character from console input device, returns -1
- * if no input was taken.  This can be used for polling.
- */
-static int prom_nbgetchar(char *buf)
-{
-	unsigned long args[7];
-
-	args[0] = (unsigned long) "read";
-	args[1] = 3;
-	args[2] = 1;
-	args[3] = (unsigned int) prom_stdin;
-	args[4] = (unsigned long) buf;
-	args[5] = 1;
-	args[6] = (unsigned long) -1;
-
-	p1275_cmd_direct(args);
-
-	if (args[6] == 1)
-		return 0;
-	return -1;
-}
-
 /* Non blocking put character to console device, returns -1 if
  * unsuccessful.
  */
@@ -60,16 +38,6 @@ static int prom_nbputchar(const char *bu
 		return -1;
 }
 
-/* Blocking version of get character routine above. */
-void prom_getchar(char *buf)
-{
-	while (1) {
-		int err = prom_nbgetchar(buf);
-		if (!err)
-			break;
-	}
-}
-
 /* Blocking version of put character routine above. */
 void prom_putchar(const char *buf)
 {

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

* [PATCH] [44/139] sparc: Write to prom console using indirect buffer.
  2011-02-02  0:43 [PATCH] [0/139] 2.6.35.11 longterm review Andi Kleen
                   ` (42 preceding siblings ...)
  2011-02-02  0:43 ` [PATCH] [43/139] sparc: Delete prom_*getchar() Andi Kleen
@ 2011-02-02  0:43 ` Andi Kleen
  2011-02-02  0:44 ` [PATCH] [45/139] tcp: Don't change unlocked socket state in tcp_v4_err() Andi Kleen
                   ` (95 subsequent siblings)
  139 siblings, 0 replies; 149+ messages in thread
From: Andi Kleen @ 2011-02-02  0:43 UTC (permalink / raw)
  To: davem, gregkh, ak, linux-kernel, stable

2.6.35-longterm review patch.  If anyone has any objections, please let me know.

------------------

From: David S. Miller <davem@davemloft.net>

[ Upstream commit 595a251c0740785fd3c0d2156d78578c7479811e ]

sparc64 systems have a restriction in that passing in buffer
addressses above 4GB to prom calls is not reliable.

We end up violating this when we do prom console writes, because we
use an on-stack buffer to translate '\n' into '\r\n'.

So instead, do this translation into an intermediate buffer, which is
in the kernel image and thus below 4GB, then pass that to the PROM
console write calls.

On the 32-bit side we don't have to deal with any of these issues, so
the new prom_console_write_buf() uses the existing prom_nbputchar()
implementation.  However we can now mark those routines static.

Since the 64-bit side completely uses new code we can delete the
putchar bits as they are now completely unused.

Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: Andi Kleen <ak@linux.intel.com>

---
 arch/sparc/include/asm/oplib_32.h |    4 ++--
 arch/sparc/include/asm/oplib_64.h |    4 ++--
 arch/sparc/prom/console_32.c      |   14 ++++++++------
 arch/sparc/prom/console_64.c      |   27 +++++++++++++--------------
 arch/sparc/prom/printf.c          |   32 +++++++++++++++++++++++++++-----
 5 files changed, 52 insertions(+), 29 deletions(-)

Index: linux-2.6.35.y/arch/sparc/include/asm/oplib_32.h
===================================================================
--- linux-2.6.35.y.orig/arch/sparc/include/asm/oplib_32.h
+++ linux-2.6.35.y/arch/sparc/include/asm/oplib_32.h
@@ -102,8 +102,8 @@ extern int prom_getrev(void);
 /* Get the prom firmware revision. */
 extern int prom_getprev(void);
 
-/* Blocking put character to console. */
-extern void prom_putchar(const char *buf);
+/* Write a buffer of characters to the console. */
+extern void prom_console_write_buf(const char *buf, int len);
 
 /* Prom's internal routines, don't use in kernel/boot code. */
 extern void prom_printf(const char *fmt, ...);
Index: linux-2.6.35.y/arch/sparc/include/asm/oplib_64.h
===================================================================
--- linux-2.6.35.y.orig/arch/sparc/include/asm/oplib_64.h
+++ linux-2.6.35.y/arch/sparc/include/asm/oplib_64.h
@@ -94,8 +94,8 @@ extern void prom_halt_power_off(void) __
  */
 extern unsigned char prom_get_idprom(char *idp_buffer, int idpbuf_size);
 
-/* Blocking put character to console. */
-extern void prom_putchar(const char *buf);
+/* Write a buffer of characters to the console. */
+extern void prom_console_write_buf(const char *buf, int len);
 
 /* Prom's internal routines, don't use in kernel/boot code. */
 extern void prom_printf(const char *fmt, ...);
Index: linux-2.6.35.y/arch/sparc/prom/console_32.c
===================================================================
--- linux-2.6.35.y.orig/arch/sparc/prom/console_32.c
+++ linux-2.6.35.y/arch/sparc/prom/console_32.c
@@ -43,12 +43,14 @@ static int prom_nbputchar(const char *bu
 	return i; /* Ugh, we could spin forever on unsupported proms ;( */
 }
 
-/* Blocking version of put character routine above. */
-void prom_putchar(const char *buf)
+void prom_console_write_buf(const char *buf, int len)
 {
-	while (1) {
-		int err = prom_nbputchar(buf);
-		if (!err)
-			break;
+	while (len) {
+		int n = prom_nbputchar(buf);
+		if (n)
+			continue;
+		len--;
+		buf++;
 	}
 }
+
Index: linux-2.6.35.y/arch/sparc/prom/console_64.c
===================================================================
--- linux-2.6.35.y.orig/arch/sparc/prom/console_64.c
+++ linux-2.6.35.y/arch/sparc/prom/console_64.c
@@ -15,35 +15,34 @@
 
 extern int prom_stdin, prom_stdout;
 
-/* Non blocking put character to console device, returns -1 if
- * unsuccessful.
- */
-static int prom_nbputchar(const char *buf)
+static int __prom_console_write_buf(const char *buf, int len)
 {
 	unsigned long args[7];
+	int ret;
 
 	args[0] = (unsigned long) "write";
 	args[1] = 3;
 	args[2] = 1;
 	args[3] = (unsigned int) prom_stdout;
 	args[4] = (unsigned long) buf;
-	args[5] = 1;
+	args[5] = (unsigned int) len;
 	args[6] = (unsigned long) -1;
 
 	p1275_cmd_direct(args);
 
-	if (args[6] == 1)
-		return 0;
-	else
+	ret = (int) args[6];
+	if (ret < 0)
 		return -1;
+	return ret;
 }
 
-/* Blocking version of put character routine above. */
-void prom_putchar(const char *buf)
+void prom_console_write_buf(const char *buf, int len)
 {
-	while (1) {
-		int err = prom_nbputchar(buf);
-		if (!err)
-			break;
+	while (len) {
+		int n = __prom_console_write_buf(buf, len);
+		if (n < 0)
+			continue;
+		len -= n;
+		buf += len;
 	}
 }
Index: linux-2.6.35.y/arch/sparc/prom/printf.c
===================================================================
--- linux-2.6.35.y.orig/arch/sparc/prom/printf.c
+++ linux-2.6.35.y/arch/sparc/prom/printf.c
@@ -15,23 +15,45 @@
 
 #include <linux/kernel.h>
 #include <linux/compiler.h>
+#include <linux/spinlock.h>
 
 #include <asm/openprom.h>
 #include <asm/oplib.h>
 
+#define CONSOLE_WRITE_BUF_SIZE	1024
+
 static char ppbuf[1024];
+static char console_write_buf[CONSOLE_WRITE_BUF_SIZE];
+static DEFINE_RAW_SPINLOCK(console_write_lock);
 
 void notrace prom_write(const char *buf, unsigned int n)
 {
+	unsigned int dest_len;
+	unsigned long flags;
+	char *dest;
+
+	dest = console_write_buf;
+	raw_spin_lock_irqsave(&console_write_lock, flags);
+
+	dest_len = 0;
 	while (n-- != 0) {
-		char ch = *buf;
+		char ch = *buf++;
 		if (ch == '\n') {
-			char tmp = '\r';
-			prom_putchar(&tmp);
+			*dest++ = '\r';
+			dest_len++;
+		}
+		*dest++ = ch;
+		dest_len++;
+		if (dest_len >= CONSOLE_WRITE_BUF_SIZE - 1) {
+			prom_console_write_buf(console_write_buf, dest_len);
+			dest = console_write_buf;
+			dest_len = 0;
 		}
-		prom_putchar(buf);
-		buf++;
 	}
+	if (dest_len)
+		prom_console_write_buf(console_write_buf, dest_len);
+
+	raw_spin_unlock_irqrestore(&console_write_lock, flags);
 }
 
 void notrace prom_printf(const char *fmt, ...)

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

* [PATCH] [45/139] tcp: Don't change unlocked socket state in tcp_v4_err().
  2011-02-02  0:43 [PATCH] [0/139] 2.6.35.11 longterm review Andi Kleen
                   ` (43 preceding siblings ...)
  2011-02-02  0:43 ` [PATCH] [44/139] sparc: Write to prom console using indirect buffer Andi Kleen
@ 2011-02-02  0:44 ` Andi Kleen
  2011-02-02  0:44 ` [PATCH] [46/139] tcp: Increase TCP_MAXSEG socket option minimum Andi Kleen
                   ` (94 subsequent siblings)
  139 siblings, 0 replies; 149+ messages in thread
From: Andi Kleen @ 2011-02-02  0:44 UTC (permalink / raw)
  To: davem, ak, damian, eric.dumazet, gregkh, linux-kernel, stable

2.6.35-longterm review patch.  If anyone has any objections, please let me know.

------------------

From: David S. Miller <davem@davemloft.net>

[ Upstream commit 8f49c2703b33519aaaccc63f571b465b9d2b3a2d ]

Alexey Kuznetsov noticed a regression introduced by
commit f1ecd5d9e7366609d640ff4040304ea197fbc618
("Revert Backoff [v3]: Revert RTO on ICMP destination unreachable")

The RTO and timer modification code added to tcp_v4_err()
doesn't check sock_owned_by_user(), which if true means we
don't have exclusive access to the socket and therefore cannot
modify it's critical state.

Just skip this new code block if sock_owned_by_user() is true
and eliminate the now superfluous sock_owned_by_user() code
block contained within.

Reported-by: Alexey Kuznetsov <kuznet@ms2.inr.ac.ru>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Andi Kleen <ak@linux.intel.com>
CC: Damian Lukowski <damian@tvk.rwth-aachen.de>
Acked-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
---
 net/ipv4/tcp_ipv4.c |    8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)

Index: linux-2.6.35.y/net/ipv4/tcp_ipv4.c
===================================================================
--- linux-2.6.35.y.orig/net/ipv4/tcp_ipv4.c
+++ linux-2.6.35.y/net/ipv4/tcp_ipv4.c
@@ -411,6 +411,9 @@ void tcp_v4_err(struct sk_buff *icmp_skb
 		    !icsk->icsk_backoff)
 			break;
 
+		if (sock_owned_by_user(sk))
+			break;
+
 		icsk->icsk_backoff--;
 		inet_csk(sk)->icsk_rto = __tcp_set_rto(tp) <<
 					 icsk->icsk_backoff;
@@ -425,11 +428,6 @@ void tcp_v4_err(struct sk_buff *icmp_skb
 		if (remaining) {
 			inet_csk_reset_xmit_timer(sk, ICSK_TIME_RETRANS,
 						  remaining, TCP_RTO_MAX);
-		} else if (sock_owned_by_user(sk)) {
-			/* RTO revert clocked out retransmission,
-			 * but socket is locked. Will defer. */
-			inet_csk_reset_xmit_timer(sk, ICSK_TIME_RETRANS,
-						  HZ/20, TCP_RTO_MAX);
 		} else {
 			/* RTO revert clocked out retransmission.
 			 * Will retransmit now */

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

* [PATCH] [46/139] tcp: Increase TCP_MAXSEG socket option minimum.
  2011-02-02  0:43 [PATCH] [0/139] 2.6.35.11 longterm review Andi Kleen
                   ` (44 preceding siblings ...)
  2011-02-02  0:44 ` [PATCH] [45/139] tcp: Don't change unlocked socket state in tcp_v4_err() Andi Kleen
@ 2011-02-02  0:44 ` Andi Kleen
  2011-02-02  0:44 ` [PATCH] [47/139] tcp: Make TCP_MAXSEG minimum more correct Andi Kleen
                   ` (93 subsequent siblings)
  139 siblings, 0 replies; 149+ messages in thread
From: Andi Kleen @ 2011-02-02  0:44 UTC (permalink / raw)
  To: davem, gregkh, ak, linux-kernel, stable

2.6.35-longterm review patch.  If anyone has any objections, please let me know.

------------------

From: David S. Miller <davem@davemloft.net>

[ Upstream commit 7a1abd08d52fdeddb3e9a5a33f2f15cc6a5674d2 ]

As noted by Steve Chen, since commit
f5fff5dc8a7a3f395b0525c02ba92c95d42b7390 ("tcp: advertise MSS
requested by user") we can end up with a situation where
tcp_select_initial_window() does a divide by a zero (or
even negative) mss value.

The problem is that sometimes we effectively subtract
TCPOLEN_TSTAMP_ALIGNED and/or TCPOLEN_MD5SIG_ALIGNED from the mss.

Fix this by increasing the minimum from 8 to 64.

Reported-by: Steve Chen <schen@mvista.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: Andi Kleen <ak@linux.intel.com>

---
 net/ipv4/tcp.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Index: linux-2.6.35.y/net/ipv4/tcp.c
===================================================================
--- linux-2.6.35.y.orig/net/ipv4/tcp.c
+++ linux-2.6.35.y/net/ipv4/tcp.c
@@ -2235,7 +2235,7 @@ static int do_tcp_setsockopt(struct sock
 		/* Values greater than interface MTU won't take effect. However
 		 * at the point when this call is done we typically don't yet
 		 * know which interface is going to be used */
-		if (val < 8 || val > MAX_TCP_WINDOW) {
+		if (val < 64 || val > MAX_TCP_WINDOW) {
 			err = -EINVAL;
 			break;
 		}

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

* [PATCH] [47/139] tcp: Make TCP_MAXSEG minimum more correct.
  2011-02-02  0:43 [PATCH] [0/139] 2.6.35.11 longterm review Andi Kleen
                   ` (45 preceding siblings ...)
  2011-02-02  0:44 ` [PATCH] [46/139] tcp: Increase TCP_MAXSEG socket option minimum Andi Kleen
@ 2011-02-02  0:44 ` Andi Kleen
  2011-02-02  0:44 ` [PATCH] [48/139] tcp: Bug fix in initialization of receive window Andi Kleen
                   ` (92 subsequent siblings)
  139 siblings, 0 replies; 149+ messages in thread
From: Andi Kleen @ 2011-02-02  0:44 UTC (permalink / raw)
  To: davem, gregkh, ak, linux-kernel, stable

2.6.35-longterm review patch.  If anyone has any objections, please let me know.

------------------

From: David S. Miller <davem@davemloft.net>

[ Upstream commit c39508d6f118308355468314ff414644115a07f3 ]

Use TCP_MIN_MSS instead of constant 64.

Reported-by: Min Zhang <mzhang@mvista.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: Andi Kleen <ak@linux.intel.com>

---
 net/ipv4/tcp.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Index: linux-2.6.35.y/net/ipv4/tcp.c
===================================================================
--- linux-2.6.35.y.orig/net/ipv4/tcp.c
+++ linux-2.6.35.y/net/ipv4/tcp.c
@@ -2235,7 +2235,7 @@ static int do_tcp_setsockopt(struct sock
 		/* Values greater than interface MTU won't take effect. However
 		 * at the point when this call is done we typically don't yet
 		 * know which interface is going to be used */
-		if (val < 64 || val > MAX_TCP_WINDOW) {
+		if (val < TCP_MIN_MSS || val > MAX_TCP_WINDOW) {
 			err = -EINVAL;
 			break;
 		}

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

* [PATCH] [48/139] tcp: Bug fix in initialization of receive window.
  2011-02-02  0:43 [PATCH] [0/139] 2.6.35.11 longterm review Andi Kleen
                   ` (46 preceding siblings ...)
  2011-02-02  0:44 ` [PATCH] [47/139] tcp: Make TCP_MAXSEG minimum more correct Andi Kleen
@ 2011-02-02  0:44 ` Andi Kleen
  2011-02-02  0:44 ` [PATCH] [49/139] tcp: avoid a possible divide by zero Andi Kleen
                   ` (91 subsequent siblings)
  139 siblings, 0 replies; 149+ messages in thread
From: Andi Kleen @ 2011-02-02  0:44 UTC (permalink / raw)
  To: nanditad, davem, gregkh, ak, linux-kernel, stable

2.6.35-longterm review patch.  If anyone has any objections, please let me know.

------------------

From: Nandita Dukkipati <nanditad@google.com>

[ Upstream commit b1afde60f2b9ee8444fba4e012dc99a3b28d224d ]

The bug has to do with boundary checks on the initial receive window.
If the initial receive window falls between init_cwnd and the
receive window specified by the user, the initial window is incorrectly
brought down to init_cwnd. The correct behavior is to allow it to
remain unchanged.

Signed-off-by: Nandita Dukkipati <nanditad@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: Andi Kleen <ak@linux.intel.com>

---
 net/ipv4/tcp_output.c |    9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)

Index: linux-2.6.35.y/net/ipv4/tcp_output.c
===================================================================
--- linux-2.6.35.y.orig/net/ipv4/tcp_output.c
+++ linux-2.6.35.y/net/ipv4/tcp_output.c
@@ -237,11 +237,10 @@ void tcp_select_initial_window(int __spa
 		/* when initializing use the value from init_rcv_wnd
 		 * rather than the default from above
 		 */
-		if (init_rcv_wnd &&
-		    (*rcv_wnd > init_rcv_wnd * mss))
-			*rcv_wnd = init_rcv_wnd * mss;
-		else if (*rcv_wnd > init_cwnd * mss)
-			*rcv_wnd = init_cwnd * mss;
+		if (init_rcv_wnd)
+			*rcv_wnd = min(*rcv_wnd, init_rcv_wnd * mss);
+		else
+			*rcv_wnd = min(*rcv_wnd, init_cwnd * mss);
 	}
 
 	/* Set the clamp no higher than max representable value */

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

* [PATCH] [49/139] tcp: avoid a possible divide by zero
  2011-02-02  0:43 [PATCH] [0/139] 2.6.35.11 longterm review Andi Kleen
                   ` (47 preceding siblings ...)
  2011-02-02  0:44 ` [PATCH] [48/139] tcp: Bug fix in initialization of receive window Andi Kleen
@ 2011-02-02  0:44 ` Andi Kleen
  2011-02-02  0:44 ` [PATCH] [50/139] tcp: protect sysctl_tcp_cookie_size reads Andi Kleen
                   ` (90 subsequent siblings)
  139 siblings, 0 replies; 149+ messages in thread
From: Andi Kleen @ 2011-02-02  0:44 UTC (permalink / raw)
  To: eric.dumazet, davem, gregkh, ak, linux-kernel, stable

2.6.35-longterm review patch.  If anyone has any objections, please let me know.

------------------

From: Eric Dumazet <eric.dumazet@gmail.com>

[ Upstream commit ad9f4f50fe9288bbe65b7dfd76d8820afac6a24c ]

sysctl_tcp_tso_win_divisor might be set to zero while one cpu runs in
tcp_tso_should_defer(). Make sure we dont allow a divide by zero by
reading sysctl_tcp_tso_win_divisor exactly once.

Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: Andi Kleen <ak@linux.intel.com>

---
 net/ipv4/tcp_output.c |    6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

Index: linux-2.6.35.y/net/ipv4/tcp_output.c
===================================================================
--- linux-2.6.35.y.orig/net/ipv4/tcp_output.c
+++ linux-2.6.35.y/net/ipv4/tcp_output.c
@@ -1516,6 +1516,7 @@ static int tcp_tso_should_defer(struct s
 	struct tcp_sock *tp = tcp_sk(sk);
 	const struct inet_connection_sock *icsk = inet_csk(sk);
 	u32 send_win, cong_win, limit, in_flight;
+	int win_divisor;
 
 	if (TCP_SKB_CB(skb)->flags & TCPCB_FLAG_FIN)
 		goto send_now;
@@ -1547,13 +1548,14 @@ static int tcp_tso_should_defer(struct s
 	if ((skb != tcp_write_queue_tail(sk)) && (limit >= skb->len))
 		goto send_now;
 
-	if (sysctl_tcp_tso_win_divisor) {
+	win_divisor = ACCESS_ONCE(sysctl_tcp_tso_win_divisor);
+	if (win_divisor) {
 		u32 chunk = min(tp->snd_wnd, tp->snd_cwnd * tp->mss_cache);
 
 		/* If at least some fraction of a window is available,
 		 * just use it.
 		 */
-		chunk /= sysctl_tcp_tso_win_divisor;
+		chunk /= win_divisor;
 		if (limit >= chunk)
 			goto send_now;
 	} else {

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

* [PATCH] [50/139] tcp: protect sysctl_tcp_cookie_size reads
  2011-02-02  0:43 [PATCH] [0/139] 2.6.35.11 longterm review Andi Kleen
                   ` (48 preceding siblings ...)
  2011-02-02  0:44 ` [PATCH] [49/139] tcp: avoid a possible divide by zero Andi Kleen
@ 2011-02-02  0:44 ` Andi Kleen
  2011-02-02  0:44 ` [PATCH] [51/139] 8139cp: fix checksum broken Andi Kleen
                   ` (89 subsequent siblings)
  139 siblings, 0 replies; 149+ messages in thread
From: Andi Kleen @ 2011-02-02  0:44 UTC (permalink / raw)
  To: eric.dumazet, ak, bhutchings, william.allen.simpson, davem,
	gregkh, linux-kernel, stable

2.6.35-longterm review patch.  If anyone has any objections, please let me know.

------------------

From: Eric Dumazet <eric.dumazet@gmail.com>

[ Upstream commit f19872575ff7819a3723154657a497d9bca66b33 ]

Make sure sysctl_tcp_cookie_size is read once in
tcp_cookie_size_check(), or we might return an illegal value to caller
if sysctl_tcp_cookie_size is changed by another cpu.

Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: Andi Kleen <ak@linux.intel.com>
Cc: Ben Hutchings <bhutchings@solarflare.com>
Cc: William Allen Simpson <william.allen.simpson@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
---
 net/ipv4/tcp_output.c |   27 +++++++++++++++------------
 1 file changed, 15 insertions(+), 12 deletions(-)

Index: linux-2.6.35.y/net/ipv4/tcp_output.c
===================================================================
--- linux-2.6.35.y.orig/net/ipv4/tcp_output.c
+++ linux-2.6.35.y/net/ipv4/tcp_output.c
@@ -390,27 +390,30 @@ struct tcp_out_options {
  */
 static u8 tcp_cookie_size_check(u8 desired)
 {
-	if (desired > 0) {
+	int cookie_size;
+
+	if (desired > 0)
 		/* previously specified */
 		return desired;
-	}
-	if (sysctl_tcp_cookie_size <= 0) {
+
+	cookie_size = ACCESS_ONCE(sysctl_tcp_cookie_size);
+	if (cookie_size <= 0)
 		/* no default specified */
 		return 0;
-	}
-	if (sysctl_tcp_cookie_size <= TCP_COOKIE_MIN) {
+
+	if (cookie_size <= TCP_COOKIE_MIN)
 		/* value too small, specify minimum */
 		return TCP_COOKIE_MIN;
-	}
-	if (sysctl_tcp_cookie_size >= TCP_COOKIE_MAX) {
+
+	if (cookie_size >= TCP_COOKIE_MAX)
 		/* value too large, specify maximum */
 		return TCP_COOKIE_MAX;
-	}
-	if (0x1 & sysctl_tcp_cookie_size) {
+
+	if (cookie_size & 1)
 		/* 8-bit multiple, illegal, fix it */
-		return (u8)(sysctl_tcp_cookie_size + 0x1);
-	}
-	return (u8)sysctl_tcp_cookie_size;
+		cookie_size++;
+
+	return (u8)cookie_size;
 }
 
 /* Write previously computed TCP options to the packet.

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

* [PATCH] [51/139] 8139cp: fix checksum broken
  2011-02-02  0:43 [PATCH] [0/139] 2.6.35.11 longterm review Andi Kleen
                   ` (49 preceding siblings ...)
  2011-02-02  0:44 ` [PATCH] [50/139] tcp: protect sysctl_tcp_cookie_size reads Andi Kleen
@ 2011-02-02  0:44 ` Andi Kleen
  2011-02-02  0:44 ` [PATCH] [52/139] r8169: fix sleeping while holding spinlock Andi Kleen
                   ` (88 subsequent siblings)
  139 siblings, 0 replies; 149+ messages in thread
From: Andi Kleen @ 2011-02-02  0:44 UTC (permalink / raw)
  To: shanwei, davem, gregkh, ak, linux-kernel, stable

2.6.35-longterm review patch.  If anyone has any objections, please let me know.

------------------

From: Shan Wei <shanwei@cn.fujitsu.com>

[ Upstream commit 24b7ea9f6c9787fad885442ed0cc010f1aa69cca ]

I am not family with RealTek RTL-8139C+ series 10/100 PCI Ethernet driver.
I try to guess the meaning of RxProtoIP and IPFail.
RxProtoIP stands for received IPv4 packet that upper protocol is not tcp and udp.
!(status & IPFail) is true means that driver correctly to check checksum in IPv4 header.

If these are right, driver will set ip_summed with CHECKSUM_UNNECESSARY for other
upper protocol, e.g. sctp, igmp protocol. This will cause protocol stack ignores
checksum check for packets with invalid checksum.

This patch is only compile-test.

Signed-off-by: Shan Wei <shanwei@cn.fujitsu.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: Andi Kleen <ak@linux.intel.com>

---
 drivers/net/8139cp.c |   10 ++++------
 1 file changed, 4 insertions(+), 6 deletions(-)

Index: linux-2.6.35.y/drivers/net/8139cp.c
===================================================================
--- linux-2.6.35.y.orig/drivers/net/8139cp.c
+++ linux-2.6.35.y/drivers/net/8139cp.c
@@ -490,13 +490,11 @@ static inline unsigned int cp_rx_csum_ok
 {
 	unsigned int protocol = (status >> 16) & 0x3;
 
-	if (likely((protocol == RxProtoTCP) && (!(status & TCPFail))))
+	if (((protocol == RxProtoTCP) && !(status & TCPFail)) ||
+	    ((protocol == RxProtoUDP) && !(status & UDPFail)))
 		return 1;
-	else if ((protocol == RxProtoUDP) && (!(status & UDPFail)))
-		return 1;
-	else if ((protocol == RxProtoIP) && (!(status & IPFail)))
-		return 1;
-	return 0;
+	else
+		return 0;
 }
 
 static int cp_rx_poll(struct napi_struct *napi, int budget)

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

* [PATCH] [52/139] r8169: fix sleeping while holding spinlock.
  2011-02-02  0:43 [PATCH] [0/139] 2.6.35.11 longterm review Andi Kleen
                   ` (50 preceding siblings ...)
  2011-02-02  0:44 ` [PATCH] [51/139] 8139cp: fix checksum broken Andi Kleen
@ 2011-02-02  0:44 ` Andi Kleen
  2011-02-02  0:44 ` [PATCH] [53/139] af_unix: limit unix_tot_inflight Andi Kleen
                   ` (87 subsequent siblings)
  139 siblings, 0 replies; 149+ messages in thread
From: Andi Kleen @ 2011-02-02  0:44 UTC (permalink / raw)
  To: romieu, daniel.blueman, rjw, andrew.hendry, davem, gregkh, ak,
	linux-kernel, stable

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 1204 bytes --]

2.6.35-longterm review patch.  If anyone has any objections, please let me know.

------------------
From: françois romieu <romieu@fr.zoreil.com>

[ Upstream commit ea80907ff066edd1dd43c5fe90ae6677d15e6384 ]

As device_set_wakeup_enable can now sleep, move the call to outside
the critical section.

Signed-off-by: Daniel J Blueman <daniel.blueman@gmail.com>
Acked-by: Rafael J. Wysocki <rjw@sisk.pl>
Acked-by: Andrew Hendry <andrew.hendry@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: Andi Kleen <ak@linux.intel.com>

---
 drivers/net/r8169.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Index: linux-2.6.35.y/drivers/net/r8169.c
===================================================================
--- linux-2.6.35.y.orig/drivers/net/r8169.c
+++ linux-2.6.35.y/drivers/net/r8169.c
@@ -855,10 +855,10 @@ static int rtl8169_set_wol(struct net_de
 	else
 		tp->features &= ~RTL_FEATURE_WOL;
 	__rtl8169_set_wol(tp, wol->wolopts);
-	device_set_wakeup_enable(&tp->pci_dev->dev, wol->wolopts);
-
 	spin_unlock_irq(&tp->lock);
 
+	device_set_wakeup_enable(&tp->pci_dev->dev, wol->wolopts);
+
 	return 0;
 }
 

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

* [PATCH] [53/139] af_unix: limit unix_tot_inflight
  2011-02-02  0:43 [PATCH] [0/139] 2.6.35.11 longterm review Andi Kleen
                   ` (51 preceding siblings ...)
  2011-02-02  0:44 ` [PATCH] [52/139] r8169: fix sleeping while holding spinlock Andi Kleen
@ 2011-02-02  0:44 ` Andi Kleen
  2011-02-02  0:44 ` [PATCH] [54/139] scm: Capture the full credentials of the scm sender Andi Kleen
                   ` (86 subsequent siblings)
  139 siblings, 0 replies; 149+ messages in thread
From: Andi Kleen @ 2011-02-02  0:44 UTC (permalink / raw)
  To: eric.dumazet, davem, gregkh, ak, linux-kernel, stable

2.6.35-longterm review patch.  If anyone has any objections, please let me know.

------------------

From: Eric Dumazet <eric.dumazet@gmail.com>

[ Upstream commit 9915672d41273f5b77f1b3c29b391ffb7732b84b ]

Vegard Nossum found a unix socket OOM was possible, posting an exploit
program.

My analysis is we can eat all LOWMEM memory before unix_gc() being
called from unix_release_sock(). Moreover, the thread blocked in
unix_gc() can consume huge amount of time to perform cleanup because of
huge working set.

One way to handle this is to have a sensible limit on unix_tot_inflight,
tested from wait_for_unix_gc() and to force a call to unix_gc() if this
limit is hit.

This solves the OOM and also reduce overall latencies, and should not
slowdown normal workloads.

Reported-by: Vegard Nossum <vegard.nossum@gmail.com>
Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: Andi Kleen <ak@linux.intel.com>

---
 net/unix/garbage.c |    7 +++++++
 1 file changed, 7 insertions(+)

Index: linux-2.6.35.y/net/unix/garbage.c
===================================================================
--- linux-2.6.35.y.orig/net/unix/garbage.c
+++ linux-2.6.35.y/net/unix/garbage.c
@@ -259,9 +259,16 @@ static void inc_inflight_move_tail(struc
 }
 
 static bool gc_in_progress = false;
+#define UNIX_INFLIGHT_TRIGGER_GC 16000
 
 void wait_for_unix_gc(void)
 {
+	/*
+	 * If number of inflight sockets is insane,
+	 * force a garbage collect right now.
+	 */
+	if (unix_tot_inflight > UNIX_INFLIGHT_TRIGGER_GC && !gc_in_progress)
+		unix_gc();
 	wait_event(unix_gc_wait, gc_in_progress == false);
 }
 

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

* [PATCH] [54/139] scm: Capture the full credentials of the scm sender.
  2011-02-02  0:43 [PATCH] [0/139] 2.6.35.11 longterm review Andi Kleen
                   ` (52 preceding siblings ...)
  2011-02-02  0:44 ` [PATCH] [53/139] af_unix: limit unix_tot_inflight Andi Kleen
@ 2011-02-02  0:44 ` Andi Kleen
  2011-02-02  0:44 ` [PATCH] [55/139] af_unix: Allow credentials to work across user and pid namespaces Andi Kleen
                   ` (85 subsequent siblings)
  139 siblings, 0 replies; 149+ messages in thread
From: Andi Kleen @ 2011-02-02  0:44 UTC (permalink / raw)
  To: ebiederm, serge, davem, ak, linux-kernel, stable

2.6.35-longterm review patch.  If anyone has any objections, please let me know.

------------------
Upstream commit 257b5358b32f17e0603b6ff57b13610b0e02348f

Start capturing not only the userspace pid, uid and gid values of the
sending process but also the struct pid and struct cred of the sending
process as well.

This is in preparation for properly supporting SCM_CREDENTIALS for
sockets that have different uid and/or pid namespaces at the different
ends.

Signed-off-by: Eric W. Biederman <ebiederm@xmission.com>
Acked-by: Serge E. Hallyn <serge@hallyn.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Andi Kleen <ak@linux.intel.com>

Index: linux-2.6.35.y/include/net/scm.h
===================================================================
--- linux-2.6.35.y.orig/include/net/scm.h
+++ linux-2.6.35.y/include/net/scm.h
@@ -19,6 +19,8 @@ struct scm_fp_list {
 };
 
 struct scm_cookie {
+	struct pid		*pid;		/* Skb credentials */
+	const struct cred	*cred;
 	struct ucred		creds;		/* Skb credentials	*/
 	struct scm_fp_list	*fp;		/* Passed files		*/
 #ifdef CONFIG_SECURITY_NETWORK
@@ -42,8 +44,27 @@ static __inline__ void unix_get_peersec_
 { }
 #endif /* CONFIG_SECURITY_NETWORK */
 
+static __inline__ void scm_set_cred(struct scm_cookie *scm,
+				    struct pid *pid, const struct cred *cred)
+{
+	scm->pid  = get_pid(pid);
+	scm->cred = get_cred(cred);
+	cred_to_ucred(pid, cred, &scm->creds);
+}
+
+static __inline__ void scm_destroy_cred(struct scm_cookie *scm)
+{
+	put_pid(scm->pid);
+	scm->pid  = NULL;
+
+	if (scm->cred)
+		put_cred(scm->cred);
+	scm->cred = NULL;
+}
+
 static __inline__ void scm_destroy(struct scm_cookie *scm)
 {
+	scm_destroy_cred(scm);
 	if (scm && scm->fp)
 		__scm_destroy(scm);
 }
@@ -51,10 +72,7 @@ static __inline__ void scm_destroy(struc
 static __inline__ int scm_send(struct socket *sock, struct msghdr *msg,
 			       struct scm_cookie *scm)
 {
-	struct task_struct *p = current;
-	scm->creds.uid = current_uid();
-	scm->creds.gid = current_gid();
-	scm->creds.pid = task_tgid_vnr(p);
+	scm_set_cred(scm, task_tgid(current), current_cred());
 	scm->fp = NULL;
 	unix_get_peersec_dgram(sock, scm);
 	if (msg->msg_controllen <= 0)
@@ -96,6 +114,8 @@ static __inline__ void scm_recv(struct s
 	if (test_bit(SOCK_PASSCRED, &sock->flags))
 		put_cmsg(msg, SOL_SOCKET, SCM_CREDENTIALS, sizeof(scm->creds), &scm->creds);
 
+	scm_destroy_cred(scm);
+
 	scm_passec(sock, msg, scm);
 
 	if (!scm->fp)
Index: linux-2.6.35.y/net/core/scm.c
===================================================================
--- linux-2.6.35.y.orig/net/core/scm.c
+++ linux-2.6.35.y/net/core/scm.c
@@ -170,6 +170,30 @@ int __scm_send(struct socket *sock, stru
 			err = scm_check_creds(&p->creds);
 			if (err)
 				goto error;
+
+			if (pid_vnr(p->pid) != p->creds.pid) {
+				struct pid *pid;
+				err = -ESRCH;
+				pid = find_get_pid(p->creds.pid);
+				if (!pid)
+					goto error;
+				put_pid(p->pid);
+				p->pid = pid;
+			}
+
+			if ((p->cred->euid != p->creds.uid) ||
+				(p->cred->egid != p->creds.gid)) {
+				struct cred *cred;
+				err = -ENOMEM;
+				cred = prepare_creds();
+				if (!cred)
+					goto error;
+
+				cred->uid = cred->euid = p->creds.uid;
+				cred->gid = cred->egid = p->creds.uid;
+				put_cred(p->cred);
+				p->cred = cred;
+			}
 			break;
 		default:
 			goto error;

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

* [PATCH] [55/139] af_unix: Allow credentials to work across user and pid namespaces.
  2011-02-02  0:43 [PATCH] [0/139] 2.6.35.11 longterm review Andi Kleen
                   ` (53 preceding siblings ...)
  2011-02-02  0:44 ` [PATCH] [54/139] scm: Capture the full credentials of the scm sender Andi Kleen
@ 2011-02-02  0:44 ` Andi Kleen
  2011-02-02  0:44 ` [PATCH] [56/139] user_ns: Introduce user_nsmap_uid and user_ns_map_gid Andi Kleen
                   ` (84 subsequent siblings)
  139 siblings, 0 replies; 149+ messages in thread
From: Andi Kleen @ 2011-02-02  0:44 UTC (permalink / raw)
  To: ebiederm, xemul, davem, ak, linux-kernel, stable

2.6.35-longterm review patch.  If anyone has any objections, please let me know.

------------------
Upstream commit 7361c36c5224519b258219fe3d0e8abc865d8134

In unix_skb_parms store pointers to struct pid and struct cred instead
of raw uid, gid, and pid values, then translate the credentials on
reception into values that are meaningful in the receiving processes
namespaces.

Signed-off-by: Eric W. Biederman <ebiederm@xmission.com>
Acked-by: Pavel Emelyanov <xemul@openvz.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Andi Kleen <ak@linux.intel.com>

Index: linux-2.6.35.y/include/net/af_unix.h
===================================================================
--- linux-2.6.35.y.orig/include/net/af_unix.h
+++ linux-2.6.35.y/include/net/af_unix.h
@@ -23,7 +23,8 @@ struct unix_address {
 };
 
 struct unix_skb_parms {
-	struct ucred		creds;		/* Skb credentials	*/
+	struct pid		*pid;		/* Skb credentials	*/
+	const struct cred	*cred;
 	struct scm_fp_list	*fp;		/* Passed files		*/
 #ifdef CONFIG_SECURITY_NETWORK
 	u32			secid;		/* Security ID		*/
@@ -31,7 +32,6 @@ struct unix_skb_parms {
 };
 
 #define UNIXCB(skb) 	(*(struct unix_skb_parms *)&((skb)->cb))
-#define UNIXCREDS(skb)	(&UNIXCB((skb)).creds)
 #define UNIXSID(skb)	(&UNIXCB((skb)).secid)
 
 #define unix_state_lock(s)	spin_lock(&unix_sk(s)->lock)
Index: linux-2.6.35.y/net/unix/af_unix.c
===================================================================
--- linux-2.6.35.y.orig/net/unix/af_unix.c
+++ linux-2.6.35.y/net/unix/af_unix.c
@@ -1306,18 +1306,20 @@ static void unix_detach_fds(struct scm_c
 	int i;
 
 	scm->fp = UNIXCB(skb).fp;
-	skb->destructor = sock_wfree;
 	UNIXCB(skb).fp = NULL;
 
 	for (i = scm->fp->count-1; i >= 0; i--)
 		unix_notinflight(scm->fp->fp[i]);
 }
 
-static void unix_destruct_fds(struct sk_buff *skb)
+static void unix_destruct_scm(struct sk_buff *skb)
 {
 	struct scm_cookie scm;
 	memset(&scm, 0, sizeof(scm));
-	unix_detach_fds(&scm, skb);
+	scm.pid  = UNIXCB(skb).pid;
+	scm.cred = UNIXCB(skb).cred;
+	if (UNIXCB(skb).fp)
+		unix_detach_fds(&scm, skb);
 
 	/* Alas, it calls VFS */
 	/* So fscking what? fput() had been SMP-safe since the last Summer */
@@ -1340,10 +1342,22 @@ static int unix_attach_fds(struct scm_co
 
 	for (i = scm->fp->count-1; i >= 0; i--)
 		unix_inflight(scm->fp->fp[i]);
-	skb->destructor = unix_destruct_fds;
 	return 0;
 }
 
+static int unix_scm_to_skb(struct scm_cookie *scm, struct sk_buff *skb, bool send_fds)
+{
+	int err = 0;
+	UNIXCB(skb).pid  = get_pid(scm->pid);
+	UNIXCB(skb).cred = get_cred(scm->cred);
+	UNIXCB(skb).fp = NULL;
+	if (scm->fp && send_fds)
+		err = unix_attach_fds(scm, skb);
+
+	skb->destructor = unix_destruct_scm;
+	return err;
+}
+
 /*
  *	Send AF_UNIX data.
  */
@@ -1400,12 +1414,9 @@ static int unix_dgram_sendmsg(struct kio
 	if (skb == NULL)
 		goto out;
 
-	memcpy(UNIXCREDS(skb), &siocb->scm->creds, sizeof(struct ucred));
-	if (siocb->scm->fp) {
-		err = unix_attach_fds(siocb->scm, skb);
-		if (err)
-			goto out_free;
-	}
+	err = unix_scm_to_skb(siocb->scm, skb, true);
+	if (err)
+		goto out_free;
 	unix_get_secdata(siocb->scm, skb);
 
 	skb_reset_transport_header(skb);
@@ -1575,16 +1586,14 @@ static int unix_stream_sendmsg(struct ki
 		 */
 		size = min_t(int, size, skb_tailroom(skb));
 
-		memcpy(UNIXCREDS(skb), &siocb->scm->creds, sizeof(struct ucred));
+
 		/* Only send the fds in the first buffer */
-		if (siocb->scm->fp && !fds_sent) {
-			err = unix_attach_fds(siocb->scm, skb);
-			if (err) {
-				kfree_skb(skb);
-				goto out_err;
-			}
-			fds_sent = true;
+		err = unix_scm_to_skb(siocb->scm, skb, !fds_sent);
+		if (err) {
+			kfree_skb(skb);
+			goto out_err;
 		}
+		fds_sent = true;
 
 		err = memcpy_fromiovec(skb_put(skb, size), msg->msg_iov, size);
 		if (err) {
@@ -1701,7 +1710,7 @@ static int unix_dgram_recvmsg(struct kio
 		siocb->scm = &tmp_scm;
 		memset(&tmp_scm, 0, sizeof(tmp_scm));
 	}
-	siocb->scm->creds = *UNIXCREDS(skb);
+	scm_set_cred(siocb->scm, UNIXCB(skb).pid, UNIXCB(skb).cred);
 	unix_set_secdata(siocb->scm, skb);
 
 	if (!(flags & MSG_PEEK)) {
@@ -1850,14 +1859,14 @@ static int unix_stream_recvmsg(struct ki
 
 		if (check_creds) {
 			/* Never glue messages from different writers */
-			if (memcmp(UNIXCREDS(skb), &siocb->scm->creds,
-				   sizeof(siocb->scm->creds)) != 0) {
+			if ((UNIXCB(skb).pid  != siocb->scm->pid) ||
+			    (UNIXCB(skb).cred != siocb->scm->cred)) {
 				skb_queue_head(&sk->sk_receive_queue, skb);
 				break;
 			}
 		} else {
 			/* Copy credentials */
-			siocb->scm->creds = *UNIXCREDS(skb);
+			scm_set_cred(siocb->scm, UNIXCB(skb).pid, UNIXCB(skb).cred);
 			check_creds = 1;
 		}
 

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

* [PATCH] [56/139] user_ns: Introduce user_nsmap_uid and user_ns_map_gid.
  2011-02-02  0:43 [PATCH] [0/139] 2.6.35.11 longterm review Andi Kleen
                   ` (54 preceding siblings ...)
  2011-02-02  0:44 ` [PATCH] [55/139] af_unix: Allow credentials to work across user and pid namespaces Andi Kleen
@ 2011-02-02  0:44 ` Andi Kleen
  2011-02-02  0:44 ` [PATCH] [57/139] sock: Introduce cred_to_ucred Andi Kleen
                   ` (83 subsequent siblings)
  139 siblings, 0 replies; 149+ messages in thread
From: Andi Kleen @ 2011-02-02  0:44 UTC (permalink / raw)
  To: ebiederm, serue, davem, ak, linux-kernel, stable

2.6.35-longterm review patch.  If anyone has any objections, please let me know.

------------------
Upstream commit 5c1469de7545a35a16ff2b902e217044a7d2f8a5

Define what happens when a we view a uid from one user_namespace
in another user_namepece.

- If the user namespaces are the same no mapping is necessary.

- For most cases of difference use overflowuid and overflowgid,
  the uid and gid currently used for 16bit apis when we have a 32bit uid
  that does fit in 16bits.  Effectively the situation is the same,
  we want to return a uid or gid that is not assigned to any user.

- For the case when we happen to be mapping the uid or gid of the
  creator of the target user namespace use uid 0 and gid as confusing
  that user with root is not a problem.

Signed-off-by: Eric W. Biederman <ebiederm@xmission.com>
Acked-by: Serge E. Hallyn <serue@us.ibm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Andi Kleen <ak@linux.intel.com>

Index: linux-2.6.35.y/include/linux/user_namespace.h
===================================================================
--- linux-2.6.35.y.orig/include/linux/user_namespace.h
+++ linux-2.6.35.y/include/linux/user_namespace.h
@@ -36,6 +36,9 @@ static inline void put_user_ns(struct us
 		kref_put(&ns->kref, free_user_ns);
 }
 
+uid_t user_ns_map_uid(struct user_namespace *to, const struct cred *cred, uid_t uid);
+gid_t user_ns_map_gid(struct user_namespace *to, const struct cred *cred, gid_t gid);
+
 #else
 
 static inline struct user_namespace *get_user_ns(struct user_namespace *ns)
@@ -52,6 +55,17 @@ static inline void put_user_ns(struct us
 {
 }
 
+static inline uid_t user_ns_map_uid(struct user_namespace *to,
+	const struct cred *cred, uid_t uid)
+{
+	return uid;
+}
+static inline gid_t user_ns_map_gid(struct user_namespace *to,
+	const struct cred *cred, gid_t gid)
+{
+	return gid;
+}
+
 #endif
 
 #endif /* _LINUX_USER_H */
Index: linux-2.6.35.y/kernel/user_namespace.c
===================================================================
--- linux-2.6.35.y.orig/kernel/user_namespace.c
+++ linux-2.6.35.y/kernel/user_namespace.c
@@ -9,6 +9,7 @@
 #include <linux/nsproxy.h>
 #include <linux/slab.h>
 #include <linux/user_namespace.h>
+#include <linux/highuid.h>
 #include <linux/cred.h>
 
 /*
@@ -82,3 +83,46 @@ void free_user_ns(struct kref *kref)
 	schedule_work(&ns->destroyer);
 }
 EXPORT_SYMBOL(free_user_ns);
+
+uid_t user_ns_map_uid(struct user_namespace *to, const struct cred *cred, uid_t uid)
+{
+	struct user_namespace *tmp;
+
+	if (likely(to == cred->user->user_ns))
+		return uid;
+
+
+	/* Is cred->user the creator of the target user_ns
+	 * or the creator of one of it's parents?
+	 */
+	for ( tmp = to; tmp != &init_user_ns;
+	      tmp = tmp->creator->user_ns ) {
+		if (cred->user == tmp->creator) {
+			return (uid_t)0;
+		}
+	}
+
+	/* No useful relationship so no mapping */
+	return overflowuid;
+}
+
+gid_t user_ns_map_gid(struct user_namespace *to, const struct cred *cred, gid_t gid)
+{
+	struct user_namespace *tmp;
+
+	if (likely(to == cred->user->user_ns))
+		return gid;
+
+	/* Is cred->user the creator of the target user_ns
+	 * or the creator of one of it's parents?
+	 */
+	for ( tmp = to; tmp != &init_user_ns;
+	      tmp = tmp->creator->user_ns ) {
+		if (cred->user == tmp->creator) {
+			return (gid_t)0;
+		}
+	}
+
+	/* No useful relationship so no mapping */
+	return overflowgid;
+}

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

* [PATCH] [57/139] sock: Introduce cred_to_ucred
  2011-02-02  0:43 [PATCH] [0/139] 2.6.35.11 longterm review Andi Kleen
                   ` (55 preceding siblings ...)
  2011-02-02  0:44 ` [PATCH] [56/139] user_ns: Introduce user_nsmap_uid and user_ns_map_gid Andi Kleen
@ 2011-02-02  0:44 ` Andi Kleen
  2011-02-02  0:44 ` [PATCH] [58/139] net: Export cred_to_ucred to modules Andi Kleen
                   ` (82 subsequent siblings)
  139 siblings, 0 replies; 149+ messages in thread
From: Andi Kleen @ 2011-02-02  0:44 UTC (permalink / raw)
  To: ebiederm, xemul, davem, ak, linux-kernel, stable

2.6.35-longterm review patch.  If anyone has any objections, please let me know.

------------------
Upstream commit 3f551f9436c05a3b5eccdd6e94733df5bb98d2a5

To keep the coming code clear and to allow both the sock
code and the scm code to share the logic introduce a
fuction to translate from struct cred to struct ucred.

Signed-off-by: Eric W. Biederman <ebiederm@xmission.com>
Acked-by: Pavel Emelyanov <xemul@openvz.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Andi Kleen <ak@linux.intel.com>

Index: linux-2.6.35.y/include/linux/socket.h
===================================================================
--- linux-2.6.35.y.orig/include/linux/socket.h
+++ linux-2.6.35.y/include/linux/socket.h
@@ -24,6 +24,9 @@ struct __kernel_sockaddr_storage {
 #include <linux/types.h>		/* pid_t			*/
 #include <linux/compiler.h>		/* __user			*/
 
+struct pid;
+struct cred;
+
 #define __sockaddr_check_size(size)	\
 	BUILD_BUG_ON(((size) > sizeof(struct __kernel_sockaddr_storage)))
 
@@ -309,6 +312,8 @@ struct ucred {
 #define IPX_TYPE	1
 
 #ifdef __KERNEL__
+extern void cred_to_ucred(struct pid *pid, const struct cred *cred, struct ucred *ucred);
+
 extern int memcpy_fromiovec(unsigned char *kdata, struct iovec *iov, int len);
 extern int memcpy_fromiovecend(unsigned char *kdata, const struct iovec *iov,
 			       int offset, int len);
Index: linux-2.6.35.y/net/core/sock.c
===================================================================
--- linux-2.6.35.y.orig/net/core/sock.c
+++ linux-2.6.35.y/net/core/sock.c
@@ -110,6 +110,7 @@
 #include <linux/tcp.h>
 #include <linux/init.h>
 #include <linux/highmem.h>
+#include <linux/user_namespace.h>
 
 #include <asm/uaccess.h>
 #include <asm/system.h>
@@ -749,6 +750,19 @@ set_rcvbuf:
 EXPORT_SYMBOL(sock_setsockopt);
 
 
+void cred_to_ucred(struct pid *pid, const struct cred *cred,
+		   struct ucred *ucred)
+{
+	ucred->pid = pid_vnr(pid);
+	ucred->uid = ucred->gid = -1;
+	if (cred) {
+		struct user_namespace *current_ns = current_user_ns();
+
+		ucred->uid = user_ns_map_uid(current_ns, cred, cred->euid);
+		ucred->gid = user_ns_map_gid(current_ns, cred, cred->egid);
+	}
+}
+
 int sock_getsockopt(struct socket *sock, int level, int optname,
 		    char __user *optval, int __user *optlen)
 {

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

* [PATCH] [58/139] net: Export cred_to_ucred to modules.
  2011-02-02  0:43 [PATCH] [0/139] 2.6.35.11 longterm review Andi Kleen
                   ` (56 preceding siblings ...)
  2011-02-02  0:44 ` [PATCH] [57/139] sock: Introduce cred_to_ucred Andi Kleen
@ 2011-02-02  0:44 ` Andi Kleen
  2011-02-02  0:44 ` [PATCH] [59/139] af_unix: limit recursion level Andi Kleen
                   ` (81 subsequent siblings)
  139 siblings, 0 replies; 149+ messages in thread
From: Andi Kleen @ 2011-02-02  0:44 UTC (permalink / raw)
  To: davem, ak, linux-kernel, stable

2.6.35-longterm review patch.  If anyone has any objections, please let me know.

------------------
Upstream commit 3924773a5a82622167524bdd48799dc0452c57f8

AF_UNIX references this, and can be built as a module,
so...

Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Andi Kleen <ak@linux.intel.com>

Index: linux-2.6.35.y/net/core/sock.c
===================================================================
--- linux-2.6.35.y.orig/net/core/sock.c
+++ linux-2.6.35.y/net/core/sock.c
@@ -762,6 +762,7 @@ void cred_to_ucred(struct pid *pid, cons
 		ucred->gid = user_ns_map_gid(current_ns, cred, cred->egid);
 	}
 }
+EXPORT_SYMBOL_GPL(cred_to_ucred);
 
 int sock_getsockopt(struct socket *sock, int level, int optname,
 		    char __user *optval, int __user *optlen)

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

* [PATCH] [59/139] af_unix: limit recursion level
  2011-02-02  0:43 [PATCH] [0/139] 2.6.35.11 longterm review Andi Kleen
                   ` (57 preceding siblings ...)
  2011-02-02  0:44 ` [PATCH] [58/139] net: Export cred_to_ucred to modules Andi Kleen
@ 2011-02-02  0:44 ` Andi Kleen
  2011-02-02  0:44 ` [PATCH] [60/139] net: ax25: fix information leak to userland Andi Kleen
                   ` (80 subsequent siblings)
  139 siblings, 0 replies; 149+ messages in thread
From: Andi Kleen @ 2011-02-02  0:44 UTC (permalink / raw)
  To: eric.dumazet, davem, gregkh, ak, linux-kernel, stable

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 5608 bytes --]

2.6.35-longterm review patch.  If anyone has any objections, please let me know.

------------------

From: Eric Dumazet <eric.dumazet@gmail.com>

[ Upstream commit 25888e30319f8896fc656fc68643e6a078263060 ]

Its easy to eat all kernel memory and trigger NMI watchdog, using an
exploit program that queues unix sockets on top of others.

lkml ref : http://lkml.org/lkml/2010/11/25/8

This mechanism is used in applications, one choice we have is to have a
recursion limit.

Other limits might be needed as well (if we queue other types of files),
since the passfd mechanism is currently limited by socket receive queue
sizes only.

Add a recursion_level to unix socket, allowing up to 4 levels.

Each time we send an unix socket through sendfd mechanism, we copy its
recursion level (plus one) to receiver. This recursion level is cleared
when socket receive queue is emptied.

Reported-by: Марк Коренберг <socketpair@gmail.com>
Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: Andi Kleen <ak@linux.intel.com>

---
 include/net/af_unix.h |    2 ++
 net/unix/af_unix.c    |   37 ++++++++++++++++++++++++++++++++-----
 net/unix/garbage.c    |    2 +-
 3 files changed, 35 insertions(+), 6 deletions(-)

Index: linux-2.6.35.y/include/net/af_unix.h
===================================================================
--- linux-2.6.35.y.orig/include/net/af_unix.h
+++ linux-2.6.35.y/include/net/af_unix.h
@@ -10,6 +10,7 @@ extern void unix_inflight(struct file *f
 extern void unix_notinflight(struct file *fp);
 extern void unix_gc(void);
 extern void wait_for_unix_gc(void);
+extern struct sock *unix_get_socket(struct file *filp);
 
 #define UNIX_HASH_SIZE	256
 
@@ -56,6 +57,7 @@ struct unix_sock {
 	spinlock_t		lock;
 	unsigned int		gc_candidate : 1;
 	unsigned int		gc_maybe_cycle : 1;
+	unsigned char		recursion_level;
 	struct socket_wq	peer_wq;
 };
 #define unix_sk(__sk) ((struct unix_sock *)__sk)
Index: linux-2.6.35.y/net/unix/af_unix.c
===================================================================
--- linux-2.6.35.y.orig/net/unix/af_unix.c
+++ linux-2.6.35.y/net/unix/af_unix.c
@@ -1327,9 +1327,25 @@ static void unix_destruct_scm(struct sk_
 	sock_wfree(skb);
 }
 
+#define MAX_RECURSION_LEVEL 4
+
 static int unix_attach_fds(struct scm_cookie *scm, struct sk_buff *skb)
 {
 	int i;
+	unsigned char max_level = 0;
+	int unix_sock_count = 0;
+
+	for (i = scm->fp->count - 1; i >= 0; i--) {
+		struct sock *sk = unix_get_socket(scm->fp->fp[i]);
+
+		if (sk) {
+			unix_sock_count++;
+			max_level = max(max_level,
+					unix_sk(sk)->recursion_level);
+		}
+	}
+	if (unlikely(max_level > MAX_RECURSION_LEVEL))
+		return -ETOOMANYREFS;
 
 	/*
 	 * Need to duplicate file references for the sake of garbage
@@ -1340,9 +1356,11 @@ static int unix_attach_fds(struct scm_co
 	if (!UNIXCB(skb).fp)
 		return -ENOMEM;
 
-	for (i = scm->fp->count-1; i >= 0; i--)
-		unix_inflight(scm->fp->fp[i]);
-	return 0;
+	if (unix_sock_count) {
+		for (i = scm->fp->count - 1; i >= 0; i--)
+			unix_inflight(scm->fp->fp[i]);
+	}
+	return max_level;
 }
 
 static int unix_scm_to_skb(struct scm_cookie *scm, struct sk_buff *skb, bool send_fds)
@@ -1377,6 +1395,7 @@ static int unix_dgram_sendmsg(struct kio
 	struct sk_buff *skb;
 	long timeo;
 	struct scm_cookie tmp_scm;
+	int max_level;
 
 	if (NULL == siocb->scm)
 		siocb->scm = &tmp_scm;
@@ -1415,8 +1434,9 @@ static int unix_dgram_sendmsg(struct kio
 		goto out;
 
 	err = unix_scm_to_skb(siocb->scm, skb, true);
-	if (err)
+	if (err < 0)
 		goto out_free;
+	max_level = err + 1;
 	unix_get_secdata(siocb->scm, skb);
 
 	skb_reset_transport_header(skb);
@@ -1496,6 +1516,8 @@ restart:
 	}
 
 	skb_queue_tail(&other->sk_receive_queue, skb);
+	if (max_level > unix_sk(other)->recursion_level)
+		unix_sk(other)->recursion_level = max_level;
 	unix_state_unlock(other);
 	other->sk_data_ready(other, len);
 	sock_put(other);
@@ -1526,6 +1548,7 @@ static int unix_stream_sendmsg(struct ki
 	int sent = 0;
 	struct scm_cookie tmp_scm;
 	bool fds_sent = false;
+	int max_level;
 
 	if (NULL == siocb->scm)
 		siocb->scm = &tmp_scm;
@@ -1589,10 +1612,11 @@ static int unix_stream_sendmsg(struct ki
 
 		/* Only send the fds in the first buffer */
 		err = unix_scm_to_skb(siocb->scm, skb, !fds_sent);
-		if (err) {
+		if (err < 0) {
 			kfree_skb(skb);
 			goto out_err;
 		}
+		max_level = err + 1;
 		fds_sent = true;
 
 		err = memcpy_fromiovec(skb_put(skb, size), msg->msg_iov, size);
@@ -1608,6 +1632,8 @@ static int unix_stream_sendmsg(struct ki
 			goto pipe_err_free;
 
 		skb_queue_tail(&other->sk_receive_queue, skb);
+		if (max_level > unix_sk(other)->recursion_level)
+			unix_sk(other)->recursion_level = max_level;
 		unix_state_unlock(other);
 		other->sk_data_ready(other, size);
 		sent += size;
@@ -1824,6 +1850,7 @@ static int unix_stream_recvmsg(struct ki
 		unix_state_lock(sk);
 		skb = skb_dequeue(&sk->sk_receive_queue);
 		if (skb == NULL) {
+			unix_sk(sk)->recursion_level = 0;
 			if (copied >= target)
 				goto unlock;
 
Index: linux-2.6.35.y/net/unix/garbage.c
===================================================================
--- linux-2.6.35.y.orig/net/unix/garbage.c
+++ linux-2.6.35.y/net/unix/garbage.c
@@ -96,7 +96,7 @@ static DECLARE_WAIT_QUEUE_HEAD(unix_gc_w
 unsigned int unix_tot_inflight;
 
 
-static struct sock *unix_get_socket(struct file *filp)
+struct sock *unix_get_socket(struct file *filp)
 {
 	struct sock *u_sock = NULL;
 	struct inode *inode = filp->f_path.dentry->d_inode;

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

* [PATCH] [60/139] net: ax25: fix information leak to userland
  2011-02-02  0:43 [PATCH] [0/139] 2.6.35.11 longterm review Andi Kleen
                   ` (58 preceding siblings ...)
  2011-02-02  0:44 ` [PATCH] [59/139] af_unix: limit recursion level Andi Kleen
@ 2011-02-02  0:44 ` Andi Kleen
  2011-02-02  0:44 ` [PATCH] [61/139] driver/net/benet: fix be_cmd_multicast_set() memcpy bug Andi Kleen
                   ` (79 subsequent siblings)
  139 siblings, 0 replies; 149+ messages in thread
From: Andi Kleen @ 2011-02-02  0:44 UTC (permalink / raw)
  To: segooon, davem, gregkh, ak, linux-kernel, stable

2.6.35-longterm review patch.  If anyone has any objections, please let me know.

------------------

From: Vasiliy Kulikov <segooon@gmail.com>

[ Upstream commit fe10ae53384e48c51996941b7720ee16995cbcb7 ]

Sometimes ax25_getname() doesn't initialize all members of fsa_digipeater
field of fsa struct, also the struct has padding bytes between
sax25_call and sax25_ndigis fields.  This structure is then copied to
userland.  It leads to leaking of contents of kernel stack memory.

Signed-off-by: Vasiliy Kulikov <segooon@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: Andi Kleen <ak@linux.intel.com>

---
 net/ax25/af_ax25.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Index: linux-2.6.35.y/net/ax25/af_ax25.c
===================================================================
--- linux-2.6.35.y.orig/net/ax25/af_ax25.c
+++ linux-2.6.35.y/net/ax25/af_ax25.c
@@ -1392,6 +1392,7 @@ static int ax25_getname(struct socket *s
 	ax25_cb *ax25;
 	int err = 0;
 
+	memset(fsa, 0, sizeof(fsa));
 	lock_sock(sk);
 	ax25 = ax25_sk(sk);
 
@@ -1403,7 +1404,6 @@ static int ax25_getname(struct socket *s
 
 		fsa->fsa_ax25.sax25_family = AF_AX25;
 		fsa->fsa_ax25.sax25_call   = ax25->dest_addr;
-		fsa->fsa_ax25.sax25_ndigis = 0;
 
 		if (ax25->digipeat != NULL) {
 			ndigi = ax25->digipeat->ndigi;

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

* [PATCH] [61/139] driver/net/benet: fix be_cmd_multicast_set() memcpy bug
  2011-02-02  0:43 [PATCH] [0/139] 2.6.35.11 longterm review Andi Kleen
                   ` (59 preceding siblings ...)
  2011-02-02  0:44 ` [PATCH] [60/139] net: ax25: fix information leak to userland Andi Kleen
@ 2011-02-02  0:44 ` Andi Kleen
  2011-02-02  0:44 ` [PATCH] [62/139] bonding: Fix slave selection bug Andi Kleen
                   ` (78 subsequent siblings)
  139 siblings, 0 replies; 149+ messages in thread
From: Andi Kleen @ 2011-02-02  0:44 UTC (permalink / raw)
  To: joe.jin, sathyap, subbus, sarveshwarb, ajitk, davem, gregkh, ak,
	linux-kernel, stable

2.6.35-longterm review patch.  If anyone has any objections, please let me know.

------------------

From: Joe Jin <joe.jin@oracle.com>

[ Upstream commit 3fd40d0ceac9c234243730f4d7a6ffdb2fd3023a ]

Regarding  benet be_cmd_multicast_set() function, now using
netdev_for_each_mc_addr() helper for mac address copy, but
when copying to req->mac[] did not increase of the index.

Cc: Sathya Perla <sathyap@serverengines.com>
Cc: Subbu Seetharaman <subbus@serverengines.com>
Cc: Sarveshwar Bandi <sarveshwarb@serverengines.com>
Cc: Ajit Khaparde <ajitk@serverengines.com>
Signed-off-by: Joe Jin <joe.jin@oracle.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: Andi Kleen <ak@linux.intel.com>

---
 drivers/net/benet/be_cmds.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Index: linux-2.6.35.y/drivers/net/benet/be_cmds.c
===================================================================
--- linux-2.6.35.y.orig/drivers/net/benet/be_cmds.c
+++ linux-2.6.35.y/drivers/net/benet/be_cmds.c
@@ -1176,7 +1176,7 @@ int be_cmd_multicast_set(struct be_adapt
 
 		i = 0;
 		netdev_for_each_mc_addr(ha, netdev)
-			memcpy(req->mac[i].byte, ha->addr, ETH_ALEN);
+			memcpy(req->mac[i++].byte, ha->addr, ETH_ALEN);
 	} else {
 		req->promiscuous = 1;
 	}

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

* [PATCH] [62/139] bonding: Fix slave selection bug.
  2011-02-02  0:43 [PATCH] [0/139] 2.6.35.11 longterm review Andi Kleen
                   ` (60 preceding siblings ...)
  2011-02-02  0:44 ` [PATCH] [61/139] driver/net/benet: fix be_cmd_multicast_set() memcpy bug Andi Kleen
@ 2011-02-02  0:44 ` Andi Kleen
  2011-02-02  0:44 ` [PATCH] [63/139] bridge: fix IPv6 queries for bridge multicast snooping Andi Kleen
                   ` (77 subsequent siblings)
  139 siblings, 0 replies; 149+ messages in thread
From: Andi Kleen @ 2011-02-02  0:44 UTC (permalink / raw)
  To: dhillf, davem, gregkh, ak, linux-kernel, stable

2.6.35-longterm review patch.  If anyone has any objections, please let me know.

------------------

From: Hillf Danton <dhillf@gmail.com>

[ Upstream commit af3e5bd5f650163c2e12297f572910a1af1b8236 ]

The returned slave is incorrect, if the net device under check is not
charged yet by the master.

Signed-off-by: Hillf Danton <dhillf@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: Andi Kleen <ak@linux.intel.com>

---
 drivers/net/bonding/bonding.h |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Index: linux-2.6.35.y/drivers/net/bonding/bonding.h
===================================================================
--- linux-2.6.35.y.orig/drivers/net/bonding/bonding.h
+++ linux-2.6.35.y/drivers/net/bonding/bonding.h
@@ -235,11 +235,11 @@ static inline struct slave *bond_get_sla
 
 	bond_for_each_slave(bond, slave, i) {
 		if (slave->dev == slave_dev) {
-			break;
+			return slave;
 		}
 	}
 
-	return slave;
+	return 0;
 }
 
 static inline struct bonding *bond_get_bond_by_slave(struct slave *slave)

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

* [PATCH] [63/139] bridge: fix IPv6 queries for bridge multicast snooping
  2011-02-02  0:43 [PATCH] [0/139] 2.6.35.11 longterm review Andi Kleen
                   ` (61 preceding siblings ...)
  2011-02-02  0:44 ` [PATCH] [62/139] bonding: Fix slave selection bug Andi Kleen
@ 2011-02-02  0:44 ` Andi Kleen
  2011-02-02  0:44 ` [PATCH] [64/139] cls_cgroup: Fix crash on module unload Andi Kleen
                   ` (76 subsequent siblings)
  139 siblings, 0 replies; 149+ messages in thread
From: Andi Kleen @ 2011-02-02  0:44 UTC (permalink / raw)
  To: dlstevens, herbert, davem, gregkh, ak, linux-kernel, stable

2.6.35-longterm review patch.  If anyone has any objections, please let me know.

------------------

From: David Stevens <dlstevens@us.ibm.com>

[ Upstream commit 76d661586c8131453ba75a2e027c1f21511a893a]

This patch fixes a missing ntohs() for bridge IPv6 multicast snooping.

Signed-off-by: David L Stevens <dlstevens@us.ibm.com>
Acked-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: Andi Kleen <ak@linux.intel.com>

---
 net/bridge/br_multicast.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Index: linux-2.6.35.y/net/bridge/br_multicast.c
===================================================================
--- linux-2.6.35.y.orig/net/bridge/br_multicast.c
+++ linux-2.6.35.y/net/bridge/br_multicast.c
@@ -437,7 +437,7 @@ static struct sk_buff *br_ip6_multicast_
 	ip6h = ipv6_hdr(skb);
 
 	*(__force __be32 *)ip6h = htonl(0x60000000);
-	ip6h->payload_len = 8 + sizeof(*mldq);
+	ip6h->payload_len = htons(8 + sizeof(*mldq));
 	ip6h->nexthdr = IPPROTO_HOPOPTS;
 	ip6h->hop_limit = 1;
 	ipv6_addr_set(&ip6h->saddr, 0, 0, 0, 0);

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

* [PATCH] [64/139] cls_cgroup: Fix crash on module unload
  2011-02-02  0:43 [PATCH] [0/139] 2.6.35.11 longterm review Andi Kleen
                   ` (62 preceding siblings ...)
  2011-02-02  0:44 ` [PATCH] [63/139] bridge: fix IPv6 queries for bridge multicast snooping Andi Kleen
@ 2011-02-02  0:44 ` Andi Kleen
  2011-02-02  0:44 ` [PATCH] [65/139] filter: fix sk_filter rcu handling Andi Kleen
                   ` (75 subsequent siblings)
  139 siblings, 0 replies; 149+ messages in thread
From: Andi Kleen @ 2011-02-02  0:44 UTC (permalink / raw)
  To: herbert, ak, lizf, davem, gregkh, linux-kernel, stable

2.6.35-longterm review patch.  If anyone has any objections, please let me know.

------------------

From: Herbert Xu <herbert@gondor.apana.org.au>

[ Upstream commit c00b2c9e79466d61979cd21af526cc6d5d0ee04f ]

Somewhere along the lines net_cls_subsys_id became a macro when
cls_cgroup is built as a module.  Not only did it make cls_cgroup
completely useless, it also causes it to crash on module unload.

This patch fixes this by removing that macro.

Thanks to Eric Dumazet for diagnosing this problem.

Reported-by: Randy Dunlap <randy.dunlap@oracle.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: Andi Kleen <ak@linux.intel.com>
Reviewed-by: Li Zefan <lizf@cn.fujitsu.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
---
 net/sched/cls_cgroup.c |    2 --
 1 file changed, 2 deletions(-)

Index: linux-2.6.35.y/net/sched/cls_cgroup.c
===================================================================
--- linux-2.6.35.y.orig/net/sched/cls_cgroup.c
+++ linux-2.6.35.y/net/sched/cls_cgroup.c
@@ -34,8 +34,6 @@ struct cgroup_subsys net_cls_subsys = {
 	.populate	= cgrp_populate,
 #ifdef CONFIG_NET_CLS_CGROUP
 	.subsys_id	= net_cls_subsys_id,
-#else
-#define net_cls_subsys_id net_cls_subsys.subsys_id
 #endif
 	.module		= THIS_MODULE,
 };

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

* [PATCH] [65/139] filter: fix sk_filter rcu handling
  2011-02-02  0:43 [PATCH] [0/139] 2.6.35.11 longterm review Andi Kleen
                   ` (63 preceding siblings ...)
  2011-02-02  0:44 ` [PATCH] [64/139] cls_cgroup: Fix crash on module unload Andi Kleen
@ 2011-02-02  0:44 ` Andi Kleen
  2011-02-02  0:44 ` [PATCH] [66/139] econet: Do the correct cleanup after an unprivileged SIOCSIFADDR Andi Kleen
                   ` (74 subsequent siblings)
  139 siblings, 0 replies; 149+ messages in thread
From: Andi Kleen @ 2011-02-02  0:44 UTC (permalink / raw)
  To: eric.dumazet, davem, gregkh, ak, linux-kernel, stable

2.6.35-longterm review patch.  If anyone has any objections, please let me know.

------------------

From: Eric Dumazet <eric.dumazet@gmail.com>

[ Upstream commit 46bcf14f44d8f31ecfdc8b6708ec15a3b33316d9 ]

Pavel Emelyanov tried to fix a race between sk_filter_(de|at)tach and
sk_clone() in commit 47e958eac280c263397

Problem is we can have several clones sharing a common sk_filter, and
these clones might want to sk_filter_attach() their own filters at the
same time, and can overwrite old_filter->rcu, corrupting RCU queues.

We can not use filter->rcu without being sure no other thread could do
the same thing.

Switch code to a more conventional ref-counting technique : Do the
atomic decrement immediately and queue one rcu call back when last
reference is released.

Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: Andi Kleen <ak@linux.intel.com>

---
 include/net/sock.h |    4 +++-
 net/core/filter.c  |   19 ++++++-------------
 2 files changed, 9 insertions(+), 14 deletions(-)

Index: linux-2.6.35.y/include/net/sock.h
===================================================================
--- linux-2.6.35.y.orig/include/net/sock.h
+++ linux-2.6.35.y/include/net/sock.h
@@ -1151,6 +1151,8 @@ extern void sk_common_release(struct soc
 /* Initialise core socket variables */
 extern void sock_init_data(struct socket *sock, struct sock *sk);
 
+extern void sk_filter_release_rcu(struct rcu_head *rcu);
+
 /**
  *	sk_filter_release - release a socket filter
  *	@fp: filter to remove
@@ -1161,7 +1163,7 @@ extern void sock_init_data(struct socket
 static inline void sk_filter_release(struct sk_filter *fp)
 {
 	if (atomic_dec_and_test(&fp->refcnt))
-		kfree(fp);
+		call_rcu_bh(&fp->rcu, sk_filter_release_rcu);
 }
 
 static inline void sk_filter_uncharge(struct sock *sk, struct sk_filter *fp)
Index: linux-2.6.35.y/net/core/filter.c
===================================================================
--- linux-2.6.35.y.orig/net/core/filter.c
+++ linux-2.6.35.y/net/core/filter.c
@@ -589,23 +589,16 @@ int sk_chk_filter(struct sock_filter *fi
 EXPORT_SYMBOL(sk_chk_filter);
 
 /**
- * 	sk_filter_rcu_release: Release a socket filter by rcu_head
+ * 	sk_filter_release_rcu - Release a socket filter by rcu_head
  *	@rcu: rcu_head that contains the sk_filter to free
  */
-static void sk_filter_rcu_release(struct rcu_head *rcu)
+void sk_filter_release_rcu(struct rcu_head *rcu)
 {
 	struct sk_filter *fp = container_of(rcu, struct sk_filter, rcu);
 
-	sk_filter_release(fp);
-}
-
-static void sk_filter_delayed_uncharge(struct sock *sk, struct sk_filter *fp)
-{
-	unsigned int size = sk_filter_len(fp);
-
-	atomic_sub(size, &sk->sk_omem_alloc);
-	call_rcu_bh(&fp->rcu, sk_filter_rcu_release);
+	kfree(fp);
 }
+EXPORT_SYMBOL(sk_filter_release_rcu);
 
 /**
  *	sk_attach_filter - attach a socket filter
@@ -650,7 +643,7 @@ int sk_attach_filter(struct sock_fprog *
 	rcu_read_unlock_bh();
 
 	if (old_fp)
-		sk_filter_delayed_uncharge(sk, old_fp);
+		sk_filter_uncharge(sk, old_fp);
 	return 0;
 }
 EXPORT_SYMBOL_GPL(sk_attach_filter);
@@ -664,7 +657,7 @@ int sk_detach_filter(struct sock *sk)
 	filter = rcu_dereference_bh(sk->sk_filter);
 	if (filter) {
 		rcu_assign_pointer(sk->sk_filter, NULL);
-		sk_filter_delayed_uncharge(sk, filter);
+		sk_filter_uncharge(sk, filter);
 		ret = 0;
 	}
 	rcu_read_unlock_bh();

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

* [PATCH] [66/139] econet: Do the correct cleanup after an unprivileged SIOCSIFADDR.
  2011-02-02  0:43 [PATCH] [0/139] 2.6.35.11 longterm review Andi Kleen
                   ` (64 preceding siblings ...)
  2011-02-02  0:44 ` [PATCH] [65/139] filter: fix sk_filter rcu handling Andi Kleen
@ 2011-02-02  0:44 ` Andi Kleen
  2011-02-02  0:44 ` [PATCH] [67/139] econet: Fix crash in aun_incoming() Andi Kleen
                   ` (73 subsequent siblings)
  139 siblings, 0 replies; 149+ messages in thread
From: Andi Kleen @ 2011-02-02  0:44 UTC (permalink / raw)
  To: nelhage, davem, gregkh, ak, linux-kernel, stable

2.6.35-longterm review patch.  If anyone has any objections, please let me know.

------------------

From: Nelson Elhage <nelhage@ksplice.com>

[ Upstream commit 0c62fc6dd02c8d793c75ae76a9b6881fc36388ad]

We need to drop the mutex and do a dev_put, so set an error code and break like
the other paths, instead of returning directly.

Signed-off-by: Nelson Elhage <nelhage@ksplice.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: Andi Kleen <ak@linux.intel.com>

---
 net/econet/af_econet.c |    6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

Index: linux-2.6.35.y/net/econet/af_econet.c
===================================================================
--- linux-2.6.35.y.orig/net/econet/af_econet.c
+++ linux-2.6.35.y/net/econet/af_econet.c
@@ -661,8 +661,10 @@ static int ec_dev_ioctl(struct socket *s
 	err = 0;
 	switch (cmd) {
 	case SIOCSIFADDR:
-		if (!capable(CAP_NET_ADMIN))
-			return -EPERM;
+		if (!capable(CAP_NET_ADMIN)) {
+			err = -EPERM;
+			break;
+		}
 
 		edev = dev->ec_ptr;
 		if (edev == NULL) {

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

* [PATCH] [67/139] econet: Fix crash in aun_incoming().
  2011-02-02  0:43 [PATCH] [0/139] 2.6.35.11 longterm review Andi Kleen
                   ` (65 preceding siblings ...)
  2011-02-02  0:44 ` [PATCH] [66/139] econet: Do the correct cleanup after an unprivileged SIOCSIFADDR Andi Kleen
@ 2011-02-02  0:44 ` Andi Kleen
  2011-02-02  0:44 ` [PATCH] [68/139] ifb: goto resched directly if error happens and dp->tq isn't empty Andi Kleen
                   ` (72 subsequent siblings)
  139 siblings, 0 replies; 149+ messages in thread
From: Andi Kleen @ 2011-02-02  0:44 UTC (permalink / raw)
  To: davem, nelhage, gregkh, ak, linux-kernel, stable

2.6.35-longterm review patch.  If anyone has any objections, please let me know.

------------------

From: David S. Miller <davem@davemloft.net>

[ Upstream commit 4e085e76cbe558b79b54cbab772f61185879bc64 ]

Unconditional use of skb->dev won't work here,
try to fetch the econet device via skb_dst()->dev
instead.

Suggested by Eric Dumazet.

Reported-by: Nelson Elhage <nelhage@ksplice.com>
Tested-by: Nelson Elhage <nelhage@ksplice.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: Andi Kleen <ak@linux.intel.com>

---
 net/econet/af_econet.c |    6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

Index: linux-2.6.35.y/net/econet/af_econet.c
===================================================================
--- linux-2.6.35.y.orig/net/econet/af_econet.c
+++ linux-2.6.35.y/net/econet/af_econet.c
@@ -849,7 +849,11 @@ static void aun_incoming(struct sk_buff 
 	unsigned char stn = ntohl(ip->saddr) & 0xff;
 	struct sock *sk;
 	struct sk_buff *newskb;
-	struct ec_device *edev = skb->dev->ec_ptr;
+	struct dst_entry *dst = skb_dst(skb);
+	struct ec_device *edev = NULL;
+
+	if (dst)
+		edev = dst->dev->ec_ptr;
 
 	if (! edev)
 		goto bad;

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

* [PATCH] [68/139] ifb: goto resched directly if error happens and dp->tq isn't empty
  2011-02-02  0:43 [PATCH] [0/139] 2.6.35.11 longterm review Andi Kleen
                   ` (66 preceding siblings ...)
  2011-02-02  0:44 ` [PATCH] [67/139] econet: Fix crash in aun_incoming() Andi Kleen
@ 2011-02-02  0:44 ` Andi Kleen
  2011-02-02  0:44 ` [PATCH] [69/139] l2tp: Fix modalias of l2tp_ip Andi Kleen
                   ` (71 subsequent siblings)
  139 siblings, 0 replies; 149+ messages in thread
From: Andi Kleen @ 2011-02-02  0:44 UTC (permalink / raw)
  To: xiaosuo, hadi, davem, gregkh, ak, linux-kernel, stable

2.6.35-longterm review patch.  If anyone has any objections, please let me know.

------------------

From: Changli Gao <xiaosuo@gmail.com>

[ Upstream commit 75c1c82566f23dd539fb7ccbf57a1caa7ba82628 ]

If we break the loop when there are still skbs in tq and no skb in
rq, the skbs will be left in txq until new skbs are enqueued into rq.
In rare cases, no new skb is queued, then these skbs will stay in rq
forever.

After this patch, if tq isn't empty when we break the loop, we goto
resched directly.

Signed-off-by: Changli Gao <xiaosuo@gmail.com>
Signed-off-by: Jamal Hadi Salim <hadi@cyberus.ca>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: Andi Kleen <ak@linux.intel.com>

---
 drivers/net/ifb.c |    2 ++
 1 file changed, 2 insertions(+)

Index: linux-2.6.35.y/drivers/net/ifb.c
===================================================================
--- linux-2.6.35.y.orig/drivers/net/ifb.c
+++ linux-2.6.35.y/drivers/net/ifb.c
@@ -104,6 +104,8 @@ static void ri_tasklet(unsigned long dev
 			rcu_read_unlock();
 			dev_kfree_skb(skb);
 			stats->tx_dropped++;
+			if (skb_queue_len(&dp->tq) != 0)
+				goto resched;
 			break;
 		}
 		rcu_read_unlock();

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

* [PATCH] [69/139] l2tp: Fix modalias of l2tp_ip
  2011-02-02  0:43 [PATCH] [0/139] 2.6.35.11 longterm review Andi Kleen
                   ` (67 preceding siblings ...)
  2011-02-02  0:44 ` [PATCH] [68/139] ifb: goto resched directly if error happens and dp->tq isn't empty Andi Kleen
@ 2011-02-02  0:44 ` Andi Kleen
  2011-02-02  0:44 ` [PATCH] [70/139] x25: decrement netdev reference counts on unload Andi Kleen
                   ` (70 subsequent siblings)
  139 siblings, 0 replies; 149+ messages in thread
From: Andi Kleen @ 2011-02-02  0:44 UTC (permalink / raw)
  To: mmarek, davem, gregkh, ak, linux-kernel, stable

2.6.35-longterm review patch.  If anyone has any objections, please let me know.

------------------

From: Michal Marek <mmarek@suse.cz>

[ Upstream commit e8d34a884e4ff118920bb57664def8a73b1b784f]

Using the SOCK_DGRAM enum results in
"net-pf-2-proto-SOCK_DGRAM-type-115", so use the numeric value like it
is done in net/dccp.

Signed-off-by: Michal Marek <mmarek@suse.cz>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: Andi Kleen <ak@linux.intel.com>

---
 net/l2tp/l2tp_ip.c |    6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

Index: linux-2.6.35.y/net/l2tp/l2tp_ip.c
===================================================================
--- linux-2.6.35.y.orig/net/l2tp/l2tp_ip.c
+++ linux-2.6.35.y/net/l2tp/l2tp_ip.c
@@ -676,4 +676,8 @@ MODULE_LICENSE("GPL");
 MODULE_AUTHOR("James Chapman <jchapman@katalix.com>");
 MODULE_DESCRIPTION("L2TP over IP");
 MODULE_VERSION("1.0");
-MODULE_ALIAS_NET_PF_PROTO_TYPE(PF_INET, SOCK_DGRAM, IPPROTO_L2TP);
+
+/* Use the value of SOCK_DGRAM (2) directory, because __stringify does't like
+ * enums
+ */
+MODULE_ALIAS_NET_PF_PROTO_TYPE(PF_INET, 2, IPPROTO_L2TP);

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

* [PATCH] [70/139] x25: decrement netdev reference counts on unload
  2011-02-02  0:43 [PATCH] [0/139] 2.6.35.11 longterm review Andi Kleen
                   ` (68 preceding siblings ...)
  2011-02-02  0:44 ` [PATCH] [69/139] l2tp: Fix modalias of l2tp_ip Andi Kleen
@ 2011-02-02  0:44 ` Andi Kleen
  2011-02-02  0:44 ` [PATCH] [71/139] tehuti: Firmware filename is tehuti/bdx.bin Andi Kleen
                   ` (69 subsequent siblings)
  139 siblings, 0 replies; 149+ messages in thread
From: Andi Kleen @ 2011-02-02  0:44 UTC (permalink / raw)
  To: apollon, davem, gregkh, ak, linux-kernel, stable

2.6.35-longterm review patch.  If anyone has any objections, please let me know.

------------------

From: Apollon Oikonomopoulos <apollon@noc.grnet.gr>

[ Upstream commit 171995e5d82dcc92bea37a7d2a2ecc21068a0f19]

x25 does not decrement the network device reference counts on module unload.
Thus unregistering any pre-existing interface after unloading the x25 module
hangs and results in

 unregister_netdevice: waiting for tap0 to become free. Usage count = 1

This patch decrements the reference counts of all interfaces in x25_link_free,
the way it is already done in x25_link_device_down for NETDEV_DOWN events.

Signed-off-by: Apollon Oikonomopoulos <apollon@noc.grnet.gr>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: Andi Kleen <ak@linux.intel.com>

---
 net/x25/x25_link.c |    1 +
 1 file changed, 1 insertion(+)

Index: linux-2.6.35.y/net/x25/x25_link.c
===================================================================
--- linux-2.6.35.y.orig/net/x25/x25_link.c
+++ linux-2.6.35.y/net/x25/x25_link.c
@@ -394,6 +394,7 @@ void __exit x25_link_free(void)
 	list_for_each_safe(entry, tmp, &x25_neigh_list) {
 		nb = list_entry(entry, struct x25_neigh, node);
 		__x25_remove_neigh(nb);
+		dev_put(nb->dev);
 	}
 	write_unlock_bh(&x25_neigh_list_lock);
 }

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

* [PATCH] [71/139] tehuti: Firmware filename is tehuti/bdx.bin
  2011-02-02  0:43 [PATCH] [0/139] 2.6.35.11 longterm review Andi Kleen
                   ` (69 preceding siblings ...)
  2011-02-02  0:44 ` [PATCH] [70/139] x25: decrement netdev reference counts on unload Andi Kleen
@ 2011-02-02  0:44 ` Andi Kleen
  2011-02-02  0:44 ` [PATCH] [72/139] net/dst: dst_dev_event() called after other notifiers Andi Kleen
                   ` (68 subsequent siblings)
  139 siblings, 0 replies; 149+ messages in thread
From: Andi Kleen @ 2011-02-02  0:44 UTC (permalink / raw)
  To: ben, andy, davem, gregkh, ak, linux-kernel, stable

2.6.35-longterm review patch.  If anyone has any objections, please let me know.

------------------

From: Ben Hutchings <ben@decadent.org.uk>

[ Upstream commit 46814e08d80f87449b5adb3d549a3cae6f9f8148 ]

My conversion of tehuti to use request_firmware() was confused about
the filename of the firmware blob.  Change the driver to match the
blob.

Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
Signed-off-by: Andy Gospodarek <andy@greyhouse.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: Andi Kleen <ak@linux.intel.com>

---
 drivers/net/tehuti.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Index: linux-2.6.35.y/drivers/net/tehuti.c
===================================================================
--- linux-2.6.35.y.orig/drivers/net/tehuti.c
+++ linux-2.6.35.y/drivers/net/tehuti.c
@@ -324,7 +324,7 @@ static int bdx_fw_load(struct bdx_priv *
 	ENTER;
 	master = READ_REG(priv, regINIT_SEMAPHORE);
 	if (!READ_REG(priv, regINIT_STATUS) && master) {
-		rc = request_firmware(&fw, "tehuti/firmware.bin", &priv->pdev->dev);
+		rc = request_firmware(&fw, "tehuti/bdx.bin", &priv->pdev->dev);
 		if (rc)
 			goto out;
 		bdx_tx_push_desc_safe(priv, (char *)fw->data, fw->size);
@@ -2516,4 +2516,4 @@ module_exit(bdx_module_exit);
 MODULE_LICENSE("GPL");
 MODULE_AUTHOR(DRIVER_AUTHOR);
 MODULE_DESCRIPTION(BDX_DRV_DESC);
-MODULE_FIRMWARE("tehuti/firmware.bin");
+MODULE_FIRMWARE("tehuti/bdx.bin");

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

* [PATCH] [72/139] net/dst: dst_dev_event() called after other notifiers
  2011-02-02  0:43 [PATCH] [0/139] 2.6.35.11 longterm review Andi Kleen
                   ` (70 preceding siblings ...)
  2011-02-02  0:44 ` [PATCH] [71/139] tehuti: Firmware filename is tehuti/bdx.bin Andi Kleen
@ 2011-02-02  0:44 ` Andi Kleen
  2011-02-02  0:44 ` [PATCH] [73/139] net: Fix header size check for GSO case in recvmsg (af_packet) Andi Kleen
                   ` (67 subsequent siblings)
  139 siblings, 0 replies; 149+ messages in thread
From: Andi Kleen @ 2011-02-02  0:44 UTC (permalink / raw)
  To: eric.dumazet, greearb, davem, gregkh, ak, linux-kernel, stable

2.6.35-longterm review patch.  If anyone has any objections, please let me know.

------------------

From: Eric Dumazet <eric.dumazet@gmail.com>

[ Upstream commit 332dd96f7ac15e937088fe11f15cfe0210e8edd1 ]

Followup of commit ef885afbf8a37689 (net: use rcu_barrier() in
rollback_registered_many)

dst_dev_event() scans a garbage dst list that might be feeded by various
network notifiers at device dismantle time.

Its important to call dst_dev_event() after other notifiers, or we might
enter the infamous msleep(250) in netdev_wait_allrefs(), and wait one
second before calling again call_netdevice_notifiers(NETDEV_UNREGISTER,
dev) to properly remove last device references.

Use priority -10 to let dst_dev_notifier be called after other network
notifiers (they have the default 0 priority)

Reported-by: Ben Greear <greearb@candelatech.com>
Reported-by: Nicolas Dichtel <nicolas.dichtel@6wind.com>
Reported-by: Octavian Purdila <opurdila@ixiacom.com>
Reported-by: Benjamin LaHaise <bcrl@kvack.org>
Tested-by: Ben Greear <greearb@candelatech.com>
Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: Andi Kleen <ak@linux.intel.com>

---
 net/core/dst.c |    1 +
 1 file changed, 1 insertion(+)

Index: linux-2.6.35.y/net/core/dst.c
===================================================================
--- linux-2.6.35.y.orig/net/core/dst.c
+++ linux-2.6.35.y/net/core/dst.c
@@ -343,6 +343,7 @@ static int dst_dev_event(struct notifier
 
 static struct notifier_block dst_dev_notifier = {
 	.notifier_call	= dst_dev_event,
+	.priority = -10, /* must be called after other network notifiers */
 };
 
 void __init dst_init(void)

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

* [PATCH] [73/139] net: Fix header size check for GSO case in recvmsg (af_packet)
  2011-02-02  0:43 [PATCH] [0/139] 2.6.35.11 longterm review Andi Kleen
                   ` (71 preceding siblings ...)
  2011-02-02  0:44 ` [PATCH] [72/139] net/dst: dst_dev_event() called after other notifiers Andi Kleen
@ 2011-02-02  0:44 ` Andi Kleen
  2011-02-02  0:44 ` [PATCH] [74/139] net: packet: fix information leak to userland Andi Kleen
                   ` (66 subsequent siblings)
  139 siblings, 0 replies; 149+ messages in thread
From: Andi Kleen @ 2011-02-02  0:44 UTC (permalink / raw)
  To: mk, davem, gregkh, ak, linux-kernel, stable

2.6.35-longterm review patch.  If anyone has any objections, please let me know.

------------------

From: Mariusz Kozlowski <mk@lab.zgora.pl>

[ Upstream commit 1f18b7176e2e41fada24584ce3c80e9abfaca52b]

Parameter 'len' is size_t type so it will never get negative.

Signed-off-by: Mariusz Kozlowski <mk@lab.zgora.pl>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: Andi Kleen <ak@linux.intel.com>

---
 net/packet/af_packet.c |    4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

Index: linux-2.6.35.y/net/packet/af_packet.c
===================================================================
--- linux-2.6.35.y.orig/net/packet/af_packet.c
+++ linux-2.6.35.y/net/packet/af_packet.c
@@ -1595,9 +1595,11 @@ static int packet_recvmsg(struct kiocb *
 
 		err = -EINVAL;
 		vnet_hdr_len = sizeof(vnet_hdr);
-		if ((len -= vnet_hdr_len) < 0)
+		if (len < vnet_hdr_len)
 			goto out_free;
 
+		len -= vnet_hdr_len;
+
 		if (skb_is_gso(skb)) {
 			struct skb_shared_info *sinfo = skb_shinfo(skb);
 

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

* [PATCH] [74/139] net: packet: fix information leak to userland
  2011-02-02  0:43 [PATCH] [0/139] 2.6.35.11 longterm review Andi Kleen
                   ` (72 preceding siblings ...)
  2011-02-02  0:44 ` [PATCH] [73/139] net: Fix header size check for GSO case in recvmsg (af_packet) Andi Kleen
@ 2011-02-02  0:44 ` Andi Kleen
  2011-02-02  0:44 ` [PATCH] [75/139] ACPICA: Fix Scope() op in module level code Andi Kleen
                   ` (65 subsequent siblings)
  139 siblings, 0 replies; 149+ messages in thread
From: Andi Kleen @ 2011-02-02  0:44 UTC (permalink / raw)
  To: segooon, davem, gregkh, ak, linux-kernel, stable

2.6.35-longterm review patch.  If anyone has any objections, please let me know.

------------------

From: Vasiliy Kulikov <segooon@gmail.com>

[ Upstream commit 67286640f638f5ad41a946b9a3dc75327950248f ]

packet_getname_spkt() doesn't initialize all members of sa_data field of
sockaddr struct if strlen(dev->name) < 13.  This structure is then copied
to userland.  It leads to leaking of contents of kernel stack memory.
We have to fully fill sa_data with strncpy() instead of strlcpy().

The same with packet_getname(): it doesn't initialize sll_pkttype field of
sockaddr_ll.  Set it to zero.

Signed-off-by: Vasiliy Kulikov <segooon@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: Andi Kleen <ak@linux.intel.com>

---
 net/packet/af_packet.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Index: linux-2.6.35.y/net/packet/af_packet.c
===================================================================
--- linux-2.6.35.y.orig/net/packet/af_packet.c
+++ linux-2.6.35.y/net/packet/af_packet.c
@@ -1706,7 +1706,7 @@ static int packet_getname_spkt(struct so
 	rcu_read_lock();
 	dev = dev_get_by_index_rcu(sock_net(sk), pkt_sk(sk)->ifindex);
 	if (dev)
-		strlcpy(uaddr->sa_data, dev->name, 15);
+		strncpy(uaddr->sa_data, dev->name, 14);
 	else
 		memset(uaddr->sa_data, 0, 14);
 	rcu_read_unlock();
@@ -1729,6 +1729,7 @@ static int packet_getname(struct socket 
 	sll->sll_family = AF_PACKET;
 	sll->sll_ifindex = po->ifindex;
 	sll->sll_protocol = po->num;
+	sll->sll_pkttype = 0;
 	rcu_read_lock();
 	dev = dev_get_by_index_rcu(sock_net(sk), po->ifindex);
 	if (dev) {

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

* [PATCH] [75/139] ACPICA: Fix Scope() op in module level code
  2011-02-02  0:43 [PATCH] [0/139] 2.6.35.11 longterm review Andi Kleen
                   ` (73 preceding siblings ...)
  2011-02-02  0:44 ` [PATCH] [74/139] net: packet: fix information leak to userland Andi Kleen
@ 2011-02-02  0:44 ` Andi Kleen
  2011-02-02  0:44 ` [PATCH] [76/139] nouveau: Acknowledge HPD irq in handler, not bottom half Andi Kleen
                   ` (64 subsequent siblings)
  139 siblings, 0 replies; 149+ messages in thread
From: Andi Kleen @ 2011-02-02  0:44 UTC (permalink / raw)
  To: robert.moore, ming.m.lin, len.brown, gregkh, ak, linux-kernel, stable

2.6.35-longterm review patch.  If anyone has any objections, please let me know.

------------------
From: Bob Moore <robert.moore@intel.com>

commit 8df3fc981dc12d9fdcaef4100a2193b605024d7a upstream.

Some Panasonic Toughbooks create nodes in module level code.
Module level code is the executable AML code outside of control method,
for example, below AML code creates a node \_SB.PCI0.GFX0.DD02.CUBL

        If (\_OSI ("Windows 2006"))
        {
            Scope (\_SB.PCI0.GFX0.DD02)
            {
                Name (CUBL, Ones)
                ...
            }
        }

Scope() op does not actually create a new object, it refers to an
existing object(\_SB.PCI0.GFX0.DD02 in above example). However, for
Scope(), we want to indeed open a new scope, so the child nodes(CUBL in
above example) can be created correctly under it.

https://bugzilla.kernel.org/show_bug.cgi?id=19462

Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Lin Ming <ming.m.lin@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: Andi Kleen <ak@linux.intel.com>

---
 drivers/acpi/acpica/dswexec.c |   19 +++++++++++++++++--
 1 file changed, 17 insertions(+), 2 deletions(-)

Index: linux-2.6.35.y/drivers/acpi/acpica/dswexec.c
===================================================================
--- linux-2.6.35.y.orig/drivers/acpi/acpica/dswexec.c
+++ linux-2.6.35.y/drivers/acpi/acpica/dswexec.c
@@ -300,10 +300,25 @@ acpi_ds_exec_begin_op(struct acpi_walk_s
 			 * we must enter this object into the namespace.  The created
 			 * object is temporary and will be deleted upon completion of
 			 * the execution of this method.
+			 *
+			 * Note 10/2010: Except for the Scope() op. This opcode does
+			 * not actually create a new object, it refers to an existing
+			 * object. However, for Scope(), we want to indeed open a
+			 * new scope.
 			 */
-			status = acpi_ds_load2_begin_op(walk_state, NULL);
+			if (op->common.aml_opcode != AML_SCOPE_OP) {
+				status =
+				    acpi_ds_load2_begin_op(walk_state, NULL);
+			} else {
+				status =
+				    acpi_ds_scope_stack_push(op->named.node,
+							     op->named.node->
+							     type, walk_state);
+				if (ACPI_FAILURE(status)) {
+					return_ACPI_STATUS(status);
+				}
+			}
 		}
-
 		break;
 
 	case AML_CLASS_EXECUTE:

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

* [PATCH] [76/139] nouveau: Acknowledge HPD irq in handler, not bottom half
  2011-02-02  0:43 [PATCH] [0/139] 2.6.35.11 longterm review Andi Kleen
                   ` (74 preceding siblings ...)
  2011-02-02  0:44 ` [PATCH] [75/139] ACPICA: Fix Scope() op in module level code Andi Kleen
@ 2011-02-02  0:44 ` Andi Kleen
  2011-02-02  0:44 ` [PATCH] [77/139] printk: Fix wake_up_klogd() vs cpu hotplug Andi Kleen
                   ` (63 subsequent siblings)
  139 siblings, 0 replies; 149+ messages in thread
From: Andi Kleen @ 2011-02-02  0:44 UTC (permalink / raw)
  To: luto, bskeggs, gregkh, ak, linux-kernel, stable

2.6.35-longterm review patch.  If anyone has any objections, please let me know.

------------------
From: Andy Lutomirski <luto@mit.edu>

commit ab838338a2a9e0cb8346eb0cab9977be13e8dce5 upstream.

The old code generated an interrupt storm bad enough to completely
take down my system.

Signed-off-by: Andy Lutomirski <luto@mit.edu>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: Andi Kleen <ak@linux.intel.com>

---
 drivers/gpu/drm/nouveau/nouveau_drv.h  |    6 +++++
 drivers/gpu/drm/nouveau/nouveau_irq.c  |    1 
 drivers/gpu/drm/nouveau/nv50_display.c |   35 ++++++++++++++++++++++++---------
 3 files changed, 33 insertions(+), 9 deletions(-)

Index: linux-2.6.35.y/drivers/gpu/drm/nouveau/nouveau_drv.h
===================================================================
--- linux-2.6.35.y.orig/drivers/gpu/drm/nouveau/nouveau_drv.h
+++ linux-2.6.35.y/drivers/gpu/drm/nouveau/nouveau_drv.h
@@ -522,6 +522,12 @@ struct drm_nouveau_private {
 	struct work_struct irq_work;
 	struct work_struct hpd_work;
 
+	struct {
+		spinlock_t lock;
+		uint32_t hpd0_bits;
+		uint32_t hpd1_bits;
+	} hpd_state;
+
 	struct list_head vbl_waiting;
 
 	struct {
Index: linux-2.6.35.y/drivers/gpu/drm/nouveau/nouveau_irq.c
===================================================================
--- linux-2.6.35.y.orig/drivers/gpu/drm/nouveau/nouveau_irq.c
+++ linux-2.6.35.y/drivers/gpu/drm/nouveau/nouveau_irq.c
@@ -52,6 +52,7 @@ nouveau_irq_preinstall(struct drm_device
 	if (dev_priv->card_type == NV_50) {
 		INIT_WORK(&dev_priv->irq_work, nv50_display_irq_handler_bh);
 		INIT_WORK(&dev_priv->hpd_work, nv50_display_irq_hotplug_bh);
+		spin_lock_init(&dev_priv->hpd_state.lock);
 		INIT_LIST_HEAD(&dev_priv->vbl_waiting);
 	}
 }
Index: linux-2.6.35.y/drivers/gpu/drm/nouveau/nv50_display.c
===================================================================
--- linux-2.6.35.y.orig/drivers/gpu/drm/nouveau/nv50_display.c
+++ linux-2.6.35.y/drivers/gpu/drm/nouveau/nv50_display.c
@@ -930,11 +930,18 @@ nv50_display_irq_hotplug_bh(struct work_
 	struct drm_connector *connector;
 	const uint32_t gpio_reg[4] = { 0xe104, 0xe108, 0xe280, 0xe284 };
 	uint32_t unplug_mask, plug_mask, change_mask;
-	uint32_t hpd0, hpd1 = 0;
+	uint32_t hpd0, hpd1;
 
-	hpd0 = nv_rd32(dev, 0xe054) & nv_rd32(dev, 0xe050);
+	spin_lock_irq(&dev_priv->hpd_state.lock);
+	hpd0 = dev_priv->hpd_state.hpd0_bits;
+	dev_priv->hpd_state.hpd0_bits = 0;
+	hpd1 = dev_priv->hpd_state.hpd1_bits;
+	dev_priv->hpd_state.hpd1_bits = 0;
+	spin_unlock_irq(&dev_priv->hpd_state.lock);
+
+	hpd0 &= nv_rd32(dev, 0xe050);
 	if (dev_priv->chipset >= 0x90)
-		hpd1 = nv_rd32(dev, 0xe074) & nv_rd32(dev, 0xe070);
+		hpd1 &= nv_rd32(dev, 0xe070);
 
 	plug_mask   = (hpd0 & 0x0000ffff) | (hpd1 << 16);
 	unplug_mask = (hpd0 >> 16) | (hpd1 & 0xffff0000);
@@ -976,10 +983,6 @@ nv50_display_irq_hotplug_bh(struct work_
 			helper->dpms(connector->encoder, DRM_MODE_DPMS_OFF);
 	}
 
-	nv_wr32(dev, 0xe054, nv_rd32(dev, 0xe054));
-	if (dev_priv->chipset >= 0x90)
-		nv_wr32(dev, 0xe074, nv_rd32(dev, 0xe074));
-
 	drm_helper_hpd_irq_event(dev);
 }
 
@@ -990,8 +993,22 @@ nv50_display_irq_handler(struct drm_devi
 	uint32_t delayed = 0;
 
 	if (nv_rd32(dev, NV50_PMC_INTR_0) & NV50_PMC_INTR_0_HOTPLUG) {
-		if (!work_pending(&dev_priv->hpd_work))
-			queue_work(dev_priv->wq, &dev_priv->hpd_work);
+		uint32_t hpd0_bits, hpd1_bits = 0;
+
+		hpd0_bits = nv_rd32(dev, 0xe054);
+		nv_wr32(dev, 0xe054, hpd0_bits);
+
+		if (dev_priv->chipset >= 0x90) {
+			hpd1_bits = nv_rd32(dev, 0xe074);
+			nv_wr32(dev, 0xe074, hpd1_bits);
+		}
+
+		spin_lock(&dev_priv->hpd_state.lock);
+		dev_priv->hpd_state.hpd0_bits |= hpd0_bits;
+		dev_priv->hpd_state.hpd1_bits |= hpd1_bits;
+		spin_unlock(&dev_priv->hpd_state.lock);
+
+		queue_work(dev_priv->wq, &dev_priv->hpd_work);
 	}
 
 	while (nv_rd32(dev, NV50_PMC_INTR_0) & NV50_PMC_INTR_0_DISPLAY) {

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

* [PATCH] [77/139] printk: Fix wake_up_klogd() vs cpu hotplug
  2011-02-02  0:43 [PATCH] [0/139] 2.6.35.11 longterm review Andi Kleen
                   ` (75 preceding siblings ...)
  2011-02-02  0:44 ` [PATCH] [76/139] nouveau: Acknowledge HPD irq in handler, not bottom half Andi Kleen
@ 2011-02-02  0:44 ` Andi Kleen
  2011-02-02  0:44 ` [PATCH] [78/139] xen: Provide a variant of __RING_SIZE() that is an integer constant expression Andi Kleen
                   ` (62 subsequent siblings)
  139 siblings, 0 replies; 149+ messages in thread
From: Andi Kleen @ 2011-02-02  0:44 UTC (permalink / raw)
  To: heiko.carstens, eric.dumazet, a.p.zijlstra, ak, mingo, gregkh,
	linux-kernel, stable

2.6.35-longterm review patch.  If anyone has any objections, please let me know.

------------------
From: Heiko Carstens <heiko.carstens@de.ibm.com>

commit 49f4138346b3cec2706adff02658fe27ceb1e46f upstream.

wake_up_klogd() may get called from preemptible context but uses
__raw_get_cpu_var() to write to a per cpu variable. If it gets preempted
between getting the address and writing to it, the cpu in question could be
offline if the process gets scheduled back and hence writes to the per cpu data
of an offline cpu.

This buggy behaviour was introduced with fa33507a "printk: robustify
printk, fix #2" which was supposed to fix a "using smp_processor_id() in
preemptible" warning.

Let's use this_cpu_write() instead which disables preemption and makes sure
that the outlined scenario cannot happen.

Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Acked-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
Signed-off-by: Andi Kleen <ak@linux.intel.com>
LKML-Reference: <20101126124247.GC7023@osiris.boeblingen.de.ibm.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

---
 kernel/printk.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Index: linux-2.6.35.y/kernel/printk.c
===================================================================
--- linux-2.6.35.y.orig/kernel/printk.c
+++ linux-2.6.35.y/kernel/printk.c
@@ -1042,7 +1042,7 @@ int printk_needs_cpu(int cpu)
 void wake_up_klogd(void)
 {
 	if (waitqueue_active(&log_wait))
-		__raw_get_cpu_var(printk_pending) = 1;
+		this_cpu_write(printk_pending, 1);
 }
 
 /**

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

* [PATCH] [78/139] xen: Provide a variant of __RING_SIZE() that is an integer constant expression
  2011-02-02  0:43 [PATCH] [0/139] 2.6.35.11 longterm review Andi Kleen
                   ` (76 preceding siblings ...)
  2011-02-02  0:44 ` [PATCH] [77/139] printk: Fix wake_up_klogd() vs cpu hotplug Andi Kleen
@ 2011-02-02  0:44 ` Andi Kleen
  2011-02-02  0:44 ` [PATCH] [79/139] sched: Cure more NO_HZ load average woes Andi Kleen
                   ` (61 subsequent siblings)
  139 siblings, 0 replies; 149+ messages in thread
From: Andi Kleen @ 2011-02-02  0:44 UTC (permalink / raw)
  To: jeremy, jbeulich, jeremy.fitzhardinge, ak, axboe, davem,
	torvalds, gregkh, linux-kernel, stable

2.6.35-longterm review patch.  If anyone has any objections, please let me know.

------------------
From: Jeremy Fitzhardinge <jeremy@goop.org>

commit 667c78afaec0ac500908e191e8f236e9578d7b1f upstream.

Without this, gcc 4.5 won't compile xen-netfront and xen-blkfront, where
this is being used to specify array sizes.

Signed-off-by: Jan Beulich <jbeulich@novell.com>
Signed-off-by: Jeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com>
Signed-off-by: Andi Kleen <ak@linux.intel.com>
Cc: Jens Axboe <axboe@kernel.dk>
Cc: David Miller <davem@davemloft.net>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

---
 drivers/block/xen-blkfront.c    |    2 +-
 drivers/net/xen-netfront.c      |    4 ++--
 include/xen/interface/io/ring.h |   11 +++++++++--
 3 files changed, 12 insertions(+), 5 deletions(-)

Index: linux-2.6.35.y/drivers/block/xen-blkfront.c
===================================================================
--- linux-2.6.35.y.orig/drivers/block/xen-blkfront.c
+++ linux-2.6.35.y/drivers/block/xen-blkfront.c
@@ -69,7 +69,7 @@ struct blk_shadow {
 
 static const struct block_device_operations xlvbd_block_fops;
 
-#define BLK_RING_SIZE __RING_SIZE((struct blkif_sring *)0, PAGE_SIZE)
+#define BLK_RING_SIZE __CONST_RING_SIZE(blkif, PAGE_SIZE)
 
 /*
  * We have one of these per vbd, whether ide, scsi or 'other'.  They
Index: linux-2.6.35.y/drivers/net/xen-netfront.c
===================================================================
--- linux-2.6.35.y.orig/drivers/net/xen-netfront.c
+++ linux-2.6.35.y/drivers/net/xen-netfront.c
@@ -66,8 +66,8 @@ struct netfront_cb {
 
 #define GRANT_INVALID_REF	0
 
-#define NET_TX_RING_SIZE __RING_SIZE((struct xen_netif_tx_sring *)0, PAGE_SIZE)
-#define NET_RX_RING_SIZE __RING_SIZE((struct xen_netif_rx_sring *)0, PAGE_SIZE)
+#define NET_TX_RING_SIZE __CONST_RING_SIZE(xen_netif_tx, PAGE_SIZE)
+#define NET_RX_RING_SIZE __CONST_RING_SIZE(xen_netif_rx, PAGE_SIZE)
 #define TX_MAX_TARGET min_t(int, NET_RX_RING_SIZE, 256)
 
 struct netfront_info {
Index: linux-2.6.35.y/include/xen/interface/io/ring.h
===================================================================
--- linux-2.6.35.y.orig/include/xen/interface/io/ring.h
+++ linux-2.6.35.y/include/xen/interface/io/ring.h
@@ -24,8 +24,15 @@ typedef unsigned int RING_IDX;
  * A ring contains as many entries as will fit, rounded down to the nearest
  * power of two (so we can mask with (size-1) to loop around).
  */
-#define __RING_SIZE(_s, _sz) \
-    (__RD32(((_sz) - (long)&(_s)->ring + (long)(_s)) / sizeof((_s)->ring[0])))
+#define __CONST_RING_SIZE(_s, _sz)				\
+	(__RD32(((_sz) - offsetof(struct _s##_sring, ring)) /	\
+		sizeof(((struct _s##_sring *)0)->ring[0])))
+
+/*
+ * The same for passing in an actual pointer instead of a name tag.
+ */
+#define __RING_SIZE(_s, _sz)						\
+	(__RD32(((_sz) - (long)&(_s)->ring + (long)(_s)) / sizeof((_s)->ring[0])))
 
 /*
  * Macros to make the correct C datatypes for a new kind of ring.

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

* [PATCH] [79/139] sched: Cure more NO_HZ load average woes
  2011-02-02  0:43 [PATCH] [0/139] 2.6.35.11 longterm review Andi Kleen
                   ` (77 preceding siblings ...)
  2011-02-02  0:44 ` [PATCH] [78/139] xen: Provide a variant of __RING_SIZE() that is an integer constant expression Andi Kleen
@ 2011-02-02  0:44 ` Andi Kleen
  2011-02-02  0:44 ` [PATCH] [80/139] ACPI: EC: Add another dmi match entry for MSI hardware Andi Kleen
                   ` (60 subsequent siblings)
  139 siblings, 0 replies; 149+ messages in thread
From: Andi Kleen @ 2011-02-02  0:44 UTC (permalink / raw)
  To: a.p.zijlstra, damien.wyart, orion, kyle, ak, chase.douglas,
	mingo, gregkh, linux-kernel, stable

2.6.35-longterm review patch.  If anyone has any objections, please let me know.

------------------
From: Peter Zijlstra <a.p.zijlstra@chello.nl>

commit 0f004f5a696a9434b7214d0d3cbd0525ee77d428 upstream.

There's a long-running regression that proved difficult to fix and
which is hitting certain people and is rather annoying in its effects.

Damien reported that after 74f5187ac8 (sched: Cure load average vs
NO_HZ woes) his load average is unnaturally high, he also noted that
even with that patch reverted the load avgerage numbers are not
correct.

The problem is that the previous patch only solved half the NO_HZ
problem, it addressed the part of going into NO_HZ mode, not of
comming out of NO_HZ mode. This patch implements that missing half.

When comming out of NO_HZ mode there are two important things to take
care of:

 - Folding the pending idle delta into the global active count.
 - Correctly aging the averages for the idle-duration.

So with this patch the NO_HZ interaction should be complete and
behaviour between CONFIG_NO_HZ=[yn] should be equivalent.

Furthermore, this patch slightly changes the load average computation
by adding a rounding term to the fixed point multiplication.

Reported-by: Damien Wyart <damien.wyart@free.fr>
Reported-by: Tim McGrath <tmhikaru@gmail.com>
Tested-by: Damien Wyart <damien.wyart@free.fr>
Tested-by: Orion Poplawski <orion@cora.nwra.com>
Tested-by: Kyle McMartin <kyle@mcmartin.ca>
Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
Signed-off-by: Andi Kleen <ak@linux.intel.com>
Cc: Chase Douglas <chase.douglas@canonical.com>
LKML-Reference: <1291129145.32004.874.camel@laptop>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

---
 include/linux/sched.h |    2 
 kernel/sched.c        |  150 ++++++++++++++++++++++++++++++++++++++++++++++----
 kernel/timer.c        |    2 
 3 files changed, 141 insertions(+), 13 deletions(-)

Index: linux-2.6.35.y/include/linux/sched.h
===================================================================
--- linux-2.6.35.y.orig/include/linux/sched.h
+++ linux-2.6.35.y/include/linux/sched.h
@@ -143,7 +143,7 @@ extern unsigned long nr_iowait_cpu(int c
 extern unsigned long this_cpu_load(void);
 
 
-extern void calc_global_load(void);
+extern void calc_global_load(unsigned long ticks);
 
 extern unsigned long get_parent_ip(unsigned long addr);
 
Index: linux-2.6.35.y/kernel/sched.c
===================================================================
--- linux-2.6.35.y.orig/kernel/sched.c
+++ linux-2.6.35.y/kernel/sched.c
@@ -2890,6 +2890,15 @@ static long calc_load_fold_active(struct
 	return delta;
 }
 
+static unsigned long
+calc_load(unsigned long load, unsigned long exp, unsigned long active)
+{
+	load *= exp;
+	load += active * (FIXED_1 - exp);
+	load += 1UL << (FSHIFT - 1);
+	return load >> FSHIFT;
+}
+
 #ifdef CONFIG_NO_HZ
 /*
  * For NO_HZ we delay the active fold to the next LOAD_FREQ update.
@@ -2919,6 +2928,128 @@ static long calc_load_fold_idle(void)
 
 	return delta;
 }
+
+/**
+ * fixed_power_int - compute: x^n, in O(log n) time
+ *
+ * @x:         base of the power
+ * @frac_bits: fractional bits of @x
+ * @n:         power to raise @x to.
+ *
+ * By exploiting the relation between the definition of the natural power
+ * function: x^n := x*x*...*x (x multiplied by itself for n times), and
+ * the binary encoding of numbers used by computers: n := \Sum n_i * 2^i,
+ * (where: n_i \elem {0, 1}, the binary vector representing n),
+ * we find: x^n := x^(\Sum n_i * 2^i) := \Prod x^(n_i * 2^i), which is
+ * of course trivially computable in O(log_2 n), the length of our binary
+ * vector.
+ */
+static unsigned long
+fixed_power_int(unsigned long x, unsigned int frac_bits, unsigned int n)
+{
+	unsigned long result = 1UL << frac_bits;
+
+	if (n) for (;;) {
+		if (n & 1) {
+			result *= x;
+			result += 1UL << (frac_bits - 1);
+			result >>= frac_bits;
+		}
+		n >>= 1;
+		if (!n)
+			break;
+		x *= x;
+		x += 1UL << (frac_bits - 1);
+		x >>= frac_bits;
+	}
+
+	return result;
+}
+
+/*
+ * a1 = a0 * e + a * (1 - e)
+ *
+ * a2 = a1 * e + a * (1 - e)
+ *    = (a0 * e + a * (1 - e)) * e + a * (1 - e)
+ *    = a0 * e^2 + a * (1 - e) * (1 + e)
+ *
+ * a3 = a2 * e + a * (1 - e)
+ *    = (a0 * e^2 + a * (1 - e) * (1 + e)) * e + a * (1 - e)
+ *    = a0 * e^3 + a * (1 - e) * (1 + e + e^2)
+ *
+ *  ...
+ *
+ * an = a0 * e^n + a * (1 - e) * (1 + e + ... + e^n-1) [1]
+ *    = a0 * e^n + a * (1 - e) * (1 - e^n)/(1 - e)
+ *    = a0 * e^n + a * (1 - e^n)
+ *
+ * [1] application of the geometric series:
+ *
+ *              n         1 - x^(n+1)
+ *     S_n := \Sum x^i = -------------
+ *             i=0          1 - x
+ */
+static unsigned long
+calc_load_n(unsigned long load, unsigned long exp,
+	    unsigned long active, unsigned int n)
+{
+
+	return calc_load(load, fixed_power_int(exp, FSHIFT, n), active);
+}
+
+/*
+ * NO_HZ can leave us missing all per-cpu ticks calling
+ * calc_load_account_active(), but since an idle CPU folds its delta into
+ * calc_load_tasks_idle per calc_load_account_idle(), all we need to do is fold
+ * in the pending idle delta if our idle period crossed a load cycle boundary.
+ *
+ * Once we've updated the global active value, we need to apply the exponential
+ * weights adjusted to the number of cycles missed.
+ */
+static void calc_global_nohz(unsigned long ticks)
+{
+	long delta, active, n;
+
+	if (time_before(jiffies, calc_load_update))
+		return;
+
+	/*
+	 * If we crossed a calc_load_update boundary, make sure to fold
+	 * any pending idle changes, the respective CPUs might have
+	 * missed the tick driven calc_load_account_active() update
+	 * due to NO_HZ.
+	 */
+	delta = calc_load_fold_idle();
+	if (delta)
+		atomic_long_add(delta, &calc_load_tasks);
+
+	/*
+	 * If we were idle for multiple load cycles, apply them.
+	 */
+	if (ticks >= LOAD_FREQ) {
+		n = ticks / LOAD_FREQ;
+
+		active = atomic_long_read(&calc_load_tasks);
+		active = active > 0 ? active * FIXED_1 : 0;
+
+		avenrun[0] = calc_load_n(avenrun[0], EXP_1, active, n);
+		avenrun[1] = calc_load_n(avenrun[1], EXP_5, active, n);
+		avenrun[2] = calc_load_n(avenrun[2], EXP_15, active, n);
+
+		calc_load_update += n * LOAD_FREQ;
+	}
+
+	/*
+	 * Its possible the remainder of the above division also crosses
+	 * a LOAD_FREQ period, the regular check in calc_global_load()
+	 * which comes after this will take care of that.
+	 *
+	 * Consider us being 11 ticks before a cycle completion, and us
+	 * sleeping for 4*LOAD_FREQ + 22 ticks, then the above code will
+	 * age us 4 cycles, and the test in calc_global_load() will
+	 * pick up the final one.
+	 */
+}
 #else
 static void calc_load_account_idle(struct rq *this_rq)
 {
@@ -2928,6 +3059,10 @@ static inline long calc_load_fold_idle(v
 {
 	return 0;
 }
+
+static void calc_global_nohz(unsigned long ticks)
+{
+}
 #endif
 
 /**
@@ -2945,24 +3080,17 @@ void get_avenrun(unsigned long *loads, u
 	loads[2] = (avenrun[2] + offset) << shift;
 }
 
-static unsigned long
-calc_load(unsigned long load, unsigned long exp, unsigned long active)
-{
-	load *= exp;
-	load += active * (FIXED_1 - exp);
-	return load >> FSHIFT;
-}
-
 /*
  * calc_load - update the avenrun load estimates 10 ticks after the
  * CPUs have updated calc_load_tasks.
  */
-void calc_global_load(void)
+void calc_global_load(unsigned long ticks)
 {
-	unsigned long upd = calc_load_update + 10;
 	long active;
 
-	if (time_before(jiffies, upd))
+	calc_global_nohz(ticks);
+
+	if (time_before(jiffies, calc_load_update + 10))
 		return;
 
 	active = atomic_long_read(&calc_load_tasks);
Index: linux-2.6.35.y/kernel/timer.c
===================================================================
--- linux-2.6.35.y.orig/kernel/timer.c
+++ linux-2.6.35.y/kernel/timer.c
@@ -1308,7 +1308,7 @@ void do_timer(unsigned long ticks)
 {
 	jiffies_64 += ticks;
 	update_wall_time();
-	calc_global_load();
+	calc_global_load(ticks);
 }
 
 #ifdef __ARCH_WANT_SYS_ALARM

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

* [PATCH] [80/139] ACPI: EC: Add another dmi match entry for MSI hardware
  2011-02-02  0:43 [PATCH] [0/139] 2.6.35.11 longterm review Andi Kleen
                   ` (78 preceding siblings ...)
  2011-02-02  0:44 ` [PATCH] [79/139] sched: Cure more NO_HZ load average woes Andi Kleen
@ 2011-02-02  0:44 ` Andi Kleen
  2011-02-02  0:44 ` [PATCH] [81/139] PM / Runtime: Fix pm_runtime_suspended() Andi Kleen
                   ` (59 subsequent siblings)
  139 siblings, 0 replies; 149+ messages in thread
From: Andi Kleen @ 2011-02-02  0:44 UTC (permalink / raw)
  To: astarikovskiy, len.brown, gregkh, ak, linux-kernel, stable

2.6.35-longterm review patch.  If anyone has any objections, please let me know.

------------------
From: Alexey Starikovskiy <astarikovskiy@suse.de>

commit a5dc4f898c2a0f66e2cefada6c687db82ba2fcbc upstream.

http://bugzilla.kernel.org/show_bug.cgi?id=15418

Signed-off-by: Alexey Starikovskiy <astarikovskiy@suse.de>
Signed-off-by: Len Brown <len.brown@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: Andi Kleen <ak@linux.intel.com>

---
 drivers/acpi/ec.c |    3 +++
 1 file changed, 3 insertions(+)

Index: linux-2.6.35.y/drivers/acpi/ec.c
===================================================================
--- linux-2.6.35.y.orig/drivers/acpi/ec.c
+++ linux-2.6.35.y/drivers/acpi/ec.c
@@ -1006,6 +1006,9 @@ static struct dmi_system_id __initdata e
 	ec_flag_msi, "MSI hardware", {
 	DMI_MATCH(DMI_CHASSIS_VENDOR, "MICRO-Star")}, NULL},
 	{
+	ec_flag_msi, "MSI hardware", {
+	DMI_MATCH(DMI_CHASSIS_VENDOR, "MICRO-STAR")}, NULL},
+	{
 	ec_validate_ecdt, "ASUS hardware", {
 	DMI_MATCH(DMI_BIOS_VENDOR, "ASUS") }, NULL},
 	{},

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

* [PATCH] [81/139] PM / Runtime: Fix pm_runtime_suspended()
  2011-02-02  0:43 [PATCH] [0/139] 2.6.35.11 longterm review Andi Kleen
                   ` (79 preceding siblings ...)
  2011-02-02  0:44 ` [PATCH] [80/139] ACPI: EC: Add another dmi match entry for MSI hardware Andi Kleen
@ 2011-02-02  0:44 ` Andi Kleen
  2011-02-02  0:44 ` [PATCH] [82/139] inotify: stop kernel memory leak on file creation failure Andi Kleen
                   ` (58 subsequent siblings)
  139 siblings, 0 replies; 149+ messages in thread
From: Andi Kleen @ 2011-02-02  0:44 UTC (permalink / raw)
  To: rjw, gregkh, ak, linux-kernel, stable

2.6.35-longterm review patch.  If anyone has any objections, please let me know.

------------------
From: Rafael J. Wysocki <rjw@sisk.pl>

commit f08f5a0add20834d3f3d876dfe08005a5df656db upstream.

There are some situations (e.g. in __pm_generic_call()), where
pm_runtime_suspended() is used to decide whether or not to execute
a device's (system) ->suspend() callback.  The callback is not
executed if pm_runtime_suspended() returns true, but it does so
for devices that don't even support runtime PM, because the
power.disable_depth device field is ignored by it.  This leads to
problems (i.e. devices are not suspened when they should), so rework
pm_runtime_suspended() so that it returns false if the device's
power.disable_depth field is different from zero.

Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: Andi Kleen <ak@linux.intel.com>

---
 Documentation/power/runtime_pm.txt |    4 ++--
 include/linux/pm_runtime.h         |    3 ++-
 2 files changed, 4 insertions(+), 3 deletions(-)

Index: linux-2.6.35.y/Documentation/power/runtime_pm.txt
===================================================================
--- linux-2.6.35.y.orig/Documentation/power/runtime_pm.txt
+++ linux-2.6.35.y/Documentation/power/runtime_pm.txt
@@ -336,8 +336,8 @@ drivers/base/power/runtime.c and include
       zero)
 
   bool pm_runtime_suspended(struct device *dev);
-    - return true if the device's runtime PM status is 'suspended', or false
-      otherwise
+    - return true if the device's runtime PM status is 'suspended' and its
+      'power.disable_depth' field is equal to zero, or false otherwise
 
   void pm_runtime_allow(struct device *dev);
     - set the power.runtime_auto flag for the device and decrease its usage
Index: linux-2.6.35.y/include/linux/pm_runtime.h
===================================================================
--- linux-2.6.35.y.orig/include/linux/pm_runtime.h
+++ linux-2.6.35.y/include/linux/pm_runtime.h
@@ -67,7 +67,8 @@ static inline void device_set_run_wake(s
 
 static inline bool pm_runtime_suspended(struct device *dev)
 {
-	return dev->power.runtime_status == RPM_SUSPENDED;
+	return dev->power.runtime_status == RPM_SUSPENDED
+		&& !dev->power.disable_depth;
 }
 
 #else /* !CONFIG_PM_RUNTIME */

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

* [PATCH] [82/139] inotify: stop kernel memory leak on file creation failure
  2011-02-02  0:43 [PATCH] [0/139] 2.6.35.11 longterm review Andi Kleen
                   ` (80 preceding siblings ...)
  2011-02-02  0:44 ` [PATCH] [81/139] PM / Runtime: Fix pm_runtime_suspended() Andi Kleen
@ 2011-02-02  0:44 ` Andi Kleen
  2011-02-02  0:44 ` [PATCH] [83/139] orinoco: fix TKIP countermeasure behaviour Andi Kleen
                   ` (57 subsequent siblings)
  139 siblings, 0 replies; 149+ messages in thread
From: Andi Kleen @ 2011-02-02  0:44 UTC (permalink / raw)
  To: eparis, gregkh, ak, linux-kernel, stable

2.6.35-longterm review patch.  If anyone has any objections, please let me know.

------------------
From: Eric Paris <eparis@redhat.com>

commit a2ae4cc9a16e211c8a128ba10d22a85431f093ab upstream.

If inotify_init is unable to allocate a new file for the new inotify
group we leak the new group.  This patch drops the reference on the
group on file allocation failure.

Reported-by: Vegard Nossum <vegard.nossum@gmail.com>
Signed-off-by: Eric Paris <eparis@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: Andi Kleen <ak@linux.intel.com>

---
 fs/notify/inotify/inotify_user.c |    1 +
 1 file changed, 1 insertion(+)

Index: linux-2.6.35.y/fs/notify/inotify/inotify_user.c
===================================================================
--- linux-2.6.35.y.orig/fs/notify/inotify/inotify_user.c
+++ linux-2.6.35.y/fs/notify/inotify/inotify_user.c
@@ -674,6 +674,7 @@ SYSCALL_DEFINE1(inotify_init1, int, flag
 	if (ret >= 0)
 		return ret;
 
+	fsnotify_put_group(group);
 	atomic_dec(&user->inotify_devs);
 out_free_uid:
 	free_uid(user);

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

* [PATCH] [83/139] orinoco: fix TKIP countermeasure behaviour
  2011-02-02  0:43 [PATCH] [0/139] 2.6.35.11 longterm review Andi Kleen
                   ` (81 preceding siblings ...)
  2011-02-02  0:44 ` [PATCH] [82/139] inotify: stop kernel memory leak on file creation failure Andi Kleen
@ 2011-02-02  0:44 ` Andi Kleen
  2011-02-02  0:44 ` [PATCH] [84/139] orinoco: clear countermeasure setting on commit Andi Kleen
                   ` (56 subsequent siblings)
  139 siblings, 0 replies; 149+ messages in thread
From: Andi Kleen @ 2011-02-02  0:44 UTC (permalink / raw)
  To: kilroyd, linville, gregkh, ak, linux-kernel, stable

2.6.35-longterm review patch.  If anyone has any objections, please let me know.

------------------
From: David Kilroy <kilroyd@googlemail.com>

commit 0a54917c3fc295cb61f3fb52373c173fd3b69f48 upstream.

Enable the port when disabling countermeasures, and disable it on
enabling countermeasures.

This bug causes the response of the system to certain attacks to be
ineffective.

It also prevents wpa_supplicant from getting scan results, as
wpa_supplicant disables countermeasures on startup - preventing the
hardware from scanning.

wpa_supplicant works with ap_mode=2 despite this bug because the commit
handler re-enables the port.

The log tends to look like:

State: DISCONNECTED -> SCANNING
Starting AP scan for wildcard SSID
Scan requested (ret=0) - scan timeout 5 seconds
EAPOL: disable timer tick
EAPOL: Supplicant port status: Unauthorized
Scan timeout - try to get results
Failed to get scan results
Failed to get scan results - try scanning again
Setting scan request: 1 sec 0 usec
Starting AP scan for wildcard SSID
Scan requested (ret=-1) - scan timeout 5 seconds
Failed to initiate AP scan.

Reported by: Giacomo Comes <comes@naic.edu>
Signed-off by: David Kilroy <kilroyd@googlemail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: Andi Kleen <ak@linux.intel.com>

---
 drivers/net/wireless/orinoco/wext.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Index: linux-2.6.35.y/drivers/net/wireless/orinoco/wext.c
===================================================================
--- linux-2.6.35.y.orig/drivers/net/wireless/orinoco/wext.c
+++ linux-2.6.35.y/drivers/net/wireless/orinoco/wext.c
@@ -904,10 +904,10 @@ static int orinoco_ioctl_set_auth(struct
 		 */
 		if (param->value) {
 			priv->tkip_cm_active = 1;
-			ret = hermes_enable_port(hw, 0);
+			ret = hermes_disable_port(hw, 0);
 		} else {
 			priv->tkip_cm_active = 0;
-			ret = hermes_disable_port(hw, 0);
+			ret = hermes_enable_port(hw, 0);
 		}
 		break;
 

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

* [PATCH] [84/139] orinoco: clear countermeasure setting on commit
  2011-02-02  0:43 [PATCH] [0/139] 2.6.35.11 longterm review Andi Kleen
                   ` (82 preceding siblings ...)
  2011-02-02  0:44 ` [PATCH] [83/139] orinoco: fix TKIP countermeasure behaviour Andi Kleen
@ 2011-02-02  0:44 ` Andi Kleen
  2011-02-02  0:44 ` [PATCH] [85/139] x86, amd: Fix panic on AMD CPU family 0x15 Andi Kleen
                   ` (55 subsequent siblings)
  139 siblings, 0 replies; 149+ messages in thread
From: Andi Kleen @ 2011-02-02  0:44 UTC (permalink / raw)
  To: kilroyd, linville, gregkh, ak, linux-kernel, stable

2.6.35-longterm review patch.  If anyone has any objections, please let me know.

------------------
From: David Kilroy <kilroyd@googlemail.com>

commit ba34fcee476d11e7c9df95932787a22a96ff6e68 upstream.

... and interface up.

In these situations, you are usually trying to connect to a new AP, so
keeping TKIP countermeasures active is confusing. This is already how
the driver behaves (inadvertently). However, querying SIOCGIWAUTH may
tell userspace that countermeasures are active when they aren't.

Clear the setting so that the reporting matches what the driver has
done..

Signed-off by: David Kilroy <kilroyd@googlemail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: Andi Kleen <ak@linux.intel.com>

---
 drivers/net/wireless/orinoco/main.c |    6 ++++++
 1 file changed, 6 insertions(+)

Index: linux-2.6.35.y/drivers/net/wireless/orinoco/main.c
===================================================================
--- linux-2.6.35.y.orig/drivers/net/wireless/orinoco/main.c
+++ linux-2.6.35.y/drivers/net/wireless/orinoco/main.c
@@ -1813,6 +1813,12 @@ static int __orinoco_commit(struct orino
 	struct net_device *dev = priv->ndev;
 	int err = 0;
 
+	/* If we've called commit, we are reconfiguring or bringing the
+	 * interface up. Maintaining countermeasures across this would
+	 * be confusing, so note that we've disabled them. The port will
+	 * be enabled later in orinoco_commit or __orinoco_up. */
+	priv->tkip_cm_active = 0;
+
 	err = orinoco_hw_program_rids(priv);
 
 	/* FIXME: what about netif_tx_lock */

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

* [PATCH] [85/139] x86, amd: Fix panic on AMD CPU family 0x15
  2011-02-02  0:43 [PATCH] [0/139] 2.6.35.11 longterm review Andi Kleen
                   ` (83 preceding siblings ...)
  2011-02-02  0:44 ` [PATCH] [84/139] orinoco: clear countermeasure setting on commit Andi Kleen
@ 2011-02-02  0:44 ` Andi Kleen
  2011-02-02  0:44 ` [PATCH] [86/139] md: fix bug with re-adding of partially recovered device Andi Kleen
                   ` (54 subsequent siblings)
  139 siblings, 0 replies; 149+ messages in thread
From: Andi Kleen @ 2011-02-02  0:44 UTC (permalink / raw)
  To: andreas.herrmann3, gregkh, ak, linux-kernel, stable

2.6.35-longterm review patch.  If anyone has any objections, please let me know.

------------------
From: Andreas Herrmann <andreas.herrmann3@amd.com>

[The mainline kernel doesn't have this problem. Commit "(23588c3) x86,
amd: Add support for CPUID topology extension of AMD CPUs" removed the
family check. But 2.6.32.y needs to be fixed.]

This CPU family check is not required -- existence of the NodeId MSR
is indicated by a CPUID feature flag which is already checked in
amd_fixup_dcm() -- and it needlessly prevents amd_fixup_dcm() to be
called for newer AMD CPUs.

In worst case this can lead to a panic in the scheduler code for AMD
family 0x15 multi-node AMD CPUs. I just have a picture of VGA console
output so I can't copy-and-paste it herein, but the call stack of such
a panic looked like:

  do_divide_error
  ...
  find_busiest_group
  run_rebalance_domains
  ...
  apic_timer_interrupt
  ...
  cpu_idle

The mainline kernel doesn't have this problem. Commit "(23588c3) x86,
amd: Add support for CPUID topology extension of AMD CPUs" removed the
family check. But 2.6.32.y needs to be fixed.

Signed-off-by: Andreas Herrmann <andreas.herrmann3@amd.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: Andi Kleen <ak@linux.intel.com>

---
 arch/x86/kernel/cpu/amd.c |    3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

Index: linux-2.6.35.y/arch/x86/kernel/cpu/amd.c
===================================================================
--- linux-2.6.35.y.orig/arch/x86/kernel/cpu/amd.c
+++ linux-2.6.35.y/arch/x86/kernel/cpu/amd.c
@@ -305,8 +305,7 @@ static void __cpuinit amd_detect_cmp(str
 	/* use socket ID also for last level cache */
 	per_cpu(cpu_llc_id, cpu) = c->phys_proc_id;
 	/* fixup topology information on multi-node processors */
-	if ((c->x86 == 0x10) && (c->x86_model == 9))
-		amd_fixup_dcm(c);
+	amd_fixup_dcm(c);
 #endif
 }
 

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

* [PATCH] [86/139] md: fix bug with re-adding of partially recovered device.
  2011-02-02  0:43 [PATCH] [0/139] 2.6.35.11 longterm review Andi Kleen
                   ` (84 preceding siblings ...)
  2011-02-02  0:44 ` [PATCH] [85/139] x86, amd: Fix panic on AMD CPU family 0x15 Andi Kleen
@ 2011-02-02  0:44 ` Andi Kleen
  2011-02-02  0:44 ` [PATCH] [87/139] md: protect against NULL reference when waiting to start a raid10 Andi Kleen
                   ` (53 subsequent siblings)
  139 siblings, 0 replies; 149+ messages in thread
From: Andi Kleen @ 2011-02-02  0:44 UTC (permalink / raw)
  To: neilb, gregkh, ak, linux-kernel, stable

2.6.35-longterm review patch.  If anyone has any objections, please let me know.

------------------
From: NeilBrown <neilb@suse.de>

commit 1a855a0606653d2d82506281e2c686bacb4b2f45 upstream.

With v0.90 metadata, a hot-spare does not become a full member of the
array until recovery is complete.  So if we re-add such a device to
the array, we know that all of it is as up-to-date as the event count
would suggest, and so it a bitmap-based recovery is possible.

However with v1.x metadata, the hot-spare immediately becomes a full
member of the array, but it record how much of the device has been
recovered.  If the array is stopped and re-assembled recovery starts
from this point.

When such a device is hot-added to an array we currently lose the 'how
much is recovered' information and incorrectly included it as a full
in-sync member (after bitmap-based fixup).
This is wrong and unsafe and could corrupt data.

So be more careful about setting saved_raid_disk - which is what
guides the re-adding of devices back into an array.
The new code matches the code in slot_store which does a similar
thing, which is encouraging.

This is suitable for any -stable kernel.

Reported-by: "Dailey, Nate" <Nate.Dailey@stratus.com>
Signed-off-by: NeilBrown <neilb@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: Andi Kleen <ak@linux.intel.com>

---
 drivers/md/md.c |    7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

Index: linux-2.6.35.y/drivers/md/md.c
===================================================================
--- linux-2.6.35.y.orig/drivers/md/md.c
+++ linux-2.6.35.y/drivers/md/md.c
@@ -5109,7 +5109,7 @@ static int add_new_disk(mddev_t * mddev,
 				PTR_ERR(rdev));
 			return PTR_ERR(rdev);
 		}
-		/* set save_raid_disk if appropriate */
+		/* set saved_raid_disk if appropriate */
 		if (!mddev->persistent) {
 			if (info->state & (1<<MD_DISK_SYNC)  &&
 			    info->raid_disk < mddev->raid_disks)
@@ -5119,7 +5119,10 @@ static int add_new_disk(mddev_t * mddev,
 		} else
 			super_types[mddev->major_version].
 				validate_super(mddev, rdev);
-		rdev->saved_raid_disk = rdev->raid_disk;
+		if (test_bit(In_sync, &rdev->flags))
+			rdev->saved_raid_disk = rdev->raid_disk;
+		else
+			rdev->saved_raid_disk = -1;
 
 		clear_bit(In_sync, &rdev->flags); /* just to be sure */
 		if (info->state & (1<<MD_DISK_WRITEMOSTLY))

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

* [PATCH] [87/139] md: protect against NULL reference when waiting to start a raid10.
  2011-02-02  0:43 [PATCH] [0/139] 2.6.35.11 longterm review Andi Kleen
                   ` (85 preceding siblings ...)
  2011-02-02  0:44 ` [PATCH] [86/139] md: fix bug with re-adding of partially recovered device Andi Kleen
@ 2011-02-02  0:44 ` Andi Kleen
  2011-02-02  0:44 ` [PATCH] [88/139] tracing: Fix panic when lseek() called on "trace" opened for writing Andi Kleen
                   ` (52 subsequent siblings)
  139 siblings, 0 replies; 149+ messages in thread
From: Andi Kleen @ 2011-02-02  0:44 UTC (permalink / raw)
  To: neilb, gregkh, ak, linux-kernel, stable

2.6.35-longterm review patch.  If anyone has any objections, please let me know.

------------------
From: NeilBrown <neilb@suse.de>

commit 589a594be1fb8815b3f18e517be696c48664f728 upstream.

When we fail to start a raid10 for some reason, we call
md_unregister_thread to kill the thread that was created.

Unfortunately md_thread() will then make one call into the handler
(raid10d) even though md_wakeup_thread has not been called.  This is
not safe and as md_unregister_thread is called after mddev->private
has been set to NULL, it will definitely cause a NULL dereference.

So fix this at both ends:
 - md_thread should only call the handler if THREAD_WAKEUP has been
   set.
 - raid10 should call md_unregister_thread before setting things
   to NULL just like all the other raid modules do.

This is applicable to 2.6.35 and later.

Reported-by: "Citizen" <citizen_lee@thecus.com>
Signed-off-by: NeilBrown <neilb@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: Andi Kleen <ak@linux.intel.com>

---
 drivers/md/md.c     |    5 ++---
 drivers/md/raid10.c |    2 +-
 2 files changed, 3 insertions(+), 4 deletions(-)

Index: linux-2.6.35.y/drivers/md/md.c
===================================================================
--- linux-2.6.35.y.orig/drivers/md/md.c
+++ linux-2.6.35.y/drivers/md/md.c
@@ -5989,9 +5989,8 @@ static int md_thread(void * arg)
 			 || kthread_should_stop(),
 			 thread->timeout);
 
-		clear_bit(THREAD_WAKEUP, &thread->flags);
-
-		thread->run(thread->mddev);
+		if (test_and_clear_bit(THREAD_WAKEUP, &thread->flags))
+			thread->run(thread->mddev);
 	}
 
 	return 0;
Index: linux-2.6.35.y/drivers/md/raid10.c
===================================================================
--- linux-2.6.35.y.orig/drivers/md/raid10.c
+++ linux-2.6.35.y/drivers/md/raid10.c
@@ -2393,13 +2393,13 @@ static int run(mddev_t *mddev)
 	return 0;
 
 out_free_conf:
+	md_unregister_thread(mddev->thread);
 	if (conf->r10bio_pool)
 		mempool_destroy(conf->r10bio_pool);
 	safe_put_page(conf->tmppage);
 	kfree(conf->mirrors);
 	kfree(conf);
 	mddev->private = NULL;
-	md_unregister_thread(mddev->thread);
 out:
 	return -EIO;
 }

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

* [PATCH] [88/139] tracing: Fix panic when lseek() called on "trace" opened for writing
  2011-02-02  0:43 [PATCH] [0/139] 2.6.35.11 longterm review Andi Kleen
                   ` (86 preceding siblings ...)
  2011-02-02  0:44 ` [PATCH] [87/139] md: protect against NULL reference when waiting to start a raid10 Andi Kleen
@ 2011-02-02  0:44 ` Andi Kleen
  2011-02-02  0:44 ` [PATCH] [89/139] x86, gcc-4.6: Use gcc -m options when building vdso Andi Kleen
                   ` (51 subsequent siblings)
  139 siblings, 0 replies; 149+ messages in thread
From: Andi Kleen @ 2011-02-02  0:44 UTC (permalink / raw)
  To: slavapestov, ak, rostedt, gregkh, linux-kernel, stable

2.6.35-longterm review patch.  If anyone has any objections, please let me know.

------------------
From: Slava Pestov <slavapestov@google.com>

commit 364829b1263b44aa60383824e4c1289d83d78ca7 upstream.

The file_ops struct for the "trace" special file defined llseek as seq_lseek().
However, if the file was opened for writing only, seq_open() was not called,
and the seek would dereference a null pointer, file->private_data.

This patch introduces a new wrapper for seq_lseek() which checks if the file
descriptor is opened for reading first. If not, it does nothing.

Signed-off-by: Slava Pestov <slavapestov@google.com>
Signed-off-by: Andi Kleen <ak@linux.intel.com>
LKML-Reference: <1290640396-24179-1-git-send-email-slavapestov@google.com>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

---
 kernel/trace/trace.c |   10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

Index: linux-2.6.35.y/kernel/trace/trace.c
===================================================================
--- linux-2.6.35.y.orig/kernel/trace/trace.c
+++ linux-2.6.35.y/kernel/trace/trace.c
@@ -2382,11 +2382,19 @@ tracing_write_stub(struct file *filp, co
 	return count;
 }
 
+static loff_t tracing_seek(struct file *file, loff_t offset, int origin)
+{
+	if (file->f_mode & FMODE_READ)
+		return seq_lseek(file, offset, origin);
+	else
+		return 0;
+}
+
 static const struct file_operations tracing_fops = {
 	.open		= tracing_open,
 	.read		= seq_read,
 	.write		= tracing_write_stub,
-	.llseek		= seq_lseek,
+	.llseek		= tracing_seek,
 	.release	= tracing_release,
 };
 

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

* [PATCH] [89/139] x86, gcc-4.6: Use gcc -m options when building vdso
  2011-02-02  0:43 [PATCH] [0/139] 2.6.35.11 longterm review Andi Kleen
                   ` (87 preceding siblings ...)
  2011-02-02  0:44 ` [PATCH] [88/139] tracing: Fix panic when lseek() called on "trace" opened for writing Andi Kleen
@ 2011-02-02  0:44 ` Andi Kleen
  2011-02-02  0:44 ` [PATCH] [90/139] x86: Enable the intr-remap fault handling after local APIC setup Andi Kleen
                   ` (50 subsequent siblings)
  139 siblings, 0 replies; 149+ messages in thread
From: Andi Kleen @ 2011-02-02  0:44 UTC (permalink / raw)
  To: hpa, ak, gregkh, linux-kernel, stable

2.6.35-longterm review patch.  If anyone has any objections, please let me know.

------------------
From: H. Peter Anvin <hpa@linux.intel.com>

commit de2a8cf98ecdde25231d6c5e7901e2cffaf32af9 upstream.

The vdso Makefile passes linker-style -m options not to the linker but
to gcc.  This happens to work with earlier gcc, but fails with gcc
4.6.  Pass gcc-style -m options, instead.

Note: all currently supported versions of gcc supports -m32, so there
is no reason to conditionalize it any more.

Reported-by: H. J. Lu <hjl.tools@gmail.com>
Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
Signed-off-by: Andi Kleen <ak@linux.intel.com>
LKML-Reference: <tip-*@git.kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

---
 arch/x86/vdso/Makefile |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Index: linux-2.6.35.y/arch/x86/vdso/Makefile
===================================================================
--- linux-2.6.35.y.orig/arch/x86/vdso/Makefile
+++ linux-2.6.35.y/arch/x86/vdso/Makefile
@@ -25,7 +25,7 @@ targets += vdso.so vdso.so.dbg vdso.lds 
 
 export CPPFLAGS_vdso.lds += -P -C
 
-VDSO_LDFLAGS_vdso.lds = -m elf_x86_64 -Wl,-soname=linux-vdso.so.1 \
+VDSO_LDFLAGS_vdso.lds = -m64 -Wl,-soname=linux-vdso.so.1 \
 		      	-Wl,-z,max-page-size=4096 -Wl,-z,common-page-size=4096
 
 $(obj)/vdso.o: $(src)/vdso.S $(obj)/vdso.so
@@ -69,7 +69,7 @@ vdso32.so-$(VDSO32-y)		+= sysenter
 vdso32-images			= $(vdso32.so-y:%=vdso32-%.so)
 
 CPPFLAGS_vdso32.lds = $(CPPFLAGS_vdso.lds)
-VDSO_LDFLAGS_vdso32.lds = -m elf_i386 -Wl,-soname=linux-gate.so.1
+VDSO_LDFLAGS_vdso32.lds = -m32 -Wl,-soname=linux-gate.so.1
 
 # This makes sure the $(obj) subdirectory exists even though vdso32/
 # is not a kbuild sub-make subdirectory.

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

* [PATCH] [90/139] x86: Enable the intr-remap fault handling after local APIC setup
  2011-02-02  0:43 [PATCH] [0/139] 2.6.35.11 longterm review Andi Kleen
                   ` (88 preceding siblings ...)
  2011-02-02  0:44 ` [PATCH] [89/139] x86, gcc-4.6: Use gcc -m options when building vdso Andi Kleen
@ 2011-02-02  0:44 ` Andi Kleen
  2011-02-02  0:44 ` [PATCH] [91/139] x86, vt-d: Handle previous faults after enabling fault handling Andi Kleen
                   ` (49 subsequent siblings)
  139 siblings, 0 replies; 149+ messages in thread
From: Andi Kleen @ 2011-02-02  0:44 UTC (permalink / raw)
  To: kaneshige.kenji, ak, suresh.b.siddha, chrisw, hpa, gregkh,
	linux-kernel, stable

2.6.35-longterm review patch.  If anyone has any objections, please let me know.

------------------
From: Kenji Kaneshige <kaneshige.kenji@jp.fujitsu.com>

commit 7f7fbf45c6b748074546f7f16b9488ca71de99c1 upstream.

Interrupt-remapping gets enabled very early in the boot, as it determines the
apic mode that the processor can use. And the current code enables the vt-d
fault handling before the setup_local_APIC(). And hence the APIC LDR registers
and data structure in the memory may not be initialized. So the vt-d fault
handling in logical xapic/x2apic modes were broken.

Fix this by enabling the vt-d fault handling in the end_local_APIC_setup()

A cleaner fix of enabling fault handling while enabling intr-remapping
will be addressed for v2.6.38. [ Enabling intr-remapping determines the
usage of x2apic mode and the apic mode determines the fault-handling
configuration. ]

Signed-off-by: Kenji Kaneshige <kaneshige.kenji@jp.fujitsu.com>
Signed-off-by: Andi Kleen <ak@linux.intel.com>
LKML-Reference: <20101201062244.541996375@intel.com>
Signed-off-by: Suresh Siddha <suresh.b.siddha@intel.com>
Acked-by: Chris Wright <chrisw@sous-sol.org>
Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

---
 arch/x86/kernel/apic/apic.c     |    8 ++++++++
 arch/x86/kernel/apic/probe_64.c |    7 -------
 2 files changed, 8 insertions(+), 7 deletions(-)

Index: linux-2.6.35.y/arch/x86/kernel/apic/apic.c
===================================================================
--- linux-2.6.35.y.orig/arch/x86/kernel/apic/apic.c
+++ linux-2.6.35.y/arch/x86/kernel/apic/apic.c
@@ -1340,6 +1340,14 @@ void __cpuinit end_local_APIC_setup(void
 
 	setup_apic_nmi_watchdog(NULL);
 	apic_pm_activate();
+
+	/*
+	 * Now that local APIC setup is completed for BP, configure the fault
+	 * handling for interrupt remapping.
+	 */
+	if (!smp_processor_id() && intr_remapping_enabled)
+		enable_drhd_fault_handling();
+
 }
 
 #ifdef CONFIG_X86_X2APIC
Index: linux-2.6.35.y/arch/x86/kernel/apic/probe_64.c
===================================================================
--- linux-2.6.35.y.orig/arch/x86/kernel/apic/probe_64.c
+++ linux-2.6.35.y/arch/x86/kernel/apic/probe_64.c
@@ -76,13 +76,6 @@ void __init default_setup_apic_routing(v
 		/* need to update phys_pkg_id */
 		apic->phys_pkg_id = apicid_phys_pkg_id;
 	}
-
-	/*
-	 * Now that apic routing model is selected, configure the
-	 * fault handling for intr remapping.
-	 */
-	if (intr_remapping_enabled)
-		enable_drhd_fault_handling();
 }
 
 /* Same for both flat and physical. */

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

* [PATCH] [91/139] x86, vt-d: Handle previous faults after enabling fault handling
  2011-02-02  0:43 [PATCH] [0/139] 2.6.35.11 longterm review Andi Kleen
                   ` (89 preceding siblings ...)
  2011-02-02  0:44 ` [PATCH] [90/139] x86: Enable the intr-remap fault handling after local APIC setup Andi Kleen
@ 2011-02-02  0:44 ` Andi Kleen
  2011-02-02  0:44 ` [PATCH] [92/139] x86, vt-d: Fix the vt-d fault handling irq migration in the x2apic mode Andi Kleen
                   ` (48 subsequent siblings)
  139 siblings, 0 replies; 149+ messages in thread
From: Andi Kleen @ 2011-02-02  0:44 UTC (permalink / raw)
  To: suresh.b.siddha, ak, chrisw, hpa, gregkh, linux-kernel, stable

2.6.35-longterm review patch.  If anyone has any objections, please let me know.

------------------
From: Suresh Siddha <suresh.b.siddha@intel.com>

commit 7f99d946e71e71d484b7543b49e990508e70d0c0 upstream.

Fault handling is getting enabled after enabling the interrupt-remapping (as
the success of interrupt-remapping can affect the apic mode and hence the
fault handling mode).

Hence there can potentially be some faults between the window of enabling
interrupt-remapping in the vt-d and the fault-handling of the vt-d units.

Handle any previous faults after enabling the vt-d fault handling.

For v2.6.38 cleanup, need to check if we can remove the dmar_fault() in the
enable_intr_remapping() and see if we can enable fault handling along with
enabling intr-remapping.

Signed-off-by: Suresh Siddha <suresh.b.siddha@intel.com>
Signed-off-by: Andi Kleen <ak@linux.intel.com>
LKML-Reference: <20101201062244.630417138@intel.com>
Acked-by: Chris Wright <chrisw@sous-sol.org>
Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

---
 drivers/pci/dmar.c |    5 +++++
 1 file changed, 5 insertions(+)

Index: linux-2.6.35.y/drivers/pci/dmar.c
===================================================================
--- linux-2.6.35.y.orig/drivers/pci/dmar.c
+++ linux-2.6.35.y/drivers/pci/dmar.c
@@ -1414,6 +1414,11 @@ int __init enable_drhd_fault_handling(vo
 			       (unsigned long long)drhd->reg_base_addr, ret);
 			return -1;
 		}
+
+		/*
+		 * Clear any previous faults.
+		 */
+		dmar_fault(iommu->irq, iommu);
 	}
 
 	return 0;

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

* [PATCH] [92/139] x86, vt-d: Fix the vt-d fault handling irq migration in the x2apic mode
  2011-02-02  0:43 [PATCH] [0/139] 2.6.35.11 longterm review Andi Kleen
                   ` (90 preceding siblings ...)
  2011-02-02  0:44 ` [PATCH] [91/139] x86, vt-d: Handle previous faults after enabling fault handling Andi Kleen
@ 2011-02-02  0:44 ` Andi Kleen
  2011-02-02  0:44 ` [PATCH] [93/139] x86, vt-d: Quirk for masking vtd spec errors to platform error handling logic Andi Kleen
                   ` (47 subsequent siblings)
  139 siblings, 0 replies; 149+ messages in thread
From: Andi Kleen @ 2011-02-02  0:44 UTC (permalink / raw)
  To: kaneshige.kenji, ak, suresh.b.siddha, chrisw, indou.takao, hpa,
	gregkh, linux-kernel, stable

2.6.35-longterm review patch.  If anyone has any objections, please let me know.

------------------
From: Kenji Kaneshige <kaneshige.kenji@jp.fujitsu.com>

commit 086e8ced65d9bcc4a8e8f1cd39b09640f2883f90 upstream.

In x2apic mode, we need to set the upper address register of the fault
handling interrupt register of the vt-d hardware. Without this
irq migration of the vt-d fault handling interrupt is broken.

Signed-off-by: Kenji Kaneshige <kaneshige.kenji@jp.fujitsu.com>
Signed-off-by: Andi Kleen <ak@linux.intel.com>
LKML-Reference: <1291225233.2648.39.camel@sbsiddha-MOBL3>
Signed-off-by: Suresh Siddha <suresh.b.siddha@intel.com>
Acked-by: Chris Wright <chrisw@sous-sol.org>
Tested-by: Takao Indoh <indou.takao@jp.fujitsu.com>
Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

---
 arch/x86/kernel/apic/io_apic.c |    1 +
 1 file changed, 1 insertion(+)

Index: linux-2.6.35.y/arch/x86/kernel/apic/io_apic.c
===================================================================
--- linux-2.6.35.y.orig/arch/x86/kernel/apic/io_apic.c
+++ linux-2.6.35.y/arch/x86/kernel/apic/io_apic.c
@@ -3626,6 +3626,7 @@ static int dmar_msi_set_affinity(unsigne
 	msg.data |= MSI_DATA_VECTOR(cfg->vector);
 	msg.address_lo &= ~MSI_ADDR_DEST_ID_MASK;
 	msg.address_lo |= MSI_ADDR_DEST_ID(dest);
+	msg.address_hi = MSI_ADDR_BASE_HI | MSI_ADDR_EXT_DEST_ID(dest);
 
 	dmar_msi_write(irq, &msg);
 

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

* [PATCH] [93/139] x86, vt-d: Quirk for masking vtd spec errors to platform error handling logic
  2011-02-02  0:43 [PATCH] [0/139] 2.6.35.11 longterm review Andi Kleen
                   ` (91 preceding siblings ...)
  2011-02-02  0:44 ` [PATCH] [92/139] x86, vt-d: Fix the vt-d fault handling irq migration in the x2apic mode Andi Kleen
@ 2011-02-02  0:44 ` Andi Kleen
  2011-02-02  0:44 ` [PATCH] [94/139] rt2x00: Fix max TX power settings Andi Kleen
                   ` (46 subsequent siblings)
  139 siblings, 0 replies; 149+ messages in thread
From: Andi Kleen @ 2011-02-02  0:44 UTC (permalink / raw)
  To: suresh.b.siddha, ak, chrisw, kaneshige.kenji, hpa, gregkh,
	linux-kernel, stable

2.6.35-longterm review patch.  If anyone has any objections, please let me know.

------------------
From: Suresh Siddha <suresh.b.siddha@intel.com>

commit 254e42006c893f45bca48f313536fcba12206418 upstream.

On platforms with Intel 7500 chipset, there were some reports of system
hang/NMI's during kexec/kdump in the presence of interrupt-remapping enabled.

During kdump, there is a window where the devices might be still using old
kernel's interrupt information, while the kdump kernel is coming up. This can
cause vt-d faults as the interrupt configuration from the old kernel map to
null IRTE entries in the new kernel etc. (with out interrupt-remapping enabled,
we still have the same issue but in this case we will see benign spurious
interrupt hit the new kernel).

Based on platform config settings, these platforms seem to generate NMI/SMI
when a vt-d fault happens and there were reports that the resulting SMI causes
the  system to hang.

Fix it by masking vt-d spec defined errors to platform error reporting logic.
VT-d spec related errors are already handled by the VT-d OS code, so need to
report the same error through other channels.

Signed-off-by: Suresh Siddha <suresh.b.siddha@intel.com>
Signed-off-by: Andi Kleen <ak@linux.intel.com>
LKML-Reference: <1291667190.2675.8.camel@sbsiddha-MOBL3.sc.intel.com>
Reported-by: Max Asbock <masbock@linux.vnet.ibm.com>
Reported-and-tested-by: Takao Indoh <indou.takao@jp.fujitsu.com>
Acked-by: Chris Wright <chrisw@sous-sol.org>
Acked-by: Kenji Kaneshige <kaneshige.kenji@jp.fujitsu.com>
Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

---
 drivers/pci/quirks.c |   23 +++++++++++++++++++++++
 1 file changed, 23 insertions(+)

Index: linux-2.6.35.y/drivers/pci/quirks.c
===================================================================
--- linux-2.6.35.y.orig/drivers/pci/quirks.c
+++ linux-2.6.35.y/drivers/pci/quirks.c
@@ -2678,6 +2678,29 @@ DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_RI
 DECLARE_PCI_FIXUP_RESUME_EARLY(PCI_VENDOR_ID_RICOH, PCI_DEVICE_ID_RICOH_R5C832, ricoh_mmc_fixup_r5c832);
 #endif /*CONFIG_MMC_RICOH_MMC*/
 
+#if defined(CONFIG_DMAR) || defined(CONFIG_INTR_REMAP)
+#define VTUNCERRMSK_REG	0x1ac
+#define VTD_MSK_SPEC_ERRORS	(1 << 31)
+/*
+ * This is a quirk for masking vt-d spec defined errors to platform error
+ * handling logic. With out this, platforms using Intel 7500, 5500 chipsets
+ * (and the derivative chipsets like X58 etc) seem to generate NMI/SMI (based
+ * on the RAS config settings of the platform) when a vt-d fault happens.
+ * The resulting SMI caused the system to hang.
+ *
+ * VT-d spec related errors are already handled by the VT-d OS code, so no
+ * need to report the same error through other channels.
+ */
+static void vtd_mask_spec_errors(struct pci_dev *dev)
+{
+	u32 word;
+
+	pci_read_config_dword(dev, VTUNCERRMSK_REG, &word);
+	pci_write_config_dword(dev, VTUNCERRMSK_REG, word | VTD_MSK_SPEC_ERRORS);
+}
+DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_INTEL, 0x342e, vtd_mask_spec_errors);
+DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_INTEL, 0x3c28, vtd_mask_spec_errors);
+#endif
 
 static void pci_do_fixups(struct pci_dev *dev, struct pci_fixup *f,
 			  struct pci_fixup *end)

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

* [PATCH] [94/139] rt2x00: Fix max TX power settings
  2011-02-02  0:43 [PATCH] [0/139] 2.6.35.11 longterm review Andi Kleen
                   ` (92 preceding siblings ...)
  2011-02-02  0:44 ` [PATCH] [93/139] x86, vt-d: Quirk for masking vtd spec errors to platform error handling logic Andi Kleen
@ 2011-02-02  0:44 ` Andi Kleen
  2011-02-02  0:44 ` [PATCH] [95/139] ALSA: hda - Enable jack sense for Thinkpad Edge 11 Andi Kleen
                   ` (45 subsequent siblings)
  139 siblings, 0 replies; 149+ messages in thread
From: Andi Kleen @ 2011-02-02  0:44 UTC (permalink / raw)
  To: ivdoorn, IvDoorn, helmut.schaa, linville, gregkh, ak,
	linux-kernel, stable

2.6.35-longterm review patch.  If anyone has any objections, please let me know.

------------------
From: Ivo van Doorn <ivdoorn@gmail.com>

commit 8d1331b37d5b656a7a8e561f8e9d7661dd00c910 upstream.

During initialization each driver reads the default TX power
for each individual channel. However mac80211 only accepts the
maximum value (which is also handled as default value).

As a result, the TX power of the device was being limited to
the default value, which is often quite low compared to the
real maximum acceptable value.

This patch allows each driver to set the maximum value on a
per-channel basis which is forwarded to mac80211. The default
value will be preserved for now, in case we want to update
mac80211 to differentiate between the maximum and default txpower.

This fixes bug complaining about limited TX power values like:
https://bugzilla.kernel.org/show_bug.cgi?id=16358

Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com>
Acked-by: Helmut Schaa <helmut.schaa@googlemail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: Andi Kleen <ak@linux.intel.com>

---
 drivers/net/wireless/rt2x00/rt2400pci.c |    6 ++-
 drivers/net/wireless/rt2x00/rt2500pci.c |   12 ++++--
 drivers/net/wireless/rt2x00/rt2500usb.c |   12 ++++--
 drivers/net/wireless/rt2x00/rt2800.h    |    7 +++
 drivers/net/wireless/rt2x00/rt2800lib.c |   59 ++++++++++++++++++--------------
 drivers/net/wireless/rt2x00/rt2x00.h    |    5 +-
 drivers/net/wireless/rt2x00/rt2x00dev.c |    2 -
 drivers/net/wireless/rt2x00/rt61pci.c   |   12 ++++--
 drivers/net/wireless/rt2x00/rt73usb.c   |   12 ++++--
 9 files changed, 82 insertions(+), 45 deletions(-)

Index: linux-2.6.35.y/drivers/net/wireless/rt2x00/rt2400pci.c
===================================================================
--- linux-2.6.35.y.orig/drivers/net/wireless/rt2x00/rt2400pci.c
+++ linux-2.6.35.y/drivers/net/wireless/rt2x00/rt2400pci.c
@@ -1462,8 +1462,10 @@ static int rt2400pci_probe_hw_mode(struc
 	spec->channels_info = info;
 
 	tx_power = rt2x00_eeprom_addr(rt2x00dev, EEPROM_TXPOWER_START);
-	for (i = 0; i < 14; i++)
-		info[i].tx_power1 = TXPOWER_FROM_DEV(tx_power[i]);
+	for (i = 0; i < 14; i++) {
+		info[i].max_power = TXPOWER_FROM_DEV(MAX_TXPOWER);
+		info[i].default_power1 = TXPOWER_FROM_DEV(tx_power[i]);
+	}
 
 	return 0;
 }
Index: linux-2.6.35.y/drivers/net/wireless/rt2x00/rt2500pci.c
===================================================================
--- linux-2.6.35.y.orig/drivers/net/wireless/rt2x00/rt2500pci.c
+++ linux-2.6.35.y/drivers/net/wireless/rt2x00/rt2500pci.c
@@ -1780,12 +1780,16 @@ static int rt2500pci_probe_hw_mode(struc
 	spec->channels_info = info;
 
 	tx_power = rt2x00_eeprom_addr(rt2x00dev, EEPROM_TXPOWER_START);
-	for (i = 0; i < 14; i++)
-		info[i].tx_power1 = TXPOWER_FROM_DEV(tx_power[i]);
+	for (i = 0; i < 14; i++) {
+		info[i].max_power = MAX_TXPOWER;
+		info[i].default_power1 = TXPOWER_FROM_DEV(tx_power[i]);
+	}
 
 	if (spec->num_channels > 14) {
-		for (i = 14; i < spec->num_channels; i++)
-			info[i].tx_power1 = DEFAULT_TXPOWER;
+		for (i = 14; i < spec->num_channels; i++) {
+			info[i].max_power = MAX_TXPOWER;
+			info[i].default_power1 = DEFAULT_TXPOWER;
+		}
 	}
 
 	return 0;
Index: linux-2.6.35.y/drivers/net/wireless/rt2x00/rt2500usb.c
===================================================================
--- linux-2.6.35.y.orig/drivers/net/wireless/rt2x00/rt2500usb.c
+++ linux-2.6.35.y/drivers/net/wireless/rt2x00/rt2500usb.c
@@ -1690,12 +1690,16 @@ static int rt2500usb_probe_hw_mode(struc
 	spec->channels_info = info;
 
 	tx_power = rt2x00_eeprom_addr(rt2x00dev, EEPROM_TXPOWER_START);
-	for (i = 0; i < 14; i++)
-		info[i].tx_power1 = TXPOWER_FROM_DEV(tx_power[i]);
+	for (i = 0; i < 14; i++) {
+		info[i].max_power = MAX_TXPOWER;
+		info[i].default_power1 = TXPOWER_FROM_DEV(tx_power[i]);
+	}
 
 	if (spec->num_channels > 14) {
-		for (i = 14; i < spec->num_channels; i++)
-			info[i].tx_power1 = DEFAULT_TXPOWER;
+		for (i = 14; i < spec->num_channels; i++) {
+			info[i].max_power = MAX_TXPOWER;
+			info[i].default_power1 = DEFAULT_TXPOWER;
+		}
 	}
 
 	return 0;
Index: linux-2.6.35.y/drivers/net/wireless/rt2x00/rt2800.h
===================================================================
--- linux-2.6.35.y.orig/drivers/net/wireless/rt2x00/rt2800.h
+++ linux-2.6.35.y/drivers/net/wireless/rt2x00/rt2800.h
@@ -1770,6 +1770,13 @@ struct mac_iveiv_entry {
 #define EEPROM_RSSI_A2_LNA_A2		FIELD16(0xff00)
 
 /*
+ * EEPROM Maximum TX power values
+ */
+#define EEPROM_MAX_TX_POWER		0x0027
+#define EEPROM_MAX_TX_POWER_24GHZ	FIELD16(0x00ff)
+#define EEPROM_MAX_TX_POWER_5GHZ	FIELD16(0xff00)
+
+/*
  * EEPROM TXpower delta: 20MHZ AND 40 MHZ use different power.
  *	This is delta in 40MHZ.
  * VALUE: Tx Power dalta value (MAX=4)
Index: linux-2.6.35.y/drivers/net/wireless/rt2x00/rt2800lib.c
===================================================================
--- linux-2.6.35.y.orig/drivers/net/wireless/rt2x00/rt2800lib.c
+++ linux-2.6.35.y/drivers/net/wireless/rt2x00/rt2800lib.c
@@ -840,27 +840,27 @@ static void rt2800_config_channel_rf2xxx
 		 * double meaning, and we should set a 7DBm boost flag.
 		 */
 		rt2x00_set_field32(&rf->rf3, RF3_TXPOWER_A_7DBM_BOOST,
-				   (info->tx_power1 >= 0));
+				   (info->default_power1 >= 0));
 
-		if (info->tx_power1 < 0)
-			info->tx_power1 += 7;
+		if (info->default_power1 < 0)
+			info->default_power1 += 7;
 
 		rt2x00_set_field32(&rf->rf3, RF3_TXPOWER_A,
-				   TXPOWER_A_TO_DEV(info->tx_power1));
+				   TXPOWER_A_TO_DEV(info->default_power1));
 
 		rt2x00_set_field32(&rf->rf4, RF4_TXPOWER_A_7DBM_BOOST,
-				   (info->tx_power2 >= 0));
+				   (info->default_power2 >= 0));
 
-		if (info->tx_power2 < 0)
-			info->tx_power2 += 7;
+		if (info->default_power2 < 0)
+			info->default_power2 += 7;
 
 		rt2x00_set_field32(&rf->rf4, RF4_TXPOWER_A,
-				   TXPOWER_A_TO_DEV(info->tx_power2));
+				   TXPOWER_A_TO_DEV(info->default_power2));
 	} else {
 		rt2x00_set_field32(&rf->rf3, RF3_TXPOWER_G,
-				   TXPOWER_G_TO_DEV(info->tx_power1));
+				   TXPOWER_G_TO_DEV(info->default_power1));
 		rt2x00_set_field32(&rf->rf4, RF4_TXPOWER_G,
-				   TXPOWER_G_TO_DEV(info->tx_power2));
+				   TXPOWER_G_TO_DEV(info->default_power2));
 	}
 
 	rt2x00_set_field32(&rf->rf4, RF4_HT40, conf_is_ht40(conf));
@@ -900,13 +900,11 @@ static void rt2800_config_channel_rf3xxx
 	rt2800_rfcsr_write(rt2x00dev, 6, rfcsr);
 
 	rt2800_rfcsr_read(rt2x00dev, 12, &rfcsr);
-	rt2x00_set_field8(&rfcsr, RFCSR12_TX_POWER,
-			  TXPOWER_G_TO_DEV(info->tx_power1));
+	rt2x00_set_field8(&rfcsr, RFCSR12_TX_POWER, info->default_power1);
 	rt2800_rfcsr_write(rt2x00dev, 12, rfcsr);
 
 	rt2800_rfcsr_read(rt2x00dev, 13, &rfcsr);
-	rt2x00_set_field8(&rfcsr, RFCSR13_TX_POWER,
-			  TXPOWER_G_TO_DEV(info->tx_power2));
+	rt2x00_set_field8(&rfcsr, RFCSR13_TX_POWER, info->default_power2);
 	rt2800_rfcsr_write(rt2x00dev, 13, rfcsr);
 
 	rt2800_rfcsr_read(rt2x00dev, 23, &rfcsr);
@@ -2226,6 +2224,13 @@ int rt2800_validate_eeprom(struct rt2x00
 				   default_lna_gain);
 	rt2x00_eeprom_write(rt2x00dev, EEPROM_RSSI_A2, word);
 
+	rt2x00_eeprom_read(rt2x00dev, EEPROM_MAX_TX_POWER, &word);
+	if (rt2x00_get_field16(word, EEPROM_MAX_TX_POWER_24GHZ) == 0xff)
+		rt2x00_set_field16(&word, EEPROM_MAX_TX_POWER_24GHZ, MAX_G_TXPOWER);
+	if (rt2x00_get_field16(word, EEPROM_MAX_TX_POWER_5GHZ) == 0xff)
+		rt2x00_set_field16(&word, EEPROM_MAX_TX_POWER_5GHZ, MAX_A_TXPOWER);
+	rt2x00_eeprom_write(rt2x00dev, EEPROM_MAX_TX_POWER, word);
+
 	return 0;
 }
 EXPORT_SYMBOL_GPL(rt2800_validate_eeprom);
@@ -2466,9 +2471,10 @@ int rt2800_probe_hw_mode(struct rt2x00_d
 {
 	struct hw_mode_spec *spec = &rt2x00dev->spec;
 	struct channel_info *info;
-	char *tx_power1;
-	char *tx_power2;
+	char *default_power1;
+	char *default_power2;
 	unsigned int i;
+	unsigned short max_power;
 	u16 eeprom;
 
 	/*
@@ -2566,21 +2572,26 @@ int rt2800_probe_hw_mode(struct rt2x00_d
 
 	spec->channels_info = info;
 
-	tx_power1 = rt2x00_eeprom_addr(rt2x00dev, EEPROM_TXPOWER_BG1);
-	tx_power2 = rt2x00_eeprom_addr(rt2x00dev, EEPROM_TXPOWER_BG2);
+	rt2x00_eeprom_read(rt2x00dev, EEPROM_MAX_TX_POWER, &eeprom);
+	max_power = rt2x00_get_field16(eeprom, EEPROM_MAX_TX_POWER_24GHZ);
+	default_power1 = rt2x00_eeprom_addr(rt2x00dev, EEPROM_TXPOWER_BG1);
+	default_power2 = rt2x00_eeprom_addr(rt2x00dev, EEPROM_TXPOWER_BG2);
 
 	for (i = 0; i < 14; i++) {
-		info[i].tx_power1 = TXPOWER_G_FROM_DEV(tx_power1[i]);
-		info[i].tx_power2 = TXPOWER_G_FROM_DEV(tx_power2[i]);
+		info[i].max_power = max_power;
+		info[i].default_power1 = TXPOWER_G_FROM_DEV(default_power1[i]);
+		info[i].default_power2 = TXPOWER_G_FROM_DEV(default_power2[i]);
 	}
 
 	if (spec->num_channels > 14) {
-		tx_power1 = rt2x00_eeprom_addr(rt2x00dev, EEPROM_TXPOWER_A1);
-		tx_power2 = rt2x00_eeprom_addr(rt2x00dev, EEPROM_TXPOWER_A2);
+		max_power = rt2x00_get_field16(eeprom, EEPROM_MAX_TX_POWER_5GHZ);
+		default_power1 = rt2x00_eeprom_addr(rt2x00dev, EEPROM_TXPOWER_A1);
+		default_power2 = rt2x00_eeprom_addr(rt2x00dev, EEPROM_TXPOWER_A2);
 
 		for (i = 14; i < spec->num_channels; i++) {
-			info[i].tx_power1 = TXPOWER_A_FROM_DEV(tx_power1[i]);
-			info[i].tx_power2 = TXPOWER_A_FROM_DEV(tx_power2[i]);
+			info[i].max_power = max_power;
+			info[i].default_power1 = TXPOWER_A_FROM_DEV(default_power1[i]);
+			info[i].default_power2 = TXPOWER_A_FROM_DEV(default_power2[i]);
 		}
 	}
 
Index: linux-2.6.35.y/drivers/net/wireless/rt2x00/rt2x00.h
===================================================================
--- linux-2.6.35.y.orig/drivers/net/wireless/rt2x00/rt2x00.h
+++ linux-2.6.35.y/drivers/net/wireless/rt2x00/rt2x00.h
@@ -211,8 +211,9 @@ struct channel_info {
 	unsigned int flags;
 #define GEOGRAPHY_ALLOWED	0x00000001
 
-	short tx_power1;
-	short tx_power2;
+	short max_power;
+	short default_power1;
+	short default_power2;
 };
 
 /*
Index: linux-2.6.35.y/drivers/net/wireless/rt2x00/rt2x00dev.c
===================================================================
--- linux-2.6.35.y.orig/drivers/net/wireless/rt2x00/rt2x00dev.c
+++ linux-2.6.35.y/drivers/net/wireless/rt2x00/rt2x00dev.c
@@ -605,7 +605,7 @@ static int rt2x00lib_probe_hw_modes(stru
 	for (i = 0; i < spec->num_channels; i++) {
 		rt2x00lib_channel(&channels[i],
 				  spec->channels[i].channel,
-				  spec->channels_info[i].tx_power1, i);
+				  spec->channels_info[i].max_power, i);
 	}
 
 	/*
Index: linux-2.6.35.y/drivers/net/wireless/rt2x00/rt61pci.c
===================================================================
--- linux-2.6.35.y.orig/drivers/net/wireless/rt2x00/rt61pci.c
+++ linux-2.6.35.y/drivers/net/wireless/rt2x00/rt61pci.c
@@ -2605,13 +2605,17 @@ static int rt61pci_probe_hw_mode(struct 
 	spec->channels_info = info;
 
 	tx_power = rt2x00_eeprom_addr(rt2x00dev, EEPROM_TXPOWER_G_START);
-	for (i = 0; i < 14; i++)
-		info[i].tx_power1 = TXPOWER_FROM_DEV(tx_power[i]);
+	for (i = 0; i < 14; i++) {
+		info[i].max_power = MAX_TXPOWER;
+		info[i].default_power1 = TXPOWER_FROM_DEV(tx_power[i]);
+	}
 
 	if (spec->num_channels > 14) {
 		tx_power = rt2x00_eeprom_addr(rt2x00dev, EEPROM_TXPOWER_A_START);
-		for (i = 14; i < spec->num_channels; i++)
-			info[i].tx_power1 = TXPOWER_FROM_DEV(tx_power[i]);
+		for (i = 14; i < spec->num_channels; i++) {
+			info[i].max_power = MAX_TXPOWER;
+			info[i].default_power1 = TXPOWER_FROM_DEV(tx_power[i]);
+		}
 	}
 
 	return 0;
Index: linux-2.6.35.y/drivers/net/wireless/rt2x00/rt73usb.c
===================================================================
--- linux-2.6.35.y.orig/drivers/net/wireless/rt2x00/rt73usb.c
+++ linux-2.6.35.y/drivers/net/wireless/rt2x00/rt73usb.c
@@ -2092,13 +2092,17 @@ static int rt73usb_probe_hw_mode(struct 
 	spec->channels_info = info;
 
 	tx_power = rt2x00_eeprom_addr(rt2x00dev, EEPROM_TXPOWER_G_START);
-	for (i = 0; i < 14; i++)
-		info[i].tx_power1 = TXPOWER_FROM_DEV(tx_power[i]);
+	for (i = 0; i < 14; i++) {
+		info[i].max_power = MAX_TXPOWER;
+		info[i].default_power1 = TXPOWER_FROM_DEV(tx_power[i]);
+	}
 
 	if (spec->num_channels > 14) {
 		tx_power = rt2x00_eeprom_addr(rt2x00dev, EEPROM_TXPOWER_A_START);
-		for (i = 14; i < spec->num_channels; i++)
-			info[i].tx_power1 = TXPOWER_FROM_DEV(tx_power[i]);
+		for (i = 14; i < spec->num_channels; i++) {
+			info[i].max_power = MAX_TXPOWER;
+			info[i].default_power1 = TXPOWER_FROM_DEV(tx_power[i]);
+		}
 	}
 
 	return 0;

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

* [PATCH] [95/139] ALSA: hda - Enable jack sense for Thinkpad Edge 11
  2011-02-02  0:43 [PATCH] [0/139] 2.6.35.11 longterm review Andi Kleen
                   ` (93 preceding siblings ...)
  2011-02-02  0:44 ` [PATCH] [94/139] rt2x00: Fix max TX power settings Andi Kleen
@ 2011-02-02  0:44 ` Andi Kleen
  2011-02-02  0:44 ` [PATCH] [96/139] Input: synaptics - fix handling of 2-button ClickPads Andi Kleen
                   ` (44 subsequent siblings)
  139 siblings, 0 replies; 149+ messages in thread
From: Andi Kleen @ 2011-02-02  0:44 UTC (permalink / raw)
  To: manoj.iyer, tiwai, gregkh, ak, linux-kernel, stable

2.6.35-longterm review patch.  If anyone has any objections, please let me know.

------------------
From: Manoj Iyer <manoj.iyer@canonical.com>

commit 6027277e77df2d2893d906c42f5c9f9abcb731e0 upstream.

Add a quirk entry for Thinkpad Edge 11 as well as other TP Edge models.

Signed-off-by: Manoj Iyer <manoj.iyer@canonical.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: Andi Kleen <ak@linux.intel.com>

---
 sound/pci/hda/patch_conexant.c |    1 +
 1 file changed, 1 insertion(+)

Index: linux-2.6.35.y/sound/pci/hda/patch_conexant.c
===================================================================
--- linux-2.6.35.y.orig/sound/pci/hda/patch_conexant.c
+++ linux-2.6.35.y/sound/pci/hda/patch_conexant.c
@@ -3039,6 +3039,7 @@ static struct snd_pci_quirk cxt5066_cfg_
 	SND_PCI_QUIRK(0x17aa, 0x21b2, "Thinkpad X100e", CXT5066_IDEAPAD),
 	SND_PCI_QUIRK(0x17aa, 0x21b3, "Thinkpad Edge 13 (197)", CXT5066_IDEAPAD),
 	SND_PCI_QUIRK(0x17aa, 0x21b4, "Thinkpad Edge", CXT5066_IDEAPAD),
+	SND_PCI_QUIRK(0x17aa, 0x21c8, "Thinkpad Edge 11", CXT5066_IDEAPAD),
 	SND_PCI_QUIRK(0x17aa, 0x3a0d, "ideapad", CXT5066_IDEAPAD),
 	SND_PCI_QUIRK(0x17aa, 0x215e, "Lenovo Thinkpad", CXT5066_THINKPAD),
 	{}

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

* [PATCH] [96/139] Input: synaptics - fix handling of 2-button ClickPads
  2011-02-02  0:43 [PATCH] [0/139] 2.6.35.11 longterm review Andi Kleen
                   ` (94 preceding siblings ...)
  2011-02-02  0:44 ` [PATCH] [95/139] ALSA: hda - Enable jack sense for Thinkpad Edge 11 Andi Kleen
@ 2011-02-02  0:44 ` Andi Kleen
  2011-02-02  0:44 ` [PATCH] [97/139] install_special_mapping skips security_file_mmap check Andi Kleen
                   ` (43 subsequent siblings)
  139 siblings, 0 replies; 149+ messages in thread
From: Andi Kleen @ 2011-02-02  0:44 UTC (permalink / raw)
  To: yan.i.li, dtor, gregkh, ak, linux-kernel, stable

2.6.35-longterm review patch.  If anyone has any objections, please let me know.

------------------
From: Yan Li <yan.i.li@intel.com>

commit 3bfa321e662edf90fb8123a02c987c2965fa50bb upstream.

Lenovo S10-3t's ClickPad is a 2-button ClickPad that reports BTN_LEFT
and BTN_RIGHT as normal touchpad, unlike the 1-button ClickPad used in
HP mini 210 that reports solely BTN_MIDDLE.

In 0xc0-cap response, the 1-button ClickPad has the 20-bit set while
2-button ClickPad has the 8-bit set.

This patch makes the kernel only handle 1-button ClickPad specially,
and treat 2-button ClickPad in the same fashion as regular touchpads.

This fixes kernel bug #18122 and MeeGo bug #4807.

Signed-off-by: Yan Li <yan.i.li@intel.com>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: Andi Kleen <ak@linux.intel.com>

---
 drivers/input/mouse/synaptics.h |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Index: linux-2.6.35.y/drivers/input/mouse/synaptics.h
===================================================================
--- linux-2.6.35.y.orig/drivers/input/mouse/synaptics.h
+++ linux-2.6.35.y/drivers/input/mouse/synaptics.h
@@ -51,7 +51,8 @@
 #define SYN_EXT_CAP_REQUESTS(c)		(((c) & 0x700000) >> 20)
 #define SYN_CAP_MULTI_BUTTON_NO(ec)	(((ec) & 0x00f000) >> 12)
 #define SYN_CAP_PRODUCT_ID(ec)		(((ec) & 0xff0000) >> 16)
-#define SYN_CAP_CLICKPAD(ex0c)		((ex0c) & 0x100100)
+#define SYN_CAP_CLICKPAD(ex0c)		((ex0c) & 0x100000) /* 1-button ClickPad */
+#define SYN_CAP_CLICKPAD2BTN(ex0c)	((ex0c) & 0x000100) /* 2-button ClickPad */
 #define SYN_CAP_MAX_DIMENSIONS(ex0c)	((ex0c) & 0x020000)
 
 /* synaptics modes query bits */

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

* [PATCH] [97/139] install_special_mapping skips security_file_mmap check.
  2011-02-02  0:43 [PATCH] [0/139] 2.6.35.11 longterm review Andi Kleen
                   ` (95 preceding siblings ...)
  2011-02-02  0:44 ` [PATCH] [96/139] Input: synaptics - fix handling of 2-button ClickPads Andi Kleen
@ 2011-02-02  0:44 ` Andi Kleen
  2011-02-02  0:44 ` [PATCH] [98/139] USB: misc: uss720.c: add another vendor/product ID Andi Kleen
                   ` (42 subsequent siblings)
  139 siblings, 0 replies; 149+ messages in thread
From: Andi Kleen @ 2011-02-02  0:44 UTC (permalink / raw)
  To: taviso, taviso, kees, swiecki, ak, jmorris, torvalds, gregkh,
	linux-kernel, stable

2.6.35-longterm review patch.  If anyone has any objections, please let me know.

------------------
From: Tavis Ormandy <taviso@cmpxchg8b.com>

commit 462e635e5b73ba9a4c03913b77138cd57ce4b050 upstream.

The install_special_mapping routine (used, for example, to setup the
vdso) skips the security check before insert_vm_struct, allowing a local
attacker to bypass the mmap_min_addr security restriction by limiting
the available pages for special mappings.

bprm_mm_init() also skips the check, and although I don't think this can
be used to bypass any restrictions, I don't see any reason not to have
the security check.

  $ uname -m
  x86_64
  $ cat /proc/sys/vm/mmap_min_addr
  65536
  $ cat install_special_mapping.s
  section .bss
      resb BSS_SIZE
  section .text
      global _start
      _start:
          mov     eax, __NR_pause
          int     0x80
  $ nasm -D__NR_pause=29 -DBSS_SIZE=0xfffed000 -f elf -o install_special_mapping.o install_special_mapping.s
  $ ld -m elf_i386 -Ttext=0x10000 -Tbss=0x11000 -o install_special_mapping install_special_mapping.o
  $ ./install_special_mapping &
  [1] 14303
  $ cat /proc/14303/maps
  0000f000-00010000 r-xp 00000000 00:00 0                                  [vdso]
  00010000-00011000 r-xp 00001000 00:19 2453665                            /home/taviso/install_special_mapping
  00011000-ffffe000 rwxp 00000000 00:00 0                                  [stack]

It's worth noting that Red Hat are shipping with mmap_min_addr set to
4096.

Signed-off-by: Tavis Ormandy <taviso@google.com>
Acked-by: Kees Cook <kees@ubuntu.com>
Acked-by: Robert Swiecki <swiecki@google.com>
Signed-off-by: Andi Kleen <ak@linux.intel.com>
[ Changed to not drop the error code - akpm ]
Reviewed-by: James Morris <jmorris@namei.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

---
 fs/exec.c |    5 +++++
 mm/mmap.c |   16 ++++++++++++----
 2 files changed, 17 insertions(+), 4 deletions(-)

Index: linux-2.6.35.y/fs/exec.c
===================================================================
--- linux-2.6.35.y.orig/fs/exec.c
+++ linux-2.6.35.y/fs/exec.c
@@ -265,6 +265,11 @@ static int __bprm_mm_init(struct linux_b
 	vma->vm_flags = VM_STACK_FLAGS | VM_STACK_INCOMPLETE_SETUP;
 	vma->vm_page_prot = vm_get_page_prot(vma->vm_flags);
 	INIT_LIST_HEAD(&vma->anon_vma_chain);
+
+	err = security_file_mmap(NULL, 0, 0, 0, vma->vm_start, 1);
+	if (err)
+		goto err;
+
 	err = insert_vm_struct(mm, vma);
 	if (err)
 		goto err;
Index: linux-2.6.35.y/mm/mmap.c
===================================================================
--- linux-2.6.35.y.orig/mm/mmap.c
+++ linux-2.6.35.y/mm/mmap.c
@@ -2444,6 +2444,7 @@ int install_special_mapping(struct mm_st
 			    unsigned long addr, unsigned long len,
 			    unsigned long vm_flags, struct page **pages)
 {
+	int ret;
 	struct vm_area_struct *vma;
 
 	vma = kmem_cache_zalloc(vm_area_cachep, GFP_KERNEL);
@@ -2461,16 +2462,23 @@ int install_special_mapping(struct mm_st
 	vma->vm_ops = &special_mapping_vmops;
 	vma->vm_private_data = pages;
 
-	if (unlikely(insert_vm_struct(mm, vma))) {
-		kmem_cache_free(vm_area_cachep, vma);
-		return -ENOMEM;
-	}
+	ret = security_file_mmap(NULL, 0, 0, 0, vma->vm_start, 1);
+	if (ret)
+		goto out;
+
+	ret = insert_vm_struct(mm, vma);
+	if (ret)
+		goto out;
 
 	mm->total_vm += len >> PAGE_SHIFT;
 
 	perf_event_mmap(vma);
 
 	return 0;
+
+out:
+	kmem_cache_free(vm_area_cachep, vma);
+	return ret;
 }
 
 static DEFINE_MUTEX(mm_all_locks_mutex);

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

* [PATCH] [98/139] USB: misc: uss720.c: add another vendor/product ID
  2011-02-02  0:43 [PATCH] [0/139] 2.6.35.11 longterm review Andi Kleen
                   ` (96 preceding siblings ...)
  2011-02-02  0:44 ` [PATCH] [97/139] install_special_mapping skips security_file_mmap check Andi Kleen
@ 2011-02-02  0:44 ` Andi Kleen
  2011-02-02  0:44 ` [PATCH] [99/139] USB: ftdi_sio: Add D.O.Tec PID Andi Kleen
                   ` (41 subsequent siblings)
  139 siblings, 0 replies; 149+ messages in thread
From: Andi Kleen @ 2011-02-02  0:44 UTC (permalink / raw)
  To: t.sailer, gregkh, ak, linux-kernel, stable

2.6.35-longterm review patch.  If anyone has any objections, please let me know.

------------------
From: Thomas Sailer <t.sailer@alumni.ethz.ch>

commit ecc1624a2fff45780959efbcb73ace18fdb3c58d upstream.

Fabio Battaglia report that he has another cable that works with this
driver, so this patch adds its vendor/product ID.

Signed-off-by: Thomas Sailer <t.sailer@alumni.ethz.ch>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: Andi Kleen <ak@linux.intel.com>

---
 drivers/usb/misc/uss720.c |    4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

Index: linux-2.6.35.y/drivers/usb/misc/uss720.c
===================================================================
--- linux-2.6.35.y.orig/drivers/usb/misc/uss720.c
+++ linux-2.6.35.y/drivers/usb/misc/uss720.c
@@ -3,7 +3,7 @@
 /*
  *	uss720.c  --  USS720 USB Parport Cable.
  *
- *	Copyright (C) 1999, 2005
+ *	Copyright (C) 1999, 2005, 2010
  *	    Thomas Sailer (t.sailer@alumni.ethz.ch)
  *
  *	This program is free software; you can redistribute it and/or modify
@@ -776,6 +776,8 @@ static const struct usb_device_id uss720
 	{ USB_DEVICE(0x0557, 0x2001) },
 	{ USB_DEVICE(0x0729, 0x1284) },
 	{ USB_DEVICE(0x1293, 0x0002) },
+	{ USB_DEVICE(0x1293, 0x0002) },
+	{ USB_DEVICE(0x050d, 0x0002) },
 	{ }						/* Terminating entry */
 };
 

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

* [PATCH] [99/139] USB: ftdi_sio: Add D.O.Tec PID
  2011-02-02  0:43 [PATCH] [0/139] 2.6.35.11 longterm review Andi Kleen
                   ` (97 preceding siblings ...)
  2011-02-02  0:44 ` [PATCH] [98/139] USB: misc: uss720.c: add another vendor/product ID Andi Kleen
@ 2011-02-02  0:44 ` Andi Kleen
  2011-02-02  0:44 ` [PATCH] [100/139] USB: usb-storage: unusual_devs entry for the Samsung YP-CP3 Andi Kleen
                   ` (40 subsequent siblings)
  139 siblings, 0 replies; 149+ messages in thread
From: Andi Kleen @ 2011-02-02  0:44 UTC (permalink / raw)
  To: faberman, gregkh, ak, linux-kernel, stable

2.6.35-longterm review patch.  If anyone has any objections, please let me know.

------------------
From: Florian Faber <faberman@linuxproaudio.org>

commit 5363cdc3c5da9bd431552cf5989ab481596f0c6d upstream.

Add FTDI PID to identify D.O.Tec devices correctly.

Signed-off-by: Florian Faber <faberman@linuxproaudio.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: Andi Kleen <ak@linux.intel.com>

---
 drivers/usb/serial/ftdi_sio.c     |    1 +
 drivers/usb/serial/ftdi_sio_ids.h |    5 +++++
 2 files changed, 6 insertions(+)

Index: linux-2.6.35.y/drivers/usb/serial/ftdi_sio.c
===================================================================
--- linux-2.6.35.y.orig/drivers/usb/serial/ftdi_sio.c
+++ linux-2.6.35.y/drivers/usb/serial/ftdi_sio.c
@@ -796,6 +796,7 @@ static struct usb_device_id id_table_com
 	{ USB_DEVICE(FTDI_VID, FTDI_SCIENCESCOPE_LOGBOOKML_PID) },
 	{ USB_DEVICE(FTDI_VID, FTDI_SCIENCESCOPE_LS_LOGBOOK_PID) },
 	{ USB_DEVICE(FTDI_VID, FTDI_SCIENCESCOPE_HS_LOGBOOK_PID) },
+	{ USB_DEVICE(FTDI_VID, FTDI_DOTEC_PID) },
 	{ USB_DEVICE(QIHARDWARE_VID, MILKYMISTONE_JTAGSERIAL_PID),
 		.driver_info = (kernel_ulong_t)&ftdi_jtag_quirk },
 	{ },					/* Optional parameter entry */
Index: linux-2.6.35.y/drivers/usb/serial/ftdi_sio_ids.h
===================================================================
--- linux-2.6.35.y.orig/drivers/usb/serial/ftdi_sio_ids.h
+++ linux-2.6.35.y/drivers/usb/serial/ftdi_sio_ids.h
@@ -1081,6 +1081,11 @@
 #define MJSG_HD_RADIO_PID	0x937C
 
 /*
+ * D.O.Tec products (http://www.directout.eu)
+ */
+#define FTDI_DOTEC_PID 0x9868
+
+/*
  * Xverve Signalyzer tools (http://www.signalyzer.com/)
  */
 #define XVERVE_SIGNALYZER_ST_PID	0xBCA0

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

* [PATCH] [100/139] USB: usb-storage: unusual_devs entry for the Samsung YP-CP3
  2011-02-02  0:43 [PATCH] [0/139] 2.6.35.11 longterm review Andi Kleen
                   ` (98 preceding siblings ...)
  2011-02-02  0:44 ` [PATCH] [99/139] USB: ftdi_sio: Add D.O.Tec PID Andi Kleen
@ 2011-02-02  0:44 ` Andi Kleen
  2011-02-02  0:44 ` [PATCH] [101/139] Revert "USB: gadget: Allow function access to device ID data during bind()" Andi Kleen
                   ` (39 subsequent siblings)
  139 siblings, 0 replies; 149+ messages in thread
From: Andi Kleen @ 2011-02-02  0:44 UTC (permalink / raw)
  To: vitty, stern, ak, mdharm-usb, gregkh, linux-kernel, stable

2.6.35-longterm review patch.  If anyone has any objections, please let me know.

------------------
From: Vitaly Kuznetsov <vitty@altlinux.ru>

commit d73a9b3001f29271c2e9f2a806b05a431c5d9591 upstream.

Add an unusual_devs entry for the Samsung YP-CP3 MP4 player.

User was getting the following errors in dmesg:
 usb 2-6: reset high speed USB device using ehci_hcd and address 2
 usb 2-6: reset high speed USB device using ehci_hcd and address 2
 usb 2-6: reset high speed USB device using ehci_hcd and address 2
 usb 2-6: USB disconnect, address 2
 sd 3:0:0:0: [sdb] Assuming drive cache: write through
 sdb:<2>ldm_validate_partition_table(): Disk read failed.
 Dev sdb: unable to read RDB block 0
  unable to read partition table

Signed-off-by: Vitaly Kuznetsov <vitty@altlinux.ru>
Acked-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Andi Kleen <ak@linux.intel.com>
CC: Matthew Dharm <mdharm-usb@one-eyed-alien.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

---
 drivers/usb/storage/unusual_devs.h |    7 +++++++
 1 file changed, 7 insertions(+)

Index: linux-2.6.35.y/drivers/usb/storage/unusual_devs.h
===================================================================
--- linux-2.6.35.y.orig/drivers/usb/storage/unusual_devs.h
+++ linux-2.6.35.y/drivers/usb/storage/unusual_devs.h
@@ -481,6 +481,13 @@ UNUSUAL_DEV(  0x04e8, 0x507c, 0x0220, 0x
 		US_SC_DEVICE, US_PR_DEVICE, NULL,
 		US_FL_MAX_SECTORS_64),
 
+/* Reported by Vitaly Kuznetsov <vitty@altlinux.ru> */
+UNUSUAL_DEV(  0x04e8, 0x5122, 0x0000, 0x9999,
+		"Samsung",
+		"YP-CP3",
+		US_SC_DEVICE, US_PR_DEVICE, NULL,
+		US_FL_MAX_SECTORS_64 | US_FL_BULK_IGNORE_TAG),
+
 /* Entry and supporting patch by Theodore Kilgore <kilgota@auburn.edu>.
  * Device uses standards-violating 32-byte Bulk Command Block Wrappers and
  * reports itself as "Proprietary SCSI Bulk." Cf. device entry 0x084d:0x0011.

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

* [PATCH] [101/139] Revert "USB: gadget: Allow function access to device ID data during bind()"
  2011-02-02  0:43 [PATCH] [0/139] 2.6.35.11 longterm review Andi Kleen
                   ` (99 preceding siblings ...)
  2011-02-02  0:44 ` [PATCH] [100/139] USB: usb-storage: unusual_devs entry for the Samsung YP-CP3 Andi Kleen
@ 2011-02-02  0:44 ` Andi Kleen
  2011-02-02  0:45 ` [PATCH] [102/139] p54usb: add 5 more USBIDs Andi Kleen
                   ` (38 subsequent siblings)
  139 siblings, 0 replies; 149+ messages in thread
From: Andi Kleen @ 2011-02-02  0:44 UTC (permalink / raw)
  To: gregkh, Robert.Lukassen, ak, linux-kernel, stable

2.6.35-longterm review patch.  If anyone has any objections, please let me know.

------------------
From: Greg Kroah-Hartman <gregkh@suse.de>

commit dbb442b85a1d82f91cfe0524c4f9b3a5196a10ca upstream.

This reverts commit 1ab83238740ff1e1773d5c13ecac43c60cf4aec4.

Turns out this doesn't allow for the device ids to be overridden
properly, so we need to revert the thing.

Reported-by: Jef Driesen <jefdriesen@telenet.be>
Cc: Robert Lukassen <Robert.Lukassen@tomtom.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: Andi Kleen <ak@linux.intel.com>

---
 drivers/usb/gadget/composite.c |   16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

Index: linux-2.6.35.y/drivers/usb/gadget/composite.c
===================================================================
--- linux-2.6.35.y.orig/drivers/usb/gadget/composite.c
+++ linux-2.6.35.y/drivers/usb/gadget/composite.c
@@ -1018,14 +1018,6 @@ static int composite_bind(struct usb_gad
 	 */
 	usb_ep_autoconfig_reset(cdev->gadget);
 
-	/* standardized runtime overrides for device ID data */
-	if (idVendor)
-		cdev->desc.idVendor = cpu_to_le16(idVendor);
-	if (idProduct)
-		cdev->desc.idProduct = cpu_to_le16(idProduct);
-	if (bcdDevice)
-		cdev->desc.bcdDevice = cpu_to_le16(bcdDevice);
-
 	/* composite gadget needs to assign strings for whole device (like
 	 * serial number), register function drivers, potentially update
 	 * power state and consumption, etc
@@ -1037,6 +1029,14 @@ static int composite_bind(struct usb_gad
 	cdev->desc = *composite->dev;
 	cdev->desc.bMaxPacketSize0 = gadget->ep0->maxpacket;
 
+	/* standardized runtime overrides for device ID data */
+	if (idVendor)
+		cdev->desc.idVendor = cpu_to_le16(idVendor);
+	if (idProduct)
+		cdev->desc.idProduct = cpu_to_le16(idProduct);
+	if (bcdDevice)
+		cdev->desc.bcdDevice = cpu_to_le16(bcdDevice);
+
 	/* strings can't be assigned before bind() allocates the
 	 * releavnt identifiers
 	 */

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

* [PATCH] [102/139] p54usb: add 5 more USBIDs
  2011-02-02  0:43 [PATCH] [0/139] 2.6.35.11 longterm review Andi Kleen
                   ` (100 preceding siblings ...)
  2011-02-02  0:44 ` [PATCH] [101/139] Revert "USB: gadget: Allow function access to device ID data during bind()" Andi Kleen
@ 2011-02-02  0:45 ` Andi Kleen
  2011-02-02  0:45 ` [PATCH] [103/139] p54usb: New USB ID for Gemtek WUBI-100GW Andi Kleen
                   ` (37 subsequent siblings)
  139 siblings, 0 replies; 149+ messages in thread
From: Andi Kleen @ 2011-02-02  0:45 UTC (permalink / raw)
  To: chunkeey, linville, gregkh, ak, linux-kernel, stable

2.6.35-longterm review patch.  If anyone has any objections, please let me know.

------------------
From: Christian Lamparter <chunkeey@googlemail.com>

commit 16cad7fba037b34ca32cc0adac65bc089d969fb8 upstream.

This patch adds five more USBIDs to the table.

Source:
http://www.linuxant.com/pipermail/driverloader/2005q3/002307.html
http://wireless.kernel.org/en/users/Drivers/p54/devices (by M. Davis)

Signed-off-by: Christian Lamparter <chunkeey@googlemail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: Andi Kleen <ak@linux.intel.com>

---
 drivers/net/wireless/p54/p54usb.c |    5 +++++
 1 file changed, 5 insertions(+)

Index: linux-2.6.35.y/drivers/net/wireless/p54/p54usb.c
===================================================================
--- linux-2.6.35.y.orig/drivers/net/wireless/p54/p54usb.c
+++ linux-2.6.35.y/drivers/net/wireless/p54/p54usb.c
@@ -43,6 +43,7 @@ MODULE_FIRMWARE("isl3887usb");
 
 static struct usb_device_id p54u_table[] __devinitdata = {
 	/* Version 1 devices (pci chip + net2280) */
+	{USB_DEVICE(0x0411, 0x0050)},	/* Buffalo WLI2-USB2-G54 */
 	{USB_DEVICE(0x045e, 0x00c2)},	/* Microsoft MN-710 */
 	{USB_DEVICE(0x0506, 0x0a11)},	/* 3COM 3CRWE254G72 */
 	{USB_DEVICE(0x06b9, 0x0120)},	/* Thomson SpeedTouch 120g */
@@ -56,9 +57,12 @@ static struct usb_device_id p54u_table[]
 	{USB_DEVICE(0x0846, 0x4220)},	/* Netgear WG111 */
 	{USB_DEVICE(0x09aa, 0x1000)},	/* Spinnaker Proto board */
 	{USB_DEVICE(0x0cde, 0x0006)},	/* Medion 40900, Roper Europe */
+	{USB_DEVICE(0x0db0, 0x6826)},	/* MSI UB54G (MS-6826) */
 	{USB_DEVICE(0x107b, 0x55f2)},	/* Gateway WGU-210 (Gemtek) */
 	{USB_DEVICE(0x124a, 0x4023)},	/* Shuttle PN15, Airvast WM168g, IOGear GWU513 */
+	{USB_DEVICE(0x1435, 0x0210)},	/* Inventel UR054G */
 	{USB_DEVICE(0x1630, 0x0005)},	/* 2Wire 802.11g USB (v1) / Z-Com */
+	{USB_DEVICE(0x182d, 0x096b)},	/* Sitecom WL-107 */
 	{USB_DEVICE(0x1915, 0x2234)},	/* Linksys WUSB54G OEM */
 	{USB_DEVICE(0x1915, 0x2235)},	/* Linksys WUSB54G Portable OEM */
 	{USB_DEVICE(0x2001, 0x3701)},	/* DLink DWL-G120 Spinnaker */
@@ -93,6 +97,7 @@ static struct usb_device_id p54u_table[]
 	{USB_DEVICE(0x1435, 0x0427)},	/* Inventel UR054G */
 	{USB_DEVICE(0x1668, 0x1050)},	/* Actiontec 802UIG-1 */
 	{USB_DEVICE(0x2001, 0x3704)},	/* DLink DWL-G122 rev A2 */
+	{USB_DEVICE(0x2001, 0x3705)},	/* D-Link DWL-G120 rev C1 */
 	{USB_DEVICE(0x413c, 0x5513)},	/* Dell WLA3310 USB Wireless Adapter */
 	{USB_DEVICE(0x413c, 0x8102)},	/* Spinnaker DUT */
 	{USB_DEVICE(0x413c, 0x8104)},	/* Cohiba Proto board */

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

* [PATCH] [103/139] p54usb: New USB ID for Gemtek WUBI-100GW
  2011-02-02  0:43 [PATCH] [0/139] 2.6.35.11 longterm review Andi Kleen
                   ` (101 preceding siblings ...)
  2011-02-02  0:45 ` [PATCH] [102/139] p54usb: add 5 more USBIDs Andi Kleen
@ 2011-02-02  0:45 ` Andi Kleen
  2011-02-02  0:45 ` [PATCH] [104/139] n_gsm: Fix message length handling when building header Andi Kleen
                   ` (36 subsequent siblings)
  139 siblings, 0 replies; 149+ messages in thread
From: Andi Kleen @ 2011-02-02  0:45 UTC (permalink / raw)
  To: ecosta.tmp, Larry.Finger, linville, gregkh, ak, linux-kernel, stable

2.6.35-longterm review patch.  If anyone has any objections, please let me know.

------------------
From: Eduardo Costa <ecosta.tmp@gmail.com>

commit 56e6417b49132d4f56e9f2241d31942b90b46315 upstream.

This USB ID is for the WUBI-100GW 802.11g Wireless LAN USB Device that
uses p54usb.

Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: Eduardo Costa <ecosta.tmp@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: Andi Kleen <ak@linux.intel.com>

---
 drivers/net/wireless/p54/p54usb.c |    1 +
 1 file changed, 1 insertion(+)

Index: linux-2.6.35.y/drivers/net/wireless/p54/p54usb.c
===================================================================
--- linux-2.6.35.y.orig/drivers/net/wireless/p54/p54usb.c
+++ linux-2.6.35.y/drivers/net/wireless/p54/p54usb.c
@@ -61,6 +61,7 @@ static struct usb_device_id p54u_table[]
 	{USB_DEVICE(0x107b, 0x55f2)},	/* Gateway WGU-210 (Gemtek) */
 	{USB_DEVICE(0x124a, 0x4023)},	/* Shuttle PN15, Airvast WM168g, IOGear GWU513 */
 	{USB_DEVICE(0x1435, 0x0210)},	/* Inventel UR054G */
+	{USB_DEVICE(0x15a9, 0x0002)},	/* Gemtek WUBI-100GW 802.11g */
 	{USB_DEVICE(0x1630, 0x0005)},	/* 2Wire 802.11g USB (v1) / Z-Com */
 	{USB_DEVICE(0x182d, 0x096b)},	/* Sitecom WL-107 */
 	{USB_DEVICE(0x1915, 0x2234)},	/* Linksys WUSB54G OEM */

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

* [PATCH] [104/139] n_gsm: Fix message length handling when building header
  2011-02-02  0:43 [PATCH] [0/139] 2.6.35.11 longterm review Andi Kleen
                   ` (102 preceding siblings ...)
  2011-02-02  0:45 ` [PATCH] [103/139] p54usb: New USB ID for Gemtek WUBI-100GW Andi Kleen
@ 2011-02-02  0:45 ` Andi Kleen
  2011-02-02  0:45 ` [PATCH] [105/139] n_gsm: gsm_data_alloc buffer allocation could fail and it is not being checked Andi Kleen
                   ` (35 subsequent siblings)
  139 siblings, 0 replies; 149+ messages in thread
From: Andi Kleen @ 2011-02-02  0:45 UTC (permalink / raw)
  To: ken.k.mills, alan, gregkh, ak, linux-kernel, stable

2.6.35-longterm review patch.  If anyone has any objections, please let me know.

------------------
From: Ken Mills <ken.k.mills@intel.com>

commit be7a7411d63ccad165d66fe8e0b11b2ee336159b upstream.

Fix message length handling when building header

When the message length is greater than 127, the length field in the header
is built incorrectly. According to the spec, when the length is less than 128
the length field is a single byte formatted as: bbbbbbb1. When it is greater
than 127 then the field is two bytes of the format: bbbbbbb0 bbbbbbbb.

Signed-off-by: Ken Mills <ken.k.mills@intel.com>
Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: Andi Kleen <ak@linux.intel.com>

---
 drivers/char/n_gsm.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Index: linux-2.6.35.y/drivers/char/n_gsm.c
===================================================================
--- linux-2.6.35.y.orig/drivers/char/n_gsm.c
+++ linux-2.6.35.y/drivers/char/n_gsm.c
@@ -717,8 +717,8 @@ static void __gsm_data_queue(struct gsm_
 		if (msg->len < 128)
 			*--dp = (msg->len << 1) | EA;
 		else {
-			*--dp = (msg->len >> 6) | EA;
-			*--dp = (msg->len & 127) << 1;
+			*--dp = (msg->len >> 7);	/* bits 7 - 15 */
+			*--dp = (msg->len & 127) << 1;	/* bits 0 - 6 */
 		}
 	}
 

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

* [PATCH] [105/139] n_gsm: gsm_data_alloc buffer allocation could fail and it is not being checked
  2011-02-02  0:43 [PATCH] [0/139] 2.6.35.11 longterm review Andi Kleen
                   ` (103 preceding siblings ...)
  2011-02-02  0:45 ` [PATCH] [104/139] n_gsm: Fix message length handling when building header Andi Kleen
@ 2011-02-02  0:45 ` Andi Kleen
  2011-02-02  0:45 ` [PATCH] [106/139] xhci: Fix issue with port array setup and buggy hosts Andi Kleen
                   ` (34 subsequent siblings)
  139 siblings, 0 replies; 149+ messages in thread
From: Andi Kleen @ 2011-02-02  0:45 UTC (permalink / raw)
  To: ken.k.mills, alan, gregkh, ak, linux-kernel, stable

2.6.35-longterm review patch.  If anyone has any objections, please let me know.

------------------
From: Ken Mills <ken.k.mills@intel.com>

commit 093d804611b9a38fe59753b37c29f840518406a9 upstream.

gsm_data_alloc buffer allocation could fail and it is not being checked.

Add check for allocated buffer and return if the buffer allocation
fails.

Signed-off-by: Ken Mills <ken.k.mills@intel.com>
Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: Andi Kleen <ak@linux.intel.com>

---
 drivers/char/n_gsm.c |    2 ++
 1 file changed, 2 insertions(+)

Index: linux-2.6.35.y/drivers/char/n_gsm.c
===================================================================
--- linux-2.6.35.y.orig/drivers/char/n_gsm.c
+++ linux-2.6.35.y/drivers/char/n_gsm.c
@@ -969,6 +969,8 @@ static void gsm_control_reply(struct gsm
 {
 	struct gsm_msg *msg;
 	msg = gsm_data_alloc(gsm, 0, dlen + 2, gsm->ftype);
+	if (msg == NULL)
+		return;
 	msg->data[0] = (cmd & 0xFE) << 1 | EA;	/* Clear C/R */
 	msg->data[1] = (dlen << 1) | EA;
 	memcpy(msg->data + 2, data, dlen);

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

* [PATCH] [106/139] xhci: Fix issue with port array setup and buggy hosts.
  2011-02-02  0:43 [PATCH] [0/139] 2.6.35.11 longterm review Andi Kleen
                   ` (104 preceding siblings ...)
  2011-02-02  0:45 ` [PATCH] [105/139] n_gsm: gsm_data_alloc buffer allocation could fail and it is not being checked Andi Kleen
@ 2011-02-02  0:45 ` Andi Kleen
  2011-02-02  0:45 ` [PATCH] [107/139] gpio: Fix null pointer dereference while accessing rdc321x platform_data Andi Kleen
                   ` (33 subsequent siblings)
  139 siblings, 0 replies; 149+ messages in thread
From: Andi Kleen @ 2011-02-02  0:45 UTC (permalink / raw)
  To: sarah.a.sharp, gregkh, ak, linux-kernel, stable

2.6.35-longterm review patch.  If anyone has any objections, please let me know.

------------------
From: Sarah Sharp <sarah.a.sharp@linux.intel.com>

commit f8bbeabc34aa945ab4275abc9a4dfde0aea798ca upstream.

Fix two bugs with the port array setup.

The first bug will only show up with broken xHCI hosts with Extended
Capabilities registers that have duplicate port speed entries for the same
port.  The idea with the original code was to set the port_array entry to
-1 if the duplicate port speed entry said the port was a different speed
than the original port speed entry.  That would mean that later, the port
would not be exposed to the USB core. Unfortunately, I forgot a continue
statement, and the port_array entry would just be overwritten in the next
line.

The second bug would happen if there are conflicting port speed registers
(so that some entry in port_array is -1), or one of the hardware port
registers was not described in the port speed registers (so that some
entry in port_array is 0).  The code that sets up the usb2_ports array
would accidentally claim those ports.  That wouldn't really cause any
user-visible issues, but it is a bug.

This patch should go into the stable trees that have the port array and
USB 3.0 port disabling prevention patches.

Signed-off-by: Sarah Sharp <sarah.a.sharp@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: Andi Kleen <ak@linux.intel.com>

---
 drivers/usb/host/xhci-mem.c |   25 +++++++++++++++----------
 1 file changed, 15 insertions(+), 10 deletions(-)

Index: linux-2.6.35.y/drivers/usb/host/xhci-mem.c
===================================================================
--- linux-2.6.35.y.orig/drivers/usb/host/xhci-mem.c
+++ linux-2.6.35.y/drivers/usb/host/xhci-mem.c
@@ -1670,6 +1670,7 @@ static void xhci_add_in_port(struct xhci
 				xhci->port_array[i] = (u8) -1;
 			}
 			/* FIXME: Should we disable the port? */
+			continue;
 		}
 		xhci->port_array[i] = major_revision;
 		if (major_revision == 0x03)
@@ -1748,16 +1749,20 @@ static int xhci_setup_port_arrays(struct
 			return -ENOMEM;
 
 		port_index = 0;
-		for (i = 0; i < num_ports; i++)
-			if (xhci->port_array[i] != 0x03) {
-				xhci->usb2_ports[port_index] =
-					&xhci->op_regs->port_status_base +
-					NUM_PORT_REGS*i;
-				xhci_dbg(xhci, "USB 2.0 port at index %u, "
-						"addr = %p\n", i,
-						xhci->usb2_ports[port_index]);
-				port_index++;
-			}
+		for (i = 0; i < num_ports; i++) {
+			if (xhci->port_array[i] == 0x03 ||
+					xhci->port_array[i] == 0 ||
+					xhci->port_array[i] == -1)
+				continue;
+
+			xhci->usb2_ports[port_index] =
+				&xhci->op_regs->port_status_base +
+				NUM_PORT_REGS*i;
+			xhci_dbg(xhci, "USB 2.0 port at index %u, "
+					"addr = %p\n", i,
+					xhci->usb2_ports[port_index]);
+			port_index++;
+		}
 	}
 	if (xhci->num_usb3_ports) {
 		xhci->usb3_ports = kmalloc(sizeof(*xhci->usb3_ports)*

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

* [PATCH] [107/139] gpio: Fix null pointer dereference while accessing rdc321x platform_data
  2011-02-02  0:43 [PATCH] [0/139] 2.6.35.11 longterm review Andi Kleen
                   ` (105 preceding siblings ...)
  2011-02-02  0:45 ` [PATCH] [106/139] xhci: Fix issue with port array setup and buggy hosts Andi Kleen
@ 2011-02-02  0:45 ` Andi Kleen
  2011-02-02  0:45 ` [PATCH] [108/139] cs5535-gpio: don't apply errata #36 to edge detect GPIOs Andi Kleen
                   ` (32 subsequent siblings)
  139 siblings, 0 replies; 149+ messages in thread
From: Andi Kleen @ 2011-02-02  0:45 UTC (permalink / raw)
  To: florian, sameo, gregkh, ak, linux-kernel, stable

2.6.35-longterm review patch.  If anyone has any objections, please let me know.

------------------
From: Florian Fainelli <florian@openwrt.org>

commit fa6469cb5b2d16703464c344b943e2c025cb7858 upstream.

rdc321x-gpio currently fetches its driver specific data by using the
platform_device->platform_data pointer, this is wrong because the mfd
device which registers our platform_device has been added using
mfd_add_device() which sets the platform_device->driver_data pointer
instead.

Signed-off-by: Florian Fainelli <florian@openwrt.org>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: Andi Kleen <ak@linux.intel.com>

---
 drivers/gpio/rdc321x-gpio.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Index: linux-2.6.35.y/drivers/gpio/rdc321x-gpio.c
===================================================================
--- linux-2.6.35.y.orig/drivers/gpio/rdc321x-gpio.c
+++ linux-2.6.35.y/drivers/gpio/rdc321x-gpio.c
@@ -135,7 +135,7 @@ static int __devinit rdc321x_gpio_probe(
 	struct rdc321x_gpio *rdc321x_gpio_dev;
 	struct rdc321x_gpio_pdata *pdata;
 
-	pdata = pdev->dev.platform_data;
+	pdata = platform_get_drvdata(pdev);
 	if (!pdata) {
 		dev_err(&pdev->dev, "no platform data supplied\n");
 		return -ENODEV;

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

* [PATCH] [108/139] cs5535-gpio: don't apply errata #36 to edge detect GPIOs
  2011-02-02  0:43 [PATCH] [0/139] 2.6.35.11 longterm review Andi Kleen
                   ` (106 preceding siblings ...)
  2011-02-02  0:45 ` [PATCH] [107/139] gpio: Fix null pointer dereference while accessing rdc321x platform_data Andi Kleen
@ 2011-02-02  0:45 ` Andi Kleen
  2011-02-02  0:45 ` [PATCH] [109/139] cs5535-gpio: handle GPIO regs where higher (clear) bits are set Andi Kleen
                   ` (31 subsequent siblings)
  139 siblings, 0 replies; 149+ messages in thread
From: Andi Kleen @ 2011-02-02  0:45 UTC (permalink / raw)
  To: dilinger, dsd, torvalds, gregkh, ak, linux-kernel, stable

2.6.35-longterm review patch.  If anyone has any objections, please let me know.

------------------
From: Andres Salomon <dilinger@queued.net>

commit 001851659354cce436b749a793f3512a53394d80 upstream.

The edge detect status GPIOs function differently from the other atomic
model CS5536 GPIO registers; writing 1 to the high bits clears the GPIO,
but writing 1 to the lower bits also clears the bit.

This means that read-modify-write doesn't actually work for it, so don't
apply the errata here.  If a negative edge status gets lost after
resume..  well, we tried our best!

Tested-by: Daniel Drake <dsd@laptop.org>
Signed-off-by: Andres Salomon <dilinger@queued.net>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: Andi Kleen <ak@linux.intel.com>

---
 drivers/gpio/cs5535-gpio.c |   15 +++++++++++----
 1 file changed, 11 insertions(+), 4 deletions(-)

Index: linux-2.6.35.y/drivers/gpio/cs5535-gpio.c
===================================================================
--- linux-2.6.35.y.orig/drivers/gpio/cs5535-gpio.c
+++ linux-2.6.35.y/drivers/gpio/cs5535-gpio.c
@@ -56,15 +56,22 @@ static struct cs5535_gpio_chip {
  * registers, see include/linux/cs5535.h.
  */
 
-static void errata_outl(u32 val, unsigned long addr)
+static void errata_outl(struct cs5535_gpio_chip *chip, u32 val,
+		unsigned int reg)
 {
+	unsigned long addr = chip->base + 0x80 + reg;
+
 	/*
 	 * According to the CS5536 errata (#36), after suspend
 	 * a write to the high bank GPIO register will clear all
 	 * non-selected bits; the recommended workaround is a
 	 * read-modify-write operation.
+	 *
+	 * Don't apply this errata to the edge status GPIOs, as writing
+	 * to their lower bits will clear them.
 	 */
-	val |= inl(addr);
+	if (reg != GPIO_POSITIVE_EDGE_STS && reg != GPIO_NEGATIVE_EDGE_STS)
+		val |= inl(addr);
 	outl(val, addr);
 }
 
@@ -76,7 +83,7 @@ static void __cs5535_gpio_set(struct cs5
 		outl(1 << offset, chip->base + reg);
 	else
 		/* high bank register */
-		errata_outl(1 << (offset - 16), chip->base + 0x80 + reg);
+		errata_outl(chip, 1 << (offset - 16), reg);
 }
 
 void cs5535_gpio_set(unsigned offset, unsigned int reg)
@@ -98,7 +105,7 @@ static void __cs5535_gpio_clear(struct c
 		outl(1 << (offset + 16), chip->base + reg);
 	else
 		/* high bank register */
-		errata_outl(1 << offset, chip->base + 0x80 + reg);
+		errata_outl(chip, 1 << offset, reg);
 }
 
 void cs5535_gpio_clear(unsigned offset, unsigned int reg)

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

* [PATCH] [109/139] cs5535-gpio: handle GPIO regs where higher (clear) bits are set
  2011-02-02  0:43 [PATCH] [0/139] 2.6.35.11 longterm review Andi Kleen
                   ` (107 preceding siblings ...)
  2011-02-02  0:45 ` [PATCH] [108/139] cs5535-gpio: don't apply errata #36 to edge detect GPIOs Andi Kleen
@ 2011-02-02  0:45 ` Andi Kleen
  2011-02-02  0:45 ` [PATCH] [110/139] mmc: at91_mci: fix multiblock SDIO transfers Andi Kleen
                   ` (30 subsequent siblings)
  139 siblings, 0 replies; 149+ messages in thread
From: Andi Kleen @ 2011-02-02  0:45 UTC (permalink / raw)
  To: dilinger, dsd, torvalds, gregkh, ak, linux-kernel, stable

2.6.35-longterm review patch.  If anyone has any objections, please let me know.

------------------
From: Andres Salomon <dilinger@queued.net>

commit 44658a11f312fb9217674cb90b1a11cbe17fd18d upstream.

The default for non-READ_BACK GPIO regs is to have the clear bits set;
this means that our original errata fix was too simplistic.  This
changes it to the following behavior:

 - when setting GPIOs, ignore the higher order bits (they're for
   clearing, we don't need to care about them).

 - when clearing GPIOs, keep all the bits, but unset (via XOR) the
   lower order bit that negates the clear bit that we care about.  That
   is, if we're clearing GPIO 26 (val = 0x04000000), we first XOR what's
   currently in the register with 0x0400 (GPIO 26's SET bit), and then
   OR that with the GPIO 26's CLEAR bit.

Tested-by: Daniel Drake <dsd@laptop.org>
Signed-off-by: Andres Salomon <dilinger@queued.net>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: Andi Kleen <ak@linux.intel.com>

---
 drivers/gpio/cs5535-gpio.c |    8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

Index: linux-2.6.35.y/drivers/gpio/cs5535-gpio.c
===================================================================
--- linux-2.6.35.y.orig/drivers/gpio/cs5535-gpio.c
+++ linux-2.6.35.y/drivers/gpio/cs5535-gpio.c
@@ -70,8 +70,12 @@ static void errata_outl(struct cs5535_gp
 	 * Don't apply this errata to the edge status GPIOs, as writing
 	 * to their lower bits will clear them.
 	 */
-	if (reg != GPIO_POSITIVE_EDGE_STS && reg != GPIO_NEGATIVE_EDGE_STS)
-		val |= inl(addr);
+	if (reg != GPIO_POSITIVE_EDGE_STS && reg != GPIO_NEGATIVE_EDGE_STS) {
+		if (val & 0xffff)
+			val |= (inl(addr) & 0xffff); /* ignore the high bits */
+		else
+			val |= (inl(addr) ^ (val >> 16));
+	}
 	outl(val, addr);
 }
 

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

* [PATCH] [110/139] mmc: at91_mci: fix multiblock SDIO transfers
  2011-02-02  0:43 [PATCH] [0/139] 2.6.35.11 longterm review Andi Kleen
                   ` (108 preceding siblings ...)
  2011-02-02  0:45 ` [PATCH] [109/139] cs5535-gpio: handle GPIO regs where higher (clear) bits are set Andi Kleen
@ 2011-02-02  0:45 ` Andi Kleen
  2011-02-02  0:45 ` [PATCH] [111/139] mmc: atmel-mci: " Andi Kleen
                   ` (29 subsequent siblings)
  139 siblings, 0 replies; 149+ messages in thread
From: Andi Kleen @ 2011-02-02  0:45 UTC (permalink / raw)
  To: yauhen.kharuzhy, nicolas.ferre, plagnioj, cjb, gregkh, ak,
	linux-kernel, stable

2.6.35-longterm review patch.  If anyone has any objections, please let me know.

------------------
From: Yauhen Kharuzhy <yauhen.kharuzhy@promwad.com>

commit a2255ff45143001fecbc5e5a4b58fcb999d393ae upstream.

The AT91 MCI has special SDIO transfer types: SDIO block and SDIO byte
transfers, but at91_mci driver doesn't use them and handles all SDIO
transfers as ordinary MMC block transfers. This causes problems for
multiple-block SDIO transfers (in particular for 256-bytes blocks).

Fix this situation by checking the opcode for SDIO CMD53 and setting
the transfer type in the AT91_MCI_CMDR register properly.

This patch was tested with libertas SDIO driver: problem with TX
timeouts on big packets was eliminated.

Signed-off-by: Yauhen Kharuzhy <yauhen.kharuzhy@promwad.com>
Signed-off-by: Nicolas Ferre <nicolas.ferre@atmel.com>
Acked-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Signed-off-by: Chris Ball <cjb@laptop.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: Andi Kleen <ak@linux.intel.com>

---
 arch/arm/mach-at91/include/mach/at91_mci.h |    2 ++
 drivers/mmc/host/at91_mci.c                |   13 +++++++++----
 2 files changed, 11 insertions(+), 4 deletions(-)

Index: linux-2.6.35.y/arch/arm/mach-at91/include/mach/at91_mci.h
===================================================================
--- linux-2.6.35.y.orig/arch/arm/mach-at91/include/mach/at91_mci.h
+++ linux-2.6.35.y/arch/arm/mach-at91/include/mach/at91_mci.h
@@ -74,6 +74,8 @@
 #define			AT91_MCI_TRTYP_BLOCK	(0 << 19)
 #define			AT91_MCI_TRTYP_MULTIPLE	(1 << 19)
 #define			AT91_MCI_TRTYP_STREAM	(2 << 19)
+#define			AT91_MCI_TRTYP_SDIO_BYTE	(4 << 19)
+#define			AT91_MCI_TRTYP_SDIO_BLOCK	(5 << 19)
 
 #define AT91_MCI_BLKR		0x18		/* Block Register */
 #define		AT91_MCI_BLKR_BCNT(n)	((0xffff & (n)) << 0)	/* Block count */
Index: linux-2.6.35.y/drivers/mmc/host/at91_mci.c
===================================================================
--- linux-2.6.35.y.orig/drivers/mmc/host/at91_mci.c
+++ linux-2.6.35.y/drivers/mmc/host/at91_mci.c
@@ -68,6 +68,7 @@
 #include <linux/gfp.h>
 
 #include <linux/mmc/host.h>
+#include <linux/mmc/sdio.h>
 
 #include <asm/io.h>
 #include <asm/irq.h>
@@ -492,10 +493,14 @@ static void at91_mci_send_command(struct
 		else if (data->flags & MMC_DATA_WRITE)
 			cmdr |= AT91_MCI_TRCMD_START;
 
-		if (data->flags & MMC_DATA_STREAM)
-			cmdr |= AT91_MCI_TRTYP_STREAM;
-		if (data->blocks > 1)
-			cmdr |= AT91_MCI_TRTYP_MULTIPLE;
+		if (cmd->opcode == SD_IO_RW_EXTENDED) {
+			cmdr |= AT91_MCI_TRTYP_SDIO_BLOCK;
+		} else {
+			if (data->flags & MMC_DATA_STREAM)
+				cmdr |= AT91_MCI_TRTYP_STREAM;
+			if (data->blocks > 1)
+				cmdr |= AT91_MCI_TRTYP_MULTIPLE;
+		}
 	}
 	else {
 		block_length = 0;

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

* [PATCH] [111/139] mmc: atmel-mci: fix multiblock SDIO transfers
  2011-02-02  0:43 [PATCH] [0/139] 2.6.35.11 longterm review Andi Kleen
                   ` (109 preceding siblings ...)
  2011-02-02  0:45 ` [PATCH] [110/139] mmc: at91_mci: fix multiblock SDIO transfers Andi Kleen
@ 2011-02-02  0:45 ` Andi Kleen
  2011-02-02  0:45 ` [PATCH] [112/139] mmc: Fix re-probing with PM_POST_RESTORE notification Andi Kleen
                   ` (28 subsequent siblings)
  139 siblings, 0 replies; 149+ messages in thread
From: Andi Kleen @ 2011-02-02  0:45 UTC (permalink / raw)
  To: nicolas.ferre, plagnioj, cjb, gregkh, ak, linux-kernel, stable

2.6.35-longterm review patch.  If anyone has any objections, please let me know.

------------------
From: Nicolas Ferre <nicolas.ferre@atmel.com>

commit 2f1d791882d21a4002a719fb016a1ac21c8bd6b7 upstream.

Based on report made by Yauhen in:
"MMC: Fix multiblock SDIO transfers in AT91 MCI" patch,
I report those changes to the brother driver: atmel-mci.

So, this patch sets SDIO transfer types: SDIO block and SDIO byte
transfers instead of using ordinary MMC block transfers.
It is checking opcode for SDIO CMD53 and setting transfer
type in MCI_CMDR register properly.

Reported-by: Yauhen Kharuzhy <yauhen.kharuzhy@promwad.com>
Signed-off-by: Nicolas Ferre <nicolas.ferre@atmel.com>
Acked-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Signed-off-by: Chris Ball <cjb@laptop.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: Andi Kleen <ak@linux.intel.com>

---
 drivers/mmc/host/atmel-mci.c |   18 ++++++++++++------
 1 file changed, 12 insertions(+), 6 deletions(-)

Index: linux-2.6.35.y/drivers/mmc/host/atmel-mci.c
===================================================================
--- linux-2.6.35.y.orig/drivers/mmc/host/atmel-mci.c
+++ linux-2.6.35.y/drivers/mmc/host/atmel-mci.c
@@ -26,6 +26,7 @@
 #include <linux/stat.h>
 
 #include <linux/mmc/host.h>
+#include <linux/mmc/sdio.h>
 
 #include <mach/atmel-mci.h>
 #include <linux/atmel-mci.h>
@@ -532,12 +533,17 @@ static u32 atmci_prepare_command(struct 
 	data = cmd->data;
 	if (data) {
 		cmdr |= MCI_CMDR_START_XFER;
-		if (data->flags & MMC_DATA_STREAM)
-			cmdr |= MCI_CMDR_STREAM;
-		else if (data->blocks > 1)
-			cmdr |= MCI_CMDR_MULTI_BLOCK;
-		else
-			cmdr |= MCI_CMDR_BLOCK;
+
+		if (cmd->opcode == SD_IO_RW_EXTENDED) {
+			cmdr |= MCI_CMDR_SDIO_BLOCK;
+		} else {
+			if (data->flags & MMC_DATA_STREAM)
+				cmdr |= MCI_CMDR_STREAM;
+			else if (data->blocks > 1)
+				cmdr |= MCI_CMDR_MULTI_BLOCK;
+			else
+				cmdr |= MCI_CMDR_BLOCK;
+		}
 
 		if (data->flags & MMC_DATA_READ)
 			cmdr |= MCI_CMDR_TRDIR_READ;

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

* [PATCH] [112/139] mmc: Fix re-probing with PM_POST_RESTORE notification
  2011-02-02  0:43 [PATCH] [0/139] 2.6.35.11 longterm review Andi Kleen
                   ` (110 preceding siblings ...)
  2011-02-02  0:45 ` [PATCH] [111/139] mmc: atmel-mci: " Andi Kleen
@ 2011-02-02  0:45 ` Andi Kleen
  2011-02-02  0:45 ` [PATCH] [113/139] fix freeing user_struct in user cache Andi Kleen
                   ` (27 subsequent siblings)
  139 siblings, 0 replies; 149+ messages in thread
From: Andi Kleen @ 2011-02-02  0:45 UTC (permalink / raw)
  To: tiwai, cjb, gregkh, ak, linux-kernel, stable

2.6.35-longterm review patch.  If anyone has any objections, please let me know.

------------------
From: Takashi Iwai <tiwai@suse.de>

commit 274476f8fe0b6ac9bac542cc39de12c3dd0f43f6 upstream.

In the error-path where PM notifies PM_POST_RESTORE, the rescan-blockage
should be cleared as well.  Otherwise it'll be never re-probed.

Also, as a bonus, this fixes a bug in S4 with user-mode suspend in the
current code, as it sends PM_POST_RESTORE instead of
PM_POST_HIBERNATION wrongly.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Chris Ball <cjb@laptop.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: Andi Kleen <ak@linux.intel.com>

---
 drivers/mmc/core/core.c |    1 +
 1 file changed, 1 insertion(+)

Index: linux-2.6.35.y/drivers/mmc/core/core.c
===================================================================
--- linux-2.6.35.y.orig/drivers/mmc/core/core.c
+++ linux-2.6.35.y/drivers/mmc/core/core.c
@@ -1366,6 +1366,7 @@ int mmc_pm_notify(struct notifier_block 
 
 	case PM_POST_SUSPEND:
 	case PM_POST_HIBERNATION:
+	case PM_POST_RESTORE:
 
 		spin_lock_irqsave(&host->lock, flags);
 		host->rescan_disable = 0;

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

* [PATCH] [113/139] fix freeing user_struct in user cache
  2011-02-02  0:43 [PATCH] [0/139] 2.6.35.11 longterm review Andi Kleen
                   ` (111 preceding siblings ...)
  2011-02-02  0:45 ` [PATCH] [112/139] mmc: Fix re-probing with PM_POST_RESTORE notification Andi Kleen
@ 2011-02-02  0:45 ` Andi Kleen
  2011-02-02  0:45 ` [PATCH] [114/139] rtc: rs5c372: fix buffer size Andi Kleen
                   ` (26 subsequent siblings)
  139 siblings, 0 replies; 149+ messages in thread
From: Andi Kleen @ 2011-02-02  0:45 UTC (permalink / raw)
  To: dhillf, serge, torvalds, gregkh, ak, linux-kernel, stable

2.6.35-longterm review patch.  If anyone has any objections, please let me know.

------------------
From: Hillf Danton <dhillf@gmail.com>

commit 4ef9e11d6867f88951e30db910fa015300e31871 upstream.

When racing on adding into user cache, the new allocated from mm slab
is freed without putting user namespace.

Since the user namespace is already operated by getting, putting has
to be issued.

Signed-off-by: Hillf Danton <dhillf@gmail.com>
Acked-by: Serge Hallyn <serge@hallyn.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: Andi Kleen <ak@linux.intel.com>

---
 kernel/user.c |    1 +
 1 file changed, 1 insertion(+)

Index: linux-2.6.35.y/kernel/user.c
===================================================================
--- linux-2.6.35.y.orig/kernel/user.c
+++ linux-2.6.35.y/kernel/user.c
@@ -157,6 +157,7 @@ struct user_struct *alloc_uid(struct use
 		spin_lock_irq(&uidhash_lock);
 		up = uid_hash_find(uid, hashent);
 		if (up) {
+			put_user_ns(ns);
 			key_put(new->uid_keyring);
 			key_put(new->session_keyring);
 			kmem_cache_free(uid_cachep, new);

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

* [PATCH] [114/139] rtc: rs5c372: fix buffer size
  2011-02-02  0:43 [PATCH] [0/139] 2.6.35.11 longterm review Andi Kleen
                   ` (112 preceding siblings ...)
  2011-02-02  0:45 ` [PATCH] [113/139] fix freeing user_struct in user cache Andi Kleen
@ 2011-02-02  0:45 ` Andi Kleen
  2011-02-02  0:45 ` [PATCH] [115/139] RAMOOPS: Don't overflow over non-allocated regions Andi Kleen
                   ` (25 subsequent siblings)
  139 siblings, 0 replies; 149+ messages in thread
From: Andi Kleen @ 2011-02-02  0:45 UTC (permalink / raw)
  To: w.sang, ak, a.zummo, akpm, torvalds, gregkh, linux-kernel, stable

2.6.35-longterm review patch.  If anyone has any objections, please let me know.

------------------
From: Wolfram Sang <w.sang@pengutronix.de>

commit 118364948fad7b6c0469ef2d3ddaee447d7a0b5f upstream.

Match the buffer size to the amount of initialized values.  Before, it was
one too big and thus destroyed the neighbouring register causing the clock
to run at false speeds.

Reported-by: Andre van Rooyen <a.v.rooyen@sercom.nl>
Signed-off-by: Wolfram Sang <w.sang@pengutronix.de>
Signed-off-by: Andi Kleen <ak@linux.intel.com>
Cc: Alessandro Zummo <a.zummo@towertech.it>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

---
 drivers/rtc/rtc-rs5c372.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Index: linux-2.6.35.y/drivers/rtc/rtc-rs5c372.c
===================================================================
--- linux-2.6.35.y.orig/drivers/rtc/rtc-rs5c372.c
+++ linux-2.6.35.y/drivers/rtc/rtc-rs5c372.c
@@ -207,7 +207,7 @@ static int rs5c372_get_datetime(struct i
 static int rs5c372_set_datetime(struct i2c_client *client, struct rtc_time *tm)
 {
 	struct rs5c372	*rs5c = i2c_get_clientdata(client);
-	unsigned char	buf[8];
+	unsigned char	buf[7];
 	int		addr;
 
 	dev_dbg(&client->dev, "%s: tm is secs=%d, mins=%d, hours=%d "

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

* [PATCH] [115/139] RAMOOPS: Don't overflow over non-allocated regions
  2011-02-02  0:43 [PATCH] [0/139] 2.6.35.11 longterm review Andi Kleen
                   ` (113 preceding siblings ...)
  2011-02-02  0:45 ` [PATCH] [114/139] rtc: rs5c372: fix buffer size Andi Kleen
@ 2011-02-02  0:45 ` Andi Kleen
  2011-02-02  0:45 ` [PATCH] [116/139] watchdog: Fix null pointer dereference while accessing rdc321x platform_data Andi Kleen
                   ` (24 subsequent siblings)
  139 siblings, 0 replies; 149+ messages in thread
From: Andi Kleen @ 2011-02-02  0:45 UTC (permalink / raw)
  To: darwish.07, marco.stornelli, torvalds, gregkh, ak, linux-kernel, stable

2.6.35-longterm review patch.  If anyone has any objections, please let me know.

------------------
From: Ahmed S. Darwish <darwish.07@gmail.com>

commit 1873bb8115e678ad9fd0aac9dbbc68383bc36e06 upstream.

The current code mis-calculates the ramoops header size, leading to an
overflow over the next record at best, or over a non-allocated region at
worst.  Fix that calculation.

Signed-off-by: Ahmed S. Darwish <darwish.07@gmail.com>
Acked-by: Marco Stornelli <marco.stornelli@gmail.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: Andi Kleen <ak@linux.intel.com>

---
 drivers/char/ramoops.c |   12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)

Index: linux-2.6.35.y/drivers/char/ramoops.c
===================================================================
--- linux-2.6.35.y.orig/drivers/char/ramoops.c
+++ linux-2.6.35.y/drivers/char/ramoops.c
@@ -27,7 +27,6 @@
 #include <linux/ioport.h>
 
 #define RAMOOPS_KERNMSG_HDR "===="
-#define RAMOOPS_HEADER_SIZE   (5 + sizeof(struct timeval))
 
 #define RECORD_SIZE 4096
 
@@ -63,8 +62,8 @@ static void ramoops_do_dump(struct kmsg_
 			struct ramoops_context, dump);
 	unsigned long s1_start, s2_start;
 	unsigned long l1_cpy, l2_cpy;
-	int res;
-	char *buf;
+	int res, hdr_size;
+	char *buf, *buf_orig;
 	struct timeval timestamp;
 
 	/* Only dump oopses if dump_oops is set */
@@ -72,6 +71,8 @@ static void ramoops_do_dump(struct kmsg_
 		return;
 
 	buf = (char *)(cxt->virt_addr + (cxt->count * RECORD_SIZE));
+	buf_orig = buf;
+
 	memset(buf, '\0', RECORD_SIZE);
 	res = sprintf(buf, "%s", RAMOOPS_KERNMSG_HDR);
 	buf += res;
@@ -79,8 +80,9 @@ static void ramoops_do_dump(struct kmsg_
 	res = sprintf(buf, "%lu.%lu\n", (long)timestamp.tv_sec, (long)timestamp.tv_usec);
 	buf += res;
 
-	l2_cpy = min(l2, (unsigned long)(RECORD_SIZE - RAMOOPS_HEADER_SIZE));
-	l1_cpy = min(l1, (unsigned long)(RECORD_SIZE - RAMOOPS_HEADER_SIZE) - l2_cpy);
+	hdr_size = buf - buf_orig;
+	l2_cpy = min(l2, (unsigned long)(RECORD_SIZE - hdr_size));
+	l1_cpy = min(l1, (unsigned long)(RECORD_SIZE - hdr_size) - l2_cpy);
 
 	s2_start = l2 - l2_cpy;
 	s1_start = l1 - l1_cpy;

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

* [PATCH] [116/139] watchdog: Fix null pointer dereference while accessing rdc321x platform_data
  2011-02-02  0:43 [PATCH] [0/139] 2.6.35.11 longterm review Andi Kleen
                   ` (114 preceding siblings ...)
  2011-02-02  0:45 ` [PATCH] [115/139] RAMOOPS: Don't overflow over non-allocated regions Andi Kleen
@ 2011-02-02  0:45 ` Andi Kleen
  2011-02-02  0:45 ` [PATCH] [117/139] arch/x86/oprofile/op_model_amd.c: Perform initialisation on a single CPU Andi Kleen
                   ` (23 subsequent siblings)
  139 siblings, 0 replies; 149+ messages in thread
From: Andi Kleen @ 2011-02-02  0:45 UTC (permalink / raw)
  To: florian, sameo, gregkh, ak, linux-kernel, stable

2.6.35-longterm review patch.  If anyone has any objections, please let me know.

------------------
From: Florian Fainelli <florian@openwrt.org>

commit 3b3c1f24e96c411a95daabb6af9e09c5381f713b upstream.

rdc321x-wdt currently fetches its driver specific data by using the
platform_device->platform_data pointer, this is wrong because the mfd
device which registers our platform_device has been added using
mfd_add_device() which sets the platform_device->driver_data pointer
instead.

Signed-off-by: Florian Fainelli <florian@openwrt.org>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: Andi Kleen <ak@linux.intel.com>

---
 drivers/watchdog/rdc321x_wdt.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Index: linux-2.6.35.y/drivers/watchdog/rdc321x_wdt.c
===================================================================
--- linux-2.6.35.y.orig/drivers/watchdog/rdc321x_wdt.c
+++ linux-2.6.35.y/drivers/watchdog/rdc321x_wdt.c
@@ -231,7 +231,7 @@ static int __devinit rdc321x_wdt_probe(s
 	struct resource *r;
 	struct rdc321x_wdt_pdata *pdata;
 
-	pdata = pdev->dev.platform_data;
+	pdata = platform_get_drvdata(pdev);
 	if (!pdata) {
 		dev_err(&pdev->dev, "no platform data supplied\n");
 		return -ENODEV;

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

* [PATCH] [117/139] arch/x86/oprofile/op_model_amd.c: Perform initialisation on a single CPU
  2011-02-02  0:43 [PATCH] [0/139] 2.6.35.11 longterm review Andi Kleen
                   ` (115 preceding siblings ...)
  2011-02-02  0:45 ` [PATCH] [116/139] watchdog: Fix null pointer dereference while accessing rdc321x platform_data Andi Kleen
@ 2011-02-02  0:45 ` Andi Kleen
  2011-02-02  0:45 ` [PATCH] [118/139] mfd: Support additional parent IDs for wm831x Andi Kleen
                   ` (22 subsequent siblings)
  139 siblings, 0 replies; 149+ messages in thread
From: Andi Kleen @ 2011-02-02  0:45 UTC (permalink / raw)
  To: robert.richter, ak, oprofile-list, a.p.zijlstra, fweisbec, rjw,
	error27, akpm, mingo, gregkh, linux-kernel, stable

2.6.35-longterm review patch.  If anyone has any objections, please let me know.

------------------
From: Robert Richter <robert.richter@amd.com>

commit c7c25802b39c443b3745cfa973dc49a97a3491f8 upstream.

Disable preemption in init_ibs(). The function only checks the
ibs capabilities and sets up pci devices (if necessary). It runs
only on one cpu but operates with the local APIC and some MSRs,
thus it is better to disable preemption.

[    7.034377] BUG: using smp_processor_id() in preemptible [00000000] code: modprobe/483
[    7.034385] caller is setup_APIC_eilvt+0x155/0x180
[    7.034389] Pid: 483, comm: modprobe Not tainted 2.6.37-rc1-20101110+ #1
[    7.034392] Call Trace:
[    7.034400]  [<ffffffff812a2b72>] debug_smp_processor_id+0xd2/0xf0
[    7.034404]  [<ffffffff8101e985>] setup_APIC_eilvt+0x155/0x180
[ ... ]

Addresses https://bugzilla.kernel.org/show_bug.cgi?id=22812

Reported-by: <atswartz@gmail.com>
Signed-off-by: Robert Richter <robert.richter@amd.com>
Signed-off-by: Andi Kleen <ak@linux.intel.com>
Cc: oprofile-list@lists.sourceforge.net <oprofile-list@lists.sourceforge.net>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Rafael J. Wysocki <rjw@sisk.pl>
Cc: Dan Carpenter <error27@gmail.com>
Cc: Andrew Morton <akpm@linux-foundation.org>
LKML-Reference: <20110103111514.GM4739@erda.amd.com>
[ small cleanups ]
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

---
 arch/x86/oprofile/op_model_amd.c |   24 ++++++++++++++++--------
 1 file changed, 16 insertions(+), 8 deletions(-)

Index: linux-2.6.35.y/arch/x86/oprofile/op_model_amd.c
===================================================================
--- linux-2.6.35.y.orig/arch/x86/oprofile/op_model_amd.c
+++ linux-2.6.35.y/arch/x86/oprofile/op_model_amd.c
@@ -484,21 +484,29 @@ static int __init_ibs_nmi(void)
 	return 0;
 }
 
-/* initialize the APIC for the IBS interrupts if available */
+/*
+ * check and reserve APIC extended interrupt LVT offset for IBS if
+ * available
+ *
+ * init_ibs() preforms implicitly cpu-local operations, so pin this
+ * thread to its current CPU
+ */
+
 static void init_ibs(void)
 {
-	ibs_caps = get_ibs_caps();
+	preempt_disable();
 
+	ibs_caps = get_ibs_caps();
 	if (!ibs_caps)
-		return;
+		goto out;
 
-	if (__init_ibs_nmi()) {
+	if (__init_ibs_nmi() < 0)
 		ibs_caps = 0;
-		return;
-	}
+	else
+		printk(KERN_INFO "oprofile: AMD IBS detected (0x%08x)\n", ibs_caps);
 
-	printk(KERN_INFO "oprofile: AMD IBS detected (0x%08x)\n",
-	       (unsigned)ibs_caps);
+out:
+	preempt_enable();
 }
 
 static int (*create_arch_files)(struct super_block *sb, struct dentry *root);

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

* [PATCH] [118/139] mfd: Support additional parent IDs for wm831x
  2011-02-02  0:43 [PATCH] [0/139] 2.6.35.11 longterm review Andi Kleen
                   ` (116 preceding siblings ...)
  2011-02-02  0:45 ` [PATCH] [117/139] arch/x86/oprofile/op_model_amd.c: Perform initialisation on a single CPU Andi Kleen
@ 2011-02-02  0:45 ` Andi Kleen
  2011-02-02  0:45 ` [PATCH] [119/139] mfd: Supply IRQ base for WM832x devices Andi Kleen
                   ` (21 subsequent siblings)
  139 siblings, 0 replies; 149+ messages in thread
From: Andi Kleen @ 2011-02-02  0:45 UTC (permalink / raw)
  To: broonie, sameo, gregkh, ak, linux-kernel, stable

2.6.35-longterm review patch.  If anyone has any objections, please let me know.

------------------
From: Mark Brown <broonie@opensource.wolfsonmicro.com>

commit b93cef556162b0f33399bfe5f307c54f51554e09 upstream.

Some newer device revisions add a second parent ID. Support this in
the device validity checks done at startup.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: Andi Kleen <ak@linux.intel.com>

---
 drivers/mfd/wm831x-core.c |    6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

Index: linux-2.6.35.y/drivers/mfd/wm831x-core.c
===================================================================
--- linux-2.6.35.y.orig/drivers/mfd/wm831x-core.c
+++ linux-2.6.35.y/drivers/mfd/wm831x-core.c
@@ -1463,7 +1463,11 @@ static int wm831x_device_init(struct wm8
 		dev_err(wm831x->dev, "Failed to read parent ID: %d\n", ret);
 		goto err;
 	}
-	if (ret != 0x6204) {
+	switch (ret) {
+	case 0x6204:
+	case 0x6246:
+		break;
+	default:
 		dev_err(wm831x->dev, "Device is not a WM831x: ID %x\n", ret);
 		ret = -EINVAL;
 		goto err;

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

* [PATCH] [119/139] mfd: Supply IRQ base for WM832x devices
  2011-02-02  0:43 [PATCH] [0/139] 2.6.35.11 longterm review Andi Kleen
                   ` (117 preceding siblings ...)
  2011-02-02  0:45 ` [PATCH] [118/139] mfd: Support additional parent IDs for wm831x Andi Kleen
@ 2011-02-02  0:45 ` Andi Kleen
  2011-02-02  0:45 ` [PATCH] [120/139] drm/radeon/kms/evergreen: reset the grbm blocks at resume and init Andi Kleen
                   ` (20 subsequent siblings)
  139 siblings, 0 replies; 149+ messages in thread
From: Andi Kleen @ 2011-02-02  0:45 UTC (permalink / raw)
  To: broonie, sameo, gregkh, ak, linux-kernel, stable

2.6.35-longterm review patch.  If anyone has any objections, please let me know.

------------------
From: Mark Brown <broonie@opensource.wolfsonmicro.com>

commit bd7c72ed18d719c1fb0fdf6ff9042d8ab78fdf71 upstream.

Without this the IRQ base will not be correctly configured for the
subdevices.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: Andi Kleen <ak@linux.intel.com>

---
 drivers/mfd/wm831x-core.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Index: linux-2.6.35.y/drivers/mfd/wm831x-core.c
===================================================================
--- linux-2.6.35.y.orig/drivers/mfd/wm831x-core.c
+++ linux-2.6.35.y/drivers/mfd/wm831x-core.c
@@ -1608,7 +1608,7 @@ static int wm831x_device_init(struct wm8
 	case WM8320:
 		ret = mfd_add_devices(wm831x->dev, -1,
 				      wm8320_devs, ARRAY_SIZE(wm8320_devs),
-				      NULL, 0);
+				      NULL, wm831x->irq_base);
 		break;
 
 	default:

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

* [PATCH] [120/139] drm/radeon/kms/evergreen: reset the grbm blocks at resume and init
  2011-02-02  0:43 [PATCH] [0/139] 2.6.35.11 longterm review Andi Kleen
                   ` (118 preceding siblings ...)
  2011-02-02  0:45 ` [PATCH] [119/139] mfd: Supply IRQ base for WM832x devices Andi Kleen
@ 2011-02-02  0:45 ` Andi Kleen
  2011-02-02  0:45 ` [PATCH] [121/139] drm/radeon/kms: fix evergreen asic reset Andi Kleen
                   ` (19 subsequent siblings)
  139 siblings, 0 replies; 149+ messages in thread
From: Andi Kleen @ 2011-02-02  0:45 UTC (permalink / raw)
  To: alexdeucher, airlied, gregkh, ak, linux-kernel, stable

2.6.35-longterm review patch.  If anyone has any objections, please let me know.

------------------
From: Alex Deucher <alexdeucher@gmail.com>

commit 86f5c9edbb3bac37cc8cee6528a929005ba72aad upstream.

This fixes module reloading and resume as the gfx block seems to
be left in a bad state in some cases.

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: Andi Kleen <ak@linux.intel.com>

---
 drivers/gpu/drm/radeon/evergreen.c |   10 ++++++++++
 1 file changed, 10 insertions(+)

Index: linux-2.6.35.y/drivers/gpu/drm/radeon/evergreen.c
===================================================================
--- linux-2.6.35.y.orig/drivers/gpu/drm/radeon/evergreen.c
+++ linux-2.6.35.y/drivers/gpu/drm/radeon/evergreen.c
@@ -2080,6 +2080,11 @@ int evergreen_resume(struct radeon_devic
 {
 	int r;
 
+	/* reset the asic, the gfx blocks are often in a bad state
+	 * after the driver is unloaded or after a resume
+	 */
+	if (radeon_asic_reset(rdev))
+		dev_warn(rdev->dev, "GPU reset failed !\n");
 	/* Do not reset GPU before posting, on rv770 hw unlike on r500 hw,
 	 * posting will perform necessary task to bring back GPU into good
 	 * shape.
@@ -2181,6 +2186,11 @@ int evergreen_init(struct radeon_device 
 	r = radeon_atombios_init(rdev);
 	if (r)
 		return r;
+	/* reset the asic, the gfx blocks are often in a bad state
+	 * after the driver is unloaded or after a resume
+	 */
+	if (radeon_asic_reset(rdev))
+		dev_warn(rdev->dev, "GPU reset failed !\n");
 	/* Post card if necessary */
 	if (!evergreen_card_posted(rdev)) {
 		if (!rdev->bios) {

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

* [PATCH] [121/139] drm/radeon/kms: fix evergreen asic reset
  2011-02-02  0:43 [PATCH] [0/139] 2.6.35.11 longterm review Andi Kleen
                   ` (119 preceding siblings ...)
  2011-02-02  0:45 ` [PATCH] [120/139] drm/radeon/kms/evergreen: reset the grbm blocks at resume and init Andi Kleen
@ 2011-02-02  0:45 ` Andi Kleen
  2011-02-02  0:45 ` [PATCH] [122/139] drm/radeon/kms: reorder display resume to avoid problems Andi Kleen
                   ` (18 subsequent siblings)
  139 siblings, 0 replies; 149+ messages in thread
From: Andi Kleen @ 2011-02-02  0:45 UTC (permalink / raw)
  To: alexdeucher, ak, jglisse, airlied, gregkh, linux-kernel, stable

2.6.35-longterm review patch.  If anyone has any objections, please let me know.

------------------
From: Alex Deucher <alexdeucher@gmail.com>

commit 9f0c4f9c2f835eee1bbb93f96bf9483d56f1892b upstream.

Only reset the grbm blocks, srbm tends to lock the GPU
if not done properly and in most cases is not necessary.
Also, no need to call asic init after reset the grbm blocks.

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
Signed-off-by: Andi Kleen <ak@linux.intel.com>
Reviewed-by: Jerome Glisse <jglisse@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

---
 drivers/gpu/drm/radeon/evergreen.c |   15 ---------------
 1 file changed, 15 deletions(-)

Index: linux-2.6.35.y/drivers/gpu/drm/radeon/evergreen.c
===================================================================
--- linux-2.6.35.y.orig/drivers/gpu/drm/radeon/evergreen.c
+++ linux-2.6.35.y/drivers/gpu/drm/radeon/evergreen.c
@@ -1406,7 +1406,6 @@ bool evergreen_gpu_is_lockup(struct rade
 static int evergreen_gpu_soft_reset(struct radeon_device *rdev)
 {
 	struct evergreen_mc_save save;
-	u32 srbm_reset = 0;
 	u32 grbm_reset = 0;
 
 	dev_info(rdev->dev, "GPU softreset \n");
@@ -1445,16 +1444,6 @@ static int evergreen_gpu_soft_reset(stru
 	udelay(50);
 	WREG32(GRBM_SOFT_RESET, 0);
 	(void)RREG32(GRBM_SOFT_RESET);
-
-	/* reset all the system blocks */
-	srbm_reset = SRBM_SOFT_RESET_ALL_MASK;
-
-	dev_info(rdev->dev, "  SRBM_SOFT_RESET=0x%08X\n", srbm_reset);
-	WREG32(SRBM_SOFT_RESET, srbm_reset);
-	(void)RREG32(SRBM_SOFT_RESET);
-	udelay(50);
-	WREG32(SRBM_SOFT_RESET, 0);
-	(void)RREG32(SRBM_SOFT_RESET);
 	/* Wait a little for things to settle down */
 	udelay(50);
 	dev_info(rdev->dev, "  GRBM_STATUS=0x%08X\n",
@@ -1465,10 +1454,6 @@ static int evergreen_gpu_soft_reset(stru
 		RREG32(GRBM_STATUS_SE1));
 	dev_info(rdev->dev, "  SRBM_STATUS=0x%08X\n",
 		RREG32(SRBM_STATUS));
-	/* After reset we need to reinit the asic as GPU often endup in an
-	 * incoherent state.
-	 */
-	atom_asic_init(rdev->mode_info.atom_context);
 	evergreen_mc_resume(rdev, &save);
 	return 0;
 }

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

* [PATCH] [122/139] drm/radeon/kms: reorder display resume to avoid problems
  2011-02-02  0:43 [PATCH] [0/139] 2.6.35.11 longterm review Andi Kleen
                   ` (120 preceding siblings ...)
  2011-02-02  0:45 ` [PATCH] [121/139] drm/radeon/kms: fix evergreen asic reset Andi Kleen
@ 2011-02-02  0:45 ` Andi Kleen
  2011-02-02  0:45 ` [PATCH] [123/139] drm/i915/dp: Fix I2C/EDID handling with active DisplayPort to DVI converter Andi Kleen
                   ` (17 subsequent siblings)
  139 siblings, 0 replies; 149+ messages in thread
From: Andi Kleen @ 2011-02-02  0:45 UTC (permalink / raw)
  To: alexdeucher, airlied, gregkh, ak, linux-kernel, stable

2.6.35-longterm review patch.  If anyone has any objections, please let me know.

------------------
From: Alex Deucher <alexdeucher@gmail.com>

commit a93f344d3c04e4b84490c65f2a574387c593be40 upstream.

On resume, we were attemping to unblank the displays before the
timing and plls had be reprogrammed which led to atom timeouts
waiting for things that are not yet programmed.  Re-program
the mode first, then reset the dpms state.

This fixes the infamous atombios timeouts on resume.

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: Andi Kleen <ak@linux.intel.com>

---
 drivers/gpu/drm/radeon/atombios_crtc.c |    3 ++-
 drivers/gpu/drm/radeon/radeon_device.c |    9 ++++-----
 2 files changed, 6 insertions(+), 6 deletions(-)

Index: linux-2.6.35.y/drivers/gpu/drm/radeon/atombios_crtc.c
===================================================================
--- linux-2.6.35.y.orig/drivers/gpu/drm/radeon/atombios_crtc.c
+++ linux-2.6.35.y/drivers/gpu/drm/radeon/atombios_crtc.c
@@ -259,7 +259,8 @@ void atombios_crtc_dpms(struct drm_crtc 
 	case DRM_MODE_DPMS_SUSPEND:
 	case DRM_MODE_DPMS_OFF:
 		drm_vblank_pre_modeset(dev, radeon_crtc->crtc_id);
-		atombios_blank_crtc(crtc, ATOM_ENABLE);
+		if (radeon_crtc->enabled)
+			atombios_blank_crtc(crtc, ATOM_ENABLE);
 		if (ASIC_IS_DCE3(rdev))
 			atombios_enable_crtc_memreq(crtc, ATOM_DISABLE);
 		atombios_enable_crtc(crtc, ATOM_DISABLE);
Index: linux-2.6.35.y/drivers/gpu/drm/radeon/radeon_device.c
===================================================================
--- linux-2.6.35.y.orig/drivers/gpu/drm/radeon/radeon_device.c
+++ linux-2.6.35.y/drivers/gpu/drm/radeon/radeon_device.c
@@ -799,11 +799,6 @@ int radeon_resume_kms(struct drm_device 
 	radeon_pm_resume(rdev);
 	radeon_restore_bios_scratch_regs(rdev);
 
-	/* turn on display hw */
-	list_for_each_entry(connector, &dev->mode_config.connector_list, head) {
-		drm_helper_connector_dpms(connector, DRM_MODE_DPMS_ON);
-	}
-
 	radeon_fbdev_set_suspend(rdev, 0);
 	release_console_sem();
 
@@ -811,6 +806,10 @@ int radeon_resume_kms(struct drm_device 
 	radeon_hpd_init(rdev);
 	/* blat the mode back in */
 	drm_helper_resume_force_mode(dev);
+	/* turn on display hw */
+	list_for_each_entry(connector, &dev->mode_config.connector_list, head) {
+		drm_helper_connector_dpms(connector, DRM_MODE_DPMS_ON);
+	}
 	return 0;
 }
 

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

* [PATCH] [123/139] drm/i915/dp: Fix I2C/EDID handling with active DisplayPort to DVI converter
  2011-02-02  0:43 [PATCH] [0/139] 2.6.35.11 longterm review Andi Kleen
                   ` (121 preceding siblings ...)
  2011-02-02  0:45 ` [PATCH] [122/139] drm/radeon/kms: reorder display resume to avoid problems Andi Kleen
@ 2011-02-02  0:45 ` Andi Kleen
  2011-02-02  0:45 ` [PATCH] [124/139] sound: Prevent buffer overflow in OSS load_mixer_volumes Andi Kleen
                   ` (16 subsequent siblings)
  139 siblings, 0 replies; 149+ messages in thread
From: Andi Kleen @ 2011-02-02  0:45 UTC (permalink / raw)
  To: davidf, ak, chris, gregkh, linux-kernel, stable

2.6.35-longterm review patch.  If anyone has any objections, please let me know.

------------------
From: David Flynn <davidf@rd.bbc.co.uk>

commit 8316f33766a82907c694267ff911e45e256f09f9 upstream.

The DisplayPort standard (1.1a) states that:
  The I2C-over-AUX Reply field is valid only when Native AUX CH Reply
  field is AUX_ACK (00). When Native AUX CH Reply field is not 00, then,
  I2C-over-AUX Reply field must be 00 and be ignored.

This fixes broken EDID reading when using an active DisplayPort to
duallink DVI converter.  If the AUX CH replier chooses to defer the
transaction, a short read occurs and erroneous data is returned as
the i2c reply due to a lack of length checking and failure to check
for AUX ACK.

As a result, broken EDIDs can look like:
     0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f    0123456789abcdef
00: bc bc bc ff bc bc bc ff bc bc bc ac bc bc bc 45    ???.???.???????E
10: bc bc bc 10 bc bc bc 34 bc bc bc ee bc bc bc 4c    ???????4???????L
20: bc bc bc 50 bc bc bc 00 bc bc bc 40 bc bc bc 00    ???P???.???@???.
30: bc bc bc 01 bc bc bc 01 bc bc bc a0 bc bc bc 40    ???????????????@
40: bc bc bc 00 bc bc bc 00 bc bc bc 00 bc bc bc 55    ???.???.???.???U
50: bc bc bc 35 bc bc bc 31 bc bc bc 20 bc bc bc fc    ???5???1??? ????
60: bc bc bc 4c bc bc bc 34 bc bc bc 46 bc bc bc 00    ???L???4???F???.
70: bc bc bc 38 bc bc bc 11 bc bc bc 20 bc bc bc 20    ???8??????? ???
80: bc bc bc ff bc bc bc ff bc bc bc ff bc bc bc ff    ???.???.???.???.
...

which can lead to:
[drm:drm_edid_block_valid] *ERROR* EDID checksum is invalid, remainder
[drm:drm_edid_block_valid] *ERROR* Raw EDID:
<3>30 30 30 30 30 30 30 32 38 32 30 32 63 63 31 61  000000028202cc1a
<3>28 00 02 8c 00 00 00 00 18 00 00 00 00 00 00 00  (...............
<3>20 4c 61 73 74 20 62 65 61 63 6f 6e 3a 20 33 32   Last beacon: 32
<3>32 30 6d 73 20 61 67 6f 46 00 05 8c 00 00 00 00  20ms agoF.......
<3>36 00 00 00 00 00 00 00 00 0c 57 69 2d 46 69 20  6.........Wi-Fi
<3>52 6f 75 74 65 72 01 08 82 84 8b 96 24 30 48 6c  Router......$0Hl
<3>03 01 01 06 02 00 00 2a 01 00 2f 01 00 32 04 0c  .......*../..2..
<3>12 18 60 dd 09 00 10 18 02 00 00 01 00 00 18 00  ..`.............

Signed-off-by: David Flynn <davidf@rd.bbc.co.uk>
Signed-off-by: Andi Kleen <ak@linux.intel.com>
[ickle: fix up some surrounding checkpatch warnings]
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

---
 drivers/gpu/drm/i915/intel_dp.c |   37 ++++++++++++++++++++++++++++++-------
 1 file changed, 30 insertions(+), 7 deletions(-)

Index: linux-2.6.35.y/drivers/gpu/drm/i915/intel_dp.c
===================================================================
--- linux-2.6.35.y.orig/drivers/gpu/drm/i915/intel_dp.c
+++ linux-2.6.35.y/drivers/gpu/drm/i915/intel_dp.c
@@ -416,6 +416,7 @@ intel_dp_i2c_aux_ch(struct i2c_adapter *
 	uint16_t address = algo_data->address;
 	uint8_t msg[5];
 	uint8_t reply[2];
+	unsigned retry;
 	int msg_bytes;
 	int reply_bytes;
 	int ret;
@@ -450,14 +451,33 @@ intel_dp_i2c_aux_ch(struct i2c_adapter *
 		break;
 	}
 
-	for (;;) {
-	  ret = intel_dp_aux_ch(intel_encoder,
-				msg, msg_bytes,
-				reply, reply_bytes);
+	for (retry = 0; retry < 5; retry++) {
+		ret = intel_dp_aux_ch(intel_encoder,
+				      msg, msg_bytes,
+				      reply, reply_bytes);
 		if (ret < 0) {
 			DRM_DEBUG_KMS("aux_ch failed %d\n", ret);
 			return ret;
 		}
+
+		switch (reply[0] & AUX_NATIVE_REPLY_MASK) {
+		case AUX_NATIVE_REPLY_ACK:
+			/* I2C-over-AUX Reply field is only valid
+			 * when paired with AUX ACK.
+			 */
+			break;
+		case AUX_NATIVE_REPLY_NACK:
+			DRM_DEBUG_KMS("aux_ch native nack\n");
+			return -EREMOTEIO;
+		case AUX_NATIVE_REPLY_DEFER:
+			udelay(100);
+			continue;
+		default:
+			DRM_ERROR("aux_ch invalid native reply 0x%02x\n",
+				  reply[0]);
+			return -EREMOTEIO;
+		}
+
 		switch (reply[0] & AUX_I2C_REPLY_MASK) {
 		case AUX_I2C_REPLY_ACK:
 			if (mode == MODE_I2C_READ) {
@@ -465,17 +485,20 @@ intel_dp_i2c_aux_ch(struct i2c_adapter *
 			}
 			return reply_bytes - 1;
 		case AUX_I2C_REPLY_NACK:
-			DRM_DEBUG_KMS("aux_ch nack\n");
+			DRM_DEBUG_KMS("aux_i2c nack\n");
 			return -EREMOTEIO;
 		case AUX_I2C_REPLY_DEFER:
-			DRM_DEBUG_KMS("aux_ch defer\n");
+			DRM_DEBUG_KMS("aux_i2c defer\n");
 			udelay(100);
 			break;
 		default:
-			DRM_ERROR("aux_ch invalid reply 0x%02x\n", reply[0]);
+			DRM_ERROR("aux_i2c invalid reply 0x%02x\n", reply[0]);
 			return -EREMOTEIO;
 		}
 	}
+
+	DRM_ERROR("too many retries, giving up\n");
+	return -EREMOTEIO;
 }
 
 static int

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

* [PATCH] [124/139] sound: Prevent buffer overflow in OSS load_mixer_volumes
  2011-02-02  0:43 [PATCH] [0/139] 2.6.35.11 longterm review Andi Kleen
                   ` (122 preceding siblings ...)
  2011-02-02  0:45 ` [PATCH] [123/139] drm/i915/dp: Fix I2C/EDID handling with active DisplayPort to DVI converter Andi Kleen
@ 2011-02-02  0:45 ` Andi Kleen
  2011-02-02  0:45 ` [PATCH] [125/139] mv_xor: fix race in tasklet function Andi Kleen
                   ` (15 subsequent siblings)
  139 siblings, 0 replies; 149+ messages in thread
From: Andi Kleen @ 2011-02-02  0:45 UTC (permalink / raw)
  To: drosenberg, tiwai, gregkh, ak, linux-kernel, stable

2.6.35-longterm review patch.  If anyone has any objections, please let me know.

------------------
From: Dan Rosenberg <drosenberg@vsecurity.com>

commit d81a12bc29ae4038770e05dce4ab7f26fd5880fb upstream.

The load_mixer_volumes() function, which can be triggered by
unprivileged users via the SOUND_MIXER_SETLEVELS ioctl, is vulnerable to
a buffer overflow.  Because the provided "name" argument isn't
guaranteed to be NULL terminated at the expected 32 bytes, it's possible
to overflow past the end of the last element in the mixer_vols array.
Further exploitation can result in an arbitrary kernel write (via
subsequent calls to load_mixer_volumes()) leading to privilege
escalation, or arbitrary kernel reads via get_mixer_levels().  In
addition, the strcmp() may leak bytes beyond the mixer_vols array.

Signed-off-by: Dan Rosenberg <drosenberg@vsecurity.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: Andi Kleen <ak@linux.intel.com>

---
 sound/oss/soundcard.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Index: linux-2.6.35.y/sound/oss/soundcard.c
===================================================================
--- linux-2.6.35.y.orig/sound/oss/soundcard.c
+++ linux-2.6.35.y/sound/oss/soundcard.c
@@ -86,7 +86,7 @@ int *load_mixer_volumes(char *name, int 
 	int             i, n;
 
 	for (i = 0; i < num_mixer_volumes; i++) {
-		if (strcmp(name, mixer_vols[i].name) == 0) {
+		if (strncmp(name, mixer_vols[i].name, 32) == 0) {
 			if (present)
 				mixer_vols[i].num = i;
 			return mixer_vols[i].levels;
@@ -98,7 +98,7 @@ int *load_mixer_volumes(char *name, int 
 	}
 	n = num_mixer_volumes++;
 
-	strcpy(mixer_vols[n].name, name);
+	strncpy(mixer_vols[n].name, name, 32);
 
 	if (present)
 		mixer_vols[n].num = n;

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

* [PATCH] [125/139] mv_xor: fix race in tasklet function
  2011-02-02  0:43 [PATCH] [0/139] 2.6.35.11 longterm review Andi Kleen
                   ` (123 preceding siblings ...)
  2011-02-02  0:45 ` [PATCH] [124/139] sound: Prevent buffer overflow in OSS load_mixer_volumes Andi Kleen
@ 2011-02-02  0:45 ` Andi Kleen
  2011-02-02  0:45 ` [PATCH] [126/139] ima: fix add LSM rule bug Andi Kleen
                   ` (14 subsequent siblings)
  139 siblings, 0 replies; 149+ messages in thread
From: Andi Kleen @ 2011-02-02  0:45 UTC (permalink / raw)
  To: saeed, dan.j.williams, gregkh, ak, linux-kernel, stable

2.6.35-longterm review patch.  If anyone has any objections, please let me know.

------------------
From: Saeed Bishara <saeed@marvell.com>

commit 8333f65ef094e47020cd01452b4637e7daf5a77f upstream.

use mv_xor_slot_cleanup() instead of __mv_xor_slot_cleanup() as the former function
aquires the spin lock that needed to protect the drivers data.

Signed-off-by: Saeed Bishara <saeed@marvell.com>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: Andi Kleen <ak@linux.intel.com>

---
 drivers/dma/mv_xor.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Index: linux-2.6.35.y/drivers/dma/mv_xor.c
===================================================================
--- linux-2.6.35.y.orig/drivers/dma/mv_xor.c
+++ linux-2.6.35.y/drivers/dma/mv_xor.c
@@ -449,7 +449,7 @@ mv_xor_slot_cleanup(struct mv_xor_chan *
 static void mv_xor_tasklet(unsigned long data)
 {
 	struct mv_xor_chan *chan = (struct mv_xor_chan *) data;
-	__mv_xor_slot_cleanup(chan);
+	mv_xor_slot_cleanup(chan);
 }
 
 static struct mv_xor_desc_slot *

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

* [PATCH] [126/139] ima: fix add LSM rule bug
  2011-02-02  0:43 [PATCH] [0/139] 2.6.35.11 longterm review Andi Kleen
                   ` (124 preceding siblings ...)
  2011-02-02  0:45 ` [PATCH] [125/139] mv_xor: fix race in tasklet function Andi Kleen
@ 2011-02-02  0:45 ` Andi Kleen
  2011-02-02  0:45 ` [PATCH] [127/139] libata-sff: fix HSM_ST_ERR handling in __ata_sff_port_intr() Andi Kleen
                   ` (13 subsequent siblings)
  139 siblings, 0 replies; 149+ messages in thread
From: Andi Kleen @ 2011-02-02  0:45 UTC (permalink / raw)
  To: zohar, zohar, ak, jmorris, serge.hallyn, safford, akpm, torvalds,
	gregkh, linux-kernel, stable

2.6.35-longterm review patch.  If anyone has any objections, please let me know.

------------------
From: Mimi Zohar <zohar@linux.vnet.ibm.com>

commit 867c20265459d30a01b021a9c1e81fb4c5832aa9 upstream.

If security_filter_rule_init() doesn't return a rule, then not everything
is as fine as the return code implies.

This bug only occurs when the LSM (eg. SELinux) is disabled at runtime.

Adding an empty LSM rule causes ima_match_rules() to always succeed,
ignoring any remaining rules.

 default IMA TCB policy:
  # PROC_SUPER_MAGIC
  dont_measure fsmagic=0x9fa0
  # SYSFS_MAGIC
  dont_measure fsmagic=0x62656572
  # DEBUGFS_MAGIC
  dont_measure fsmagic=0x64626720
  # TMPFS_MAGIC
  dont_measure fsmagic=0x01021994
  # SECURITYFS_MAGIC
  dont_measure fsmagic=0x73636673

  < LSM specific rule >
  dont_measure obj_type=var_log_t

  measure func=BPRM_CHECK
  measure func=FILE_MMAP mask=MAY_EXEC
  measure func=FILE_CHECK mask=MAY_READ uid=0

Thus without the patch, with the boot parameters 'tcb selinux=0', adding
the above 'dont_measure obj_type=var_log_t' rule to the default IMA TCB
measurement policy, would result in nothing being measured.  The patch
prevents the default TCB policy from being replaced.

Signed-off-by: Mimi Zohar <zohar@us.ibm.com>
Signed-off-by: Andi Kleen <ak@linux.intel.com>
Cc: James Morris <jmorris@namei.org>
Acked-by: Serge Hallyn <serge.hallyn@canonical.com>
Cc: David Safford <safford@watson.ibm.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

---
 security/integrity/ima/ima_policy.c |    2 ++
 1 file changed, 2 insertions(+)

Index: linux-2.6.35.y/security/integrity/ima/ima_policy.c
===================================================================
--- linux-2.6.35.y.orig/security/integrity/ima/ima_policy.c
+++ linux-2.6.35.y/security/integrity/ima/ima_policy.c
@@ -253,6 +253,8 @@ static int ima_lsm_rule_init(struct ima_
 	result = security_filter_rule_init(entry->lsm[lsm_rule].type,
 					   Audit_equal, args,
 					   &entry->lsm[lsm_rule].rule);
+	if (!entry->lsm[lsm_rule].rule)
+		return -EINVAL;
 	return result;
 }
 

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

* [PATCH] [127/139] libata-sff: fix HSM_ST_ERR handling in __ata_sff_port_intr()
  2011-02-02  0:43 [PATCH] [0/139] 2.6.35.11 longterm review Andi Kleen
                   ` (125 preceding siblings ...)
  2011-02-02  0:45 ` [PATCH] [126/139] ima: fix add LSM rule bug Andi Kleen
@ 2011-02-02  0:45 ` Andi Kleen
  2011-02-02  0:45 ` [PATCH] [128/139] mac80211: fix mesh forwarding Andi Kleen
                   ` (12 subsequent siblings)
  139 siblings, 0 replies; 149+ messages in thread
From: Andi Kleen @ 2011-02-02  0:45 UTC (permalink / raw)
  To: tj, ak, jgarzik, gregkh, linux-kernel, stable

2.6.35-longterm review patch.  If anyone has any objections, please let me know.

------------------
From: Tejun Heo <tj@kernel.org>

commit 687a993339c4f3a63654746230da3aab8bbdbffd upstream.

While separating out BMDMA irq handler from SFF, commit c3b28894
(libata-sff: separate out BMDMA irq handler) incorrectly made
__ata_sff_port_intr() consider an IRQ to be an idle one if the host
state was transitioned to HSM_ST_ERR by ata_bmdma_port_intr().

This makes BMDMA drivers ignore IRQs reporting host bus error which
leads to timeouts instead of triggering EH immediately.  Fix it by
making __ata_sff_port_intr() consider the IRQ to be an idle one iff
the state is HSM_ST_IDLE.  This is equivalent to adding HSM_ST_ERR to
the "break"ing case but less error-prone.

Signed-off-by: Tejun Heo <tj@kernel.org>
Signed-off-by: Andi Kleen <ak@linux.intel.com>
Reported-by: Antonio Toma <antonio.toma@gmail.com>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

---
 drivers/ata/libata-sff.c |    7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

Index: linux-2.6.35.y/drivers/ata/libata-sff.c
===================================================================
--- linux-2.6.35.y.orig/drivers/ata/libata-sff.c
+++ linux-2.6.35.y/drivers/ata/libata-sff.c
@@ -1515,11 +1515,10 @@ static unsigned int __ata_sff_port_intr(
 		if (!(qc->dev->flags & ATA_DFLAG_CDB_INTR))
 			return ata_sff_idle_irq(ap);
 		break;
-	case HSM_ST:
-	case HSM_ST_LAST:
-		break;
-	default:
+	case HSM_ST_IDLE:
 		return ata_sff_idle_irq(ap);
+	default:
+		break;
 	}
 
 	/* check main status, clearing INTRQ if needed */

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

* [PATCH] [128/139] mac80211: fix mesh forwarding
  2011-02-02  0:43 [PATCH] [0/139] 2.6.35.11 longterm review Andi Kleen
                   ` (126 preceding siblings ...)
  2011-02-02  0:45 ` [PATCH] [127/139] libata-sff: fix HSM_ST_ERR handling in __ata_sff_port_intr() Andi Kleen
@ 2011-02-02  0:45 ` Andi Kleen
  2011-02-02  7:56   ` Johannes Berg
  2011-02-02  0:45 ` [PATCH] [129/139] ALSA: hda: Use LPIB quirk for Dell Inspiron m101z/1120 Andi Kleen
                   ` (11 subsequent siblings)
  139 siblings, 1 reply; 149+ messages in thread
From: Andi Kleen @ 2011-02-02  0:45 UTC (permalink / raw)
  To: johannes.berg, javier, linville, gregkh, ak, linux-kernel, stable

2.6.35-longterm review patch.  If anyone has any objections, please let me know.

------------------
From: Johannes Berg <johannes.berg@intel.com>

commit b51aff057c9d0ef6c529dc25fd9f775faf7b6c63 upstream.

Under memory pressure, the mac80211 mesh code
may helpfully print a message that it failed
to clone a mesh frame and then will proceed
to crash trying to use it anyway. Fix that.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Acked-by: Javier Cardona <javier@cozybit.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: Andi Kleen <ak@linux.intel.com>

---
 net/mac80211/rx.c |    5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

Index: linux-2.6.35.y/net/mac80211/rx.c
===================================================================
--- linux-2.6.35.y.orig/net/mac80211/rx.c
+++ linux-2.6.35.y/net/mac80211/rx.c
@@ -1707,9 +1707,11 @@ ieee80211_rx_h_mesh_fwding(struct ieee80
 
 			fwd_skb = skb_copy(skb, GFP_ATOMIC);
 
-			if (!fwd_skb && net_ratelimit())
+			if (!fwd_skb && net_ratelimit()) {
 				printk(KERN_DEBUG "%s: failed to clone mesh frame\n",
 						   sdata->name);
+				goto out;
+			}
 
 			fwd_hdr =  (struct ieee80211_hdr *) fwd_skb->data;
 			memcpy(fwd_hdr->addr2, sdata->vif.addr, ETH_ALEN);
@@ -1747,6 +1749,7 @@ ieee80211_rx_h_mesh_fwding(struct ieee80
 		}
 	}
 
+ out:
 	if (is_multicast_ether_addr(hdr->addr1) ||
 	    sdata->dev->flags & IFF_PROMISC)
 		return RX_CONTINUE;

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

* [PATCH] [129/139] ALSA: hda: Use LPIB quirk for Dell Inspiron m101z/1120
  2011-02-02  0:43 [PATCH] [0/139] 2.6.35.11 longterm review Andi Kleen
                   ` (127 preceding siblings ...)
  2011-02-02  0:45 ` [PATCH] [128/139] mac80211: fix mesh forwarding Andi Kleen
@ 2011-02-02  0:45 ` Andi Kleen
  2011-02-02  0:45 ` [PATCH] [130/139] Sched: fix skip_clock_update optimization Andi Kleen
                   ` (10 subsequent siblings)
  139 siblings, 0 replies; 149+ messages in thread
From: Andi Kleen @ 2011-02-02  0:45 UTC (permalink / raw)
  To: crimsun, tiwai, gregkh, ak, linux-kernel, stable

2.6.35-longterm review patch.  If anyone has any objections, please let me know.

------------------
From: Daniel T Chen <crimsun@ubuntu.com>

commit e03fa055bc126e536c7f65862e08a9b143138ea9 upstream.

Sjoerd Simons reports that, without using position_fix=1, recording
experiences overruns. Work around that by applying the LPIB quirk
for his hardware.

Reported-and-tested-by: Sjoerd Simons <sjoerd@debian.org>
Signed-off-by: Daniel T Chen <crimsun@ubuntu.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: Andi Kleen <ak@linux.intel.com>

---
 sound/pci/hda/hda_intel.c |    1 +
 1 file changed, 1 insertion(+)

Index: linux-2.6.35.y/sound/pci/hda/hda_intel.c
===================================================================
--- linux-2.6.35.y.orig/sound/pci/hda/hda_intel.c
+++ linux-2.6.35.y/sound/pci/hda/hda_intel.c
@@ -2295,6 +2295,7 @@ static struct snd_pci_quirk position_fix
 	SND_PCI_QUIRK(0x1028, 0x01cc, "Dell D820", POS_FIX_LPIB),
 	SND_PCI_QUIRK(0x1028, 0x01de, "Dell Precision 390", POS_FIX_LPIB),
 	SND_PCI_QUIRK(0x1028, 0x01f6, "Dell Latitude 131L", POS_FIX_LPIB),
+	SND_PCI_QUIRK(0x1028, 0x0470, "Dell Inspiron 1120", POS_FIX_LPIB),
 	SND_PCI_QUIRK(0x103c, 0x306d, "HP dv3", POS_FIX_LPIB),
 	SND_PCI_QUIRK(0x1043, 0x813d, "ASUS P5AD2", POS_FIX_LPIB),
 	SND_PCI_QUIRK(0x1043, 0x81b3, "ASUS", POS_FIX_LPIB),

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

* [PATCH] [130/139] Sched: fix skip_clock_update optimization
  2011-02-02  0:43 [PATCH] [0/139] 2.6.35.11 longterm review Andi Kleen
                   ` (128 preceding siblings ...)
  2011-02-02  0:45 ` [PATCH] [129/139] ALSA: hda: Use LPIB quirk for Dell Inspiron m101z/1120 Andi Kleen
@ 2011-02-02  0:45 ` Andi Kleen
  2011-02-02  0:45 ` [PATCH] [131/139] block: Deprecate QUEUE_FLAG_CLUSTER and use queue_limits instead Andi Kleen
                   ` (9 subsequent siblings)
  139 siblings, 0 replies; 149+ messages in thread
From: Andi Kleen @ 2011-02-02  0:45 UTC (permalink / raw)
  To: efault, ak, yong.zhang0, a.p.zijlstra, mingo, gregkh,
	linux-kernel, stable

2.6.35-longterm review patch.  If anyone has any objections, please let me know.

------------------
From: Mike Galbraith <efault@gmx.de>

commit f26f9aff6aaf67e9a430d16c266f91b13a5bff64 upstream.

idle_balance() drops/retakes rq->lock, leaving the previous task
vulnerable to set_tsk_need_resched().  Clear it after we return
from balancing instead, and in setup_thread_stack() as well, so
no successfully descheduled or never scheduled task has it set.

Need resched confused the skip_clock_update logic, which assumes
that the next call to update_rq_clock() will come nearly immediately
after being set.  Make the optimization robust against the waking
a sleeper before it sucessfully deschedules case by checking that
the current task has not been dequeued before setting the flag,
since it is that useless clock update we're trying to save, and
clear unconditionally in schedule() proper instead of conditionally
in put_prev_task().

Signed-off-by: Mike Galbraith <efault@gmx.de>
Signed-off-by: Andi Kleen <ak@linux.intel.com>
Reported-by: Bjoern B. Brandenburg <bbb.lst@gmail.com>
Tested-by: Yong Zhang <yong.zhang0@gmail.com>
Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
LKML-Reference: <1291802742.1417.9.camel@marge.simson.net>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

---
 kernel/fork.c  |    1 +
 kernel/sched.c |    6 +++---
 2 files changed, 4 insertions(+), 3 deletions(-)

Index: linux-2.6.35.y/kernel/fork.c
===================================================================
--- linux-2.6.35.y.orig/kernel/fork.c
+++ linux-2.6.35.y/kernel/fork.c
@@ -272,6 +272,7 @@ static struct task_struct *dup_task_stru
 
 	setup_thread_stack(tsk, orig);
 	clear_user_return_notifier(tsk);
+	clear_tsk_need_resched(tsk);
 	stackend = end_of_stack(tsk);
 	*stackend = STACK_END_MAGIC;	/* for overflow detection */
 
Index: linux-2.6.35.y/kernel/sched.c
===================================================================
--- linux-2.6.35.y.orig/kernel/sched.c
+++ linux-2.6.35.y/kernel/sched.c
@@ -564,7 +564,7 @@ void check_preempt_curr(struct rq *rq, s
 	 * A queue event has occurred, and we're going to schedule.  In
 	 * this case, we can save a useless back to back clock update.
 	 */
-	if (test_tsk_need_resched(p))
+	if (rq->curr->se.on_rq && test_tsk_need_resched(rq->curr))
 		rq->skip_clock_update = 1;
 }
 
@@ -3657,7 +3657,6 @@ static void put_prev_task(struct rq *rq,
 {
 	if (prev->se.on_rq)
 		update_rq_clock(rq);
-	rq->skip_clock_update = 0;
 	prev->sched_class->put_prev_task(rq, prev);
 }
 
@@ -3720,7 +3719,6 @@ need_resched_nonpreemptible:
 		hrtick_clear(rq);
 
 	raw_spin_lock_irq(&rq->lock);
-	clear_tsk_need_resched(prev);
 
 	if (prev->state && !(preempt_count() & PREEMPT_ACTIVE)) {
 		if (unlikely(signal_pending_state(prev->state, prev)))
@@ -3737,6 +3735,8 @@ need_resched_nonpreemptible:
 
 	put_prev_task(rq, prev);
 	next = pick_next_task(rq);
+	clear_tsk_need_resched(prev);
+	rq->skip_clock_update = 0;
 
 	if (likely(prev != next)) {
 		sched_info_switch(prev, next);

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

* [PATCH] [131/139] block: Deprecate QUEUE_FLAG_CLUSTER and use queue_limits instead
  2011-02-02  0:43 [PATCH] [0/139] 2.6.35.11 longterm review Andi Kleen
                   ` (129 preceding siblings ...)
  2011-02-02  0:45 ` [PATCH] [130/139] Sched: fix skip_clock_update optimization Andi Kleen
@ 2011-02-02  0:45 ` Andi Kleen
  2011-02-02  0:45 ` [PATCH] [132/139] x86/microcode: Fix double vfree() and remove redundant pointer checks before vfree() Andi Kleen
                   ` (8 subsequent siblings)
  139 siblings, 0 replies; 149+ messages in thread
From: Andi Kleen @ 2011-02-02  0:45 UTC (permalink / raw)
  To: martin.petersen, snitzer, jaxboe, gregkh, ak, linux-kernel, stable

2.6.35-longterm review patch.  If anyone has any objections, please let me know.

------------------
From: Martin K. Petersen <martin.petersen@oracle.com>

commit e692cb668fdd5a712c6ed2a2d6f2a36ee83997b4 upstream.

When stacking devices, a request_queue is not always available. This
forced us to have a no_cluster flag in the queue_limits that could be
used as a carrier until the request_queue had been set up for a
metadevice.

There were several problems with that approach. First of all it was up
to the stacking device to remember to set queue flag after stacking had
completed. Also, the queue flag and the queue limits had to be kept in
sync at all times. We got that wrong, which could lead to us issuing
commands that went beyond the max scatterlist limit set by the driver.

The proper fix is to avoid having two flags for tracking the same thing.
We deprecate QUEUE_FLAG_CLUSTER and use the queue limit directly in the
block layer merging functions. The queue_limit 'no_cluster' is turned
into 'cluster' to avoid double negatives and to ease stacking.
Clustering defaults to being enabled as before. The queue flag logic is
removed from the stacking function, and explicitly setting the cluster
flag is no longer necessary in DM and MD.

Reported-by: Ed Lin <ed.lin@promise.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Acked-by: Mike Snitzer <snitzer@redhat.com>
Signed-off-by: Jens Axboe <jaxboe@fusionio.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: Andi Kleen <ak@linux.intel.com>

---
 block/blk-merge.c       |    6 +++---
 block/blk-settings.c    |   25 ++-----------------------
 block/blk-sysfs.c       |    2 +-
 drivers/md/dm-table.c   |    5 -----
 drivers/md/md.c         |    3 ---
 drivers/scsi/scsi_lib.c |    3 +--
 include/linux/blkdev.h  |    9 ++++++---
 7 files changed, 13 insertions(+), 40 deletions(-)

Index: linux-2.6.35.y/block/blk-merge.c
===================================================================
--- linux-2.6.35.y.orig/block/blk-merge.c
+++ linux-2.6.35.y/block/blk-merge.c
@@ -22,7 +22,7 @@ static unsigned int __blk_recalc_rq_segm
 		return 0;
 
 	fbio = bio;
-	cluster = test_bit(QUEUE_FLAG_CLUSTER, &q->queue_flags);
+	cluster = blk_queue_cluster(q);
 	seg_size = 0;
 	phys_size = nr_phys_segs = 0;
 	for_each_bio(bio) {
@@ -88,7 +88,7 @@ EXPORT_SYMBOL(blk_recount_segments);
 static int blk_phys_contig_segment(struct request_queue *q, struct bio *bio,
 				   struct bio *nxt)
 {
-	if (!test_bit(QUEUE_FLAG_CLUSTER, &q->queue_flags))
+	if (!blk_queue_cluster(q))
 		return 0;
 
 	if (bio->bi_seg_back_size + nxt->bi_seg_front_size >
@@ -124,7 +124,7 @@ int blk_rq_map_sg(struct request_queue *
 	int nsegs, cluster;
 
 	nsegs = 0;
-	cluster = test_bit(QUEUE_FLAG_CLUSTER, &q->queue_flags);
+	cluster = blk_queue_cluster(q);
 
 	/*
 	 * for each bio in rq
Index: linux-2.6.35.y/block/blk-settings.c
===================================================================
--- linux-2.6.35.y.orig/block/blk-settings.c
+++ linux-2.6.35.y/block/blk-settings.c
@@ -108,7 +108,7 @@ void blk_set_default_limits(struct queue
 	lim->alignment_offset = 0;
 	lim->io_opt = 0;
 	lim->misaligned = 0;
-	lim->no_cluster = 0;
+	lim->cluster = 1;
 }
 EXPORT_SYMBOL(blk_set_default_limits);
 
@@ -451,15 +451,6 @@ EXPORT_SYMBOL(blk_queue_io_opt);
 void blk_queue_stack_limits(struct request_queue *t, struct request_queue *b)
 {
 	blk_stack_limits(&t->limits, &b->limits, 0);
-
-	if (!t->queue_lock)
-		WARN_ON_ONCE(1);
-	else if (!test_bit(QUEUE_FLAG_CLUSTER, &b->queue_flags)) {
-		unsigned long flags;
-		spin_lock_irqsave(t->queue_lock, flags);
-		queue_flag_clear(QUEUE_FLAG_CLUSTER, t);
-		spin_unlock_irqrestore(t->queue_lock, flags);
-	}
 }
 EXPORT_SYMBOL(blk_queue_stack_limits);
 
@@ -530,7 +521,7 @@ int blk_stack_limits(struct queue_limits
 	t->io_min = max(t->io_min, b->io_min);
 	t->io_opt = lcm(t->io_opt, b->io_opt);
 
-	t->no_cluster |= b->no_cluster;
+	t->cluster &= b->cluster;
 	t->discard_zeroes_data &= b->discard_zeroes_data;
 
 	/* Physical block size a multiple of the logical block size? */
@@ -626,7 +617,6 @@ void disk_stack_limits(struct gendisk *d
 		       sector_t offset)
 {
 	struct request_queue *t = disk->queue;
-	struct request_queue *b = bdev_get_queue(bdev);
 
 	if (bdev_stack_limits(&t->limits, bdev, offset >> 9) < 0) {
 		char top[BDEVNAME_SIZE], bottom[BDEVNAME_SIZE];
@@ -637,17 +627,6 @@ void disk_stack_limits(struct gendisk *d
 		printk(KERN_NOTICE "%s: Warning: Device %s is misaligned\n",
 		       top, bottom);
 	}
-
-	if (!t->queue_lock)
-		WARN_ON_ONCE(1);
-	else if (!test_bit(QUEUE_FLAG_CLUSTER, &b->queue_flags)) {
-		unsigned long flags;
-
-		spin_lock_irqsave(t->queue_lock, flags);
-		if (!test_bit(QUEUE_FLAG_CLUSTER, &b->queue_flags))
-			queue_flag_clear(QUEUE_FLAG_CLUSTER, t);
-		spin_unlock_irqrestore(t->queue_lock, flags);
-	}
 }
 EXPORT_SYMBOL(disk_stack_limits);
 
Index: linux-2.6.35.y/block/blk-sysfs.c
===================================================================
--- linux-2.6.35.y.orig/block/blk-sysfs.c
+++ linux-2.6.35.y/block/blk-sysfs.c
@@ -114,7 +114,7 @@ static ssize_t queue_max_segments_show(s
 
 static ssize_t queue_max_segment_size_show(struct request_queue *q, char *page)
 {
-	if (test_bit(QUEUE_FLAG_CLUSTER, &q->queue_flags))
+	if (blk_queue_cluster(q))
 		return queue_var_show(queue_max_segment_size(q), (page));
 
 	return queue_var_show(PAGE_CACHE_SIZE, (page));
Index: linux-2.6.35.y/drivers/md/dm-table.c
===================================================================
--- linux-2.6.35.y.orig/drivers/md/dm-table.c
+++ linux-2.6.35.y/drivers/md/dm-table.c
@@ -1081,11 +1081,6 @@ void dm_table_set_restrictions(struct dm
 	 */
 	q->limits = *limits;
 
-	if (limits->no_cluster)
-		queue_flag_clear_unlocked(QUEUE_FLAG_CLUSTER, q);
-	else
-		queue_flag_set_unlocked(QUEUE_FLAG_CLUSTER, q);
-
 	dm_table_set_integrity(t);
 
 	/*
Index: linux-2.6.35.y/drivers/md/md.c
===================================================================
--- linux-2.6.35.y.orig/drivers/md/md.c
+++ linux-2.6.35.y/drivers/md/md.c
@@ -4248,9 +4248,6 @@ static int md_alloc(dev_t dev, char *nam
 		goto abort;
 	mddev->queue->queuedata = mddev;
 
-	/* Can be unlocked because the queue is new: no concurrency */
-	queue_flag_set_unlocked(QUEUE_FLAG_CLUSTER, mddev->queue);
-
 	blk_queue_make_request(mddev->queue, md_make_request);
 
 	disk = alloc_disk(1 << shift);
Index: linux-2.6.35.y/drivers/scsi/scsi_lib.c
===================================================================
--- linux-2.6.35.y.orig/drivers/scsi/scsi_lib.c
+++ linux-2.6.35.y/drivers/scsi/scsi_lib.c
@@ -1640,9 +1640,8 @@ struct request_queue *__scsi_alloc_queue
 
 	blk_queue_max_segment_size(q, dma_get_max_seg_size(dev));
 
-	/* New queue, no concurrency on queue_flags */
 	if (!shost->use_clustering)
-		queue_flag_clear_unlocked(QUEUE_FLAG_CLUSTER, q);
+		q->limits.cluster = 0;
 
 	/*
 	 * set a reasonable default alignment on word boundaries: the
Index: linux-2.6.35.y/include/linux/blkdev.h
===================================================================
--- linux-2.6.35.y.orig/include/linux/blkdev.h
+++ linux-2.6.35.y/include/linux/blkdev.h
@@ -325,7 +325,7 @@ struct queue_limits {
 
 	unsigned char		misaligned;
 	unsigned char		discard_misaligned;
-	unsigned char		no_cluster;
+	unsigned char		cluster;
 	signed char		discard_zeroes_data;
 };
 
@@ -448,7 +448,6 @@ struct request_queue
 #endif
 };
 
-#define QUEUE_FLAG_CLUSTER	0	/* cluster several segments into 1 */
 #define QUEUE_FLAG_QUEUED	1	/* uses generic tag queueing */
 #define QUEUE_FLAG_STOPPED	2	/* queue is stopped */
 #define	QUEUE_FLAG_SYNCFULL	3	/* read queue has been filled */
@@ -469,7 +468,6 @@ struct request_queue
 #define QUEUE_FLAG_NOXMERGES   17	/* No extended merges */
 
 #define QUEUE_FLAG_DEFAULT	((1 << QUEUE_FLAG_IO_STAT) |		\
-				 (1 << QUEUE_FLAG_CLUSTER) |		\
 				 (1 << QUEUE_FLAG_STACKABLE)	|	\
 				 (1 << QUEUE_FLAG_SAME_COMP))
 
@@ -636,6 +634,11 @@ enum {
 
 #define rq_data_dir(rq)		((rq)->cmd_flags & 1)
 
+static inline unsigned int blk_queue_cluster(struct request_queue *q)
+{
+	return q->limits.cluster;
+}
+
 /*
  * We regard a request as sync, if either a read or a sync write
  */

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

* [PATCH] [132/139] x86/microcode: Fix double vfree() and remove redundant pointer checks before vfree()
  2011-02-02  0:43 [PATCH] [0/139] 2.6.35.11 longterm review Andi Kleen
                   ` (130 preceding siblings ...)
  2011-02-02  0:45 ` [PATCH] [131/139] block: Deprecate QUEUE_FLAG_CLUSTER and use queue_limits instead Andi Kleen
@ 2011-02-02  0:45 ` Andi Kleen
  2011-02-02  0:45 ` [PATCH] [133/139] posix-cpu-timers: workaround to suppress the problems with mt exec Andi Kleen
                   ` (7 subsequent siblings)
  139 siblings, 0 replies; 149+ messages in thread
From: Andi Kleen @ 2011-02-02  0:45 UTC (permalink / raw)
  To: jj, tigran, ak, shaohua.li, mingo, gregkh, linux-kernel, stable

2.6.35-longterm review patch.  If anyone has any objections, please let me know.

------------------
From: Jesper Juhl <jj@chaosbits.net>

commit 5cdd2de0a76d0ac47f107c8a7b32d75d25768dc1 upstream.

In arch/x86/kernel/microcode_intel.c::generic_load_microcode()
we have  this:

	while (leftover) {
		...
		if (get_ucode_data(mc, ucode_ptr, mc_size) ||
		    microcode_sanity_check(mc) < 0) {
			vfree(mc);
			break;
		}
		...
	}

	if (mc)
		vfree(mc);

This will cause a double free of 'mc'. This patch fixes that by
just  removing the vfree() call in the loop since 'mc' will be
freed nicely just  after we break out of the loop.

There's also a second change in the patch. I noticed a lot of
checks for  pointers being NULL before passing them to vfree().
That's completely  redundant since vfree() deals gracefully with
being passed a NULL pointer.  Removing the redundant checks
yields a nice size decrease for the object  file.

Size before the patch:
   text    data     bss     dec     hex filename
   4578     240    1032    5850    16da arch/x86/kernel/microcode_intel.o
Size after the patch:
   text    data     bss     dec     hex filename
   4489     240     984    5713    1651 arch/x86/kernel/microcode_intel.o

Signed-off-by: Jesper Juhl <jj@chaosbits.net>
Acked-by: Tigran Aivazian <tigran@aivazian.fsnet.co.uk>
Signed-off-by: Andi Kleen <ak@linux.intel.com>
Cc: Shaohua Li <shaohua.li@intel.com>
LKML-Reference: <alpine.LNX.2.00.1012251946100.10759@swampdragon.chaosbits.net>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

---
 arch/x86/kernel/microcode_intel.c |   16 +++++-----------
 1 file changed, 5 insertions(+), 11 deletions(-)

Index: linux-2.6.35.y/arch/x86/kernel/microcode_intel.c
===================================================================
--- linux-2.6.35.y.orig/arch/x86/kernel/microcode_intel.c
+++ linux-2.6.35.y/arch/x86/kernel/microcode_intel.c
@@ -364,8 +364,7 @@ static enum ucode_state generic_load_mic
 
 		/* For performance reasons, reuse mc area when possible */
 		if (!mc || mc_size > curr_mc_size) {
-			if (mc)
-				vfree(mc);
+			vfree(mc);
 			mc = vmalloc(mc_size);
 			if (!mc)
 				break;
@@ -374,13 +373,11 @@ static enum ucode_state generic_load_mic
 
 		if (get_ucode_data(mc, ucode_ptr, mc_size) ||
 		    microcode_sanity_check(mc) < 0) {
-			vfree(mc);
 			break;
 		}
 
 		if (get_matching_microcode(&uci->cpu_sig, mc, new_rev)) {
-			if (new_mc)
-				vfree(new_mc);
+			vfree(new_mc);
 			new_rev = mc_header.rev;
 			new_mc  = mc;
 			mc = NULL;	/* trigger new vmalloc */
@@ -390,12 +387,10 @@ static enum ucode_state generic_load_mic
 		leftover  -= mc_size;
 	}
 
-	if (mc)
-		vfree(mc);
+	vfree(mc);
 
 	if (leftover) {
-		if (new_mc)
-			vfree(new_mc);
+		vfree(new_mc);
 		state = UCODE_ERROR;
 		goto out;
 	}
@@ -405,8 +400,7 @@ static enum ucode_state generic_load_mic
 		goto out;
 	}
 
-	if (uci->mc)
-		vfree(uci->mc);
+	vfree(uci->mc);
 	uci->mc = (struct microcode_intel *)new_mc;
 
 	pr_debug("CPU%d found a matching microcode update with version 0x%x (current=0x%x)\n",

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

* [PATCH] [133/139] posix-cpu-timers: workaround to suppress the problems with mt exec
  2011-02-02  0:43 [PATCH] [0/139] 2.6.35.11 longterm review Andi Kleen
                   ` (131 preceding siblings ...)
  2011-02-02  0:45 ` [PATCH] [132/139] x86/microcode: Fix double vfree() and remove redundant pointer checks before vfree() Andi Kleen
@ 2011-02-02  0:45 ` Andi Kleen
  2011-02-02  0:45 ` [PATCH] [134/139] gspca - sonixj: Set the flag for some devices Andi Kleen
                   ` (6 subsequent siblings)
  139 siblings, 0 replies; 149+ messages in thread
From: Andi Kleen @ 2011-02-02  0:45 UTC (permalink / raw)
  To: oleg, torvalds, gregkh, ak, linux-kernel, stable

2.6.35-longterm review patch.  If anyone has any objections, please let me know.

------------------
From: Oleg Nesterov <oleg@redhat.com>

commit e0a70217107e6f9844628120412cb27bb4cea194 upstream.

posix-cpu-timers.c correctly assumes that the dying process does
posix_cpu_timers_exit_group() and removes all !CPUCLOCK_PERTHREAD
timers from signal->cpu_timers list.

But, it also assumes that timer->it.cpu.task is always the group
leader, and thus the dead ->task means the dead thread group.

This is obviously not true after de_thread() changes the leader.
After that almost every posix_cpu_timer_ method has problems.

It is not simple to fix this bug correctly. First of all, I think
that timer->it.cpu should use struct pid instead of task_struct.
Also, the locking should be reworked completely. In particular,
tasklist_lock should not be used at all. This all needs a lot of
nontrivial and hard-to-test changes.

Change __exit_signal() to do posix_cpu_timers_exit_group() when
the old leader dies during exec. This is not the fix, just the
temporary hack to hide the problem for 2.6.37 and stable. IOW,
this is obviously wrong but this is what we currently have anyway:
cpu timers do not work after mt exec.

In theory this change adds another race. The exiting leader can
detach the timers which were attached to the new leader. However,
the window between de_thread() and release_task() is small, we
can pretend that sys_timer_create() was called before de_thread().

Signed-off-by: Oleg Nesterov <oleg@redhat.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: Andi Kleen <ak@linux.intel.com>

---
 kernel/exit.c |    8 ++++++++
 1 file changed, 8 insertions(+)

Index: linux-2.6.35.y/kernel/exit.c
===================================================================
--- linux-2.6.35.y.orig/kernel/exit.c
+++ linux-2.6.35.y/kernel/exit.c
@@ -95,6 +95,14 @@ static void __exit_signal(struct task_st
 		sig->tty = NULL;
 	} else {
 		/*
+		 * This can only happen if the caller is de_thread().
+		 * FIXME: this is the temporary hack, we should teach
+		 * posix-cpu-timers to handle this case correctly.
+		 */
+		if (unlikely(has_group_leader_pid(tsk)))
+			posix_cpu_timers_exit_group(tsk);
+
+		/*
 		 * If there is any task waiting for the group exit
 		 * then notify it:
 		 */

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

* [PATCH] [134/139] gspca - sonixj: Set the flag for some devices
  2011-02-02  0:43 [PATCH] [0/139] 2.6.35.11 longterm review Andi Kleen
                   ` (132 preceding siblings ...)
  2011-02-02  0:45 ` [PATCH] [133/139] posix-cpu-timers: workaround to suppress the problems with mt exec Andi Kleen
@ 2011-02-02  0:45 ` Andi Kleen
  2011-02-02  0:45 ` [PATCH] [135/139] gspca - sonixj: Add a flag in the driver_info table Andi Kleen
                   ` (5 subsequent siblings)
  139 siblings, 0 replies; 149+ messages in thread
From: Andi Kleen @ 2011-02-02  0:45 UTC (permalink / raw)
  To: moinejf, mchehab, gregkh, ak, linux-kernel, stable

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 1860 bytes --]

2.6.35-longterm review patch.  If anyone has any objections, please let me know.

------------------
From: Jean-Francois Moine <moinejf@free.fr>

commit b2272a49e7df37732d73988f00468ce31e1ebc92 upstream.

The flag PDN_INV indicates that the sensor pin S_PWR_DN has not the same
value as other webcams with the same sensor. For now, only two webcams have
been so detected: the Microsoft's VX1000 and VX3000.

Signed-off-by: Jean-François Moine <moinejf@free.fr>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: Andi Kleen <ak@linux.intel.com>

---
 drivers/media/video/gspca/sonixj.c |    7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

Index: linux-2.6.35.y/drivers/media/video/gspca/sonixj.c
===================================================================
--- linux-2.6.35.y.orig/drivers/media/video/gspca/sonixj.c
+++ linux-2.6.35.y/drivers/media/video/gspca/sonixj.c
@@ -88,6 +88,9 @@ enum {
 	u8 jpeg_hdr[JPEG_HDR_SZ];
 };
 
+/* device flags */
+#define PDN_INV	1		/* inverse pin S_PWR_DN / sn_xxx tables */
+
 /* V4L2 controls supported by the driver */
 static int sd_setbrightness(struct gspca_dev *gspca_dev, __s32 val);
 static int sd_getbrightness(struct gspca_dev *gspca_dev, __s32 *val);
@@ -3004,8 +3007,8 @@ static const __devinitdata struct usb_de
 	{USB_DEVICE(0x0458, 0x7025), BS(SN9C120, MI0360)},
 	{USB_DEVICE(0x0458, 0x702e), BS(SN9C120, OV7660)},
 #endif
-	{USB_DEVICE(0x045e, 0x00f5), BS(SN9C105, OV7660)},
-	{USB_DEVICE(0x045e, 0x00f7), BS(SN9C105, OV7660)},
+	{USB_DEVICE(0x045e, 0x00f5), BSF(SN9C105, OV7660, PDN_INV)},
+	{USB_DEVICE(0x045e, 0x00f7), BSF(SN9C105, OV7660, PDN_INV)},
 	{USB_DEVICE(0x0471, 0x0327), BS(SN9C105, MI0360)},
 	{USB_DEVICE(0x0471, 0x0328), BS(SN9C105, MI0360)},
 	{USB_DEVICE(0x0471, 0x0330), BS(SN9C105, MI0360)},

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

* [PATCH] [135/139] gspca - sonixj: Add a flag in the driver_info table
  2011-02-02  0:43 [PATCH] [0/139] 2.6.35.11 longterm review Andi Kleen
                   ` (133 preceding siblings ...)
  2011-02-02  0:45 ` [PATCH] [134/139] gspca - sonixj: Set the flag for some devices Andi Kleen
@ 2011-02-02  0:45 ` Andi Kleen
  2011-02-02  0:45 ` [PATCH] [136/139] [PATCH 2.6.35] mac80211: fix hard lockup in Andi Kleen
                   ` (4 subsequent siblings)
  139 siblings, 0 replies; 149+ messages in thread
From: Andi Kleen @ 2011-02-02  0:45 UTC (permalink / raw)
  To: moinejf, mchehab, gregkh, ak, linux-kernel, stable

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 1734 bytes --]

2.6.35-longterm review patch.  If anyone has any objections, please let me know.

------------------
From: Jean-Francois Moine <moinejf@free.fr>

commit c6c14330717f9850b4b4c054b81424b9979cd07d upstream.

Signed-off-by: Jean-François Moine <moinejf@free.fr>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: Andi Kleen <ak@linux.intel.com>

---
 drivers/media/video/gspca/sonixj.c |   10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

Index: linux-2.6.35.y/drivers/media/video/gspca/sonixj.c
===================================================================
--- linux-2.6.35.y.orig/drivers/media/video/gspca/sonixj.c
+++ linux-2.6.35.y/drivers/media/video/gspca/sonixj.c
@@ -57,6 +57,7 @@ struct sd {
 	u8 jpegqual;			/* webcam quality */
 
 	u8 reg18;
+	u8 flags;
 
 	s8 ag_cnt;
 #define AG_CNT_START 13
@@ -1777,7 +1778,8 @@ static int sd_config(struct gspca_dev *g
 	struct cam *cam;
 
 	sd->bridge = id->driver_info >> 16;
-	sd->sensor = id->driver_info;
+	sd->sensor = id->driver_info >> 8;
+	sd->flags = id->driver_info;
 
 	cam = &gspca_dev->cam;
 	if (sd->sensor == SENSOR_ADCM1700) {
@@ -3001,7 +3003,11 @@ static const struct sd_desc sd_desc = {
 /* -- module initialisation -- */
 #define BS(bridge, sensor) \
 	.driver_info = (BRIDGE_ ## bridge << 16) \
-			| SENSOR_ ## sensor
+			| (SENSOR_ ## sensor << 8)
+#define BSF(bridge, sensor, flags) \
+	.driver_info = (BRIDGE_ ## bridge << 16) \
+			| (SENSOR_ ## sensor << 8) \
+			| (flags)
 static const __devinitdata struct usb_device_id device_table[] = {
 #if !defined CONFIG_USB_SN9C102 && !defined CONFIG_USB_SN9C102_MODULE
 	{USB_DEVICE(0x0458, 0x7025), BS(SN9C120, MI0360)},

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

* [PATCH] [136/139] [PATCH 2.6.35] mac80211: fix hard lockup in
  2011-02-02  0:43 [PATCH] [0/139] 2.6.35.11 longterm review Andi Kleen
                   ` (134 preceding siblings ...)
  2011-02-02  0:45 ` [PATCH] [135/139] gspca - sonixj: Add a flag in the driver_info table Andi Kleen
@ 2011-02-02  0:45 ` Andi Kleen
  2011-02-02  0:45 ` [PATCH] [137/139] Input: i8042 - introduce 'notimeout' blacklist for Dell Vostro V13 Andi Kleen
                   ` (3 subsequent siblings)
  139 siblings, 0 replies; 149+ messages in thread
From: Andi Kleen @ 2011-02-02  0:45 UTC (permalink / raw)
  To: sgruszka, johannes.berg, ak, linux-kernel, stable

2.6.35-longterm review patch.  If anyone has any objections, please let me know.

------------------
Problem is 2.6.35 specific, bug was introduced in backport
of upstream 44271488b91c9eecf249e075a1805dd887e222d2 commit.

We can not call del_timer_sync(addba_resp_timer) from
___ieee80211_stop_tx_ba_session(), as this function can be called from
that timer callback. To fix, simply use not synchronous del_timer().

Resolve https://bugzilla.redhat.com/show_bug.cgi?id=667459

Reported-and-tested-by: Mathieu Chouquet-Stringer <mathieu-acct@csetco.com>
Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
Signed-off-by: Andi Kleen <ak@linux.intel.com>

---
 net/mac80211/agg-tx.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

Index: linux-2.6.35.y/net/mac80211/agg-tx.c
===================================================================
--- linux-2.6.35.y.orig/net/mac80211/agg-tx.c
+++ linux-2.6.35.y/net/mac80211/agg-tx.c
@@ -138,7 +138,7 @@ int ___ieee80211_stop_tx_ba_session(stru
 	       sta->sta.addr, tid);
 #endif /* CONFIG_MAC80211_HT_DEBUG */
 
-	del_timer_sync(&tid_tx->addba_resp_timer);
+	del_timer(&tid_tx->addba_resp_timer);
 
 	state = &sta->ampdu_mlme.tid_state_tx[tid];
 

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

* [PATCH] [137/139] Input: i8042 - introduce 'notimeout' blacklist for Dell Vostro V13
  2011-02-02  0:43 [PATCH] [0/139] 2.6.35.11 longterm review Andi Kleen
                   ` (135 preceding siblings ...)
  2011-02-02  0:45 ` [PATCH] [136/139] [PATCH 2.6.35] mac80211: fix hard lockup in Andi Kleen
@ 2011-02-02  0:45 ` Andi Kleen
  2011-02-02  0:45 ` [PATCH] [138/139] Revert drm/radeon/kms: properly compute group_size on 6xx/7xx Andi Kleen
                   ` (2 subsequent siblings)
  139 siblings, 0 replies; 149+ messages in thread
From: Andi Kleen @ 2011-02-02  0:45 UTC (permalink / raw)
  To: jkosina, dtor, linux-kernel, stable

2.6.35-longterm review patch.  If anyone has any objections, please let me know.

------------------
i8042 controller present in Dell Vostro V13 errorneously signals spurious
timeouts.

Introduce i8042.notimeout parameter for ignoring i8042-signalled timeouts
and apply this quirk automatically for Dell Vostro V13, based on DMI match.

In addition to that, this machine also needs to be added to nomux blacklist.

Signed-off-by: Jiri Kosina <jkosina@suse.cz>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>

Index: linux-2.6.35.y/Documentation/kernel-parameters.txt
===================================================================
--- linux-2.6.35.y.orig/Documentation/kernel-parameters.txt
+++ linux-2.6.35.y/Documentation/kernel-parameters.txt
@@ -917,6 +917,7 @@ and is between 256 and 4096 characters. 
 			     controller
 	i8042.nopnp	[HW] Don't use ACPIPnP / PnPBIOS to discover KBD/AUX
 			     controllers
+	i8042.notimeout	[HW] Ignore timeout condition signalled by conroller
 	i8042.panicblink=
 			[HW] Frequency with which keyboard LEDs should blink
 			     when kernel panics (default is 0.5 sec)
Index: linux-2.6.35.y/drivers/input/serio/i8042-x86ia64io.h
===================================================================
--- linux-2.6.35.y.orig/drivers/input/serio/i8042-x86ia64io.h
+++ linux-2.6.35.y/drivers/input/serio/i8042-x86ia64io.h
@@ -420,6 +420,13 @@ static const struct dmi_system_id __init
 			DMI_MATCH(DMI_PRODUCT_VERSION, "0100"),
 		},
 	},
+	{
+		/* Dell Vostro V13 */
+		.matches = {
+			DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
+			DMI_MATCH(DMI_PRODUCT_NAME, "Vostro V13"),
+		},
+	},
 	{ }
 };
 
@@ -541,6 +548,17 @@ static const struct dmi_system_id __init
 };
 #endif
 
+static const struct dmi_system_id __initconst i8042_dmi_notimeout_table[] = {
+	{
+		/* Dell Vostro V13 */
+		.matches = {
+			DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
+			DMI_MATCH(DMI_PRODUCT_NAME, "Vostro V13"),
+		},
+	},
+	{ }
+};
+
 /*
  * Some Wistron based laptops need us to explicitly enable the 'Dritek
  * keyboard extension' to make their extra keys start generating scancodes.
@@ -893,6 +911,9 @@ static int __init i8042_platform_init(vo
 	if (dmi_check_system(i8042_dmi_nomux_table))
 		i8042_nomux = true;
 
+	if (dmi_check_system(i8042_dmi_notimeout_table))
+		i8042_notimeout = true;
+
 	if (dmi_check_system(i8042_dmi_dritek_table))
 		i8042_dritek = true;
 #endif /* CONFIG_X86 */
Index: linux-2.6.35.y/drivers/input/serio/i8042.c
===================================================================
--- linux-2.6.35.y.orig/drivers/input/serio/i8042.c
+++ linux-2.6.35.y/drivers/input/serio/i8042.c
@@ -65,6 +65,10 @@ static unsigned int i8042_blink_frequenc
 module_param_named(panicblink, i8042_blink_frequency, uint, 0600);
 MODULE_PARM_DESC(panicblink, "Frequency with which keyboard LEDs should blink when kernel panics");
 
+static bool i8042_notimeout;
+module_param_named(notimeout, i8042_notimeout, bool, 0);
+MODULE_PARM_DESC(notimeout, "Ignore timeouts signalled by i8042");
+
 #ifdef CONFIG_X86
 static bool i8042_dritek;
 module_param_named(dritek, i8042_dritek, bool, 0);
@@ -507,7 +511,7 @@ static irqreturn_t i8042_interrupt(int i
 	} else {
 
 		dfl = ((str & I8042_STR_PARITY) ? SERIO_PARITY : 0) |
-		      ((str & I8042_STR_TIMEOUT) ? SERIO_TIMEOUT : 0);
+		      ((str & I8042_STR_TIMEOUT && !i8042_notimeout) ? SERIO_TIMEOUT : 0);
 
 		port_no = (str & I8042_STR_AUXDATA) ?
 				I8042_AUX_PORT_NO : I8042_KBD_PORT_NO;

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

* [PATCH] [138/139] Revert drm/radeon/kms: properly compute group_size on 6xx/7xx
  2011-02-02  0:43 [PATCH] [0/139] 2.6.35.11 longterm review Andi Kleen
                   ` (136 preceding siblings ...)
  2011-02-02  0:45 ` [PATCH] [137/139] Input: i8042 - introduce 'notimeout' blacklist for Dell Vostro V13 Andi Kleen
@ 2011-02-02  0:45 ` Andi Kleen
  2011-02-02  0:45 ` [PATCH] [139/139] Subject: Release 2.6.35.11 Andi Kleen
  2011-02-04 17:38 ` [PATCH] [0/139] 2.6.35.11 longterm review Frederic Weisbecker
  139 siblings, 0 replies; 149+ messages in thread
From: Andi Kleen @ 2011-02-02  0:45 UTC (permalink / raw)
  To: sconklin, linux-kernel, stable

2.6.35-longterm review patch.  If anyone has any objections, please let me know.

------------------

From: Steve Conklin <sconklin@canonical.com>

We discovered a regression for Radeon users in our latest proposed
kernel for 2.6.35 (Maverick), and have isolated it to this patch:

http://git.kernel.org/?p=linux/kernel/git/longterm/linux-2.6.35.y.git;a=commit;h=b8e9a4a45f8427837f4dba89
+bda4d4e3f3a5c726

We took that patch as part of 2.6.35.10, and one of our testers has
reported that our build of that kernel also exhibits the problem.

These are mainline kernels built with the Ubuntu configs.
http://kernel.ubuntu.com/~kernel-ppa/mainline/v2.6.35.10-maverick/

Our bug report is here:
https://bugs.launchpad.net/ubuntu/+source/linux/+bug/703553

Upstream bug report:

https://bugzilla.kernel.org/show_bug.cgi?id=24802

Index: linux-2.6.35.y/drivers/gpu/drm/radeon/r600.c
===================================================================
--- linux-2.6.35.y.orig/drivers/gpu/drm/radeon/r600.c
+++ linux-2.6.35.y/drivers/gpu/drm/radeon/r600.c
@@ -1597,11 +1597,8 @@ void r600_gpu_init(struct radeon_device 
 	rdev->config.r600.tiling_npipes = rdev->config.r600.max_tile_pipes;
 	rdev->config.r600.tiling_nbanks = 4 << ((ramcfg & NOOFBANK_MASK) >> NOOFBANK_SHIFT);
 	tiling_config |= BANK_TILING((ramcfg & NOOFBANK_MASK) >> NOOFBANK_SHIFT);
-	tiling_config |= GROUP_SIZE((ramcfg & BURSTLENGTH_MASK) >> BURSTLENGTH_SHIFT);
-	if ((ramcfg & BURSTLENGTH_MASK) >> BURSTLENGTH_SHIFT)
-		rdev->config.r600.tiling_group_size = 512;
-	else
-		rdev->config.r600.tiling_group_size = 256;
+	tiling_config |= GROUP_SIZE(0);
+	rdev->config.r600.tiling_group_size = 256;
 	tmp = (ramcfg & NOOFROWS_MASK) >> NOOFROWS_SHIFT;
 	if (tmp > 3) {
 		tiling_config |= ROW_TILING(3);
Index: linux-2.6.35.y/drivers/gpu/drm/radeon/rv770.c
===================================================================
--- linux-2.6.35.y.orig/drivers/gpu/drm/radeon/rv770.c
+++ linux-2.6.35.y/drivers/gpu/drm/radeon/rv770.c
@@ -627,11 +627,10 @@ static void rv770_gpu_init(struct radeon
 	else
 		gb_tiling_config |= BANK_TILING((mc_arb_ramcfg & NOOFBANK_MASK) >> NOOFBANK_SHIFT);
 	rdev->config.rv770.tiling_nbanks = 4 << ((gb_tiling_config >> 4) & 0x3);
-	gb_tiling_config |= GROUP_SIZE((mc_arb_ramcfg & BURSTLENGTH_MASK) >> BURSTLENGTH_SHIFT);
-	if ((mc_arb_ramcfg & BURSTLENGTH_MASK) >> BURSTLENGTH_SHIFT)
-		rdev->config.rv770.tiling_group_size = 512;
-	else
-		rdev->config.rv770.tiling_group_size = 256;
+
+	gb_tiling_config |= GROUP_SIZE(0);
+	rdev->config.rv770.tiling_group_size = 256;
+
 	if (((mc_arb_ramcfg & NOOFROWS_MASK) >> NOOFROWS_SHIFT) > 3) {
 		gb_tiling_config |= ROW_TILING(3);
 		gb_tiling_config |= SAMPLE_SPLIT(3);

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

* [PATCH] [139/139] Subject: Release 2.6.35.11
  2011-02-02  0:43 [PATCH] [0/139] 2.6.35.11 longterm review Andi Kleen
                   ` (137 preceding siblings ...)
  2011-02-02  0:45 ` [PATCH] [138/139] Revert drm/radeon/kms: properly compute group_size on 6xx/7xx Andi Kleen
@ 2011-02-02  0:45 ` Andi Kleen
  2011-02-04 17:38 ` [PATCH] [0/139] 2.6.35.11 longterm review Frederic Weisbecker
  139 siblings, 0 replies; 149+ messages in thread
From: Andi Kleen @ 2011-02-02  0:45 UTC (permalink / raw)
  To: andi, linux-kernel, stable

2.6.35-longterm review patch.  If anyone has any objections, please let me know.

------------------
From: Andi Kleen <andi@firstfloor.org>

Release 2.6.35.11

Index: linux-2.6.35.y/Makefile
===================================================================
--- linux-2.6.35.y.orig/Makefile
+++ linux-2.6.35.y/Makefile
@@ -1,7 +1,7 @@
 VERSION = 2
 PATCHLEVEL = 6
 SUBLEVEL = 35
-EXTRAVERSION = .10
+EXTRAVERSION = .11
 NAME = Yokohama
 
 # *DOCUMENTATION*

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

* Re: [PATCH] [128/139] mac80211: fix mesh forwarding
  2011-02-02  0:45 ` [PATCH] [128/139] mac80211: fix mesh forwarding Andi Kleen
@ 2011-02-02  7:56   ` Johannes Berg
  2011-02-03  0:06     ` Andi Kleen
  0 siblings, 1 reply; 149+ messages in thread
From: Johannes Berg @ 2011-02-02  7:56 UTC (permalink / raw)
  To: Andi Kleen; +Cc: javier, linville, gregkh, ak, linux-kernel, stable

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset="utf-8", Size: 1032 bytes --]

On Wed, 2011-02-02 at 00:45 +0000, Andi Kleen wrote:

> -			if (!fwd_skb && net_ratelimit())
> +			if (!fwd_skb && net_ratelimit()) {
>  				printk(KERN_DEBUG "%s: failed to clone mesh frame\n",
>  						   sdata->name);
> +				goto out;
> +			}

The net_ratelimit() here cause an obvious bug that I missed and a patch
for that was submitted later -- you may want to pick that one up and/or
fold it in (commit 919bbad580445801c22ef6ccbe624551fee652bd).

johannes

--------------------------------------------------------------------------------------
Intel GmbH
Dornacher Strasse 1
85622 Feldkirchen/Muenchen, Deutschland 
Sitz der Gesellschaft: Feldkirchen bei Muenchen
Geschaeftsfuehrer: Douglas Lusk, Peter Gleissner, Hannes Schwaderer
Registergericht: Muenchen HRB 47456 
Ust.-IdNr./VAT Registration No.: DE129385895
Citibank Frankfurt a.M. (BLZ 502 109 00) 600119052
ÿôèº{.nÇ+‰·Ÿ®‰­†+%ŠËÿ±éݶ\x17¥Šwÿº{.nÇ+‰·¥Š{±þG«éÿŠ{ayº\x1dʇڙë,j\a­¢f£¢·hšïêÿ‘êçz_è®\x03(­éšŽŠÝ¢j"ú\x1a¶^[m§ÿÿ¾\a«þG«éÿ¢¸?™¨è­Ú&£ø§~á¶iO•æ¬z·švØ^\x14\x04\x1a¶^[m§ÿÿÃ\fÿ¶ìÿ¢¸?–I¥

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

* Re: [PATCH] [34/139] mac80211: Fix BUG in pskb_expand_head when transmitting shared skbs
  2011-02-02  0:43 ` [PATCH] [34/139] mac80211: Fix BUG in pskb_expand_head when transmitting shared skbs Andi Kleen
@ 2011-02-02 10:53   ` Helmut Schaa
  2011-02-03  0:25     ` Andi Kleen
  0 siblings, 1 reply; 149+ messages in thread
From: Helmut Schaa @ 2011-02-02 10:53 UTC (permalink / raw)
  To: Andi Kleen; +Cc: johannes, linville, gregkh, ak, linux-kernel, stable

On Wed, Feb 2, 2011 at 1:43 AM, Andi Kleen <andi@firstfloor.org> wrote:
> 2.6.35-longterm review patch.  If anyone has any objections, please let me know.

There has been a followup patch to this one [1]. That should be
considered as well.

Thanks,
Helmut

[1] http://www.spinics.net/lists/linux-wireless/msg61531.html

> ------------------
> From: Helmut Schaa <helmut.schaa@googlemail.com>
>
> commit 7e2447075690860e2cea96b119fc9cadbaa7e83c upstream.
>
> mac80211 doesn't handle shared skbs correctly at the moment. As a result
> a possible resize can trigger a BUG in pskb_expand_head.
>
> [  676.030000] Kernel bug detected[#1]:
> [  676.030000] Cpu 0
> [  676.030000] $ 0   : 00000000 00000000 819662ff 00000002
> [  676.030000] $ 4   : 81966200 00000020 00000000 00000020
> [  676.030000] $ 8   : 819662e0 800043c0 00000002 00020000
> [  676.030000] $12   : 3b9aca00 00000000 00000000 00470000
> [  676.030000] $16   : 80ea2000 00000000 00000000 00000000
> [  676.030000] $20   : 818aa200 80ea2018 80ea2000 00000008
> [  676.030000] $24   : 00000002 800ace5c
> [  676.030000] $28   : 8199a000 8199bd20 81938f88 80f180d4
> [  676.030000] Hi    : 0000026e
> [  676.030000] Lo    : 0000757e
> [  676.030000] epc   : 801245e4 pskb_expand_head+0x44/0x1d8
> [  676.030000]     Not tainted
> [  676.030000] ra    : 80f180d4 ieee80211_skb_resize+0xb0/0x114 [mac80211]
> [  676.030000] Status: 1000a403    KERNEL EXL IE
> [  676.030000] Cause : 10800024
> [  676.030000] PrId  : 0001964c (MIPS 24Kc)
> [  676.030000] Modules linked in: mac80211_hwsim rt2800lib rt2x00soc rt2x00pci rt2x00lib mac80211 crc_itu_t crc_ccitt cfg80211 compat arc4 aes_generic deflate ecb cbc [last unloaded: rt2800pci]
> [  676.030000] Process kpktgend_0 (pid: 97, threadinfo=8199a000, task=81879f48, tls=00000000)
> [  676.030000] Stack : ffffffff 00000000 00000000 00000014 00000004 80ea2000 00000000 00000000
> [  676.030000]         818aa200 80f180d4 ffffffff 0000000a 81879f78 81879f48 81879f48 00000018
> [  676.030000]         81966246 80ea2000 818432e0 80f1a420 80203050 81814d98 00000001 81879f48
> [  676.030000]         81879f48 00000018 81966246 818432e0 0000001a 8199bdd4 0000001c 80f1b72c
> [  676.030000]         80203020 8001292c 80ef4aa2 7f10b55d 801ab5b8 81879f48 00000188 80005c90
> [  676.030000]         ...
> [  676.030000] Call Trace:
> [  676.030000] [<801245e4>] pskb_expand_head+0x44/0x1d8
> [  676.030000] [<80f180d4>] ieee80211_skb_resize+0xb0/0x114 [mac80211]
> [  676.030000] [<80f1a420>] ieee80211_xmit+0x150/0x22c [mac80211]
> [  676.030000] [<80f1b72c>] ieee80211_subif_start_xmit+0x6f4/0x73c [mac80211]
> [  676.030000] [<8014361c>] pktgen_thread_worker+0xfac/0x16f8
> [  676.030000] [<8002ebe8>] kthread+0x7c/0x88
> [  676.030000] [<80008e0c>] kernel_thread_helper+0x10/0x18
> [  676.030000]
> [  676.030000]
> [  676.030000] Code: 24020001  10620005  2502001f <0200000d> 0804917a  00000000  2502001f  00441023  00531021
>
> Fix this by making a local copy of shared skbs prior to mangeling them.
> To avoid copying the skb unnecessarily move the skb_copy call below the
> checks that don't need write access to the skb.
>
> Also, move the assignment of nh_pos and h_pos below the skb_copy to point
> to the correct skb.
>
> It would be possible to avoid another resize of the copied skb by using
> skb_copy_expand instead of skb_copy but that would make the patch more
> complex. Also, shared skbs are a corner case right now, so the resize
> shouldn't matter much.
>
> Cc: Johannes Berg <johannes@sipsolutions.net>
> Signed-off-by: Helmut Schaa <helmut.schaa@googlemail.com>
> Signed-off-by: John W. Linville <linville@tuxdriver.com>
> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
> Signed-off-by: Andi Kleen <ak@linux.intel.com>
>
> ---
>  net/mac80211/tx.c |   21 ++++++++++++++++++---
>  1 file changed, 18 insertions(+), 3 deletions(-)
>
> Index: linux-2.6.35.y/net/mac80211/tx.c
> ===================================================================
> --- linux-2.6.35.y.orig/net/mac80211/tx.c
> +++ linux-2.6.35.y/net/mac80211/tx.c
> @@ -1679,15 +1679,13 @@ netdev_tx_t ieee80211_subif_start_xmit(s
>        int nh_pos, h_pos;
>        struct sta_info *sta = NULL;
>        u32 sta_flags = 0;
> +       struct sk_buff *tmp_skb;
>
>        if (unlikely(skb->len < ETH_HLEN)) {
>                ret = NETDEV_TX_OK;
>                goto fail;
>        }
>
> -       nh_pos = skb_network_header(skb) - skb->data;
> -       h_pos = skb_transport_header(skb) - skb->data;
> -
>        /* convert Ethernet header to proper 802.11 header (based on
>         * operation mode) */
>        ethertype = (skb->data[12] << 8) | skb->data[13];
> @@ -1859,6 +1857,20 @@ netdev_tx_t ieee80211_subif_start_xmit(s
>                goto fail;
>        }
>
> +       /*
> +        * If the skb is shared we need to obtain our own copy.
> +        */
> +       if (skb_shared(skb)) {
> +               tmp_skb = skb;
> +               skb = skb_copy(skb, GFP_ATOMIC);
> +               kfree_skb(tmp_skb);
> +
> +               if (!skb) {
> +                       ret = NETDEV_TX_OK;
> +                       goto fail;
> +               }
> +       }
> +
>        hdr.frame_control = fc;
>        hdr.duration_id = 0;
>        hdr.seq_ctrl = 0;
> @@ -1877,6 +1889,9 @@ netdev_tx_t ieee80211_subif_start_xmit(s
>                encaps_len = 0;
>        }
>
> +       nh_pos = skb_network_header(skb) - skb->data;
> +       h_pos = skb_transport_header(skb) - skb->data;
> +
>        skb_pull(skb, skip_header_bytes);
>        nh_pos -= skip_header_bytes;
>        h_pos -= skip_header_bytes;
>

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

* Re: [PATCH] [128/139] mac80211: fix mesh forwarding
  2011-02-02  7:56   ` Johannes Berg
@ 2011-02-03  0:06     ` Andi Kleen
  0 siblings, 0 replies; 149+ messages in thread
From: Andi Kleen @ 2011-02-03  0:06 UTC (permalink / raw)
  To: Johannes Berg
  Cc: Andi Kleen, javier, linville, gregkh, ak, linux-kernel, stable

On Wed, Feb 02, 2011 at 08:56:14AM +0100, Johannes Berg wrote:
> On Wed, 2011-02-02 at 00:45 +0000, Andi Kleen wrote:
> 
> > -			if (!fwd_skb && net_ratelimit())
> > +			if (!fwd_skb && net_ratelimit()) {
> >  				printk(KERN_DEBUG "%s: failed to clone mesh frame\n",
> >  						   sdata->name);
> > +				goto out;
> > +			}
> 
> The net_ratelimit() here cause an obvious bug that I missed and a patch
> for that was submitted later -- you may want to pick that one up and/or
> fold it in (commit 919bbad580445801c22ef6ccbe624551fee652bd).

Added thanks.
-Andi

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

* Re: [PATCH] [34/139] mac80211: Fix BUG in pskb_expand_head when transmitting shared skbs
  2011-02-02 10:53   ` Helmut Schaa
@ 2011-02-03  0:25     ` Andi Kleen
  0 siblings, 0 replies; 149+ messages in thread
From: Andi Kleen @ 2011-02-03  0:25 UTC (permalink / raw)
  To: Helmut Schaa
  Cc: Andi Kleen, johannes, linville, gregkh, ak, linux-kernel, stable

On Wed, Feb 02, 2011 at 11:53:44AM +0100, Helmut Schaa wrote:
> On Wed, Feb 2, 2011 at 1:43 AM, Andi Kleen <andi@firstfloor.org> wrote:
> > 2.6.35-longterm review patch.  If anyone has any objections, please let me know.
> 
> There has been a followup patch to this one [1]. That should be
> considered as well.

Added thanks.
-Andi

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

* Re: [PATCH] [0/139] 2.6.35.11 longterm review
  2011-02-02  0:43 [PATCH] [0/139] 2.6.35.11 longterm review Andi Kleen
                   ` (138 preceding siblings ...)
  2011-02-02  0:45 ` [PATCH] [139/139] Subject: Release 2.6.35.11 Andi Kleen
@ 2011-02-04 17:38 ` Frederic Weisbecker
  2011-02-05 23:55   ` Andi Kleen
  139 siblings, 1 reply; 149+ messages in thread
From: Frederic Weisbecker @ 2011-02-04 17:38 UTC (permalink / raw)
  To: Andi Kleen; +Cc: linux-kernel, stable

Hi Andi,

On Tue, Feb 01, 2011 at 04:43:13PM -0800, Andi Kleen wrote:
> 
> This is the start of the longterm review cycle for the 2.6.35.10 release.
> There are a large number of 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 me 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.
> 
> The full quilt queue can be found at
> git://git.kernel.org/pub/scm/linux/kernel/git/longterm/longterm-queue-2.6.35
> 
> Responses should be made within 48 hours.

Oops, it might be too late then.

But just in case it's not, could you please also include this:

https://patchwork.kernel.org/patch/469201/

Thanks!

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

* Re: [PATCH] [0/139] 2.6.35.11 longterm review
  2011-02-04 17:38 ` [PATCH] [0/139] 2.6.35.11 longterm review Frederic Weisbecker
@ 2011-02-05 23:55   ` Andi Kleen
  2011-02-06  0:45     ` Frederic Weisbecker
  2011-02-06 18:02     ` Chuck Ebbert
  0 siblings, 2 replies; 149+ messages in thread
From: Andi Kleen @ 2011-02-05 23:55 UTC (permalink / raw)
  To: Frederic Weisbecker; +Cc: Andi Kleen, linux-kernel, stable


>
> Oops, it might be too late then.
>
> But just in case it's not, could you please also include this:
>
> https://patchwork.kernel.org/patch/469201/

Sorry was too late, but I'll queue it for 2.6.35.12.

Thanks,
-Andi


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

* Re: [PATCH] [0/139] 2.6.35.11 longterm review
  2011-02-05 23:55   ` Andi Kleen
@ 2011-02-06  0:45     ` Frederic Weisbecker
  2011-02-06 18:02     ` Chuck Ebbert
  1 sibling, 0 replies; 149+ messages in thread
From: Frederic Weisbecker @ 2011-02-06  0:45 UTC (permalink / raw)
  To: Andi Kleen; +Cc: linux-kernel, stable

On Sun, Feb 06, 2011 at 12:55:49AM +0100, Andi Kleen wrote:
> 
> >
> > Oops, it might be too late then.
> >
> > But just in case it's not, could you please also include this:
> >
> > https://patchwork.kernel.org/patch/469201/
> 
> Sorry was too late, but I'll queue it for 2.6.35.12.

Ok, thanks.

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

* Re: [PATCH] [0/139] 2.6.35.11 longterm review
  2011-02-05 23:55   ` Andi Kleen
  2011-02-06  0:45     ` Frederic Weisbecker
@ 2011-02-06 18:02     ` Chuck Ebbert
  2011-02-06 20:39       ` Andi Kleen
  1 sibling, 1 reply; 149+ messages in thread
From: Chuck Ebbert @ 2011-02-06 18:02 UTC (permalink / raw)
  To: Andi Kleen; +Cc: Frederic Weisbecker, Andi Kleen, linux-kernel, stable

On Sun, 6 Feb 2011 00:55:49 +0100
"Andi Kleen" <andi@firstfloor.org> wrote:

> 
> >
> > Oops, it might be too late then.
> >
> > But just in case it's not, could you please also include this:
> >
> > https://patchwork.kernel.org/patch/469201/
> 
> Sorry was too late, but I'll queue it for 2.6.35.12.
> 

When will 2.6.35.11 be released? I've been monitoring longterm/2.6.35/
but there's still no patch.

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

* Re: [PATCH] [0/139] 2.6.35.11 longterm review
  2011-02-06 18:02     ` Chuck Ebbert
@ 2011-02-06 20:39       ` Andi Kleen
  0 siblings, 0 replies; 149+ messages in thread
From: Andi Kleen @ 2011-02-06 20:39 UTC (permalink / raw)
  To: Chuck Ebbert; +Cc: Andi Kleen, Frederic Weisbecker, linux-kernel, stable


>
> When will 2.6.35.11 be released? I've been monitoring longterm/2.6.35/
> but there's still no patch.

It's out now. Thanks for your patience.

-Andi



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

end of thread, other threads:[~2011-02-06 20:39 UTC | newest]

Thread overview: 149+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-02-02  0:43 [PATCH] [0/139] 2.6.35.11 longterm review Andi Kleen
2011-02-02  0:43 ` [PATCH] [1/139] x86, hotplug: Use mwait to offline a processor, fix the legacy case Andi Kleen
2011-02-02  0:43 ` [PATCH] [2/139] fuse: verify ioctl retries Andi Kleen
2011-02-02  0:43 ` [PATCH] [3/139] fuse: fix ioctl when server is 32bit Andi Kleen
2011-02-02  0:43 ` [PATCH] [4/139] ALSA: HDA: Quirk for Dell Vostro 320 to make microphone work Andi Kleen
2011-02-02  0:43 ` [PATCH] [5/139] ALSA: hda: Use position_fix=1 for Acer Aspire 5538 to enable capture on internal mic Andi Kleen
2011-02-02  0:43 ` [PATCH] [6/139] ALSA: hda: Use model=lg quirk for LG P1 Express to enable playback and capture Andi Kleen
2011-02-02  0:43 ` [PATCH] [7/139] drm/radeon/kms: don't apply 7xx HDP flush workaround on AGP Andi Kleen
2011-02-02  0:43 ` [PATCH] [8/139] drm/kms: remove spaces from connector names (v2) Andi Kleen
2011-02-02  0:43 ` [PATCH] [9/139] drm/radeon/kms: fix vram base calculation on rs780/rs880 Andi Kleen
2011-02-02  0:43 ` [PATCH] [10/139] nohz: Fix printk_needs_cpu() return value on offline cpus Andi Kleen
2011-02-02  0:43 ` [PATCH] [11/139] nohz: Fix get_next_timer_interrupt() vs cpu hotplug Andi Kleen
2011-02-02  0:43 ` [PATCH] [12/139] NFS: Fix panic after nfs_umount() Andi Kleen
2011-02-02  0:43 ` [PATCH] [13/139] nfsd: Fix possible BUG_ON firing in set_change_info Andi Kleen
2011-02-02  0:43 ` [PATCH] [14/139] NFS: Fix fcntl F_GETLK not reporting some conflicts Andi Kleen
2011-02-02  0:43 ` [PATCH] [15/139] sunrpc: prevent use-after-free on clearing XPT_BUSY Andi Kleen
2011-02-02  0:43 ` [PATCH] [16/139] hwmon: (adm1026) Allow 1 as a valid divider value Andi Kleen
2011-02-02  0:43 ` [PATCH] [17/139] hwmon: (adm1026) Fix setting fan_div Andi Kleen
2011-02-02  0:43 ` [PATCH] [18/139] EDAC: Fix workqueue-related crashes Andi Kleen
2011-02-02  0:43 ` [PATCH] [19/139] amd64_edac: Fix interleaving check Andi Kleen
2011-02-02  0:43 ` [PATCH] [20/139] ASoC: Fix swap of left and right channels for WM8993/4 speaker boost gain Andi Kleen
2011-02-02  0:43 ` [PATCH] [21/139] ASoC: Fix off by one error in WM8994 EQ register bank size Andi Kleen
2011-02-02  0:43 ` [PATCH] [22/139] ASoC: WM8580: Fix R8 initial value Andi Kleen
2011-02-02  0:43 ` [PATCH] [23/139] ASoC: fix deemphasis control in wm8904/55/60 codecs Andi Kleen
2011-02-02  0:43 ` [PATCH] [24/139] bootmem: Add alloc_bootmem_align() Andi Kleen
2011-02-02  0:43 ` [PATCH] [25/139] x86, xsave: Use alloc_bootmem_align() instead of alloc_bootmem() Andi Kleen
2011-02-02  0:43 ` [PATCH] [26/139] IB/uverbs: Handle large number of entries in poll CQ Andi Kleen
2011-02-02  0:43 ` [PATCH] [27/139] PM / Hibernate: Fix PM_POST_* notification with user-space suspend Andi Kleen
2011-02-02  0:43 ` [PATCH] [28/139] ARM: 6535/1: V6 MPCore v6_dma_inv_range and v6_dma_flush_range RWFO fix Andi Kleen
2011-02-02  0:43 ` [PATCH] [29/139] qla2xxx: Correct issue where NPIV-config data was not being allocated for 82xx parts Andi Kleen
2011-02-02  0:43 ` [PATCH] [30/139] qla2xxx: Populate Command Type 6 LUN field properly Andi Kleen
2011-02-02  0:43 ` [PATCH] [31/139] llc: fix a device refcount imbalance Andi Kleen
2011-02-02  0:43 ` [PATCH] [32/139] ath9k: Disable SWBA interrupt on remove_interface Andi Kleen
2011-02-02  0:43 ` [PATCH] [33/139] ath9k: fix bug in tx power Andi Kleen
2011-02-02  0:43 ` [PATCH] [34/139] mac80211: Fix BUG in pskb_expand_head when transmitting shared skbs Andi Kleen
2011-02-02 10:53   ` Helmut Schaa
2011-02-03  0:25     ` Andi Kleen
2011-02-02  0:43 ` [PATCH] [35/139] SPARC/LEON: removed constant timer initialization as if HZ=100, now it reflects the value of HZ Andi Kleen
2011-02-02  0:43 ` [PATCH] [36/139] sparc64: Delete prom_puts() unused Andi Kleen
2011-02-02  0:43 ` [PATCH] [37/139] sparc: Remove prom_pathtoinode() Andi Kleen
2011-02-02  0:43 ` [PATCH] [38/139] sparc: Kill prom devops_{32,64}.c Andi Kleen
2011-02-02  0:43 ` [PATCH] [39/139] sparc64: Unexport prom_service_exists() Andi Kleen
2011-02-02  0:43 ` [PATCH] [40/139] sparc64: Delete prom_setcallback() Andi Kleen
2011-02-02  0:43 ` [PATCH] [41/139] sparc: Do not export prom_nb{get,put}char() Andi Kleen
2011-02-02  0:43 ` [PATCH] [42/139] sparc: Pass buffer pointer all the way down to prom_{get,put}char() Andi Kleen
2011-02-02  0:43 ` [PATCH] [43/139] sparc: Delete prom_*getchar() Andi Kleen
2011-02-02  0:43 ` [PATCH] [44/139] sparc: Write to prom console using indirect buffer Andi Kleen
2011-02-02  0:44 ` [PATCH] [45/139] tcp: Don't change unlocked socket state in tcp_v4_err() Andi Kleen
2011-02-02  0:44 ` [PATCH] [46/139] tcp: Increase TCP_MAXSEG socket option minimum Andi Kleen
2011-02-02  0:44 ` [PATCH] [47/139] tcp: Make TCP_MAXSEG minimum more correct Andi Kleen
2011-02-02  0:44 ` [PATCH] [48/139] tcp: Bug fix in initialization of receive window Andi Kleen
2011-02-02  0:44 ` [PATCH] [49/139] tcp: avoid a possible divide by zero Andi Kleen
2011-02-02  0:44 ` [PATCH] [50/139] tcp: protect sysctl_tcp_cookie_size reads Andi Kleen
2011-02-02  0:44 ` [PATCH] [51/139] 8139cp: fix checksum broken Andi Kleen
2011-02-02  0:44 ` [PATCH] [52/139] r8169: fix sleeping while holding spinlock Andi Kleen
2011-02-02  0:44 ` [PATCH] [53/139] af_unix: limit unix_tot_inflight Andi Kleen
2011-02-02  0:44 ` [PATCH] [54/139] scm: Capture the full credentials of the scm sender Andi Kleen
2011-02-02  0:44 ` [PATCH] [55/139] af_unix: Allow credentials to work across user and pid namespaces Andi Kleen
2011-02-02  0:44 ` [PATCH] [56/139] user_ns: Introduce user_nsmap_uid and user_ns_map_gid Andi Kleen
2011-02-02  0:44 ` [PATCH] [57/139] sock: Introduce cred_to_ucred Andi Kleen
2011-02-02  0:44 ` [PATCH] [58/139] net: Export cred_to_ucred to modules Andi Kleen
2011-02-02  0:44 ` [PATCH] [59/139] af_unix: limit recursion level Andi Kleen
2011-02-02  0:44 ` [PATCH] [60/139] net: ax25: fix information leak to userland Andi Kleen
2011-02-02  0:44 ` [PATCH] [61/139] driver/net/benet: fix be_cmd_multicast_set() memcpy bug Andi Kleen
2011-02-02  0:44 ` [PATCH] [62/139] bonding: Fix slave selection bug Andi Kleen
2011-02-02  0:44 ` [PATCH] [63/139] bridge: fix IPv6 queries for bridge multicast snooping Andi Kleen
2011-02-02  0:44 ` [PATCH] [64/139] cls_cgroup: Fix crash on module unload Andi Kleen
2011-02-02  0:44 ` [PATCH] [65/139] filter: fix sk_filter rcu handling Andi Kleen
2011-02-02  0:44 ` [PATCH] [66/139] econet: Do the correct cleanup after an unprivileged SIOCSIFADDR Andi Kleen
2011-02-02  0:44 ` [PATCH] [67/139] econet: Fix crash in aun_incoming() Andi Kleen
2011-02-02  0:44 ` [PATCH] [68/139] ifb: goto resched directly if error happens and dp->tq isn't empty Andi Kleen
2011-02-02  0:44 ` [PATCH] [69/139] l2tp: Fix modalias of l2tp_ip Andi Kleen
2011-02-02  0:44 ` [PATCH] [70/139] x25: decrement netdev reference counts on unload Andi Kleen
2011-02-02  0:44 ` [PATCH] [71/139] tehuti: Firmware filename is tehuti/bdx.bin Andi Kleen
2011-02-02  0:44 ` [PATCH] [72/139] net/dst: dst_dev_event() called after other notifiers Andi Kleen
2011-02-02  0:44 ` [PATCH] [73/139] net: Fix header size check for GSO case in recvmsg (af_packet) Andi Kleen
2011-02-02  0:44 ` [PATCH] [74/139] net: packet: fix information leak to userland Andi Kleen
2011-02-02  0:44 ` [PATCH] [75/139] ACPICA: Fix Scope() op in module level code Andi Kleen
2011-02-02  0:44 ` [PATCH] [76/139] nouveau: Acknowledge HPD irq in handler, not bottom half Andi Kleen
2011-02-02  0:44 ` [PATCH] [77/139] printk: Fix wake_up_klogd() vs cpu hotplug Andi Kleen
2011-02-02  0:44 ` [PATCH] [78/139] xen: Provide a variant of __RING_SIZE() that is an integer constant expression Andi Kleen
2011-02-02  0:44 ` [PATCH] [79/139] sched: Cure more NO_HZ load average woes Andi Kleen
2011-02-02  0:44 ` [PATCH] [80/139] ACPI: EC: Add another dmi match entry for MSI hardware Andi Kleen
2011-02-02  0:44 ` [PATCH] [81/139] PM / Runtime: Fix pm_runtime_suspended() Andi Kleen
2011-02-02  0:44 ` [PATCH] [82/139] inotify: stop kernel memory leak on file creation failure Andi Kleen
2011-02-02  0:44 ` [PATCH] [83/139] orinoco: fix TKIP countermeasure behaviour Andi Kleen
2011-02-02  0:44 ` [PATCH] [84/139] orinoco: clear countermeasure setting on commit Andi Kleen
2011-02-02  0:44 ` [PATCH] [85/139] x86, amd: Fix panic on AMD CPU family 0x15 Andi Kleen
2011-02-02  0:44 ` [PATCH] [86/139] md: fix bug with re-adding of partially recovered device Andi Kleen
2011-02-02  0:44 ` [PATCH] [87/139] md: protect against NULL reference when waiting to start a raid10 Andi Kleen
2011-02-02  0:44 ` [PATCH] [88/139] tracing: Fix panic when lseek() called on "trace" opened for writing Andi Kleen
2011-02-02  0:44 ` [PATCH] [89/139] x86, gcc-4.6: Use gcc -m options when building vdso Andi Kleen
2011-02-02  0:44 ` [PATCH] [90/139] x86: Enable the intr-remap fault handling after local APIC setup Andi Kleen
2011-02-02  0:44 ` [PATCH] [91/139] x86, vt-d: Handle previous faults after enabling fault handling Andi Kleen
2011-02-02  0:44 ` [PATCH] [92/139] x86, vt-d: Fix the vt-d fault handling irq migration in the x2apic mode Andi Kleen
2011-02-02  0:44 ` [PATCH] [93/139] x86, vt-d: Quirk for masking vtd spec errors to platform error handling logic Andi Kleen
2011-02-02  0:44 ` [PATCH] [94/139] rt2x00: Fix max TX power settings Andi Kleen
2011-02-02  0:44 ` [PATCH] [95/139] ALSA: hda - Enable jack sense for Thinkpad Edge 11 Andi Kleen
2011-02-02  0:44 ` [PATCH] [96/139] Input: synaptics - fix handling of 2-button ClickPads Andi Kleen
2011-02-02  0:44 ` [PATCH] [97/139] install_special_mapping skips security_file_mmap check Andi Kleen
2011-02-02  0:44 ` [PATCH] [98/139] USB: misc: uss720.c: add another vendor/product ID Andi Kleen
2011-02-02  0:44 ` [PATCH] [99/139] USB: ftdi_sio: Add D.O.Tec PID Andi Kleen
2011-02-02  0:44 ` [PATCH] [100/139] USB: usb-storage: unusual_devs entry for the Samsung YP-CP3 Andi Kleen
2011-02-02  0:44 ` [PATCH] [101/139] Revert "USB: gadget: Allow function access to device ID data during bind()" Andi Kleen
2011-02-02  0:45 ` [PATCH] [102/139] p54usb: add 5 more USBIDs Andi Kleen
2011-02-02  0:45 ` [PATCH] [103/139] p54usb: New USB ID for Gemtek WUBI-100GW Andi Kleen
2011-02-02  0:45 ` [PATCH] [104/139] n_gsm: Fix message length handling when building header Andi Kleen
2011-02-02  0:45 ` [PATCH] [105/139] n_gsm: gsm_data_alloc buffer allocation could fail and it is not being checked Andi Kleen
2011-02-02  0:45 ` [PATCH] [106/139] xhci: Fix issue with port array setup and buggy hosts Andi Kleen
2011-02-02  0:45 ` [PATCH] [107/139] gpio: Fix null pointer dereference while accessing rdc321x platform_data Andi Kleen
2011-02-02  0:45 ` [PATCH] [108/139] cs5535-gpio: don't apply errata #36 to edge detect GPIOs Andi Kleen
2011-02-02  0:45 ` [PATCH] [109/139] cs5535-gpio: handle GPIO regs where higher (clear) bits are set Andi Kleen
2011-02-02  0:45 ` [PATCH] [110/139] mmc: at91_mci: fix multiblock SDIO transfers Andi Kleen
2011-02-02  0:45 ` [PATCH] [111/139] mmc: atmel-mci: " Andi Kleen
2011-02-02  0:45 ` [PATCH] [112/139] mmc: Fix re-probing with PM_POST_RESTORE notification Andi Kleen
2011-02-02  0:45 ` [PATCH] [113/139] fix freeing user_struct in user cache Andi Kleen
2011-02-02  0:45 ` [PATCH] [114/139] rtc: rs5c372: fix buffer size Andi Kleen
2011-02-02  0:45 ` [PATCH] [115/139] RAMOOPS: Don't overflow over non-allocated regions Andi Kleen
2011-02-02  0:45 ` [PATCH] [116/139] watchdog: Fix null pointer dereference while accessing rdc321x platform_data Andi Kleen
2011-02-02  0:45 ` [PATCH] [117/139] arch/x86/oprofile/op_model_amd.c: Perform initialisation on a single CPU Andi Kleen
2011-02-02  0:45 ` [PATCH] [118/139] mfd: Support additional parent IDs for wm831x Andi Kleen
2011-02-02  0:45 ` [PATCH] [119/139] mfd: Supply IRQ base for WM832x devices Andi Kleen
2011-02-02  0:45 ` [PATCH] [120/139] drm/radeon/kms/evergreen: reset the grbm blocks at resume and init Andi Kleen
2011-02-02  0:45 ` [PATCH] [121/139] drm/radeon/kms: fix evergreen asic reset Andi Kleen
2011-02-02  0:45 ` [PATCH] [122/139] drm/radeon/kms: reorder display resume to avoid problems Andi Kleen
2011-02-02  0:45 ` [PATCH] [123/139] drm/i915/dp: Fix I2C/EDID handling with active DisplayPort to DVI converter Andi Kleen
2011-02-02  0:45 ` [PATCH] [124/139] sound: Prevent buffer overflow in OSS load_mixer_volumes Andi Kleen
2011-02-02  0:45 ` [PATCH] [125/139] mv_xor: fix race in tasklet function Andi Kleen
2011-02-02  0:45 ` [PATCH] [126/139] ima: fix add LSM rule bug Andi Kleen
2011-02-02  0:45 ` [PATCH] [127/139] libata-sff: fix HSM_ST_ERR handling in __ata_sff_port_intr() Andi Kleen
2011-02-02  0:45 ` [PATCH] [128/139] mac80211: fix mesh forwarding Andi Kleen
2011-02-02  7:56   ` Johannes Berg
2011-02-03  0:06     ` Andi Kleen
2011-02-02  0:45 ` [PATCH] [129/139] ALSA: hda: Use LPIB quirk for Dell Inspiron m101z/1120 Andi Kleen
2011-02-02  0:45 ` [PATCH] [130/139] Sched: fix skip_clock_update optimization Andi Kleen
2011-02-02  0:45 ` [PATCH] [131/139] block: Deprecate QUEUE_FLAG_CLUSTER and use queue_limits instead Andi Kleen
2011-02-02  0:45 ` [PATCH] [132/139] x86/microcode: Fix double vfree() and remove redundant pointer checks before vfree() Andi Kleen
2011-02-02  0:45 ` [PATCH] [133/139] posix-cpu-timers: workaround to suppress the problems with mt exec Andi Kleen
2011-02-02  0:45 ` [PATCH] [134/139] gspca - sonixj: Set the flag for some devices Andi Kleen
2011-02-02  0:45 ` [PATCH] [135/139] gspca - sonixj: Add a flag in the driver_info table Andi Kleen
2011-02-02  0:45 ` [PATCH] [136/139] [PATCH 2.6.35] mac80211: fix hard lockup in Andi Kleen
2011-02-02  0:45 ` [PATCH] [137/139] Input: i8042 - introduce 'notimeout' blacklist for Dell Vostro V13 Andi Kleen
2011-02-02  0:45 ` [PATCH] [138/139] Revert drm/radeon/kms: properly compute group_size on 6xx/7xx Andi Kleen
2011-02-02  0:45 ` [PATCH] [139/139] Subject: Release 2.6.35.11 Andi Kleen
2011-02-04 17:38 ` [PATCH] [0/139] 2.6.35.11 longterm review Frederic Weisbecker
2011-02-05 23:55   ` Andi Kleen
2011-02-06  0:45     ` Frederic Weisbecker
2011-02-06 18:02     ` Chuck Ebbert
2011-02-06 20:39       ` Andi Kleen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).