All of lore.kernel.org
 help / color / mirror / Atom feed
* [ 000/167] 3.2.17-stable review
@ 2012-05-09  5:50 Ben Hutchings
  2012-05-09  5:50 ` [ 001/167] Perf: fix build breakage Ben Hutchings
                   ` (166 more replies)
  0 siblings, 167 replies; 195+ messages in thread
From: Ben Hutchings @ 2012-05-09  5:50 UTC (permalink / raw)
  To: linux-kernel, stable; +Cc: torvalds, akpm, alan

This is the start of the stable review cycle for the 3.2.17 release.
There are 167 patches in this series, which will be posted as responses
to this one.  If anyone has any issues with these being applied, please
let me know.

Responses should be made by Fri May 11 13:00:00 UTC 2012.
Anything received after that time might be too late.

The whole patch series should shortly be available in one patch at:
	kernel.org/pub/linux/kernel/v3.2/stable-review/patch-3.2.17-rc1.gz
and the diffstat can be found below.

Ben.

-------------
 Makefile                                       |    4 +-
 arch/arm/Kconfig                               |    9 +
 arch/arm/include/asm/tls.h                     |    4 +
 arch/arm/kernel/irq.c                          |    6 +-
 arch/arm/kernel/smp.c                          |    4 +-
 arch/arm/kernel/sys_arm.c                      |    2 +-
 arch/arm/mach-omap1/timer.c                    |    4 +-
 arch/arm/mm/abort-ev6.S                        |   17 +-
 arch/arm/mm/cache-l2x0.c                       |   25 ++-
 arch/x86/boot/compressed/relocs.c              |    2 -
 arch/x86/kernel/apic/apic.c                    |   34 +--
 arch/x86/kernel/microcode_core.c               |    4 +-
 arch/x86/kernel/setup_percpu.c                 |   14 +-
 arch/x86/xen/enlighten.c                       |    7 +-
 arch/x86/xen/mmu.c                             |    7 +-
 arch/x86/xen/smp.c                             |   15 ++
 arch/x86/xen/xen-asm.S                         |    2 +-
 crypto/sha512_generic.c                        |    2 +-
 drivers/ata/libata-eh.c                        |    3 +-
 drivers/bluetooth/ath3k.c                      |    2 +
 drivers/bluetooth/btusb.c                      |    1 +
 drivers/dma/at_hdmac.c                         |    4 -
 drivers/firmware/efivars.c                     |  196 +++++++++++++++++
 drivers/gpu/drm/i915/i915_gem_execbuffer.c     |   40 ++--
 drivers/gpu/drm/i915/i915_reg.h                |    2 +
 drivers/gpu/drm/i915/intel_hdmi.c              |    2 +-
 drivers/gpu/drm/i915/intel_ringbuffer.c        |   16 ++
 drivers/gpu/drm/i915/intel_sdvo.c              |   40 ++--
 drivers/gpu/drm/nouveau/nouveau_acpi.c         |    2 +-
 drivers/gpu/drm/radeon/atombios_crtc.c         |    4 +-
 drivers/hwmon/coretemp.c                       |    6 +-
 drivers/hwmon/fam15h_power.c                   |   42 ++++
 drivers/i2c/busses/i2c-pnx.c                   |    3 +-
 drivers/md/md.c                                |    7 +-
 drivers/media/dvb/frontends/drxk_hard.c        |    6 +-
 drivers/media/rc/winbond-cir.c                 |    1 +
 drivers/mmc/card/block.c                       |   54 +++--
 drivers/mmc/card/queue.c                       |    2 +-
 drivers/mmc/core/core.c                        |    9 +-
 drivers/mmc/host/sdhci-esdhc-imx.c             |    3 +-
 drivers/net/bonding/bond_main.c                |    6 +-
 drivers/net/dummy.c                            |    6 +-
 drivers/net/ethernet/atheros/atlx/atl1.c       |   12 +-
 drivers/net/ethernet/atheros/atlx/atl1.h       |    3 +-
 drivers/net/ethernet/atheros/atlx/atlx.c       |    2 +-
 drivers/net/ethernet/micrel/ks8851_mll.c       |    2 +-
 drivers/net/ethernet/micrel/ksz884x.c          |    2 +-
 drivers/net/ethernet/realtek/8139cp.c          |   10 +-
 drivers/net/ethernet/smsc/smsc911x.c           |   14 +-
 drivers/net/ethernet/ti/davinci_mdio.c         |    5 +
 drivers/net/ppp/ppp_generic.c                  |    3 +-
 drivers/net/usb/smsc75xx.c                     |    1 +
 drivers/net/usb/smsc95xx.c                     |    2 +-
 drivers/net/wimax/i2400m/netdev.c              |    3 +-
 drivers/net/wireless/b43/main.c                |   10 +-
 drivers/net/wireless/brcm80211/brcmsmac/main.c |    8 +
 drivers/net/wireless/ipw2x00/ipw2200.c         |   13 +-
 drivers/net/wireless/iwlwifi/iwl-1000.c        |    8 +-
 drivers/net/wireless/iwlwifi/iwl-2000.c        |   16 +-
 drivers/net/wireless/iwlwifi/iwl-5000.c        |   11 +-
 drivers/net/wireless/iwlwifi/iwl-6000.c        |   17 +-
 drivers/net/wireless/iwlwifi/iwl-agn.c         |    3 -
 drivers/net/wireless/iwlwifi/iwl-core.c        |   10 +-
 drivers/net/wireless/iwlwifi/iwl-fh.h          |   24 ++-
 drivers/net/wireless/iwlwifi/iwl-prph.h        |   27 ++-
 drivers/net/wireless/mwifiex/pcie.h            |   18 +-
 drivers/net/wireless/rt2x00/rt2800usb.c        |   28 +--
 drivers/net/wireless/rtlwifi/pci.c             |    1 +
 drivers/net/wireless/wl1251/main.c             |    1 +
 drivers/net/wireless/wl1251/sdio.c             |    2 +-
 drivers/pci/quirks.c                           |   34 +++
 drivers/platform/x86/dell-laptop.c             |   29 +++
 drivers/scsi/libsas/sas_expander.c             |   26 ++-
 drivers/spi/spi.c                              |    2 +-
 drivers/staging/rtl8712/os_intfs.c             |    3 -
 drivers/staging/rtl8712/usb_intf.c             |    5 +
 drivers/tty/amiserial.c                        |    4 +-
 drivers/tty/serial/clps711x.c                  |   14 +-
 drivers/tty/serial/pch_uart.c                  |    4 +-
 drivers/usb/class/cdc-wdm.c                    |    7 +-
 drivers/usb/core/hcd-pci.c                     |    9 +
 drivers/usb/core/hub.c                         |    3 -
 drivers/usb/core/message.c                     |    6 +-
 drivers/usb/dwc3/ep0.c                         |    3 +-
 drivers/usb/gadget/dummy_hcd.c                 |    1 -
 drivers/usb/gadget/f_fs.c                      |    2 +-
 drivers/usb/gadget/f_mass_storage.c            |    2 +-
 drivers/usb/gadget/file_storage.c              |    2 +-
 drivers/usb/gadget/udc-core.c                  |    6 +-
 drivers/usb/gadget/uvc.h                       |    2 +-
 drivers/usb/gadget/uvc_v4l2.c                  |    2 +-
 drivers/usb/host/ehci-hcd.c                    |    9 +-
 drivers/usb/host/ehci-pci.c                    |    8 +
 drivers/usb/misc/yurex.c                       |   10 +-
 drivers/usb/musb/omap2430.c                    |    9 +-
 drivers/usb/serial/cp210x.c                    |    9 +-
 drivers/usb/serial/sierra.c                    |    6 +-
 drivers/uwb/hwa-rc.c                           |    3 +-
 drivers/uwb/neh.c                              |   12 +-
 drivers/xen/gntdev.c                           |    2 +-
 drivers/xen/xenbus/xenbus_probe_frontend.c     |   69 ++++--
 fs/autofs4/autofs_i.h                          |   12 +-
 fs/autofs4/dev-ioctl.c                         |    3 +-
 fs/autofs4/inode.c                             |    4 +-
 fs/autofs4/waitq.c                             |   22 +-
 fs/btrfs/ctree.h                               |    2 +-
 fs/cifs/cifssmb.c                              |    6 +-
 fs/eventpoll.c                                 |    4 +
 fs/exec.c                                      |    3 +
 fs/ext4/extents.c                              |    2 +-
 fs/hfsplus/catalog.c                           |    4 +
 fs/hfsplus/dir.c                               |   11 +
 fs/jbd2/commit.c                               |    4 +-
 fs/lockd/clnt4xdr.c                            |    2 +-
 fs/lockd/clntxdr.c                             |    2 +-
 fs/nfs/nfs4proc.c                              |   23 +-
 fs/nfs/read.c                                  |    2 +-
 fs/nfs/super.c                                 |    8 +-
 fs/nfs/write.c                                 |    2 +-
 fs/nfsd/nfs3xdr.c                              |   22 +-
 fs/nfsd/nfs4proc.c                             |   15 +-
 fs/nfsd/nfs4state.c                            |   23 +-
 fs/nfsd/nfs4xdr.c                              |    2 +-
 fs/nfsd/vfs.c                                  |    2 +-
 fs/ocfs2/alloc.c                               |    2 +-
 fs/ocfs2/refcounttree.c                        |   12 +-
 fs/ocfs2/suballoc.c                            |    4 +-
 fs/pipe.c                                      |   31 ++-
 fs/splice.c                                    |    5 +-
 include/asm-generic/statfs.h                   |    2 +-
 include/linux/efi.h                            |   13 +-
 include/linux/kvm_host.h                       |    6 +
 include/linux/netdevice.h                      |    2 -
 include/linux/pipe_fs_i.h                      |    1 +
 include/linux/seqlock.h                        |    2 +-
 include/linux/skbuff.h                         |   13 ++
 include/linux/socket.h                         |    2 +-
 include/linux/usb/hcd.h                        |    2 +
 kernel/exit.c                                  |   19 --
 kernel/power/swap.c                            |   28 ++-
 kernel/sched.c                                 |   75 ++++---
 kernel/signal.c                                |    9 +
 kernel/trace/trace_output.c                    |    5 +
 mm/swap_state.c                                |    2 +-
 net/ax25/af_ax25.c                             |    9 +-
 net/bridge/br_multicast.c                      |   81 -------
 net/bridge/br_private.h                        |    4 -
 net/core/dev.c                                 |   58 ++---
 net/core/dev_addr_lists.c                      |    3 +-
 net/core/net_namespace.c                       |   33 +--
 net/core/skbuff.c                              |    8 +-
 net/ipv4/tcp.c                                 |   10 +-
 net/ipv4/tcp_input.c                           |    8 +-
 net/ipv4/tcp_output.c                          |   16 +-
 net/ipv6/mcast.c                               |    2 +-
 net/ipv6/tcp_ipv6.c                            |    4 +
 net/mac80211/tx.c                              |    3 +-
 net/netlink/af_netlink.c                       |   24 ++-
 net/phonet/pep.c                               |    3 +
 net/sched/sch_gred.c                           |    7 +-
 net/sctp/socket.c                              |    5 +-
 net/socket.c                                   |    6 +-
 net/wireless/nl80211.c                         |   29 +--
 net/wireless/util.c                            |    2 +-
 scripts/mod/file2alias.c                       |    4 +
 sound/pci/hda/patch_conexant.c                 |   37 +++-
 sound/pci/hda/patch_realtek.c                  |    1 +
 sound/soc/codecs/tlv320aic23.c                 |    4 +-
 sound/soc/codecs/wm8994.c                      |  276 +++++++++++++++++++-----
 sound/soc/soc-dapm.c                           |    2 +
 tools/perf/util/hist.c                         |    4 +-
 virt/kvm/iommu.c                               |   12 +-
 virt/kvm/kvm_main.c                            |    5 +-
 173 files changed, 1551 insertions(+), 702 deletions(-)

-- 
Ben Hutchings
Life is what happens to you while you're busy making other plans.
                                                               - John Lennon


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

* [ 001/167] Perf: fix build breakage
  2012-05-09  5:50 [ 000/167] 3.2.17-stable review Ben Hutchings
@ 2012-05-09  5:50 ` Ben Hutchings
  2012-05-09  5:50   ` Ben Hutchings
                   ` (165 subsequent siblings)
  166 siblings, 0 replies; 195+ messages in thread
From: Ben Hutchings @ 2012-05-09  5:50 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: torvalds, akpm, alan, Zeev Tarantov, David S. Miller,
	Arnaldo Carvalho de Melo, Greg Kroah-Hartman

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

3.2-stable review patch.  If anyone has any objections, please let me know.

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

From: Zeev Tarantov <zeev.tarantov@gmail.com>

[Patch not needed upstream as this is a backport build bugfix - gregkh

gcc correctly complains:

util/hist.c: In function ‘__hists__add_entry’:
util/hist.c:240:27: error: invalid type argument of ‘->’ (have ‘struct hist_entry’)
util/hist.c:241:23: error: invalid type argument of ‘->’ (have ‘struct hist_entry’)

for this new code:

+                       if (he->ms.map != entry->ms.map) {
+                               he->ms.map = entry->ms.map;
+                               if (he->ms.map)
+                                       he->ms.map->referenced = true;
+                       }

because "entry" is a "struct hist_entry", not a pointer to a struct.

In mainline, "entry" is a pointer to struct passed as argument to the function.
So this is broken during backporting. But obviously not compile tested.

Signed-off-by: Zeev Tarantov <zeev.tarantov@gmail.com>
Cc: Signed-off-by: David S. Miller <davem@davemloft.net>
Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
---
 tools/perf/util/hist.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

--- a/tools/perf/util/hist.c
+++ b/tools/perf/util/hist.c
@@ -237,8 +237,8 @@ struct hist_entry *__hists__add_entry(st
 			 * mis-adjust symbol addresses when computing
 			 * the history counter to increment.
 			 */
-			if (he->ms.map != entry->ms.map) {
-				he->ms.map = entry->ms.map;
+			if (he->ms.map != entry.ms.map) {
+				he->ms.map = entry.ms.map;
 				if (he->ms.map)
 					he->ms.map->referenced = true;
 			}



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

* [ 002/167] [PATCH] crypto: sha512 - Fix byte counter overflow in SHA-512
  2012-05-09  5:50 [ 000/167] 3.2.17-stable review Ben Hutchings
@ 2012-05-09  5:50   ` Ben Hutchings
  2012-05-09  5:50   ` Ben Hutchings
                     ` (165 subsequent siblings)
  166 siblings, 0 replies; 195+ messages in thread
From: Ben Hutchings @ 2012-05-09  5:50 UTC (permalink / raw)
  To: linux-kernel, stable; +Cc: torvalds, akpm, alan, Kent Yoder, Herbert Xu

3.2-stable review patch.  If anyone has any objections, please let me know.

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

From: Kent Yoder <key@linux.vnet.ibm.com>

commit 25c3d30c918207556ae1d6e663150ebdf902186b upstream.

The current code only increments the upper 64 bits of the SHA-512 byte
counter when the number of bytes hashed happens to hit 2^64 exactly.

This patch increments the upper 64 bits whenever the lower 64 bits
overflows.

Signed-off-by: Kent Yoder <key@linux.vnet.ibm.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
---
 crypto/sha512_generic.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/crypto/sha512_generic.c b/crypto/sha512_generic.c
index 107f6f7..dd30f40 100644
--- a/crypto/sha512_generic.c
+++ b/crypto/sha512_generic.c
@@ -174,7 +174,7 @@ sha512_update(struct shash_desc *desc, const u8 *data, unsigned int len)
 	index = sctx->count[0] & 0x7f;
 
 	/* Update number of bytes */
-	if (!(sctx->count[0] += len))
+	if ((sctx->count[0] += len) < len)
 		sctx->count[1]++;
 
         part_len = 128 - index;
-- 
1.7.10




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

* [ 002/167] [PATCH] crypto: sha512 - Fix byte counter overflow in SHA-512
@ 2012-05-09  5:50   ` Ben Hutchings
  0 siblings, 0 replies; 195+ messages in thread
From: Ben Hutchings @ 2012-05-09  5:50 UTC (permalink / raw)
  To: linux-kernel, stable; +Cc: torvalds, akpm, alan, Kent Yoder, Herbert Xu

3.2-stable review patch.  If anyone has any objections, please let me know.

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

From: Kent Yoder <key@linux.vnet.ibm.com>

commit 25c3d30c918207556ae1d6e663150ebdf902186b upstream.

The current code only increments the upper 64 bits of the SHA-512 byte
counter when the number of bytes hashed happens to hit 2^64 exactly.

This patch increments the upper 64 bits whenever the lower 64 bits
overflows.

Signed-off-by: Kent Yoder <key@linux.vnet.ibm.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
---
 crypto/sha512_generic.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/crypto/sha512_generic.c b/crypto/sha512_generic.c
index 107f6f7..dd30f40 100644
--- a/crypto/sha512_generic.c
+++ b/crypto/sha512_generic.c
@@ -174,7 +174,7 @@ sha512_update(struct shash_desc *desc, const u8 *data, unsigned int len)
 	index = sctx->count[0] & 0x7f;
 
 	/* Update number of bytes */
-	if (!(sctx->count[0] += len))
+	if ((sctx->count[0] += len) < len)
 		sctx->count[1]++;
 
         part_len = 128 - index;
-- 
1.7.10




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

* [ 003/167] [PATCH] ALSA: hda/conexant - Dont set HP pin-control bit unconditionally
  2012-05-09  5:50 [ 000/167] 3.2.17-stable review Ben Hutchings
  2012-05-09  5:50 ` [ 001/167] Perf: fix build breakage Ben Hutchings
  2012-05-09  5:50   ` Ben Hutchings
@ 2012-05-09  5:50 ` Ben Hutchings
  2012-05-09  5:50 ` [ 004/167] [PATCH] ALSA: hda/conexant - Set up the missing docking-station pins Ben Hutchings
                   ` (163 subsequent siblings)
  166 siblings, 0 replies; 195+ messages in thread
From: Ben Hutchings @ 2012-05-09  5:50 UTC (permalink / raw)
  To: linux-kernel, stable; +Cc: torvalds, akpm, alan, Takashi Iwai

3.2-stable review patch.  If anyone has any objections, please let me know.

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

From: Takashi Iwai <tiwai@suse.de>

commit ca3649de026ff95c6f2847e8d096cf2f411c02b3 upstream.

Some output pins on Conexant chips have no HP control bit, but the
auto-parser initializes these pins unconditionally with PIN_HP.

Check the pin-capability and avoid the HP bit if not supported.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
---
 sound/pci/hda/patch_conexant.c |    9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/sound/pci/hda/patch_conexant.c b/sound/pci/hda/patch_conexant.c
index d29d6d3..f52c9ef 100644
--- a/sound/pci/hda/patch_conexant.c
+++ b/sound/pci/hda/patch_conexant.c
@@ -3951,9 +3951,14 @@ static void cx_auto_init_output(struct hda_codec *codec)
 	int i;
 
 	mute_outputs(codec, spec->multiout.num_dacs, spec->multiout.dac_nids);
-	for (i = 0; i < cfg->hp_outs; i++)
+	for (i = 0; i < cfg->hp_outs; i++) {
+		unsigned int val = PIN_OUT;
+		if (snd_hda_query_pin_caps(codec, cfg->hp_pins[i]) &
+		    AC_PINCAP_HP_DRV)
+			val |= AC_PINCTL_HP_EN;
 		snd_hda_codec_write(codec, cfg->hp_pins[i], 0,
-				    AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_HP);
+				    AC_VERB_SET_PIN_WIDGET_CONTROL, val);
+	}
 	mute_outputs(codec, cfg->hp_outs, cfg->hp_pins);
 	mute_outputs(codec, cfg->line_outs, cfg->line_out_pins);
 	mute_outputs(codec, cfg->speaker_outs, cfg->speaker_pins);
-- 
1.7.10




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

* [ 004/167] [PATCH] ALSA: hda/conexant - Set up the missing docking-station pins
  2012-05-09  5:50 [ 000/167] 3.2.17-stable review Ben Hutchings
                   ` (2 preceding siblings ...)
  2012-05-09  5:50 ` [ 003/167] [PATCH] ALSA: hda/conexant - Dont set HP pin-control bit unconditionally Ben Hutchings
@ 2012-05-09  5:50 ` Ben Hutchings
  2012-05-09  5:50 ` [ 005/167] [PATCH] ARM: clps711x: serial driver hungs are a result of call disable_irq within ISR Ben Hutchings
                   ` (162 subsequent siblings)
  166 siblings, 0 replies; 195+ messages in thread
From: Ben Hutchings @ 2012-05-09  5:50 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: torvalds, akpm, alan, Takashi Iwai, Josh Boyer, Jens Taprogge

3.2-stable review patch.  If anyone has any objections, please let me know.

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

From: Takashi Iwai <tiwai@suse.de>

commit d70f363222ef373c2037412f09a600357cfa1c7a upstream.

ThinkPad 410,420,510,520 and X201 with cx50585 & co chips have the
docking-station ports, but BIOS doesn't initialize for these pins.
Thus, like the former X200, we need to set up the pins manually in the
driver.

The odd part is that the same PCI SSID is used for X200 and T400, thus
we need to prepare individual fixup tables for cx5051 and others.

Bugzilla entries:
	https://bugzilla.redhat.com/show_bug.cgi?id=808559
	https://bugzilla.redhat.com/show_bug.cgi?id=806217
	https://bugzilla.redhat.com/show_bug.cgi?id=810697

Reported-by: Josh Boyer <jwboyer@redhat.com>
Reported-by: Jens Taprogge <jens.taprogge@taprogge.org>
Tested-by: Jens Taprogge <jens.taprogge@taprogge.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
---
 sound/pci/hda/patch_conexant.c |   28 +++++++++++++++++++++++++---
 1 file changed, 25 insertions(+), 3 deletions(-)

diff --git a/sound/pci/hda/patch_conexant.c b/sound/pci/hda/patch_conexant.c
index f52c9ef..58b5de4 100644
--- a/sound/pci/hda/patch_conexant.c
+++ b/sound/pci/hda/patch_conexant.c
@@ -4367,8 +4367,10 @@ static void apply_pin_fixup(struct hda_codec *codec,
 
 enum {
 	CXT_PINCFG_LENOVO_X200,
+	CXT_PINCFG_LENOVO_TP410,
 };
 
+/* ThinkPad X200 & co with cxt5051 */
 static const struct cxt_pincfg cxt_pincfg_lenovo_x200[] = {
 	{ 0x16, 0x042140ff }, /* HP (seq# overridden) */
 	{ 0x17, 0x21a11000 }, /* dock-mic */
@@ -4376,15 +4378,33 @@ static const struct cxt_pincfg cxt_pincfg_lenovo_x200[] = {
 	{}
 };
 
+/* ThinkPad 410/420/510/520, X201 & co with cxt5066 */
+static const struct cxt_pincfg cxt_pincfg_lenovo_tp410[] = {
+	{ 0x19, 0x042110ff }, /* HP (seq# overridden) */
+	{ 0x1a, 0x21a190f0 }, /* dock-mic */
+	{ 0x1c, 0x212140ff }, /* dock-HP */
+	{}
+};
+
 static const struct cxt_pincfg *cxt_pincfg_tbl[] = {
 	[CXT_PINCFG_LENOVO_X200] = cxt_pincfg_lenovo_x200,
+	[CXT_PINCFG_LENOVO_TP410] = cxt_pincfg_lenovo_tp410,
 };
 
-static const struct snd_pci_quirk cxt_fixups[] = {
+static const struct snd_pci_quirk cxt5051_fixups[] = {
 	SND_PCI_QUIRK(0x17aa, 0x20f2, "Lenovo X200", CXT_PINCFG_LENOVO_X200),
 	{}
 };
 
+static const struct snd_pci_quirk cxt5066_fixups[] = {
+	SND_PCI_QUIRK(0x17aa, 0x20f2, "Lenovo T400", CXT_PINCFG_LENOVO_TP410),
+	SND_PCI_QUIRK(0x17aa, 0x215e, "Lenovo T410", CXT_PINCFG_LENOVO_TP410),
+	SND_PCI_QUIRK(0x17aa, 0x215f, "Lenovo T510", CXT_PINCFG_LENOVO_TP410),
+	SND_PCI_QUIRK(0x17aa, 0x21ce, "Lenovo T420", CXT_PINCFG_LENOVO_TP410),
+	SND_PCI_QUIRK(0x17aa, 0x21cf, "Lenovo T520", CXT_PINCFG_LENOVO_TP410),
+	{}
+};
+
 /* add "fake" mute amp-caps to DACs on cx5051 so that mixer mute switches
  * can be created (bko#42825)
  */
@@ -4421,11 +4441,13 @@ static int patch_conexant_auto(struct hda_codec *codec)
 		break;
 	case 0x14f15051:
 		add_cx5051_fake_mutes(codec);
+		apply_pin_fixup(codec, cxt5051_fixups, cxt_pincfg_tbl);
+		break;
+	default:
+		apply_pin_fixup(codec, cxt5066_fixups, cxt_pincfg_tbl);
 		break;
 	}
 
-	apply_pin_fixup(codec, cxt_fixups, cxt_pincfg_tbl);
-
 	err = cx_auto_search_adcs(codec);
 	if (err < 0)
 		return err;
-- 
1.7.10




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

* [ 005/167] [PATCH] ARM: clps711x: serial driver hungs are a result of call disable_irq within ISR
  2012-05-09  5:50 [ 000/167] 3.2.17-stable review Ben Hutchings
                   ` (3 preceding siblings ...)
  2012-05-09  5:50 ` [ 004/167] [PATCH] ALSA: hda/conexant - Set up the missing docking-station pins Ben Hutchings
@ 2012-05-09  5:50 ` Ben Hutchings
  2012-05-09  5:50 ` [ 006/167] [PATCH] ARM: OMAP1: DMTIMER: fix broken timer clock source selection Ben Hutchings
                   ` (161 subsequent siblings)
  166 siblings, 0 replies; 195+ messages in thread
From: Ben Hutchings @ 2012-05-09  5:50 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: torvalds, akpm, alan, Alexander Shiyan, Greg Kroah-Hartman

3.2-stable review patch.  If anyone has any objections, please let me know.

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

From: Alexander Shiyan <shc_work@mail.ru>

commit 7a6fbc9a887193a1e9f8658703881c528040afbc upstream.

Since 2.6.30-rc1 clps711x serial driver hungs system. This is a result
of call disable_irq from ISR. synchronize_irq waits for end of interrupt
and goes to infinite loop. This patch fix this problem.

Signed-off-by: Alexander Shiyan <shc_work@mail.ru>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
---
 drivers/tty/serial/clps711x.c |   14 ++++++++------
 1 file changed, 8 insertions(+), 6 deletions(-)

diff --git a/drivers/tty/serial/clps711x.c b/drivers/tty/serial/clps711x.c
index e6c3dbd..836fe273 100644
--- a/drivers/tty/serial/clps711x.c
+++ b/drivers/tty/serial/clps711x.c
@@ -154,10 +154,9 @@ static irqreturn_t clps711xuart_int_tx(int irq, void *dev_id)
 		port->x_char = 0;
 		return IRQ_HANDLED;
 	}
-	if (uart_circ_empty(xmit) || uart_tx_stopped(port)) {
-		clps711xuart_stop_tx(port);
-		return IRQ_HANDLED;
-	}
+
+	if (uart_circ_empty(xmit) || uart_tx_stopped(port))
+		goto disable_tx_irq;
 
 	count = port->fifosize >> 1;
 	do {
@@ -171,8 +170,11 @@ static irqreturn_t clps711xuart_int_tx(int irq, void *dev_id)
 	if (uart_circ_chars_pending(xmit) < WAKEUP_CHARS)
 		uart_write_wakeup(port);
 
-	if (uart_circ_empty(xmit))
-		clps711xuart_stop_tx(port);
+	if (uart_circ_empty(xmit)) {
+	disable_tx_irq:
+		disable_irq_nosync(TX_IRQ(port));
+		tx_enabled(port) = 0;
+	}
 
 	return IRQ_HANDLED;
 }
-- 
1.7.10




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

* [ 006/167] [PATCH] ARM: OMAP1: DMTIMER: fix broken timer clock source selection
  2012-05-09  5:50 [ 000/167] 3.2.17-stable review Ben Hutchings
                   ` (4 preceding siblings ...)
  2012-05-09  5:50 ` [ 005/167] [PATCH] ARM: clps711x: serial driver hungs are a result of call disable_irq within ISR Ben Hutchings
@ 2012-05-09  5:50 ` Ben Hutchings
  2012-05-09  5:50 ` [ 007/167] [PATCH] mmc: fixes for eMMC v4.5 discard operation Ben Hutchings
                   ` (160 subsequent siblings)
  166 siblings, 0 replies; 195+ messages in thread
From: Ben Hutchings @ 2012-05-09  5:50 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: torvalds, akpm, alan, Paul Walmsley, Tarun Kanti DebBarma, Tony Lindgren

3.2-stable review patch.  If anyone has any objections, please let me know.

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

From: Paul Walmsley <paul@pwsan.com>

commit 6aaec67da1e41a0752a2b903b989e73b9f02e182 upstream.

DMTIMER source selection on OMAP1 is broken.  omap1_dm_timer_set_src()
tries to use __raw_{read,write}l() to read from and write to physical
addresses, but those functions take virtual addresses.

sparse caught this:

arch/arm/mach-omap1/timer.c:50:13: warning: incorrect type in argument 1 (different base types)
arch/arm/mach-omap1/timer.c:50:13:    expected void const volatile [noderef] <asn:2>*<noident>
arch/arm/mach-omap1/timer.c:50:13:    got unsigned int
arch/arm/mach-omap1/timer.c:52:9: warning: incorrect type in argument 1 (different base types)
arch/arm/mach-omap1/timer.c:52:9:    expected void const volatile [noderef] <asn:2>*<noident>
arch/arm/mach-omap1/timer.c:52:9:    got unsigned int

Fix by using omap_{read,writel}(), just like the other users of the
MOD_CONF_CTRL_1 register in the OMAP1 codebase.  Of course, in the long term,
removing omap_{read,write}l() is the appropriate thing to do; but
this will take some work to do this cleanly.

Looks like this was caused by 97933d6 (ARM: OMAP1: dmtimer: conversion
to platform devices) that dangerously moved code and changed it in
the same patch.

Signed-off-by: Paul Walmsley <paul@pwsan.com>
Cc: Tarun Kanti DebBarma <tarun.kanti@ti.com>
[tony@atomide.com: updated comments to include the breaking commit]
Signed-off-by: Tony Lindgren <tony@atomide.com>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
---
 arch/arm/mach-omap1/timer.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/arm/mach-omap1/timer.c b/arch/arm/mach-omap1/timer.c
index 6e90665..fb202af 100644
--- a/arch/arm/mach-omap1/timer.c
+++ b/arch/arm/mach-omap1/timer.c
@@ -47,9 +47,9 @@ static int omap1_dm_timer_set_src(struct platform_device *pdev,
 	int n = (pdev->id - 1) << 1;
 	u32 l;
 
-	l = __raw_readl(MOD_CONF_CTRL_1) & ~(0x03 << n);
+	l = omap_readl(MOD_CONF_CTRL_1) & ~(0x03 << n);
 	l |= source << n;
-	__raw_writel(l, MOD_CONF_CTRL_1);
+	omap_writel(l, MOD_CONF_CTRL_1);
 
 	return 0;
 }
-- 
1.7.10




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

* [ 007/167] [PATCH] mmc: fixes for eMMC v4.5 discard operation
  2012-05-09  5:50 [ 000/167] 3.2.17-stable review Ben Hutchings
                   ` (5 preceding siblings ...)
  2012-05-09  5:50 ` [ 006/167] [PATCH] ARM: OMAP1: DMTIMER: fix broken timer clock source selection Ben Hutchings
@ 2012-05-09  5:50 ` Ben Hutchings
  2012-05-09  5:50 ` [ 008/167] [PATCH] mmc: fixes for eMMC v4.5 sanitize operation Ben Hutchings
                   ` (159 subsequent siblings)
  166 siblings, 0 replies; 195+ messages in thread
From: Ben Hutchings @ 2012-05-09  5:50 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: torvalds, akpm, alan, Adrian Hunter, Jaehoon Chung,
	Linus Walleij, Chris Ball

3.2-stable review patch.  If anyone has any objections, please let me know.

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

From: Adrian Hunter <adrian.hunter@intel.com>

commit 7194efb8f063ee3aa0cb50d9002348887e68ec10 upstream.

eMMC v4.5 discard operation is significantly different from the
existing trim operation because it is not guaranteed to work with
the new sanitize operation.  Consequently mmc_can_trim() is
separated from mmc_can_discard().

Also the new discard operation does not result in the sectors being
set to all-zeros, so discard_zeroes_data must not be set.

In addition, the new discard has the same timeout as trim, but from
v4.5 trim is defined to use the hc timeout.  The timeout calculation
is adjusted accordingly.

Fixes apply to linux 3.2 on.

Signed-off-by: Adrian Hunter <adrian.hunter@intel.com>
Acked-by: Jaehoon Chung <jh80.chung@samsung.com>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Chris Ball <cjb@laptop.org>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
---
 drivers/mmc/card/queue.c |    2 +-
 drivers/mmc/core/core.c  |    7 ++++---
 2 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/drivers/mmc/card/queue.c b/drivers/mmc/card/queue.c
index 2517547..996f8e3 100644
--- a/drivers/mmc/card/queue.c
+++ b/drivers/mmc/card/queue.c
@@ -139,7 +139,7 @@ static void mmc_queue_setup_discard(struct request_queue *q,
 
 	queue_flag_set_unlocked(QUEUE_FLAG_DISCARD, q);
 	q->limits.max_discard_sectors = max_discard;
-	if (card->erased_byte == 0)
+	if (card->erased_byte == 0 && !mmc_can_discard(card))
 		q->limits.discard_zeroes_data = 1;
 	q->limits.discard_granularity = card->pref_erase << 9;
 	/* granularity must not be greater than max. discard */
diff --git a/drivers/mmc/core/core.c b/drivers/mmc/core/core.c
index 7474c47..83db5ef 100644
--- a/drivers/mmc/core/core.c
+++ b/drivers/mmc/core/core.c
@@ -1409,7 +1409,10 @@ static unsigned int mmc_mmc_erase_timeout(struct mmc_card *card,
 {
 	unsigned int erase_timeout;
 
-	if (card->ext_csd.erase_group_def & 1) {
+	if (arg == MMC_DISCARD_ARG ||
+	    (arg == MMC_TRIM_ARG && card->ext_csd.rev >= 6)) {
+		erase_timeout = card->ext_csd.trim_timeout;
+	} else if (card->ext_csd.erase_group_def & 1) {
 		/* High Capacity Erase Group Size uses HC timeouts */
 		if (arg == MMC_TRIM_ARG)
 			erase_timeout = card->ext_csd.trim_timeout;
@@ -1681,8 +1684,6 @@ int mmc_can_trim(struct mmc_card *card)
 {
 	if (card->ext_csd.sec_feature_support & EXT_CSD_SEC_GB_CL_EN)
 		return 1;
-	if (mmc_can_discard(card))
-		return 1;
 	return 0;
 }
 EXPORT_SYMBOL(mmc_can_trim);
-- 
1.7.10




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

* [ 008/167] [PATCH] mmc: fixes for eMMC v4.5 sanitize operation
  2012-05-09  5:50 [ 000/167] 3.2.17-stable review Ben Hutchings
                   ` (6 preceding siblings ...)
  2012-05-09  5:50 ` [ 007/167] [PATCH] mmc: fixes for eMMC v4.5 discard operation Ben Hutchings
@ 2012-05-09  5:50 ` Ben Hutchings
  2012-05-09  5:50 ` [ 009/167] [PATCH] mmc: unbreak sdhci-esdhc-imx on i.MX25 Ben Hutchings
                   ` (158 subsequent siblings)
  166 siblings, 0 replies; 195+ messages in thread
From: Ben Hutchings @ 2012-05-09  5:50 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: torvalds, akpm, alan, Adrian Hunter, Jaehoon Chung,
	Linus Walleij, Chris Ball

3.2-stable review patch.  If anyone has any objections, please let me know.

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

From: Adrian Hunter <adrian.hunter@intel.com>

commit 283028122db37621b124f079ca8eae5b64807ad4 upstream.

eMMC v4.5 sanitize operation erases all copies of unmapped
data.  However trim or erase operations must be used first
to unmap the required sectors.  That was not being done.

Fixes apply to linux 3.2 on.

Signed-off-by: Adrian Hunter <adrian.hunter@intel.com>
Acked-by: Jaehoon Chung <jh80.chung@samsung.com>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Chris Ball <cjb@laptop.org>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
---
 drivers/mmc/card/block.c |   54 ++++++++++++++++++++++++++++++++--------------
 drivers/mmc/core/core.c  |    2 ++
 2 files changed, 40 insertions(+), 16 deletions(-)

diff --git a/drivers/mmc/card/block.c b/drivers/mmc/card/block.c
index b180965..4232bc4 100644
--- a/drivers/mmc/card/block.c
+++ b/drivers/mmc/card/block.c
@@ -873,7 +873,7 @@ static int mmc_blk_issue_secdiscard_rq(struct mmc_queue *mq,
 {
 	struct mmc_blk_data *md = mq->data;
 	struct mmc_card *card = md->queue.card;
-	unsigned int from, nr, arg;
+	unsigned int from, nr, arg, trim_arg, erase_arg;
 	int err = 0, type = MMC_BLK_SECDISCARD;
 
 	if (!(mmc_can_secure_erase_trim(card) || mmc_can_sanitize(card))) {
@@ -881,20 +881,26 @@ static int mmc_blk_issue_secdiscard_rq(struct mmc_queue *mq,
 		goto out;
 	}
 
+	from = blk_rq_pos(req);
+	nr = blk_rq_sectors(req);
+
 	/* The sanitize operation is supported at v4.5 only */
 	if (mmc_can_sanitize(card)) {
-		err = mmc_switch(card, EXT_CSD_CMD_SET_NORMAL,
-				EXT_CSD_SANITIZE_START, 1, 0);
-		goto out;
+		erase_arg = MMC_ERASE_ARG;
+		trim_arg = MMC_TRIM_ARG;
+	} else {
+		erase_arg = MMC_SECURE_ERASE_ARG;
+		trim_arg = MMC_SECURE_TRIM1_ARG;
 	}
 
-	from = blk_rq_pos(req);
-	nr = blk_rq_sectors(req);
-
-	if (mmc_can_trim(card) && !mmc_erase_group_aligned(card, from, nr))
-		arg = MMC_SECURE_TRIM1_ARG;
-	else
-		arg = MMC_SECURE_ERASE_ARG;
+	if (mmc_erase_group_aligned(card, from, nr))
+		arg = erase_arg;
+	else if (mmc_can_trim(card))
+		arg = trim_arg;
+	else {
+		err = -EINVAL;
+		goto out;
+	}
 retry:
 	if (card->quirks & MMC_QUIRK_INAND_CMD38) {
 		err = mmc_switch(card, EXT_CSD_CMD_SET_NORMAL,
@@ -904,25 +910,41 @@ retry:
 				 INAND_CMD38_ARG_SECERASE,
 				 0);
 		if (err)
-			goto out;
+			goto out_retry;
 	}
+
 	err = mmc_erase(card, from, nr, arg);
-	if (!err && arg == MMC_SECURE_TRIM1_ARG) {
+	if (err == -EIO)
+		goto out_retry;
+	if (err)
+		goto out;
+
+	if (arg == MMC_SECURE_TRIM1_ARG) {
 		if (card->quirks & MMC_QUIRK_INAND_CMD38) {
 			err = mmc_switch(card, EXT_CSD_CMD_SET_NORMAL,
 					 INAND_CMD38_ARG_EXT_CSD,
 					 INAND_CMD38_ARG_SECTRIM2,
 					 0);
 			if (err)
-				goto out;
+				goto out_retry;
 		}
+
 		err = mmc_erase(card, from, nr, MMC_SECURE_TRIM2_ARG);
+		if (err == -EIO)
+			goto out_retry;
+		if (err)
+			goto out;
 	}
-out:
-	if (err == -EIO && !mmc_blk_reset(md, card->host, type))
+
+	if (mmc_can_sanitize(card))
+		err = mmc_switch(card, EXT_CSD_CMD_SET_NORMAL,
+				 EXT_CSD_SANITIZE_START, 1, 0);
+out_retry:
+	if (err && !mmc_blk_reset(md, card->host, type))
 		goto retry;
 	if (!err)
 		mmc_blk_reset_success(md, type);
+out:
 	spin_lock_irq(&md->lock);
 	__blk_end_request(req, err, blk_rq_bytes(req));
 	spin_unlock_irq(&md->lock);
diff --git a/drivers/mmc/core/core.c b/drivers/mmc/core/core.c
index 83db5ef..e541efb 100644
--- a/drivers/mmc/core/core.c
+++ b/drivers/mmc/core/core.c
@@ -1702,6 +1702,8 @@ EXPORT_SYMBOL(mmc_can_discard);
 
 int mmc_can_sanitize(struct mmc_card *card)
 {
+	if (!mmc_can_trim(card) && !mmc_can_erase(card))
+		return 0;
 	if (card->ext_csd.sec_feature_support & EXT_CSD_SEC_SANITIZE)
 		return 1;
 	return 0;
-- 
1.7.10




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

* [ 009/167] [PATCH] mmc: unbreak sdhci-esdhc-imx on i.MX25
  2012-05-09  5:50 [ 000/167] 3.2.17-stable review Ben Hutchings
                   ` (7 preceding siblings ...)
  2012-05-09  5:50 ` [ 008/167] [PATCH] mmc: fixes for eMMC v4.5 sanitize operation Ben Hutchings
@ 2012-05-09  5:50 ` Ben Hutchings
  2012-05-09  5:50 ` [ 010/167] [PATCH] xen/gntdev: do not set VM_PFNMAP Ben Hutchings
                   ` (157 subsequent siblings)
  166 siblings, 0 replies; 195+ messages in thread
From: Ben Hutchings @ 2012-05-09  5:50 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: torvalds, akpm, alan, Eric Bénard, Wolfram Sang, Chris Ball

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

3.2-stable review patch.  If anyone has any objections, please let me know.

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

From: =?UTF-8?q?Eric=20B=C3=A9nard?= <eric@eukrea.com>

commit b89152824f993a9572b47eb31f4579feadeac34c upstream.

This was broken by me in 37865fe91582582a6f6c00652f6a2b1ff71f8a78
("mmc: sdhci-esdhc-imx: fix timeout on i.MX's sdhci") where more
extensive tests would have shown that read or write of data to the
card were failing (even if the partition table was correctly read).

Signed-off-by: Eric Bénard <eric@eukrea.com>
Acked-by: Wolfram Sang <w.sang@pengutronix.de>
Signed-off-by: Chris Ball <cjb@laptop.org>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
---
 drivers/mmc/host/sdhci-esdhc-imx.c |    3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

--- linux.orig/drivers/mmc/host/sdhci-esdhc-imx.c
+++ linux/drivers/mmc/host/sdhci-esdhc-imx.c
@@ -467,8 +467,7 @@
 	clk_enable(clk);
 	pltfm_host->clk = clk;
 
-	if (!is_imx25_esdhc(imx_data))
-		host->quirks |= SDHCI_QUIRK_BROKEN_TIMEOUT_VAL;
+	host->quirks |= SDHCI_QUIRK_BROKEN_TIMEOUT_VAL;
 
 	if (is_imx25_esdhc(imx_data) || is_imx35_esdhc(imx_data))
 		/* Fix errata ENGcm07207 present on i.MX25 and i.MX35 */



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

* [ 010/167] [PATCH] xen/gntdev: do not set VM_PFNMAP
  2012-05-09  5:50 [ 000/167] 3.2.17-stable review Ben Hutchings
                   ` (8 preceding siblings ...)
  2012-05-09  5:50 ` [ 009/167] [PATCH] mmc: unbreak sdhci-esdhc-imx on i.MX25 Ben Hutchings
@ 2012-05-09  5:50 ` Ben Hutchings
  2012-05-09  5:50 ` [ 011/167] [PATCH] xen/xenbus: Add quirk to deal with misconfigured backends Ben Hutchings
                   ` (156 subsequent siblings)
  166 siblings, 0 replies; 195+ messages in thread
From: Ben Hutchings @ 2012-05-09  5:50 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: torvalds, akpm, alan, Stefano Stabellini, Konrad Rzeszutek Wilk

3.2-stable review patch.  If anyone has any objections, please let me know.

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

From: Stefano Stabellini <stefano.stabellini@eu.citrix.com>

commit e8e937be971d706061dc56220ff3605ab77622a7 upstream.

Since we are using the m2p_override we do have struct pages
corresponding to the user vma mmap'ed by gntdev.

Removing the VM_PFNMAP flag makes get_user_pages work on that vma.
An example test case would be using a Xen userspace block backend
(QDISK) on a file on NFS using O_DIRECT.

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
---
 drivers/xen/gntdev.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/xen/gntdev.c b/drivers/xen/gntdev.c
index 99d8151..1ffd03b 100644
--- a/drivers/xen/gntdev.c
+++ b/drivers/xen/gntdev.c
@@ -722,7 +722,7 @@ static int gntdev_mmap(struct file *flip, struct vm_area_struct *vma)
 	vma->vm_flags |= VM_RESERVED|VM_DONTEXPAND;
 
 	if (use_ptemod)
-		vma->vm_flags |= VM_DONTCOPY|VM_PFNMAP;
+		vma->vm_flags |= VM_DONTCOPY;
 
 	vma->vm_private_data = map;
 
-- 
1.7.10




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

* [ 011/167] [PATCH] xen/xenbus: Add quirk to deal with misconfigured backends.
  2012-05-09  5:50 [ 000/167] 3.2.17-stable review Ben Hutchings
                   ` (9 preceding siblings ...)
  2012-05-09  5:50 ` [ 010/167] [PATCH] xen/gntdev: do not set VM_PFNMAP Ben Hutchings
@ 2012-05-09  5:50 ` Ben Hutchings
  2012-05-09  5:50 ` [ 012/167] [PATCH] USB: yurex: Remove allocation of coherent buffer for setup-packet buffer Ben Hutchings
                   ` (155 subsequent siblings)
  166 siblings, 0 replies; 195+ messages in thread
From: Ben Hutchings @ 2012-05-09  5:50 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: torvalds, akpm, alan, Konrad Rzeszutek Wilk, Stefano Stabellini

3.2-stable review patch.  If anyone has any objections, please let me know.

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

From: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>

commit 3066616ce23aad5719c23a0f21f32676402cb44b upstream.

A rather annoying and common case is when booting a PVonHVM guest
and exposing the PV KBD and PV VFB - as broken toolstacks don't
always initialize the backends correctly.

Normally The HVM guest is using the VGA driver and the emulated
keyboard for this (though upstream version of QEMU implements
PV KBD, but still uses a VGA driver). We provide a very basic
two-stage wait mechanism - where we wait for 30 seconds for all
devices, and then for 270 for all them except the two mentioned.

That allows us to wait for the essential devices, like network
or disk for the full 6 minutes.

To trigger this, put this in your guest config:

vfb = [ 'vnc=1, vnclisten=0.0.0.0 ,vncunused=1']

instead of this:
vnc=1
vnclisten="0.0.0.0"

Acked-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
[v3: Split delay in non-essential (30 seconds) and essential
 devices per Ian and Stefano suggestion]
[v4: Added comments per Stefano suggestion]
Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
---
 drivers/xen/xenbus/xenbus_probe_frontend.c |   69 +++++++++++++++++++++-------
 1 file changed, 53 insertions(+), 16 deletions(-)

diff --git a/drivers/xen/xenbus/xenbus_probe_frontend.c b/drivers/xen/xenbus/xenbus_probe_frontend.c
index f20c5f1..a31b54d 100644
--- a/drivers/xen/xenbus/xenbus_probe_frontend.c
+++ b/drivers/xen/xenbus/xenbus_probe_frontend.c
@@ -135,7 +135,7 @@ static int read_backend_details(struct xenbus_device *xendev)
 	return xenbus_read_otherend_details(xendev, "backend-id", "backend");
 }
 
-static int is_device_connecting(struct device *dev, void *data)
+static int is_device_connecting(struct device *dev, void *data, bool ignore_nonessential)
 {
 	struct xenbus_device *xendev = to_xenbus_device(dev);
 	struct device_driver *drv = data;
@@ -152,16 +152,41 @@ static int is_device_connecting(struct device *dev, void *data)
 	if (drv && (dev->driver != drv))
 		return 0;
 
+	if (ignore_nonessential) {
+		/* With older QEMU, for PVonHVM guests the guest config files
+		 * could contain: vfb = [ 'vnc=1, vnclisten=0.0.0.0']
+		 * which is nonsensical as there is no PV FB (there can be
+		 * a PVKB) running as HVM guest. */
+
+		if ((strncmp(xendev->nodename, "device/vkbd", 11) == 0))
+			return 0;
+
+		if ((strncmp(xendev->nodename, "device/vfb", 10) == 0))
+			return 0;
+	}
 	xendrv = to_xenbus_driver(dev->driver);
 	return (xendev->state < XenbusStateConnected ||
 		(xendev->state == XenbusStateConnected &&
 		 xendrv->is_ready && !xendrv->is_ready(xendev)));
 }
+static int essential_device_connecting(struct device *dev, void *data)
+{
+	return is_device_connecting(dev, data, true /* ignore PV[KBB+FB] */);
+}
+static int non_essential_device_connecting(struct device *dev, void *data)
+{
+	return is_device_connecting(dev, data, false);
+}
 
-static int exists_connecting_device(struct device_driver *drv)
+static int exists_essential_connecting_device(struct device_driver *drv)
 {
 	return bus_for_each_dev(&xenbus_frontend.bus, NULL, drv,
-				is_device_connecting);
+				essential_device_connecting);
+}
+static int exists_non_essential_connecting_device(struct device_driver *drv)
+{
+	return bus_for_each_dev(&xenbus_frontend.bus, NULL, drv,
+				non_essential_device_connecting);
 }
 
 static int print_device_status(struct device *dev, void *data)
@@ -192,6 +217,23 @@ static int print_device_status(struct device *dev, void *data)
 /* We only wait for device setup after most initcalls have run. */
 static int ready_to_wait_for_devices;
 
+static bool wait_loop(unsigned long start, unsigned int max_delay,
+		     unsigned int *seconds_waited)
+{
+	if (time_after(jiffies, start + (*seconds_waited+5)*HZ)) {
+		if (!*seconds_waited)
+			printk(KERN_WARNING "XENBUS: Waiting for "
+			       "devices to initialise: ");
+		*seconds_waited += 5;
+		printk("%us...", max_delay - *seconds_waited);
+		if (*seconds_waited == max_delay)
+			return true;
+	}
+
+	schedule_timeout_interruptible(HZ/10);
+
+	return false;
+}
 /*
  * On a 5-minute timeout, wait for all devices currently configured.  We need
  * to do this to guarantee that the filesystems and / or network devices
@@ -215,19 +257,14 @@ static void wait_for_devices(struct xenbus_driver *xendrv)
 	if (!ready_to_wait_for_devices || !xen_domain())
 		return;
 
-	while (exists_connecting_device(drv)) {
-		if (time_after(jiffies, start + (seconds_waited+5)*HZ)) {
-			if (!seconds_waited)
-				printk(KERN_WARNING "XENBUS: Waiting for "
-				       "devices to initialise: ");
-			seconds_waited += 5;
-			printk("%us...", 300 - seconds_waited);
-			if (seconds_waited == 300)
-				break;
-		}
-
-		schedule_timeout_interruptible(HZ/10);
-	}
+	while (exists_non_essential_connecting_device(drv))
+		if (wait_loop(start, 30, &seconds_waited))
+			break;
+
+	/* Skips PVKB and PVFB check.*/
+	while (exists_essential_connecting_device(drv))
+		if (wait_loop(start, 270, &seconds_waited))
+			break;
 
 	if (seconds_waited)
 		printk("\n");
-- 
1.7.10




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

* [ 012/167] [PATCH] USB: yurex: Remove allocation of coherent buffer for setup-packet buffer
  2012-05-09  5:50 [ 000/167] 3.2.17-stable review Ben Hutchings
                   ` (10 preceding siblings ...)
  2012-05-09  5:50 ` [ 011/167] [PATCH] xen/xenbus: Add quirk to deal with misconfigured backends Ben Hutchings
@ 2012-05-09  5:50 ` Ben Hutchings
  2012-05-09  5:50 ` [ 013/167] [PATCH] USB: yurex: Fix missing URB_NO_TRANSFER_DMA_MAP flag in urb Ben Hutchings
                   ` (154 subsequent siblings)
  166 siblings, 0 replies; 195+ messages in thread
From: Ben Hutchings @ 2012-05-09  5:50 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: torvalds, akpm, alan, Tomoki Sekiyama, Greg Kroah-Hartman

3.2-stable review patch.  If anyone has any objections, please let me know.

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

From: Tomoki Sekiyama <tomoki.sekiyama@gmail.com>

commit 523fc5c14f6cad283e5a266eba0e343aed6e73d5 upstream.

Removes allocation of coherent buffer for the control-request setup-packet
buffer from the yurex driver. Using coherent buffers for setup-packet is
obsolete and does not work with some USB host implementations.

Signed-off-by: Tomoki Sekiyama <tomoki.sekiyama@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
---
 drivers/usb/misc/yurex.c |    8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)

diff --git a/drivers/usb/misc/yurex.c b/drivers/usb/misc/yurex.c
index 897edda..a4a76fc 100644
--- a/drivers/usb/misc/yurex.c
+++ b/drivers/usb/misc/yurex.c
@@ -99,9 +99,7 @@ static void yurex_delete(struct kref *kref)
 	usb_put_dev(dev->udev);
 	if (dev->cntl_urb) {
 		usb_kill_urb(dev->cntl_urb);
-		if (dev->cntl_req)
-			usb_free_coherent(dev->udev, YUREX_BUF_SIZE,
-				dev->cntl_req, dev->cntl_urb->setup_dma);
+		kfree(dev->cntl_req);
 		if (dev->cntl_buffer)
 			usb_free_coherent(dev->udev, YUREX_BUF_SIZE,
 				dev->cntl_buffer, dev->cntl_urb->transfer_dma);
@@ -234,9 +232,7 @@ static int yurex_probe(struct usb_interface *interface, const struct usb_device_
 	}
 
 	/* allocate buffer for control req */
-	dev->cntl_req = usb_alloc_coherent(dev->udev, YUREX_BUF_SIZE,
-					   GFP_KERNEL,
-					   &dev->cntl_urb->setup_dma);
+	dev->cntl_req = kmalloc(YUREX_BUF_SIZE, GFP_KERNEL);
 	if (!dev->cntl_req) {
 		err("Could not allocate cntl_req");
 		goto error;
-- 
1.7.10




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

* [ 013/167] [PATCH] USB: yurex: Fix missing URB_NO_TRANSFER_DMA_MAP flag in urb
  2012-05-09  5:50 [ 000/167] 3.2.17-stable review Ben Hutchings
                   ` (11 preceding siblings ...)
  2012-05-09  5:50 ` [ 012/167] [PATCH] USB: yurex: Remove allocation of coherent buffer for setup-packet buffer Ben Hutchings
@ 2012-05-09  5:50 ` Ben Hutchings
  2012-05-09  5:50 ` [ 014/167] [PATCH] uwb: fix use of del_timer_sync() in interrupt Ben Hutchings
                   ` (153 subsequent siblings)
  166 siblings, 0 replies; 195+ messages in thread
From: Ben Hutchings @ 2012-05-09  5:50 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: torvalds, akpm, alan, Tomoki Sekiyama, Greg Kroah-Hartman

3.2-stable review patch.  If anyone has any objections, please let me know.

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

From: Tomoki Sekiyama <tomoki.sekiyama@gmail.com>

commit 532f17b5d59bf0deb6f1ff9bc1fb27d5b5011c09 upstream.

Current probing code is setting URB_NO_TRANSFER_DMA_MAP flag into a wrong urb
structure, and this causes BUG_ON with some USB host implementations.
This patch fixes the issue.

Signed-off-by: Tomoki Sekiyama <tomoki.sekiyama@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
---
 drivers/usb/misc/yurex.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/usb/misc/yurex.c b/drivers/usb/misc/yurex.c
index a4a76fc..7020146 100644
--- a/drivers/usb/misc/yurex.c
+++ b/drivers/usb/misc/yurex.c
@@ -282,7 +282,7 @@ static int yurex_probe(struct usb_interface *interface, const struct usb_device_
 			 usb_rcvintpipe(dev->udev, dev->int_in_endpointAddr),
 			 dev->int_buffer, YUREX_BUF_SIZE, yurex_interrupt,
 			 dev, 1);
-	dev->cntl_urb->transfer_flags |= URB_NO_TRANSFER_DMA_MAP;
+	dev->urb->transfer_flags |= URB_NO_TRANSFER_DMA_MAP;
 	if (usb_submit_urb(dev->urb, GFP_KERNEL)) {
 		retval = -EIO;
 		err("Could not submitting URB");
-- 
1.7.10




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

* [ 014/167] [PATCH] uwb: fix use of del_timer_sync() in interrupt
  2012-05-09  5:50 [ 000/167] 3.2.17-stable review Ben Hutchings
                   ` (12 preceding siblings ...)
  2012-05-09  5:50 ` [ 013/167] [PATCH] USB: yurex: Fix missing URB_NO_TRANSFER_DMA_MAP flag in urb Ben Hutchings
@ 2012-05-09  5:50 ` Ben Hutchings
  2012-05-09  5:50 ` [ 015/167] [PATCH] uwb: fix error handling Ben Hutchings
                   ` (152 subsequent siblings)
  166 siblings, 0 replies; 195+ messages in thread
From: Ben Hutchings @ 2012-05-09  5:50 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: torvalds, akpm, alan, Oliver Neukum, Oliver Neukum, Greg Kroah-Hartman

3.2-stable review patch.  If anyone has any objections, please let me know.

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

From: Oliver Neukum <oliver@neukum.org>

commit 9426cd05682745d1024dbabdec5631309bd2f480 upstream.

del_timer_sync() cannot be used in interrupt.
Replace it with del_timer() and a flag

Signed-off-by: Oliver Neukum <oneukum@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
---
 drivers/uwb/neh.c |   12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)

diff --git a/drivers/uwb/neh.c b/drivers/uwb/neh.c
index a269937..8cb71bb 100644
--- a/drivers/uwb/neh.c
+++ b/drivers/uwb/neh.c
@@ -107,6 +107,7 @@ struct uwb_rc_neh {
 	u8 evt_type;
 	__le16 evt;
 	u8 context;
+	u8 completed;
 	uwb_rc_cmd_cb_f cb;
 	void *arg;
 
@@ -409,6 +410,7 @@ static void uwb_rc_neh_grok_event(struct uwb_rc *rc, struct uwb_rceb *rceb, size
 	struct device *dev = &rc->uwb_dev.dev;
 	struct uwb_rc_neh *neh;
 	struct uwb_rceb *notif;
+	unsigned long flags;
 
 	if (rceb->bEventContext == 0) {
 		notif = kmalloc(size, GFP_ATOMIC);
@@ -422,7 +424,11 @@ static void uwb_rc_neh_grok_event(struct uwb_rc *rc, struct uwb_rceb *rceb, size
 	} else {
 		neh = uwb_rc_neh_lookup(rc, rceb);
 		if (neh) {
-			del_timer_sync(&neh->timer);
+			spin_lock_irqsave(&rc->neh_lock, flags);
+			/* to guard against a timeout */
+			neh->completed = 1;
+			del_timer(&neh->timer);
+			spin_unlock_irqrestore(&rc->neh_lock, flags);
 			uwb_rc_neh_cb(neh, rceb, size);
 		} else
 			dev_warn(dev, "event 0x%02x/%04x/%02x (%zu bytes): nobody cared\n",
@@ -568,6 +574,10 @@ static void uwb_rc_neh_timer(unsigned long arg)
 	unsigned long flags;
 
 	spin_lock_irqsave(&rc->neh_lock, flags);
+	if (neh->completed) {
+		spin_unlock_irqrestore(&rc->neh_lock, flags);
+		return;
+	}
 	if (neh->context)
 		__uwb_rc_neh_rm(rc, neh);
 	else
-- 
1.7.10




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

* [ 015/167] [PATCH] uwb: fix error handling
  2012-05-09  5:50 [ 000/167] 3.2.17-stable review Ben Hutchings
                   ` (13 preceding siblings ...)
  2012-05-09  5:50 ` [ 014/167] [PATCH] uwb: fix use of del_timer_sync() in interrupt Ben Hutchings
@ 2012-05-09  5:50 ` Ben Hutchings
  2012-05-09  5:50 ` [ 016/167] [PATCH] davinci_mdio: Fix MDIO timeout check Ben Hutchings
                   ` (151 subsequent siblings)
  166 siblings, 0 replies; 195+ messages in thread
From: Ben Hutchings @ 2012-05-09  5:50 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: torvalds, akpm, alan, Oliver Neukum, Oliver Neukum, Greg Kroah-Hartman

3.2-stable review patch.  If anyone has any objections, please let me know.

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

From: Oliver Neukum <oliver@neukum.org>

commit 5bd7b419ef2eb4989b207753e088c3437159618a upstream.

Fatal errors such as a device disconnect must not trigger
error handling. The error returns must be checked.

Signed-off-by: Oliver Neukum <oneukum@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
---
 drivers/uwb/hwa-rc.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/uwb/hwa-rc.c b/drivers/uwb/hwa-rc.c
index 66797e9..810c90a 100644
--- a/drivers/uwb/hwa-rc.c
+++ b/drivers/uwb/hwa-rc.c
@@ -645,7 +645,8 @@ void hwarc_neep_cb(struct urb *urb)
 		dev_err(dev, "NEEP: URB error %d\n", urb->status);
 	}
 	result = usb_submit_urb(urb, GFP_ATOMIC);
-	if (result < 0) {
+	if (result < 0 && result != -ENODEV && result != -EPERM) {
+		/* ignoring unrecoverable errors */
 		dev_err(dev, "NEEP: Can't resubmit URB (%d) resetting device\n",
 			result);
 		goto error;
-- 
1.7.10




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

* [ 016/167] [PATCH] davinci_mdio: Fix MDIO timeout check
  2012-05-09  5:50 [ 000/167] 3.2.17-stable review Ben Hutchings
                   ` (14 preceding siblings ...)
  2012-05-09  5:50 ` [ 015/167] [PATCH] uwb: fix error handling Ben Hutchings
@ 2012-05-09  5:50 ` Ben Hutchings
  2012-05-09  5:50 ` [ 017/167] [PATCH] mwifiex: update pcie8766 scratch register addresses Ben Hutchings
                   ` (150 subsequent siblings)
  166 siblings, 0 replies; 195+ messages in thread
From: Ben Hutchings @ 2012-05-09  5:50 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: torvalds, akpm, alan, Christian Riesch, Cyril Chemparathy,
	David S. Miller

3.2-stable review patch.  If anyone has any objections, please let me know.

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

From: Christian Riesch <christian.riesch@omicron.at>

commit 5b76d0600b2b08eef77f8e9226938b7b6bde3099 upstream.

Under heavy load (flood ping) it is possible for the MDIO timeout to
expire before the loop checks the GO bit again. This patch adds an
additional check whether the operation was done before actually
returning -ETIMEDOUT.

To reproduce this bug, flood ping the device, e.g., ping -f -l 1000
After some time, a "timed out waiting for user access" warning
may appear. And even worse, link may go down since the PHY reported a
timeout.

Signed-off-by: Christian Riesch <christian.riesch@omicron.at>
Cc: Cyril Chemparathy <cyril@ti.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
---
 drivers/net/ethernet/ti/davinci_mdio.c |    5 +++++
 1 file changed, 5 insertions(+)

diff --git a/drivers/net/ethernet/ti/davinci_mdio.c b/drivers/net/ethernet/ti/davinci_mdio.c
index 2757c7d..e4e4708 100644
--- a/drivers/net/ethernet/ti/davinci_mdio.c
+++ b/drivers/net/ethernet/ti/davinci_mdio.c
@@ -181,6 +181,11 @@ static inline int wait_for_user_access(struct davinci_mdio_data *data)
 		__davinci_mdio_reset(data);
 		return -EAGAIN;
 	}
+
+	reg = __raw_readl(&regs->user[0].access);
+	if ((reg & USERACCESS_GO) == 0)
+		return 0;
+
 	dev_err(data->dev, "timed out waiting for user access\n");
 	return -ETIMEDOUT;
 }
-- 
1.7.10




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

* [ 017/167] [PATCH] mwifiex: update pcie8766 scratch register addresses
  2012-05-09  5:50 [ 000/167] 3.2.17-stable review Ben Hutchings
                   ` (15 preceding siblings ...)
  2012-05-09  5:50 ` [ 016/167] [PATCH] davinci_mdio: Fix MDIO timeout check Ben Hutchings
@ 2012-05-09  5:50 ` Ben Hutchings
  2012-05-09  5:50 ` [ 018/167] [PATCH] brcm80211: smac: resume transmit fifo upon receiving frames Ben Hutchings
                   ` (149 subsequent siblings)
  166 siblings, 0 replies; 195+ messages in thread
From: Ben Hutchings @ 2012-05-09  5:50 UTC (permalink / raw)
  To: linux-kernel, stable; +Cc: torvalds, akpm, alan, Bing Zhao, John W. Linville

3.2-stable review patch.  If anyone has any objections, please let me know.

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

From: Bing Zhao <bzhao@marvell.com>

commit 428ca8a7065354877db63ceabfc493107686eebe upstream.

The scratch register addresses have been changed for newer chips.
Since the old chip was never shipped and it will not be supported
any more, just update register addresses to support the new chips.

Signed-off-by: Bing Zhao <bzhao@marvell.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
---
 drivers/net/wireless/mwifiex/pcie.h |   18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/drivers/net/wireless/mwifiex/pcie.h b/drivers/net/wireless/mwifiex/pcie.h
index 445ff21..2f218f9 100644
--- a/drivers/net/wireless/mwifiex/pcie.h
+++ b/drivers/net/wireless/mwifiex/pcie.h
@@ -48,15 +48,15 @@
 #define PCIE_HOST_INT_STATUS_MASK			0xC3C
 #define PCIE_SCRATCH_2_REG				0xC40
 #define PCIE_SCRATCH_3_REG				0xC44
-#define PCIE_SCRATCH_4_REG				0xCC0
-#define PCIE_SCRATCH_5_REG				0xCC4
-#define PCIE_SCRATCH_6_REG				0xCC8
-#define PCIE_SCRATCH_7_REG				0xCCC
-#define PCIE_SCRATCH_8_REG				0xCD0
-#define PCIE_SCRATCH_9_REG				0xCD4
-#define PCIE_SCRATCH_10_REG				0xCD8
-#define PCIE_SCRATCH_11_REG				0xCDC
-#define PCIE_SCRATCH_12_REG				0xCE0
+#define PCIE_SCRATCH_4_REG				0xCD0
+#define PCIE_SCRATCH_5_REG				0xCD4
+#define PCIE_SCRATCH_6_REG				0xCD8
+#define PCIE_SCRATCH_7_REG				0xCDC
+#define PCIE_SCRATCH_8_REG				0xCE0
+#define PCIE_SCRATCH_9_REG				0xCE4
+#define PCIE_SCRATCH_10_REG				0xCE8
+#define PCIE_SCRATCH_11_REG				0xCEC
+#define PCIE_SCRATCH_12_REG				0xCF0
 
 #define CPU_INTR_DNLD_RDY				BIT(0)
 #define CPU_INTR_DOOR_BELL				BIT(1)
-- 
1.7.10




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

* [ 018/167] [PATCH] brcm80211: smac: resume transmit fifo upon receiving frames
  2012-05-09  5:50 [ 000/167] 3.2.17-stable review Ben Hutchings
                   ` (16 preceding siblings ...)
  2012-05-09  5:50 ` [ 017/167] [PATCH] mwifiex: update pcie8766 scratch register addresses Ben Hutchings
@ 2012-05-09  5:50 ` Ben Hutchings
  2012-05-11 23:42   ` Ben Hutchings
  2012-05-09  5:50 ` [ 019/167] [PATCH] [media] rc-core: set mode for winbond-cir Ben Hutchings
                   ` (148 subsequent siblings)
  166 siblings, 1 reply; 195+ messages in thread
From: Ben Hutchings @ 2012-05-09  5:50 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: torvalds, akpm, alan, Arend van Spriel,
	Francesco Saverio Schiavarelli, Pieter-Paul Giesberts,
	Brett Rudley, John W. Linville

3.2-stable review patch.  If anyone has any objections, please let me know.

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

From: Arend van Spriel <arend@broadcom.com>

commit badc4f07622f0f7093a201638f45e85765f1b5e4 upstream.

There have been reports about not being able to use access-points
on channel 12 and 13 or having connectivity issues when these channels
were part of the selected regulatory domain. Upon switching to these
channels the brcmsmac driver suspends the transmit dma fifos. This
patch resumes them upon handing over the first received beacon to
mac80211.

This patch is to be applied to the stable tree for kernel versions
3.2 and 3.3.

Tested-by: Francesco Saverio Schiavarelli <fschiava@libero.it>
Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com>
Reviewed-by: Brett Rudley <brudley@broadcom.com>
Signed-off-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
---
 drivers/net/wireless/brcm80211/brcmsmac/main.c |    8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/drivers/net/wireless/brcm80211/brcmsmac/main.c b/drivers/net/wireless/brcm80211/brcmsmac/main.c
index 231ddf4..7083db7 100644
--- a/drivers/net/wireless/brcm80211/brcmsmac/main.c
+++ b/drivers/net/wireless/brcm80211/brcmsmac/main.c
@@ -7614,6 +7614,7 @@ brcms_c_recvctl(struct brcms_c_info *wlc, struct d11rxhdr *rxh,
 {
 	int len_mpdu;
 	struct ieee80211_rx_status rx_status;
+	struct ieee80211_hdr *hdr;
 
 	memset(&rx_status, 0, sizeof(rx_status));
 	prep_mac80211_status(wlc, rxh, p, &rx_status);
@@ -7623,6 +7624,13 @@ brcms_c_recvctl(struct brcms_c_info *wlc, struct d11rxhdr *rxh,
 	skb_pull(p, D11_PHY_HDR_LEN);
 	__skb_trim(p, len_mpdu);
 
+	/* unmute transmit */
+	if (wlc->hw->suspended_fifos) {
+		hdr = (struct ieee80211_hdr *)p->data;
+		if (ieee80211_is_beacon(hdr->frame_control))
+			brcms_b_mute(wlc->hw, false);
+	}
+
 	memcpy(IEEE80211_SKB_RXCB(p), &rx_status, sizeof(rx_status));
 	ieee80211_rx_irqsafe(wlc->pub->ieee_hw, p);
 }
-- 
1.7.10




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

* [ 019/167] [PATCH] [media] rc-core: set mode for winbond-cir
  2012-05-09  5:50 [ 000/167] 3.2.17-stable review Ben Hutchings
                   ` (17 preceding siblings ...)
  2012-05-09  5:50 ` [ 018/167] [PATCH] brcm80211: smac: resume transmit fifo upon receiving frames Ben Hutchings
@ 2012-05-09  5:50 ` Ben Hutchings
  2012-05-09  5:50 ` [ 020/167] [PATCH] [media] drxk: Does not unlock mutex if sanity check failed in scu_command() Ben Hutchings
                   ` (147 subsequent siblings)
  166 siblings, 0 replies; 195+ messages in thread
From: Ben Hutchings @ 2012-05-09  5:50 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: torvalds, akpm, alan, David Härdeman, Mauro Carvalho Chehab

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

3.2-stable review patch.  If anyone has any objections, please let me know.

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

From: =?UTF-8?q?David=20H=C3=A4rdeman?= <david@hardeman.nu>

commit d9b786955f80fb306471fdb9ea24c6d03af6ca36 upstream.

Setting the correct mode is required by rc-core or scancodes won't be
generated (which isn't very user-friendly).

This one-line fix should be suitable for 3.4-rc2.

Signed-off-by: David Härdeman <david@hardeman.nu>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
---
 drivers/media/rc/winbond-cir.c |    1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/media/rc/winbond-cir.c b/drivers/media/rc/winbond-cir.c
index b09c5fa..af52658 100644
--- a/drivers/media/rc/winbond-cir.c
+++ b/drivers/media/rc/winbond-cir.c
@@ -1046,6 +1046,7 @@ wbcir_probe(struct pnp_dev *device, const struct pnp_device_id *dev_id)
 		goto exit_unregister_led;
 	}
 
+	data->dev->driver_type = RC_DRIVER_IR_RAW;
 	data->dev->driver_name = WBCIR_NAME;
 	data->dev->input_name = WBCIR_NAME;
 	data->dev->input_phys = "wbcir/cir0";
-- 
1.7.10




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

* [ 020/167] [PATCH] [media] drxk: Does not unlock mutex if sanity check failed in scu_command()
  2012-05-09  5:50 [ 000/167] 3.2.17-stable review Ben Hutchings
                   ` (18 preceding siblings ...)
  2012-05-09  5:50 ` [ 019/167] [PATCH] [media] rc-core: set mode for winbond-cir Ben Hutchings
@ 2012-05-09  5:50 ` Ben Hutchings
  2012-05-09  5:50 ` [ 021/167] [PATCH] cfg80211: fix interface combinations check Ben Hutchings
                   ` (146 subsequent siblings)
  166 siblings, 0 replies; 195+ messages in thread
From: Ben Hutchings @ 2012-05-09  5:50 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: torvalds, akpm, alan, Alexey Khoroshilov, Mauro Carvalho Chehab

3.2-stable review patch.  If anyone has any objections, please let me know.

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

From: Alexey Khoroshilov <khoroshilov@ispras.ru>

commit e4459e1682c107d7ee1bf102c1ba534230e9b50b upstream.

If sanity check fails in scu_command(), goto error leads to unlock of
an unheld mutex. The check should not fail in reality, but it nevertheless
worth fixing.

Found by Linux Driver Verification project (linuxtesting.org).

Signed-off-by: Alexey Khoroshilov <khoroshilov@ispras.ru>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
---
 drivers/media/dvb/frontends/drxk_hard.c |    6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/media/dvb/frontends/drxk_hard.c b/drivers/media/dvb/frontends/drxk_hard.c
index 36d1175..a414b1f 100644
--- a/drivers/media/dvb/frontends/drxk_hard.c
+++ b/drivers/media/dvb/frontends/drxk_hard.c
@@ -1520,8 +1520,10 @@ static int scu_command(struct drxk_state *state,
 	dprintk(1, "\n");
 
 	if ((cmd == 0) || ((parameterLen > 0) && (parameter == NULL)) ||
-	    ((resultLen > 0) && (result == NULL)))
-		goto error;
+	    ((resultLen > 0) && (result == NULL))) {
+		printk(KERN_ERR "drxk: Error %d on %s\n", status, __func__);
+		return status;
+	}
 
 	mutex_lock(&state->mutex);
 
-- 
1.7.10




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

* [ 021/167] [PATCH] cfg80211: fix interface combinations check.
  2012-05-09  5:50 [ 000/167] 3.2.17-stable review Ben Hutchings
                   ` (19 preceding siblings ...)
  2012-05-09  5:50 ` [ 020/167] [PATCH] [media] drxk: Does not unlock mutex if sanity check failed in scu_command() Ben Hutchings
@ 2012-05-09  5:50 ` Ben Hutchings
  2012-05-09  5:50 ` [ 022/167] Fix modpost failures in fedora 17 Ben Hutchings
                   ` (145 subsequent siblings)
  166 siblings, 0 replies; 195+ messages in thread
From: Ben Hutchings @ 2012-05-09  5:50 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: torvalds, akpm, alan, Lukasz Kucharczyk, John W. Linville

3.2-stable review patch.  If anyone has any objections, please let me know.

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

From: Lukasz Kucharczyk <lukasz.kucharczyk@tieto.com>

commit e55a4046dab28c440c96890bdddcf02dc8981f2d upstream.

Signed-off-by: Lukasz Kucharczyk <lukasz.kucharczyk@tieto.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
---
 net/wireless/util.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net/wireless/util.c b/net/wireless/util.c
index 1b7a08d..957f2562 100644
--- a/net/wireless/util.c
+++ b/net/wireless/util.c
@@ -989,7 +989,7 @@ int cfg80211_can_change_interface(struct cfg80211_registered_device *rdev,
 			if (rdev->wiphy.software_iftypes & BIT(iftype))
 				continue;
 			for (j = 0; j < c->n_limits; j++) {
-				if (!(limits[j].types & iftype))
+				if (!(limits[j].types & BIT(iftype)))
 					continue;
 				if (limits[j].max < num[iftype])
 					goto cont;
-- 
1.7.10




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

* [ 022/167] Fix modpost failures in fedora 17
  2012-05-09  5:50 [ 000/167] 3.2.17-stable review Ben Hutchings
                   ` (20 preceding siblings ...)
  2012-05-09  5:50 ` [ 021/167] [PATCH] cfg80211: fix interface combinations check Ben Hutchings
@ 2012-05-09  5:50 ` Ben Hutchings
  2012-05-09  5:50 ` [ 023/167] [PATCH] mm: fix s390 BUG by __set_page_dirty_no_writeback on swap Ben Hutchings
                   ` (144 subsequent siblings)
  166 siblings, 0 replies; 195+ messages in thread
From: Ben Hutchings @ 2012-05-09  5:50 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: torvalds, akpm, alan, David Miller, Sam Ravnborg, Michal Marek,
	Jonathan Nieder

3.2-stable review patch.  If anyone has any objections, please let me know.

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

From: David Miller <davem@davemloft.net>

commit e88aa7bbbe3046a125ea1936b16bb921cc9c6349 upstream.

The symbol table on x86-64 starts to have entries that have names
like:

_GLOBAL__sub_I_65535_0___mod_x86cpu_device_table

They are of type STT_FUNCTION and this one had a length of 18.  This
matched the device ID validation logic and it barfed because the
length did not meet the device type's criteria.

--------------------
FATAL: arch/x86/crypto/aesni-intel: sizeof(struct x86cpu_device_id)=16 is not a modulo of the size of section __mod_x86cpu_device_table=18.
Fix definition of struct x86cpu_device_id in mod_devicetable.h
--------------------

These are some kind of compiler tool internal stuff being emitted and
not something we want to inspect in modpost's device ID table
validation code.

So skip the symbol if it is not of type STT_OBJECT.

Signed-off-by: David S. Miller <davem@davemloft.net>
Acked-by: Sam Ravnborg <sam@ravnborg.org>
Signed-off-by: Michal Marek <mmarek@suse.cz>
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
---
 scripts/mod/file2alias.c |    4 ++++
 1 file changed, 4 insertions(+)

--- a/scripts/mod/file2alias.c
+++ b/scripts/mod/file2alias.c
@@ -905,6 +905,10 @@ void handle_moddevtable(struct module *m
 	if (!sym->st_shndx || get_secindex(info, sym) >= info->num_sections)
 		return;
 
+	/* We're looking for an object */
+	if (ELF_ST_TYPE(sym->st_info) != STT_OBJECT)
+		return;
+
 	/* Handle all-NULL symbols allocated into .bss */
 	if (info->sechdrs[get_secindex(info, sym)].sh_type & SHT_NOBITS) {
 		zeros = calloc(1, sym->st_size);



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

* [ 023/167] [PATCH] mm: fix s390 BUG by __set_page_dirty_no_writeback on swap
  2012-05-09  5:50 [ 000/167] 3.2.17-stable review Ben Hutchings
                   ` (21 preceding siblings ...)
  2012-05-09  5:50 ` [ 022/167] Fix modpost failures in fedora 17 Ben Hutchings
@ 2012-05-09  5:50 ` Ben Hutchings
  2012-05-09  5:50 ` [ 024/167] [PATCH] md: dont call ->add_disk unless there is good reason Ben Hutchings
                   ` (143 subsequent siblings)
  166 siblings, 0 replies; 195+ messages in thread
From: Ben Hutchings @ 2012-05-09  5:50 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: torvalds, akpm, alan, Hugh Dickins, Mel Gorman,
	Martin Schwidefsky, Heiko Carstens, Rik van Riel, Ken Chen

3.2-stable review patch.  If anyone has any objections, please let me know.

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

From: Hugh Dickins <hughd@google.com>

commit aca50bd3b4c4bb5528a1878158ba7abce41de534 upstream.

Mel reports a BUG_ON(slot == NULL) in radix_tree_tag_set() on s390
3.0.13: called from __set_page_dirty_nobuffers() when page_remove_rmap()
tries to transfer dirty flag from s390 storage key to struct page and
radix_tree.

That would be because of reclaim's shrink_page_list() calling
add_to_swap() on this page at the same time: first PageSwapCache is set
(causing page_mapping(page) to appear as &swapper_space), then
page->private set, then tree_lock taken, then page inserted into
radix_tree - so there's an interval before taking the lock when the
radix_tree slot is empty.

We could fix this by moving __add_to_swap_cache()'s spin_lock_irq up
before the SetPageSwapCache.  But a better fix is simply to do what's
five years overdue: Ken Chen introduced __set_page_dirty_no_writeback()
(if !PageDirty TestSetPageDirty) for tmpfs to skip all the radix_tree
overhead, and swap is just the same - it ignores the radix_tree tag, and
does not participate in dirty page accounting, so should be using
__set_page_dirty_no_writeback() too.

s390 testing now confirms that this does indeed fix the problem.

Reported-by: Mel Gorman <mgorman@suse.de>
Signed-off-by: Hugh Dickins <hughd@google.com>
Acked-by: Mel Gorman <mgorman@suse.de>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Martin Schwidefsky <schwidefsky@de.ibm.com>
Cc: Heiko Carstens <heiko.carstens@de.ibm.com>
Cc: Rik van Riel <riel@redhat.com>
Cc: Ken Chen <kenchen@google.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
---
 mm/swap_state.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/mm/swap_state.c b/mm/swap_state.c
index 9d3dd37..4c5ff7f 100644
--- a/mm/swap_state.c
+++ b/mm/swap_state.c
@@ -26,7 +26,7 @@
  */
 static const struct address_space_operations swap_aops = {
 	.writepage	= swap_writepage,
-	.set_page_dirty	= __set_page_dirty_nobuffers,
+	.set_page_dirty	= __set_page_dirty_no_writeback,
 	.migratepage	= migrate_page,
 };
 
-- 
1.7.10




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

* [ 024/167] [PATCH] md: dont call ->add_disk unless there is good reason.
  2012-05-09  5:50 [ 000/167] 3.2.17-stable review Ben Hutchings
                   ` (22 preceding siblings ...)
  2012-05-09  5:50 ` [ 023/167] [PATCH] mm: fix s390 BUG by __set_page_dirty_no_writeback on swap Ben Hutchings
@ 2012-05-09  5:50 ` Ben Hutchings
  2012-05-09  6:57   ` Jonathan Nieder
  2012-05-09  5:50 ` [ 025/167] [PATCH] md: fix possible corruption of array metadata on shutdown Ben Hutchings
                   ` (142 subsequent siblings)
  166 siblings, 1 reply; 195+ messages in thread
From: Ben Hutchings @ 2012-05-09  5:50 UTC (permalink / raw)
  To: linux-kernel, stable; +Cc: torvalds, akpm, alan, NeilBrown, Jan Ceuleers

3.2-stable review patch.  If anyone has any objections, please let me know.

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

From: NeilBrown <neilb@suse.de>

commit ed209584c38fb74b7eecc03e5b1bfe674e591bd8 upstream.

Commit 7bfec5f35c68121e7b18

   md/raid5: If there is a spare and a want_replacement device, start replacement.

cause md_check_recovery to call ->add_disk much more often.
Instead of only when the array is degraded, it is now called whenever
md_check_recovery finds anything useful to do, which includes
updating the metadata for clean<->dirty transition.
This causes unnecessary work, and causes info messages from ->add_disk
to be reported much too often.

So refine md_check_recovery to only do any actual recovery checking
(including ->add_disk) if MD_RECOVERY_NEEDED is set.

This fix is suitable for 3.3.y:

Reported-by: Jan Ceuleers <jan.ceuleers@computer.org>
Signed-off-by: NeilBrown <neilb@suse.de>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
---
 drivers/md/md.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/md/md.c b/drivers/md/md.c
index b572e1e..8beb19c 100644
--- a/drivers/md/md.c
+++ b/drivers/md/md.c
@@ -7560,14 +7560,14 @@ void md_check_recovery(struct mddev *mddev)
 		 * any transients in the value of "sync_action".
 		 */
 		set_bit(MD_RECOVERY_RUNNING, &mddev->recovery);
-		clear_bit(MD_RECOVERY_NEEDED, &mddev->recovery);
 		/* Clear some bits that don't mean anything, but
 		 * might be left set
 		 */
 		clear_bit(MD_RECOVERY_INTR, &mddev->recovery);
 		clear_bit(MD_RECOVERY_DONE, &mddev->recovery);
 
-		if (test_bit(MD_RECOVERY_FROZEN, &mddev->recovery))
+		if (!test_and_clear_bit(MD_RECOVERY_NEEDED, &mddev->recovery) ||
+		    test_bit(MD_RECOVERY_FROZEN, &mddev->recovery))
 			goto unlock;
 		/* no recovery is running.
 		 * remove any failed drives, then
-- 
1.7.10




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

* [ 025/167] [PATCH] md: fix possible corruption of array metadata on shutdown.
  2012-05-09  5:50 [ 000/167] 3.2.17-stable review Ben Hutchings
                   ` (23 preceding siblings ...)
  2012-05-09  5:50 ` [ 024/167] [PATCH] md: dont call ->add_disk unless there is good reason Ben Hutchings
@ 2012-05-09  5:50 ` Ben Hutchings
  2012-05-09  5:50 ` [ 026/167] [PATCH] jbd2: use GFP_NOFS for blkdev_issue_flush Ben Hutchings
                   ` (141 subsequent siblings)
  166 siblings, 0 replies; 195+ messages in thread
From: Ben Hutchings @ 2012-05-09  5:50 UTC (permalink / raw)
  To: linux-kernel, stable; +Cc: torvalds, akpm, alan, NeilBrown, Christoph Nelles

3.2-stable review patch.  If anyone has any objections, please let me know.

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

From: NeilBrown <neilb@suse.de>

commit 30b8aa9172dfeaac6d77897c67ee9f9fc574cdbb upstream.

commit c744a65c1e2d59acc54333ce8
  md: don't set md arrays to readonly on shutdown.

removed the possibility of a 'BUG' when data is written to an array
that has just been switched to read-only, but also introduced the
possibility that the array metadata could be corrupted.

If, when md_notify_reboot gets the mddev lock, the array is
in a state where it is assembled but hasn't been started (as can
happen if the personality module is not available, or in other unusual
situations), then incorrect metadata will be written out making it
impossible to re-assemble the array.

So only call __md_stop_writes() if the array has actually been
activated.

This patch is needed for any stable kernel which has had the above
commit applied.

Reported-by: Christoph Nelles <evilazrael@evilazrael.de>
Signed-off-by: NeilBrown <neilb@suse.de>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
---
 drivers/md/md.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/md/md.c b/drivers/md/md.c
index 8beb19c..477eb2e 100644
--- a/drivers/md/md.c
+++ b/drivers/md/md.c
@@ -8140,7 +8140,8 @@ static int md_notify_reboot(struct notifier_block *this,
 
 	for_each_mddev(mddev, tmp) {
 		if (mddev_trylock(mddev)) {
-			__md_stop_writes(mddev);
+			if (mddev->pers)
+				__md_stop_writes(mddev);
 			mddev->safemode = 2;
 			mddev_unlock(mddev);
 		}
-- 
1.7.10




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

* [ 026/167] [PATCH] jbd2: use GFP_NOFS for blkdev_issue_flush
  2012-05-09  5:50 [ 000/167] 3.2.17-stable review Ben Hutchings
                   ` (24 preceding siblings ...)
  2012-05-09  5:50 ` [ 025/167] [PATCH] md: fix possible corruption of array metadata on shutdown Ben Hutchings
@ 2012-05-09  5:50 ` Ben Hutchings
  2012-05-09  5:50 ` [ 027/167] [PATCH] USB: serial: cp210x: Fixed usb_control_msg timeout values Ben Hutchings
                   ` (140 subsequent siblings)
  166 siblings, 0 replies; 195+ messages in thread
From: Ben Hutchings @ 2012-05-09  5:50 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: torvalds, akpm, alan, Shaohua Li, Shaohua Li, Theodore Tso, Jan Kara

3.2-stable review patch.  If anyone has any objections, please let me know.

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

From: Shaohua Li <shli@kernel.org>

commit 99aa78466777083255b876293e9e83dec7cd809a upstream.

flush request is issued in transaction commit code path, so looks using
GFP_KERNEL to allocate memory for flush request bio falls into the classic
deadlock issue.  I saw btrfs and dm get it right, but ext4, xfs and md are
using GFP.

Signed-off-by: Shaohua Li <shli@fusionio.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Reviewed-by: Jan Kara <jack@suse.cz>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
---
 fs/jbd2/commit.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/fs/jbd2/commit.c b/fs/jbd2/commit.c
index 806525a..840f70f 100644
--- a/fs/jbd2/commit.c
+++ b/fs/jbd2/commit.c
@@ -723,7 +723,7 @@ start_journal_io:
 	if (commit_transaction->t_need_data_flush &&
 	    (journal->j_fs_dev != journal->j_dev) &&
 	    (journal->j_flags & JBD2_BARRIER))
-		blkdev_issue_flush(journal->j_fs_dev, GFP_KERNEL, NULL);
+		blkdev_issue_flush(journal->j_fs_dev, GFP_NOFS, NULL);
 
 	/* Done it all: now write the commit record asynchronously. */
 	if (JBD2_HAS_INCOMPAT_FEATURE(journal,
@@ -859,7 +859,7 @@ wait_for_iobuf:
 	if (JBD2_HAS_INCOMPAT_FEATURE(journal,
 				      JBD2_FEATURE_INCOMPAT_ASYNC_COMMIT) &&
 	    journal->j_flags & JBD2_BARRIER) {
-		blkdev_issue_flush(journal->j_dev, GFP_KERNEL, NULL);
+		blkdev_issue_flush(journal->j_dev, GFP_NOFS, NULL);
 	}
 
 	if (err)
-- 
1.7.10




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

* [ 027/167] [PATCH] USB: serial: cp210x: Fixed usb_control_msg timeout values
  2012-05-09  5:50 [ 000/167] 3.2.17-stable review Ben Hutchings
                   ` (25 preceding siblings ...)
  2012-05-09  5:50 ` [ 026/167] [PATCH] jbd2: use GFP_NOFS for blkdev_issue_flush Ben Hutchings
@ 2012-05-09  5:50 ` Ben Hutchings
  2012-05-09  5:50 ` [ 028/167] [PATCH] pch_uart: Fix dma channel unallocated issue Ben Hutchings
                   ` (139 subsequent siblings)
  166 siblings, 0 replies; 195+ messages in thread
From: Ben Hutchings @ 2012-05-09  5:50 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: torvalds, akpm, alan, Yuri Matylitski, Kirill A. Shutemov,
	Greg Kroah-Hartman

3.2-stable review patch.  If anyone has any objections, please let me know.

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

From: Yuri Matylitski <ym@tekinsoft.com>

commit 2d5733fcd33dd451022d197cb6b476e970519ca7 upstream.

Fixed too small hardcoded timeout values for usb_control_msg
in driver for SiliconLabs cp210x-based usb-to-serial adapters.
Replaced with USB_CTRL_GET_TIMEOUT/USB_CTRL_SET_TIMEOUT.

Signed-off-by: Yuri Matylitski <ym@tekinsoft.com>
Acked-by: Kirill A. Shutemov <kirill@shutemov.name>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
---
 drivers/usb/serial/cp210x.c |    9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/drivers/usb/serial/cp210x.c b/drivers/usb/serial/cp210x.c
index 0310e2d..ec30f95 100644
--- a/drivers/usb/serial/cp210x.c
+++ b/drivers/usb/serial/cp210x.c
@@ -287,7 +287,8 @@ static int cp210x_get_config(struct usb_serial_port *port, u8 request,
 	/* Issue the request, attempting to read 'size' bytes */
 	result = usb_control_msg(serial->dev, usb_rcvctrlpipe(serial->dev, 0),
 				request, REQTYPE_DEVICE_TO_HOST, 0x0000,
-				port_priv->bInterfaceNumber, buf, size, 300);
+				port_priv->bInterfaceNumber, buf, size,
+				USB_CTRL_GET_TIMEOUT);
 
 	/* Convert data into an array of integers */
 	for (i = 0; i < length; i++)
@@ -340,12 +341,14 @@ static int cp210x_set_config(struct usb_serial_port *port, u8 request,
 		result = usb_control_msg(serial->dev,
 				usb_sndctrlpipe(serial->dev, 0),
 				request, REQTYPE_HOST_TO_DEVICE, 0x0000,
-				port_priv->bInterfaceNumber, buf, size, 300);
+				port_priv->bInterfaceNumber, buf, size,
+				USB_CTRL_SET_TIMEOUT);
 	} else {
 		result = usb_control_msg(serial->dev,
 				usb_sndctrlpipe(serial->dev, 0),
 				request, REQTYPE_HOST_TO_DEVICE, data[0],
-				port_priv->bInterfaceNumber, NULL, 0, 300);
+				port_priv->bInterfaceNumber, NULL, 0,
+				USB_CTRL_SET_TIMEOUT);
 	}
 
 	kfree(buf);
-- 
1.7.10




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

* [ 028/167] [PATCH] pch_uart: Fix dma channel unallocated issue
  2012-05-09  5:50 [ 000/167] 3.2.17-stable review Ben Hutchings
                   ` (26 preceding siblings ...)
  2012-05-09  5:50 ` [ 027/167] [PATCH] USB: serial: cp210x: Fixed usb_control_msg timeout values Ben Hutchings
@ 2012-05-09  5:50 ` Ben Hutchings
  2012-05-09  5:50 ` [ 029/167] [PATCH] drivers/tty/amiserial.c: add missing tty_unlock Ben Hutchings
                   ` (138 subsequent siblings)
  166 siblings, 0 replies; 195+ messages in thread
From: Ben Hutchings @ 2012-05-09  5:50 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: torvalds, akpm, alan, Tomoya MORINAGA, Greg Kroah-Hartman

3.2-stable review patch.  If anyone has any objections, please let me know.

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

From: Tomoya MORINAGA <tomoya.rohm@gmail.com>

commit af6d17cdc8c89aeb3101f0d27cd32fc0592b40b2 upstream.

This driver anticipates pch_uart_verify_port() is not called
during installation.
However, actually pch_uart_verify_port() is called during
installation.
As a result, memory access violation occurs like below.

0. initial value: use_dma=0
1. starup()
    - dma channel is not allocated because use_dma=0
2. pch_uart_verify_port()
    - Set use_dma=1
3. UART processing acts DMA mode because use_dma=1
     - memory access violation occurs!

This patch fixes the issue.

Solution:
Whenever pch_uart_verify_port() is called and then
dma channel is not allocated, the channel should be allocated.

Signed-off-by: Tomoya MORINAGA <tomoya.rohm@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
[bwh: Backported to 3.2: adjust context]
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
---
 drivers/tty/serial/pch_uart.c |    4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/tty/serial/pch_uart.c b/drivers/tty/serial/pch_uart.c
index bbbec4a..c2816f4 100644
--- a/drivers/tty/serial/pch_uart.c
+++ b/drivers/tty/serial/pch_uart.c
@@ -1447,9 +1447,11 @@ static int pch_uart_verify_port(struct uart_port *port,
 			__func__);
 		return -EOPNOTSUPP;
 #endif
-		priv->use_dma = 1;
 		priv->use_dma_flag = 1;
 		dev_info(priv->port.dev, "PCH UART : Use DMA Mode\n");
+		if (!priv->use_dma)
+			pch_request_dma(port);
+		priv->use_dma = 1;
 	}
 
 	return 0;
-- 
1.7.10




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

* [ 029/167] [PATCH] drivers/tty/amiserial.c: add missing tty_unlock
  2012-05-09  5:50 [ 000/167] 3.2.17-stable review Ben Hutchings
                   ` (27 preceding siblings ...)
  2012-05-09  5:50 ` [ 028/167] [PATCH] pch_uart: Fix dma channel unallocated issue Ben Hutchings
@ 2012-05-09  5:50 ` Ben Hutchings
  2012-05-09  5:50 ` [ 030/167] [PATCH] USB: sierra: avoid QMI/wwan interface on MC77xx Ben Hutchings
                   ` (137 subsequent siblings)
  166 siblings, 0 replies; 195+ messages in thread
From: Ben Hutchings @ 2012-05-09  5:50 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: torvalds, akpm, alan, Julia Lawall, Jiri Slaby, Greg Kroah-Hartman

3.2-stable review patch.  If anyone has any objections, please let me know.

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

From: Julia Lawall <Julia.Lawall@lip6.fr>

commit d3a7b83f865b46bb7b5e1ed18a129ce1af349db4 upstream.

tty_unlock is used on all other exits from the function.

Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
Acked-by: Jiri Slaby <jslaby@suse.cz>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
---
 drivers/tty/amiserial.c |    4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

--- a/drivers/tty/amiserial.c
+++ b/drivers/tty/amiserial.c
@@ -1113,8 +1113,10 @@ static int set_serial_info(struct async_
 		    (new_serial.close_delay != state->close_delay) ||
 		    (new_serial.xmit_fifo_size != state->xmit_fifo_size) ||
 		    ((new_serial.flags & ~ASYNC_USR_MASK) !=
-		     (state->flags & ~ASYNC_USR_MASK)))
+		     (state->flags & ~ASYNC_USR_MASK))) {
+			tty_unlock();
 			return -EPERM;
+		}
 		state->flags = ((state->flags & ~ASYNC_USR_MASK) |
 			       (new_serial.flags & ASYNC_USR_MASK));
 		info->flags = ((info->flags & ~ASYNC_USR_MASK) |



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

* [ 030/167] [PATCH] USB: sierra: avoid QMI/wwan interface on MC77xx
  2012-05-09  5:50 [ 000/167] 3.2.17-stable review Ben Hutchings
                   ` (28 preceding siblings ...)
  2012-05-09  5:50 ` [ 029/167] [PATCH] drivers/tty/amiserial.c: add missing tty_unlock Ben Hutchings
@ 2012-05-09  5:50 ` Ben Hutchings
  2012-05-09  5:51 ` [ 031/167] [PATCH] EHCI: fix criterion for resuming the root hub Ben Hutchings
                   ` (136 subsequent siblings)
  166 siblings, 0 replies; 195+ messages in thread
From: Ben Hutchings @ 2012-05-09  5:50 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: torvalds, akpm, alan, Bjørn Mork, Greg Kroah-Hartman

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

3.2-stable review patch.  If anyone has any objections, please let me know.

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

From: =?UTF-8?q?Bj=C3=B8rn=20Mork?= <bjorn@mork.no>

commit 749541d19e70905e3971f2a08335a206a98e4d0c upstream.

These devices have a number of non serial interfaces as well.  Use
the existing "Direct IP" blacklist to prevent binding to interfaces
which are handled by other drivers.

We also extend the "Direct IP" blacklist with with interfaces only
seen in "QMI" mode, assuming that these devices use the same
interface numbers for serial interfaces both in "Direct IP" and in
"QMI" mode.

Signed-off-by: Bjørn Mork <bjorn@mork.no>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
---
 drivers/usb/serial/sierra.c |    6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/usb/serial/sierra.c b/drivers/usb/serial/sierra.c
index fdd5aa2..8c8bf80 100644
--- a/drivers/usb/serial/sierra.c
+++ b/drivers/usb/serial/sierra.c
@@ -221,7 +221,7 @@ static const struct sierra_iface_info typeB_interface_list = {
 };
 
 /* 'blacklist' of interfaces not served by this driver */
-static const u8 direct_ip_non_serial_ifaces[] = { 7, 8, 9, 10, 11 };
+static const u8 direct_ip_non_serial_ifaces[] = { 7, 8, 9, 10, 11, 19, 20 };
 static const struct sierra_iface_info direct_ip_interface_blacklist = {
 	.infolen = ARRAY_SIZE(direct_ip_non_serial_ifaces),
 	.ifaceinfo = direct_ip_non_serial_ifaces,
@@ -289,7 +289,6 @@ static const struct usb_device_id id_table[] = {
 	{ USB_DEVICE(0x1199, 0x6856) },	/* Sierra Wireless AirCard 881 U */
 	{ USB_DEVICE(0x1199, 0x6859) },	/* Sierra Wireless AirCard 885 E */
 	{ USB_DEVICE(0x1199, 0x685A) },	/* Sierra Wireless AirCard 885 E */
-	{ USB_DEVICE(0x1199, 0x68A2) }, /* Sierra Wireless MC7710 */
 	/* Sierra Wireless C885 */
 	{ USB_DEVICE_AND_INTERFACE_INFO(0x1199, 0x6880, 0xFF, 0xFF, 0xFF)},
 	/* Sierra Wireless C888, Air Card 501, USB 303, USB 304 */
@@ -299,6 +298,9 @@ static const struct usb_device_id id_table[] = {
 	/* Sierra Wireless HSPA Non-Composite Device */
 	{ USB_DEVICE_AND_INTERFACE_INFO(0x1199, 0x6892, 0xFF, 0xFF, 0xFF)},
 	{ USB_DEVICE(0x1199, 0x6893) },	/* Sierra Wireless Device */
+	{ USB_DEVICE(0x1199, 0x68A2),   /* Sierra Wireless MC77xx in QMI mode */
+	  .driver_info = (kernel_ulong_t)&direct_ip_interface_blacklist
+	},
 	{ USB_DEVICE(0x1199, 0x68A3), 	/* Sierra Wireless Direct IP modems */
 	  .driver_info = (kernel_ulong_t)&direct_ip_interface_blacklist
 	},
-- 
1.7.10




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

* [ 031/167] [PATCH] EHCI: fix criterion for resuming the root hub
  2012-05-09  5:50 [ 000/167] 3.2.17-stable review Ben Hutchings
                   ` (29 preceding siblings ...)
  2012-05-09  5:50 ` [ 030/167] [PATCH] USB: sierra: avoid QMI/wwan interface on MC77xx Ben Hutchings
@ 2012-05-09  5:51 ` Ben Hutchings
  2012-05-09  5:51 ` [ 032/167] [PATCH] EHCI: always clear the STS_FLR status bit Ben Hutchings
                   ` (135 subsequent siblings)
  166 siblings, 0 replies; 195+ messages in thread
From: Ben Hutchings @ 2012-05-09  5:51 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: torvalds, akpm, alan, Alan Stern, Peter Chen, Greg Kroah-Hartman

3.2-stable review patch.  If anyone has any objections, please let me know.

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

From: Alan Stern <stern@rowland.harvard.edu>

commit dc75ce9d929aabeb0843a6b1a4ab320e58ba1597 upstream.

This patch (as1542) changes the criterion ehci-hcd uses to tell when
it needs to resume the controller's root hub.  A resume is needed when
a port status change is detected, obviously, but only if the root hub
is currently suspended.

Right now the driver tests whether the root hub is running, and that
is not the correct test.  In particular, if the controller has died
then the root hub should not be restarted.  In addition, some buggy
hardware occasionally requires the root hub to be running and
sending out SOF packets even while it is nominally supposed to be
suspended.

In the end, the test needs to be changed.  Rather than checking whether
the root hub is currently running, the driver will now check whether
the root hub is currently suspended.  This will yield the correct
behavior in all cases.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
CC: Peter Chen <B29397@freescale.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
---
 drivers/usb/host/ehci-hcd.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/usb/host/ehci-hcd.c b/drivers/usb/host/ehci-hcd.c
index 806cc95..95ca07a 100644
--- a/drivers/usb/host/ehci-hcd.c
+++ b/drivers/usb/host/ehci-hcd.c
@@ -910,7 +910,7 @@ static irqreturn_t ehci_irq (struct usb_hcd *hcd)
 		pcd_status = status;
 
 		/* resume root hub? */
-		if (!(cmd & CMD_RUN))
+		if (ehci->rh_state == EHCI_RH_SUSPENDED)
 			usb_hcd_resume_root_hub(hcd);
 
 		/* get per-port change detect bits */
-- 
1.7.10




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

* [ 032/167] [PATCH] EHCI: always clear the STS_FLR status bit
  2012-05-09  5:50 [ 000/167] 3.2.17-stable review Ben Hutchings
                   ` (30 preceding siblings ...)
  2012-05-09  5:51 ` [ 031/167] [PATCH] EHCI: fix criterion for resuming the root hub Ben Hutchings
@ 2012-05-09  5:51 ` Ben Hutchings
  2012-05-09  5:51 ` [ 033/167] [PATCH] USB: fix deadlock in bConfigurationValue attribute method Ben Hutchings
                   ` (134 subsequent siblings)
  166 siblings, 0 replies; 195+ messages in thread
From: Ben Hutchings @ 2012-05-09  5:51 UTC (permalink / raw)
  To: linux-kernel, stable; +Cc: torvalds, akpm, alan, Alan Stern, Greg Kroah-Hartman

3.2-stable review patch.  If anyone has any objections, please let me know.

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

From: Alan Stern <stern@rowland.harvard.edu>

commit 2fbe2bf1fd37f9d99950bd8d8093623cf22cf08b upstream.

This patch (as1544) fixes a problem affecting some EHCI controllers.
They can generate interrupts whenever the STS_FLR status bit is turned
on, even though that bit is masked out in the Interrupt Enable
register.

Since the driver doesn't use STS_FLR anyway, the patch changes the
interrupt routine to clear that bit whenever it is set, rather than
leaving it alone.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Reported-and-tested-by: Tomoya MORINAGA <tomoya.rohm@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
---
 drivers/usb/host/ehci-hcd.c |    7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/drivers/usb/host/ehci-hcd.c b/drivers/usb/host/ehci-hcd.c
index 95ca07a..4a3bc5b 100644
--- a/drivers/usb/host/ehci-hcd.c
+++ b/drivers/usb/host/ehci-hcd.c
@@ -858,8 +858,13 @@ static irqreturn_t ehci_irq (struct usb_hcd *hcd)
 		goto dead;
 	}
 
+	/*
+	 * We don't use STS_FLR, but some controllers don't like it to
+	 * remain on, so mask it out along with the other status bits.
+	 */
+	masked_status = status & (INTR_MASK | STS_FLR);
+
 	/* Shared IRQ? */
-	masked_status = status & INTR_MASK;
 	if (!masked_status || unlikely(ehci->rh_state == EHCI_RH_HALTED)) {
 		spin_unlock(&ehci->lock);
 		return IRQ_NONE;
-- 
1.7.10




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

* [ 033/167] [PATCH] USB: fix deadlock in bConfigurationValue attribute method
  2012-05-09  5:50 [ 000/167] 3.2.17-stable review Ben Hutchings
                   ` (31 preceding siblings ...)
  2012-05-09  5:51 ` [ 032/167] [PATCH] EHCI: always clear the STS_FLR status bit Ben Hutchings
@ 2012-05-09  5:51 ` Ben Hutchings
  2012-05-09  5:51 ` [ 034/167] [PATCH] usb: gadget: udc-core: stop UDC on device-initiated disconnect Ben Hutchings
                   ` (133 subsequent siblings)
  166 siblings, 0 replies; 195+ messages in thread
From: Ben Hutchings @ 2012-05-09  5:51 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: torvalds, akpm, alan, Alan Stern, Sarah Sharp, Greg Kroah-Hartman

3.2-stable review patch.  If anyone has any objections, please let me know.

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

From: Alan Stern <stern@rowland.harvard.edu>

commit 8963c487a80b4688c9e68dcc504a90074aacc145 upstream.

This patch (as154) fixes a self-deadlock that occurs when userspace
writes to the bConfigurationValue sysfs attribute for a hub with
children.  The task tries to lock the bandwidth_mutex at a time when
it already owns the lock:

	The attribute's method calls usb_set_configuration(),
	which calls usb_disable_device() with the bandwidth_mutex
	held.

	usb_disable_device() unregisters the existing interfaces,
	which causes the hub driver to be unbound.

	The hub_disconnect() routine calls hub_quiesce(), which
	calls usb_disconnect() for each of the hub's children.

	usb_disconnect() attempts to acquire the bandwidth_mutex
	around a call to usb_disable_device().

The solution is to make usb_disable_device() acquire the mutex for
itself instead of requiring the caller to hold it.  Then the mutex can
cover only the bandwidth deallocation operation and not the region
where the interfaces are unregistered.

This has the potential to change system behavior slightly when a
config change races with another config or altsetting change.  Some of
the bandwidth released from the old config might get claimed by the
other config or altsetting, make it impossible to restore the old
config in case of a failure.  But since we don't try to recover from
config-change failures anyway, this doesn't matter.

[This should be marked for stable kernels that contain the commit
fccf4e86200b8f5edd9a65da26f150e32ba79808 "USB: Free bandwidth when
usb_disable_device is called."
That commit was marked for stable kernels as old as 2.6.32.]

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Sarah Sharp <sarah.a.sharp@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
---
 drivers/usb/core/hub.c     |    3 ---
 drivers/usb/core/message.c |    6 +++---
 2 files changed, 3 insertions(+), 6 deletions(-)

diff --git a/drivers/usb/core/hub.c b/drivers/usb/core/hub.c
index a2aa9d6..ec6c97d 100644
--- a/drivers/usb/core/hub.c
+++ b/drivers/usb/core/hub.c
@@ -1667,7 +1667,6 @@ void usb_disconnect(struct usb_device **pdev)
 {
 	struct usb_device	*udev = *pdev;
 	int			i;
-	struct usb_hcd		*hcd = bus_to_hcd(udev->bus);
 
 	/* mark the device as inactive, so any further urb submissions for
 	 * this device (and any of its children) will fail immediately.
@@ -1690,9 +1689,7 @@ void usb_disconnect(struct usb_device **pdev)
 	 * so that the hardware is now fully quiesced.
 	 */
 	dev_dbg (&udev->dev, "unregistering device\n");
-	mutex_lock(hcd->bandwidth_mutex);
 	usb_disable_device(udev, 0);
-	mutex_unlock(hcd->bandwidth_mutex);
 	usb_hcd_synchronize_unlinks(udev);
 
 	usb_remove_ep_devs(&udev->ep0);
diff --git a/drivers/usb/core/message.c b/drivers/usb/core/message.c
index aed3e07..ca717da 100644
--- a/drivers/usb/core/message.c
+++ b/drivers/usb/core/message.c
@@ -1136,8 +1136,6 @@ void usb_disable_interface(struct usb_device *dev, struct usb_interface *intf,
  * Deallocates hcd/hardware state for the endpoints (nuking all or most
  * pending urbs) and usbcore state for the interfaces, so that usbcore
  * must usb_set_configuration() before any interfaces could be used.
- *
- * Must be called with hcd->bandwidth_mutex held.
  */
 void usb_disable_device(struct usb_device *dev, int skip_ep0)
 {
@@ -1190,7 +1188,9 @@ void usb_disable_device(struct usb_device *dev, int skip_ep0)
 			usb_disable_endpoint(dev, i + USB_DIR_IN, false);
 		}
 		/* Remove endpoints from the host controller internal state */
+		mutex_lock(hcd->bandwidth_mutex);
 		usb_hcd_alloc_bandwidth(dev, NULL, NULL, NULL);
+		mutex_unlock(hcd->bandwidth_mutex);
 		/* Second pass: remove endpoint pointers */
 	}
 	for (i = skip_ep0; i < 16; ++i) {
@@ -1750,7 +1750,6 @@ free_interfaces:
 	/* if it's already configured, clear out old state first.
 	 * getting rid of old interfaces means unbinding their drivers.
 	 */
-	mutex_lock(hcd->bandwidth_mutex);
 	if (dev->state != USB_STATE_ADDRESS)
 		usb_disable_device(dev, 1);	/* Skip ep0 */
 
@@ -1763,6 +1762,7 @@ free_interfaces:
 	 * host controller will not allow submissions to dropped endpoints.  If
 	 * this call fails, the device state is unchanged.
 	 */
+	mutex_lock(hcd->bandwidth_mutex);
 	ret = usb_hcd_alloc_bandwidth(dev, cp, NULL, NULL);
 	if (ret < 0) {
 		mutex_unlock(hcd->bandwidth_mutex);
-- 
1.7.10




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

* [ 034/167] [PATCH] usb: gadget: udc-core: stop UDC on device-initiated disconnect
  2012-05-09  5:50 [ 000/167] 3.2.17-stable review Ben Hutchings
                   ` (32 preceding siblings ...)
  2012-05-09  5:51 ` [ 033/167] [PATCH] USB: fix deadlock in bConfigurationValue attribute method Ben Hutchings
@ 2012-05-09  5:51 ` Ben Hutchings
  2012-05-09 19:19   ` Herton Ronaldo Krzesinski
  2012-05-09  5:51 ` [ 035/167] [PATCH] usb: gadget: udc-core: fix asymmetric calls in remove_driver Ben Hutchings
                   ` (132 subsequent siblings)
  166 siblings, 1 reply; 195+ messages in thread
From: Ben Hutchings @ 2012-05-09  5:51 UTC (permalink / raw)
  To: linux-kernel, stable; +Cc: torvalds, akpm, alan, Felipe Balbi

3.2-stable review patch.  If anyone has any objections, please let me know.

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

From: Felipe Balbi <balbi@ti.com>

commit 6d258a4c42089229b855fd706622029decf316d6 upstream.

When we want to do device-initiated disconnect,
let's make sure we stop the UDC in order to
e.g. allow lower power states to be achieved by
turning off unnecessary clocks and/or stoping
PHYs.

When reconnecting, call ->udc_start() again to
make sure UDC is reinitialized.

Signed-off-by: Felipe Balbi <balbi@ti.com>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
---
 drivers/usb/gadget/udc-core.c |    4 ++++
 1 file changed, 4 insertions(+)

diff --git a/drivers/usb/gadget/udc-core.c b/drivers/usb/gadget/udc-core.c
index 56da49f..c261887 100644
--- a/drivers/usb/gadget/udc-core.c
+++ b/drivers/usb/gadget/udc-core.c
@@ -411,8 +411,12 @@ static ssize_t usb_udc_softconn_store(struct device *dev,
 	struct usb_udc		*udc = container_of(dev, struct usb_udc, dev);
 
 	if (sysfs_streq(buf, "connect")) {
+		if (udc_is_newstyle(udc))
+			usb_gadget_udc_start(udc->gadget, udc->driver);
 		usb_gadget_connect(udc->gadget);
 	} else if (sysfs_streq(buf, "disconnect")) {
+		if (udc_is_newstyle(udc))
+			usb_gadget_udc_stop(udc->gadget, udc->driver);
 		usb_gadget_disconnect(udc->gadget);
 	} else {
 		dev_err(dev, "unsupported command '%s'\n", buf);
-- 
1.7.10




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

* [ 035/167] [PATCH] usb: gadget: udc-core: fix asymmetric calls in remove_driver
  2012-05-09  5:50 [ 000/167] 3.2.17-stable review Ben Hutchings
                   ` (33 preceding siblings ...)
  2012-05-09  5:51 ` [ 034/167] [PATCH] usb: gadget: udc-core: stop UDC on device-initiated disconnect Ben Hutchings
@ 2012-05-09  5:51 ` Ben Hutchings
  2012-05-09 19:25   ` Herton Ronaldo Krzesinski
  2012-05-09  5:51 ` [ 036/167] [PATCH] usb: gadget: eliminate NULL pointer dereference (bugfix) Ben Hutchings
                   ` (131 subsequent siblings)
  166 siblings, 1 reply; 195+ messages in thread
From: Ben Hutchings @ 2012-05-09  5:51 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: torvalds, akpm, alan, Kishon Vijay Abraham I, Partha Basak, Felipe Balbi

3.2-stable review patch.  If anyone has any objections, please let me know.

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

From: Kishon Vijay Abraham I <kishon@ti.com>

commit 8ae8090c82eb407267001f75b3d256b3bd4ae691 upstream.

During modprobe of gadget driver, pullup is called after
udc_start. In order to make the exit path symmetric when
removing a gadget driver, call pullup before ->udc_stop.

This is needed to avoid issues with PM where udc_stop
disables the module completely (put IP in reset state,
cut functional and interface clocks, and so on), which
prevents us from accessing the IP's address space,
thus creating the possibility of an abort exception
when we try to access IP's address space after clocks
are off.

Signed-off-by: Partha Basak <p-basak2@ti.com>
Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
---
 drivers/usb/gadget/udc-core.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/usb/gadget/udc-core.c b/drivers/usb/gadget/udc-core.c
index c261887..2fa9865 100644
--- a/drivers/usb/gadget/udc-core.c
+++ b/drivers/usb/gadget/udc-core.c
@@ -264,8 +264,8 @@ static void usb_gadget_remove_driver(struct usb_udc *udc)
 	if (udc_is_newstyle(udc)) {
 		udc->driver->disconnect(udc->gadget);
 		udc->driver->unbind(udc->gadget);
-		usb_gadget_udc_stop(udc->gadget, udc->driver);
 		usb_gadget_disconnect(udc->gadget);
+		usb_gadget_udc_stop(udc->gadget, udc->driver);
 	} else {
 		usb_gadget_stop(udc->gadget, udc->driver);
 	}
-- 
1.7.10




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

* [ 036/167] [PATCH] usb: gadget: eliminate NULL pointer dereference (bugfix)
  2012-05-09  5:50 [ 000/167] 3.2.17-stable review Ben Hutchings
                   ` (34 preceding siblings ...)
  2012-05-09  5:51 ` [ 035/167] [PATCH] usb: gadget: udc-core: fix asymmetric calls in remove_driver Ben Hutchings
@ 2012-05-09  5:51 ` Ben Hutchings
  2012-05-09  5:51 ` [ 037/167] [PATCH] usb: musb: omap: fix crash when musb glue (omap) gets initialized Ben Hutchings
                   ` (130 subsequent siblings)
  166 siblings, 0 replies; 195+ messages in thread
From: Ben Hutchings @ 2012-05-09  5:51 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: torvalds, akpm, alan, Andrzej Pietrasiewicz, Kyungmin Park, Felipe Balbi

3.2-stable review patch.  If anyone has any objections, please let me know.

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

From: Andrzej Pietrasiewicz <andrzej.p@samsung.com>

commit 92b0abf80c5c5f0e0d71d1309688a330fd74731b upstream.

usb: gadget: eliminate NULL pointer dereference (bugfix)

This patch fixes a bug which causes NULL pointer dereference in
ffs_ep0_ioctl. The bug happens when the FunctionFS is not bound (either
has not been bound yet or has been bound and then unbound) and can be
reproduced with running the following commands:

$ insmod g_ffs.ko
$ mount -t functionfs func /dev/usbgadget
$ ./null

where null.c is:

#include <fcntl.h>
#include <linux/usb/functionfs.h>

int main(void)
{
	int fd = open("/dev/usbgadget/ep0", O_RDWR);
	ioctl(fd, FUNCTIONFS_CLEAR_HALT);

	return 0;
}

Signed-off-by: Andrzej Pietrasiewicz <andrzej.p@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
---
 drivers/usb/gadget/f_fs.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/usb/gadget/f_fs.c b/drivers/usb/gadget/f_fs.c
index d187ae7..f52cb1a 100644
--- a/drivers/usb/gadget/f_fs.c
+++ b/drivers/usb/gadget/f_fs.c
@@ -712,7 +712,7 @@ static long ffs_ep0_ioctl(struct file *file, unsigned code, unsigned long value)
 	if (code == FUNCTIONFS_INTERFACE_REVMAP) {
 		struct ffs_function *func = ffs->func;
 		ret = func ? ffs_func_revmap_intf(func, value) : -ENODEV;
-	} else if (gadget->ops->ioctl) {
+	} else if (gadget && gadget->ops->ioctl) {
 		ret = gadget->ops->ioctl(gadget, code, value);
 	} else {
 		ret = -ENOTTY;
-- 
1.7.10




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

* [ 037/167] [PATCH] usb: musb: omap: fix crash when musb glue (omap) gets initialized
  2012-05-09  5:50 [ 000/167] 3.2.17-stable review Ben Hutchings
                   ` (35 preceding siblings ...)
  2012-05-09  5:51 ` [ 036/167] [PATCH] usb: gadget: eliminate NULL pointer dereference (bugfix) Ben Hutchings
@ 2012-05-09  5:51 ` Ben Hutchings
  2012-05-09  5:51 ` [ 038/167] [PATCH] usb: musb: omap: fix the error check for pm_runtime_get_sync Ben Hutchings
                   ` (129 subsequent siblings)
  166 siblings, 0 replies; 195+ messages in thread
From: Ben Hutchings @ 2012-05-09  5:51 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: torvalds, akpm, alan, Kishon Vijay Abraham I, Felipe Balbi

3.2-stable review patch.  If anyone has any objections, please let me know.

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

From: Kishon Vijay Abraham I <kishon@ti.com>

commit 3006dc8c627d738693e910c159630e4368c9e86c upstream.

pm_runtime_enable is being called after omap2430_musb_init. Hence
pm_runtime_get_sync in omap2430_musb_init does not have any effect (does
not enable clocks) resulting in a crash during register access. It is
fixed here.

Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
---
 drivers/usb/musb/omap2430.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/usb/musb/omap2430.c b/drivers/usb/musb/omap2430.c
index 3dfd122..0fb4ce8 100644
--- a/drivers/usb/musb/omap2430.c
+++ b/drivers/usb/musb/omap2430.c
@@ -453,14 +453,14 @@ static int __devinit omap2430_probe(struct platform_device *pdev)
 		goto err2;
 	}
 
+	pm_runtime_enable(&pdev->dev);
+
 	ret = platform_device_add(musb);
 	if (ret) {
 		dev_err(&pdev->dev, "failed to register musb device\n");
 		goto err2;
 	}
 
-	pm_runtime_enable(&pdev->dev);
-
 	return 0;
 
 err2:
-- 
1.7.10




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

* [ 038/167] [PATCH] usb: musb: omap: fix the error check for pm_runtime_get_sync
  2012-05-09  5:50 [ 000/167] 3.2.17-stable review Ben Hutchings
                   ` (36 preceding siblings ...)
  2012-05-09  5:51 ` [ 037/167] [PATCH] usb: musb: omap: fix crash when musb glue (omap) gets initialized Ben Hutchings
@ 2012-05-09  5:51 ` Ben Hutchings
  2012-05-09  5:51 ` [ 039/167] [PATCH] PCI: Add quirk for still enabled interrupts on Intel Sandy Bridge GPUs Ben Hutchings
                   ` (128 subsequent siblings)
  166 siblings, 0 replies; 195+ messages in thread
From: Ben Hutchings @ 2012-05-09  5:51 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: torvalds, akpm, alan, Shubhrajyoti D, Kishon Vijay Abraham I,
	Felipe Balbi

3.2-stable review patch.  If anyone has any objections, please let me know.

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

From: Shubhrajyoti D <shubhrajyoti@ti.com>

commit ad579699c4f0274bf522a9252ff9b20c72197e48 upstream.

pm_runtime_get_sync returns a signed integer. In case of errors
it returns a negative value. This patch fixes the error check
by making it signed instead of unsigned thus preventing register
access if get_sync_fails. Also passes the error cause to the
debug message.

Cc:  Kishon Vijay Abraham I <kishon@ti.com>
Signed-off-by: Shubhrajyoti D <shubhrajyoti@ti.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
---
 drivers/usb/musb/omap2430.c |    5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/usb/musb/omap2430.c b/drivers/usb/musb/omap2430.c
index 0fb4ce8..c7785e8 100644
--- a/drivers/usb/musb/omap2430.c
+++ b/drivers/usb/musb/omap2430.c
@@ -282,7 +282,8 @@ static void musb_otg_notifier_work(struct work_struct *data_notifier_work)
 
 static int omap2430_musb_init(struct musb *musb)
 {
-	u32 l, status = 0;
+	u32 l;
+	int status = 0;
 	struct device *dev = musb->controller;
 	struct musb_hdrc_platform_data *plat = dev->platform_data;
 	struct omap_musb_board_data *data = plat->board_data;
@@ -301,7 +302,7 @@ static int omap2430_musb_init(struct musb *musb)
 
 	status = pm_runtime_get_sync(dev);
 	if (status < 0) {
-		dev_err(dev, "pm_runtime_get_sync FAILED");
+		dev_err(dev, "pm_runtime_get_sync FAILED %d\n", status);
 		goto err1;
 	}
 
-- 
1.7.10




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

* [ 039/167] [PATCH] PCI: Add quirk for still enabled interrupts on Intel Sandy Bridge GPUs
  2012-05-09  5:50 [ 000/167] 3.2.17-stable review Ben Hutchings
                   ` (37 preceding siblings ...)
  2012-05-09  5:51 ` [ 038/167] [PATCH] usb: musb: omap: fix the error check for pm_runtime_get_sync Ben Hutchings
@ 2012-05-09  5:51 ` Ben Hutchings
  2012-05-09  5:51 ` [ 040/167] [PATCH] ext4: fix endianness breakage in ext4_split_extent_at() Ben Hutchings
                   ` (127 subsequent siblings)
  166 siblings, 0 replies; 195+ messages in thread
From: Ben Hutchings @ 2012-05-09  5:51 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: torvalds, akpm, alan, Thomas Jarosch, Charlie Suffin, Jesse Barnes

3.2-stable review patch.  If anyone has any objections, please let me know.

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

From: Thomas Jarosch <thomas.jarosch@intra2net.com>

commit f67fd55fa96f7d7295b43ffbc4a97d8f55e473aa upstream.

Some BIOS implementations leave the Intel GPU interrupts enabled,
even though no one is handling them (f.e. i915 driver is never loaded).
Additionally the interrupt destination is not set up properly
and the interrupt ends up -somewhere-.

These spurious interrupts are "sticky" and the kernel disables
the (shared) interrupt line after 100.000+ generated interrupts.

Fix it by disabling the still enabled interrupts.
This resolves crashes often seen on monitor unplug.

Tested on the following boards:
- Intel DH61CR: Affected
- Intel DH67BL: Affected
- Intel S1200KP server board: Affected
- Asus P8H61-M LE: Affected, but system does not crash.
  Probably the IRQ ends up somewhere unnoticed.

According to reports on the net, the Intel DH61WW board is also affected.

Many thanks to Jesse Barnes from Intel for helping
with the register configuration and to Intel in general
for providing public hardware documentation.

Signed-off-by: Thomas Jarosch <thomas.jarosch@intra2net.com>
Tested-by: Charlie Suffin <charlie.suffin@stratus.com>
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
[bwh: Backported to 3.2: adjust context]
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
---
 drivers/pci/quirks.c |   34 ++++++++++++++++++++++++++++++++++
 1 file changed, 34 insertions(+)

--- linux.orig/drivers/pci/quirks.c
+++ linux/drivers/pci/quirks.c
@@ -2906,6 +2906,40 @@
 DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, 0x65f9, quirk_intel_mc_errata);
 DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, 0x65fa, quirk_intel_mc_errata);
 
+/*
+ * Some BIOS implementations leave the Intel GPU interrupts enabled,
+ * even though no one is handling them (f.e. i915 driver is never loaded).
+ * Additionally the interrupt destination is not set up properly
+ * and the interrupt ends up -somewhere-.
+ *
+ * These spurious interrupts are "sticky" and the kernel disables
+ * the (shared) interrupt line after 100.000+ generated interrupts.
+ *
+ * Fix it by disabling the still enabled interrupts.
+ * This resolves crashes often seen on monitor unplug.
+ */
+#define I915_DEIER_REG 0x4400c
+static void __devinit disable_igfx_irq(struct pci_dev *dev)
+{
+	void __iomem *regs = pci_iomap(dev, 0, 0);
+	if (regs == NULL) {
+		dev_warn(&dev->dev, "igfx quirk: Can't iomap PCI device\n");
+		return;
+	}
+
+	/* Check if any interrupt line is still enabled */
+	if (readl(regs + I915_DEIER_REG) != 0) {
+		dev_warn(&dev->dev, "BIOS left Intel GPU interrupts enabled; "
+			"disabling\n");
+
+		writel(0, regs + I915_DEIER_REG);
+	}
+
+	pci_iounmap(dev, regs);
+}
+DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, 0x0102, disable_igfx_irq);
+DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, 0x010a, disable_igfx_irq);
+
 static void pci_do_fixups(struct pci_dev *dev, struct pci_fixup *f,
 			  struct pci_fixup *end)
 {



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

* [ 040/167] [PATCH] ext4: fix endianness breakage in ext4_split_extent_at()
  2012-05-09  5:50 [ 000/167] 3.2.17-stable review Ben Hutchings
                   ` (38 preceding siblings ...)
  2012-05-09  5:51 ` [ 039/167] [PATCH] PCI: Add quirk for still enabled interrupts on Intel Sandy Bridge GPUs Ben Hutchings
@ 2012-05-09  5:51 ` Ben Hutchings
  2012-05-09  5:51 ` [ 041/167] KVM: unmap pages from the iommu when slots are removed Ben Hutchings
                   ` (126 subsequent siblings)
  166 siblings, 0 replies; 195+ messages in thread
From: Ben Hutchings @ 2012-05-09  5:51 UTC (permalink / raw)
  To: linux-kernel, stable; +Cc: torvalds, akpm, alan, Al Viro

3.2-stable review patch.  If anyone has any objections, please let me know.

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

From: Al Viro <viro@zeniv.linux.org.uk>

commit af1584f570b19b0285e4402a0b54731495d31784 upstream.

->ee_len is __le16, so assigning cpu_to_le32() to it is going to do
Bad Things(tm) on big-endian hosts...

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
---
 fs/ext4/extents.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/ext4/extents.c b/fs/ext4/extents.c
index 1421938..1d41838 100644
--- a/fs/ext4/extents.c
+++ b/fs/ext4/extents.c
@@ -2882,7 +2882,7 @@ static int ext4_split_extent_at(handle_t *handle,
 		if (err)
 			goto fix_extent_len;
 		/* update the extent length and mark as initialized */
-		ex->ee_len = cpu_to_le32(ee_len);
+		ex->ee_len = cpu_to_le16(ee_len);
 		ext4_ext_try_to_merge(inode, path, ex);
 		err = ext4_ext_dirty(handle, inode, path + depth);
 		goto out;
-- 
1.7.10




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

* [ 041/167] KVM: unmap pages from the iommu when slots are removed
  2012-05-09  5:50 [ 000/167] 3.2.17-stable review Ben Hutchings
                   ` (39 preceding siblings ...)
  2012-05-09  5:51 ` [ 040/167] [PATCH] ext4: fix endianness breakage in ext4_split_extent_at() Ben Hutchings
@ 2012-05-09  5:51 ` Ben Hutchings
  2012-05-09  5:51 ` [ 042/167] [PATCH] dell-laptop: add 3 machines that has touchpad LED Ben Hutchings
                   ` (125 subsequent siblings)
  166 siblings, 0 replies; 195+ messages in thread
From: Ben Hutchings @ 2012-05-09  5:51 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: torvalds, akpm, alan, Alex Williamson, Marcelo Tosatti, Jonathan Nieder

3.2-stable review patch.  If anyone has any objections, please let me know.

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

From: Alex Williamson <alex.williamson@redhat.com>

commit 32f6daad4651a748a58a3ab6da0611862175722f upstream.

We've been adding new mappings, but not destroying old mappings.
This can lead to a page leak as pages are pinned using
get_user_pages, but only unpinned with put_page if they still
exist in the memslots list on vm shutdown.  A memslot that is
destroyed while an iommu domain is enabled for the guest will
therefore result in an elevated page reference count that is
never cleared.

Additionally, without this fix, the iommu is only programmed
with the first translation for a gpa.  This can result in
peer-to-peer errors if a mapping is destroyed and replaced by a
new mapping at the same gpa as the iommu will still be pointing
to the original, pinned memory address.

Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
---
 include/linux/kvm_host.h |    6 ++++++
 virt/kvm/iommu.c         |   12 ++++++++----
 virt/kvm/kvm_main.c      |    5 +++--
 3 files changed, 17 insertions(+), 6 deletions(-)

--- a/include/linux/kvm_host.h
+++ b/include/linux/kvm_host.h
@@ -554,6 +554,7 @@ void kvm_free_irq_source_id(struct kvm *
 
 #ifdef CONFIG_IOMMU_API
 int kvm_iommu_map_pages(struct kvm *kvm, struct kvm_memory_slot *slot);
+void kvm_iommu_unmap_pages(struct kvm *kvm, struct kvm_memory_slot *slot);
 int kvm_iommu_map_guest(struct kvm *kvm);
 int kvm_iommu_unmap_guest(struct kvm *kvm);
 int kvm_assign_device(struct kvm *kvm,
@@ -567,6 +568,11 @@ static inline int kvm_iommu_map_pages(st
 	return 0;
 }
 
+static inline void kvm_iommu_unmap_pages(struct kvm *kvm,
+					 struct kvm_memory_slot *slot)
+{
+}
+
 static inline int kvm_iommu_map_guest(struct kvm *kvm)
 {
 	return -ENODEV;
--- a/virt/kvm/iommu.c
+++ b/virt/kvm/iommu.c
@@ -285,6 +285,11 @@ static void kvm_iommu_put_pages(struct k
 	}
 }
 
+void kvm_iommu_unmap_pages(struct kvm *kvm, struct kvm_memory_slot *slot)
+{
+	kvm_iommu_put_pages(kvm, slot->base_gfn, slot->npages);
+}
+
 static int kvm_iommu_unmap_memslots(struct kvm *kvm)
 {
 	int i, idx;
@@ -293,10 +298,9 @@ static int kvm_iommu_unmap_memslots(stru
 	idx = srcu_read_lock(&kvm->srcu);
 	slots = kvm_memslots(kvm);
 
-	for (i = 0; i < slots->nmemslots; i++) {
-		kvm_iommu_put_pages(kvm, slots->memslots[i].base_gfn,
-				    slots->memslots[i].npages);
-	}
+	for (i = 0; i < slots->nmemslots; i++)
+		kvm_iommu_unmap_pages(kvm, &slots->memslots[i]);
+
 	srcu_read_unlock(&kvm->srcu, idx);
 
 	return 0;
--- a/virt/kvm/kvm_main.c
+++ b/virt/kvm/kvm_main.c
@@ -796,12 +796,13 @@ skip_lpage:
 	if (r)
 		goto out_free;
 
-	/* map the pages in iommu page table */
+	/* map/unmap the pages in iommu page table */
 	if (npages) {
 		r = kvm_iommu_map_pages(kvm, &new);
 		if (r)
 			goto out_free;
-	}
+	} else
+		kvm_iommu_unmap_pages(kvm, &old);
 
 	r = -ENOMEM;
 	slots = kzalloc(sizeof(struct kvm_memslots), GFP_KERNEL);



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

* [ 042/167] [PATCH] dell-laptop: add 3 machines that has touchpad LED
  2012-05-09  5:50 [ 000/167] 3.2.17-stable review Ben Hutchings
                   ` (40 preceding siblings ...)
  2012-05-09  5:51 ` [ 041/167] KVM: unmap pages from the iommu when slots are removed Ben Hutchings
@ 2012-05-09  5:51 ` Ben Hutchings
  2012-05-09  5:51 ` [ 043/167] [PATCH] dell-laptop: touchpad LED should persist its status after S3 Ben Hutchings
                   ` (124 subsequent siblings)
  166 siblings, 0 replies; 195+ messages in thread
From: Ben Hutchings @ 2012-05-09  5:51 UTC (permalink / raw)
  To: linux-kernel, stable; +Cc: torvalds, akpm, alan, AceLan Kao, Matthew Garrett

3.2-stable review patch.  If anyone has any objections, please let me know.

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

From: AceLan Kao <acelan.kao@canonical.com>

commit 2a748853ca395c48ea75baa250f7cea6f0f23dbf upstream.

Add "Vostro 3555", "Inspiron N311z", and "Inspiron M5110" into quirks,
so that they could have touchpad LED function work.

Signed-off-by: AceLan Kao <acelan.kao@canonical.com>
Signed-off-by: Matthew Garrett <mjg@redhat.com>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
---
 drivers/platform/x86/dell-laptop.c |   27 +++++++++++++++++++++++++++
 1 file changed, 27 insertions(+)

diff --git a/drivers/platform/x86/dell-laptop.c b/drivers/platform/x86/dell-laptop.c
index 50dac0c..27600a1 100644
--- a/drivers/platform/x86/dell-laptop.c
+++ b/drivers/platform/x86/dell-laptop.c
@@ -185,6 +185,33 @@ static struct dmi_system_id __devinitdata dell_quirks[] = {
 		},
 		.driver_data = &quirk_dell_vostro_v130,
 	},
+	{
+		.callback = dmi_matched,
+		.ident = "Dell Vostro 3555",
+		.matches = {
+			DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
+			DMI_MATCH(DMI_PRODUCT_NAME, "Vostro 3555"),
+		},
+		.driver_data = &quirk_dell_vostro_v130,
+	},
+	{
+		.callback = dmi_matched,
+		.ident = "Dell Inspiron N311z",
+		.matches = {
+			DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
+			DMI_MATCH(DMI_PRODUCT_NAME, "Inspiron N311z"),
+		},
+		.driver_data = &quirk_dell_vostro_v130,
+	},
+	{
+		.callback = dmi_matched,
+		.ident = "Dell Inspiron M5110",
+		.matches = {
+			DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
+			DMI_MATCH(DMI_PRODUCT_NAME, "Inspiron M5110"),
+		},
+		.driver_data = &quirk_dell_vostro_v130,
+	},
 };
 
 static struct calling_interface_buffer *buffer;
-- 
1.7.10




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

* [ 043/167] [PATCH] dell-laptop: touchpad LED should persist its status after S3
  2012-05-09  5:50 [ 000/167] 3.2.17-stable review Ben Hutchings
                   ` (41 preceding siblings ...)
  2012-05-09  5:51 ` [ 042/167] [PATCH] dell-laptop: add 3 machines that has touchpad LED Ben Hutchings
@ 2012-05-09  5:51 ` Ben Hutchings
  2012-05-09  5:51 ` [ 044/167] [PATCH] Bluetooth: Add support for Atheros [04ca:3005] Ben Hutchings
                   ` (123 subsequent siblings)
  166 siblings, 0 replies; 195+ messages in thread
From: Ben Hutchings @ 2012-05-09  5:51 UTC (permalink / raw)
  To: linux-kernel, stable; +Cc: torvalds, akpm, alan, AceLan Kao, Matthew Garrett

3.2-stable review patch.  If anyone has any objections, please let me know.

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

From: AceLan Kao <acelan.kao@canonical.com>

commit 2d5de9e84928e35b4d9b46b4d8d5dcaac1cff1fa upstream.

Touchpad LED will not turn on after S3, it will make the touchpad status
doesn't consist with the LED.
By adding one flag to let the LED device restore it's status.

Signed-off-by: AceLan Kao <acelan.kao@canonical.com>
Signed-off-by: Matthew Garrett <mjg@redhat.com>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
---
 drivers/platform/x86/dell-laptop.c |    1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/platform/x86/dell-laptop.c b/drivers/platform/x86/dell-laptop.c
index 27600a1..a05fc9c 100644
--- a/drivers/platform/x86/dell-laptop.c
+++ b/drivers/platform/x86/dell-laptop.c
@@ -641,6 +641,7 @@ static void touchpad_led_set(struct led_classdev *led_cdev,
 static struct led_classdev touchpad_led = {
 	.name = "dell-laptop::touchpad",
 	.brightness_set = touchpad_led_set,
+	.flags = LED_CORE_SUSPENDRESUME,
 };
 
 static int __devinit touchpad_led_init(struct device *dev)
-- 
1.7.10




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

* [ 044/167] [PATCH] Bluetooth: Add support for Atheros [04ca:3005]
  2012-05-09  5:50 [ 000/167] 3.2.17-stable review Ben Hutchings
                   ` (42 preceding siblings ...)
  2012-05-09  5:51 ` [ 043/167] [PATCH] dell-laptop: touchpad LED should persist its status after S3 Ben Hutchings
@ 2012-05-09  5:51 ` Ben Hutchings
  2012-05-09  5:51 ` [ 045/167] Dont limit non-nested epoll paths Ben Hutchings
                   ` (122 subsequent siblings)
  166 siblings, 0 replies; 195+ messages in thread
From: Ben Hutchings @ 2012-05-09  5:51 UTC (permalink / raw)
  To: linux-kernel, stable; +Cc: torvalds, akpm, alan, AceLan Kao, Gustavo Padovan

3.2-stable review patch.  If anyone has any objections, please let me know.

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

From: AceLan Kao <acelan.kao@canonical.com>

commit 55ed7d4d1469eafbe3ad7e8fcd44f5af27845a81 upstream.

Add another vendor specific ID for Atheros AR3012 device.
This chip is wrapped by Lite-On Technology Corp.

output of usb-devices:
T:  Bus=04 Lev=01 Prnt=01 Port=03 Cnt=01 Dev#=  2 Spd=12  MxCh= 0
D:  Ver= 1.10 Cls=e0(wlcon) Sub=01 Prot=01 MxPS=64 #Cfgs=  1
P:  Vendor=04ca ProdID=3005 Rev=00.02
S:  Manufacturer=Atheros Communications
S:  Product=Bluetooth USB Host Controller
S:  SerialNumber=Alaska Day 2006
C:  #Ifs= 2 Cfg#= 1 Atr=e0 MxPwr=100mA
I:  If#= 0 Alt= 0 #EPs= 3 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb
I:  If#= 1 Alt= 0 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb

Signed-off-by: AceLan Kao <acelan.kao@canonical.com>
Signed-off-by: Gustavo Padovan <gustavo@padovan.org>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
---
 drivers/bluetooth/ath3k.c |    2 ++
 drivers/bluetooth/btusb.c |    1 +
 2 files changed, 3 insertions(+)

diff --git a/drivers/bluetooth/ath3k.c b/drivers/bluetooth/ath3k.c
index fa65913..ae9edca 100644
--- a/drivers/bluetooth/ath3k.c
+++ b/drivers/bluetooth/ath3k.c
@@ -74,6 +74,7 @@ static struct usb_device_id ath3k_table[] = {
 	{ USB_DEVICE(0x0CF3, 0x3004) },
 	{ USB_DEVICE(0x0CF3, 0x311D) },
 	{ USB_DEVICE(0x13d3, 0x3375) },
+	{ USB_DEVICE(0x04CA, 0x3005) },
 
 	/* Atheros AR5BBU12 with sflash firmware */
 	{ USB_DEVICE(0x0489, 0xE02C) },
@@ -92,6 +93,7 @@ static struct usb_device_id ath3k_blist_tbl[] = {
 	{ USB_DEVICE(0x0cf3, 0x3004), .driver_info = BTUSB_ATH3012 },
 	{ USB_DEVICE(0x0cf3, 0x311D), .driver_info = BTUSB_ATH3012 },
 	{ USB_DEVICE(0x13d3, 0x3375), .driver_info = BTUSB_ATH3012 },
+	{ USB_DEVICE(0x04ca, 0x3005), .driver_info = BTUSB_ATH3012 },
 
 	{ }	/* Terminating entry */
 };
diff --git a/drivers/bluetooth/btusb.c b/drivers/bluetooth/btusb.c
index 9a5d811..ba89cd0 100644
--- a/drivers/bluetooth/btusb.c
+++ b/drivers/bluetooth/btusb.c
@@ -132,6 +132,7 @@ static struct usb_device_id blacklist_table[] = {
 	{ USB_DEVICE(0x0cf3, 0x3004), .driver_info = BTUSB_ATH3012 },
 	{ USB_DEVICE(0x0cf3, 0x311d), .driver_info = BTUSB_ATH3012 },
 	{ USB_DEVICE(0x13d3, 0x3375), .driver_info = BTUSB_ATH3012 },
+	{ USB_DEVICE(0x04ca, 0x3005), .driver_info = BTUSB_ATH3012 },
 
 	/* Atheros AR5BBU12 with sflash firmware */
 	{ USB_DEVICE(0x0489, 0xe02c), .driver_info = BTUSB_IGNORE },
-- 
1.7.10




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

* [ 045/167] Dont limit non-nested epoll paths
  2012-05-09  5:50 [ 000/167] 3.2.17-stable review Ben Hutchings
                   ` (43 preceding siblings ...)
  2012-05-09  5:51 ` [ 044/167] [PATCH] Bluetooth: Add support for Atheros [04ca:3005] Ben Hutchings
@ 2012-05-09  5:51 ` Ben Hutchings
  2012-05-09  5:51 ` [ 046/167] [PATCH] spi: Fix device unregistration when unregistering the bus master Ben Hutchings
                   ` (121 subsequent siblings)
  166 siblings, 0 replies; 195+ messages in thread
From: Ben Hutchings @ 2012-05-09  5:51 UTC (permalink / raw)
  To: linux-kernel, stable; +Cc: torvalds, akpm, alan, Jason Baron, Jonathan Nieder

3.2-stable review patch.  If anyone has any objections, please let me know.

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

From: Jason Baron <jbaron@redhat.com>

commit 93dc6107a76daed81c07f50215fa6ae77691634f upstream.

Commit 28d82dc1c4ed ("epoll: limit paths") that I did to limit the
number of possible wakeup paths in epoll is causing a few applications
to longer work (dovecot for one).

The original patch is really about limiting the amount of epoll nesting
(since epoll fds can be attached to other fds). Thus, we probably can
allow an unlimited number of paths of depth 1. My current patch limits
it at 1000. And enforce the limits on paths that have a greater depth.

This is captured in: https://bugzilla.redhat.com/show_bug.cgi?id=681578

Signed-off-by: Jason Baron <jbaron@redhat.com>
Cc: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
---
 fs/eventpoll.c |    4 ++++
 1 file changed, 4 insertions(+)

--- a/fs/eventpoll.c
+++ b/fs/eventpoll.c
@@ -988,6 +988,10 @@ static int path_count[PATH_ARR_SIZE];
 
 static int path_count_inc(int nests)
 {
+	/* Allow an arbitrary number of depth 1 paths */
+	if (nests == 0)
+		return 0;
+
 	if (++path_count[nests] > path_limits[nests])
 		return -1;
 	return 0;



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

* [ 046/167] [PATCH] spi: Fix device unregistration when unregistering the bus master
  2012-05-09  5:50 [ 000/167] 3.2.17-stable review Ben Hutchings
                   ` (44 preceding siblings ...)
  2012-05-09  5:51 ` [ 045/167] Dont limit non-nested epoll paths Ben Hutchings
@ 2012-05-09  5:51 ` Ben Hutchings
  2012-05-09 19:33   ` Herton Ronaldo Krzesinski
  2012-05-09  5:51 ` [ 047/167] [PATCH] rt2800: Add support for the Fujitsu Stylistic Q550 Ben Hutchings
                   ` (120 subsequent siblings)
  166 siblings, 1 reply; 195+ messages in thread
From: Ben Hutchings @ 2012-05-09  5:51 UTC (permalink / raw)
  To: linux-kernel, stable; +Cc: torvalds, akpm, alan, Laurent Pinchart, Grant Likely

3.2-stable review patch.  If anyone has any objections, please let me know.

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

From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>

commit 178db7d30f94707efca1a189753c105ef69942ed upstream.

Device are added as children of the bus master's parent device, but
spi_unregister_master() looks for devices to unregister in the bus
master's children. This results in the child devices not being
unregistered.

Fix this by registering devices as direct children of the bus master.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
---
 drivers/spi/spi.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/spi/spi.c b/drivers/spi/spi.c
index 77eae99..b2ccdea 100644
--- a/drivers/spi/spi.c
+++ b/drivers/spi/spi.c
@@ -319,7 +319,7 @@ struct spi_device *spi_alloc_device(struct spi_master *master)
 	}
 
 	spi->master = master;
-	spi->dev.parent = dev;
+	spi->dev.parent = &master->dev;
 	spi->dev.bus = &spi_bus_type;
 	spi->dev.release = spidev_release;
 	device_initialize(&spi->dev);
-- 
1.7.10




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

* [ 047/167] [PATCH] rt2800: Add support for the Fujitsu Stylistic Q550
  2012-05-09  5:50 [ 000/167] 3.2.17-stable review Ben Hutchings
                   ` (45 preceding siblings ...)
  2012-05-09  5:51 ` [ 046/167] [PATCH] spi: Fix device unregistration when unregistering the bus master Ben Hutchings
@ 2012-05-09  5:51 ` Ben Hutchings
  2012-05-09  5:51 ` [ 048/167] [PATCH] rt2x00: Identify rt2800usb chipsets Ben Hutchings
                   ` (119 subsequent siblings)
  166 siblings, 0 replies; 195+ messages in thread
From: Ben Hutchings @ 2012-05-09  5:51 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: torvalds, akpm, alan, Alan Cox, Gertjan van Wingerde, John W. Linville

3.2-stable review patch.  If anyone has any objections, please let me know.

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

From: Alan Cox <alan@linux.intel.com>

commit 3ac44670ad0fca8b6c43b3e4d8494c67c419f494 upstream.

Just another USB identifier.

Signed-off-by: Alan Cox <alan@linux.intel.com>
Acked-by: Gertjan van Wingerde <gwingerde@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
---
 drivers/net/wireless/rt2x00/rt2800usb.c |    2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/net/wireless/rt2x00/rt2800usb.c b/drivers/net/wireless/rt2x00/rt2800usb.c
index 3778763..7d1b6e4 100644
--- a/drivers/net/wireless/rt2x00/rt2800usb.c
+++ b/drivers/net/wireless/rt2x00/rt2800usb.c
@@ -1159,6 +1159,8 @@ static struct usb_device_id rt2800usb_device_table[] = {
 	{ USB_DEVICE(0x7392, 0x7722) },
 	/* Encore */
 	{ USB_DEVICE(0x203d, 0x14a1) },
+	/* Fujitsu Stylistic 550 */
+	{ USB_DEVICE(0x1690, 0x0761) },
 	/* Gemtek */
 	{ USB_DEVICE(0x15a9, 0x0010) },
 	/* Gigabyte */
-- 
1.7.10




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

* [ 048/167] [PATCH] rt2x00: Identify rt2800usb chipsets.
  2012-05-09  5:50 [ 000/167] 3.2.17-stable review Ben Hutchings
                   ` (46 preceding siblings ...)
  2012-05-09  5:51 ` [ 047/167] [PATCH] rt2800: Add support for the Fujitsu Stylistic Q550 Ben Hutchings
@ 2012-05-09  5:51 ` Ben Hutchings
  2012-05-09  5:51 ` [ 049/167] nfsd: fix b0rken error value for setattr on read-only mount Ben Hutchings
                   ` (118 subsequent siblings)
  166 siblings, 0 replies; 195+ messages in thread
From: Ben Hutchings @ 2012-05-09  5:51 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: torvalds, akpm, alan, Gertjan van Wingerde, Ivo van Doorn,
	John W. Linville

3.2-stable review patch.  If anyone has any objections, please let me know.

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

From: Gertjan van Wingerde <gwingerde@gmail.com>

commit bc93eda7e903ff75cefcb6e247ed9b8e9f8e9783 upstream.

According to the latest USB ID database these are all RT2770 / RT2870 / RT307x
devices.

Signed-off-by: Gertjan van Wingerde <gwingerde@gmail.com>
Acked-by: Ivo van Doorn <IvDoorn@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
[bwh: Backported to 3.2: adjust context for previously cherry-picked
 commit d42a179b941a9e4cc6cf41d0f3cbadd75fc48a89 'rt2x00: Add support
 for D-Link DWA-127 to rt2800usb']
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
---
 drivers/net/wireless/rt2x00/rt2800usb.c |   26 ++++++++++++--------------
 1 file changed, 12 insertions(+), 14 deletions(-)

--- linux.orig/drivers/net/wireless/rt2x00/rt2800usb.c
+++ linux/drivers/net/wireless/rt2x00/rt2800usb.c
@@ -914,12 +914,14 @@
 	{ USB_DEVICE(0x050d, 0x8053) },
 	{ USB_DEVICE(0x050d, 0x805c) },
 	{ USB_DEVICE(0x050d, 0x815c) },
+	{ USB_DEVICE(0x050d, 0x825a) },
 	{ USB_DEVICE(0x050d, 0x825b) },
 	{ USB_DEVICE(0x050d, 0x935a) },
 	{ USB_DEVICE(0x050d, 0x935b) },
 	/* Buffalo */
 	{ USB_DEVICE(0x0411, 0x00e8) },
 	{ USB_DEVICE(0x0411, 0x0158) },
+	{ USB_DEVICE(0x0411, 0x015d) },
 	{ USB_DEVICE(0x0411, 0x016f) },
 	{ USB_DEVICE(0x0411, 0x01a2) },
 	/* Corega */
@@ -934,6 +936,8 @@
 	{ USB_DEVICE(0x07d1, 0x3c0e) },
 	{ USB_DEVICE(0x07d1, 0x3c0f) },
 	{ USB_DEVICE(0x07d1, 0x3c11) },
+	{ USB_DEVICE(0x07d1, 0x3c13) },
+	{ USB_DEVICE(0x07d1, 0x3c15) },
 	{ USB_DEVICE(0x07d1, 0x3c16) },
 	{ USB_DEVICE(0x2001, 0x3c1b) },
 	/* Draytek */
@@ -944,6 +948,7 @@
 	{ USB_DEVICE(0x7392, 0x7711) },
 	{ USB_DEVICE(0x7392, 0x7717) },
 	{ USB_DEVICE(0x7392, 0x7718) },
+	{ USB_DEVICE(0x7392, 0x7722) },
 	/* Encore */
 	{ USB_DEVICE(0x203d, 0x1480) },
 	{ USB_DEVICE(0x203d, 0x14a9) },
@@ -978,6 +983,7 @@
 	{ USB_DEVICE(0x1737, 0x0070) },
 	{ USB_DEVICE(0x1737, 0x0071) },
 	{ USB_DEVICE(0x1737, 0x0077) },
+	{ USB_DEVICE(0x1737, 0x0078) },
 	/* Logitec */
 	{ USB_DEVICE(0x0789, 0x0162) },
 	{ USB_DEVICE(0x0789, 0x0163) },
@@ -1001,9 +1007,13 @@
 	{ USB_DEVICE(0x0db0, 0x871b) },
 	{ USB_DEVICE(0x0db0, 0x871c) },
 	{ USB_DEVICE(0x0db0, 0x899a) },
+	/* Ovislink */
+	{ USB_DEVICE(0x1b75, 0x3071) },
+	{ USB_DEVICE(0x1b75, 0x3072) },
 	/* Para */
 	{ USB_DEVICE(0x20b8, 0x8888) },
 	/* Pegatron */
+	{ USB_DEVICE(0x1d4d, 0x0002) },
 	{ USB_DEVICE(0x1d4d, 0x000c) },
 	{ USB_DEVICE(0x1d4d, 0x000e) },
 	{ USB_DEVICE(0x1d4d, 0x0011) },
@@ -1056,7 +1066,9 @@
 	/* Sparklan */
 	{ USB_DEVICE(0x15a9, 0x0006) },
 	/* Sweex */
+	{ USB_DEVICE(0x177f, 0x0153) },
 	{ USB_DEVICE(0x177f, 0x0302) },
+	{ USB_DEVICE(0x177f, 0x0313) },
 	/* U-Media */
 	{ USB_DEVICE(0x157e, 0x300e) },
 	{ USB_DEVICE(0x157e, 0x3013) },
@@ -1140,25 +1152,20 @@
 	{ USB_DEVICE(0x13d3, 0x3322) },
 	/* Belkin */
 	{ USB_DEVICE(0x050d, 0x1003) },
-	{ USB_DEVICE(0x050d, 0x825a) },
 	/* Buffalo */
 	{ USB_DEVICE(0x0411, 0x012e) },
 	{ USB_DEVICE(0x0411, 0x0148) },
 	{ USB_DEVICE(0x0411, 0x0150) },
-	{ USB_DEVICE(0x0411, 0x015d) },
 	/* Corega */
 	{ USB_DEVICE(0x07aa, 0x0041) },
 	{ USB_DEVICE(0x07aa, 0x0042) },
 	{ USB_DEVICE(0x18c5, 0x0008) },
 	/* D-Link */
 	{ USB_DEVICE(0x07d1, 0x3c0b) },
-	{ USB_DEVICE(0x07d1, 0x3c13) },
-	{ USB_DEVICE(0x07d1, 0x3c15) },
 	{ USB_DEVICE(0x07d1, 0x3c17) },
 	{ USB_DEVICE(0x2001, 0x3c17) },
 	/* Edimax */
 	{ USB_DEVICE(0x7392, 0x4085) },
-	{ USB_DEVICE(0x7392, 0x7722) },
 	/* Encore */
 	{ USB_DEVICE(0x203d, 0x14a1) },
 	/* Fujitsu Stylistic 550 */
@@ -1174,19 +1181,13 @@
 	/* LevelOne */
 	{ USB_DEVICE(0x1740, 0x0605) },
 	{ USB_DEVICE(0x1740, 0x0615) },
-	/* Linksys */
-	{ USB_DEVICE(0x1737, 0x0078) },
 	/* Logitec */
 	{ USB_DEVICE(0x0789, 0x0168) },
 	{ USB_DEVICE(0x0789, 0x0169) },
 	/* Motorola */
 	{ USB_DEVICE(0x100d, 0x9032) },
-	/* Ovislink */
-	{ USB_DEVICE(0x1b75, 0x3071) },
-	{ USB_DEVICE(0x1b75, 0x3072) },
 	/* Pegatron */
 	{ USB_DEVICE(0x05a6, 0x0101) },
-	{ USB_DEVICE(0x1d4d, 0x0002) },
 	{ USB_DEVICE(0x1d4d, 0x0010) },
 	/* Planex */
 	{ USB_DEVICE(0x2019, 0x5201) },
@@ -1205,9 +1206,6 @@
 	{ USB_DEVICE(0x083a, 0xc522) },
 	{ USB_DEVICE(0x083a, 0xd522) },
 	{ USB_DEVICE(0x083a, 0xf511) },
-	/* Sweex */
-	{ USB_DEVICE(0x177f, 0x0153) },
-	{ USB_DEVICE(0x177f, 0x0313) },
 	/* Zyxel */
 	{ USB_DEVICE(0x0586, 0x341a) },
 #endif



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

* [ 049/167] nfsd: fix b0rken error value for setattr on read-only mount
  2012-05-09  5:50 [ 000/167] 3.2.17-stable review Ben Hutchings
                   ` (47 preceding siblings ...)
  2012-05-09  5:51 ` [ 048/167] [PATCH] rt2x00: Identify rt2800usb chipsets Ben Hutchings
@ 2012-05-09  5:51 ` Ben Hutchings
  2012-05-09  5:51 ` [ 050/167] [PATCH] nfsd: fix error values returned by nfsd4_lockt() when nfsd_open() fails Ben Hutchings
                   ` (117 subsequent siblings)
  166 siblings, 0 replies; 195+ messages in thread
From: Ben Hutchings @ 2012-05-09  5:51 UTC (permalink / raw)
  To: linux-kernel, stable; +Cc: torvalds, akpm, alan, Al Viro, Jonathan Nieder

3.2-stable review patch.  If anyone has any objections, please let me know.

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

From: Al Viro <viro@zeniv.linux.org.uk>

commit 96f6f98501196d46ce52c2697dd758d9300c63f5 upstream.

..._want_write() returns -EROFS on failure, _not_ an NFS error value.

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
---
 fs/nfsd/nfs4proc.c |    7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

--- a/fs/nfsd/nfs4proc.c
+++ b/fs/nfsd/nfs4proc.c
@@ -812,6 +812,7 @@ nfsd4_setattr(struct svc_rqst *rqstp, st
 	      struct nfsd4_setattr *setattr)
 {
 	__be32 status = nfs_ok;
+	int err;
 
 	if (setattr->sa_iattr.ia_valid & ATTR_SIZE) {
 		nfs4_lock_state();
@@ -823,9 +824,9 @@ nfsd4_setattr(struct svc_rqst *rqstp, st
 			return status;
 		}
 	}
-	status = mnt_want_write(cstate->current_fh.fh_export->ex_path.mnt);
-	if (status)
-		return status;
+	err = mnt_want_write(cstate->current_fh.fh_export->ex_path.mnt);
+	if (err)
+		return nfserrno(err);
 	status = nfs_ok;
 
 	status = check_attr_support(rqstp, cstate, setattr->sa_bmval,



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

* [ 050/167] [PATCH] nfsd: fix error values returned by nfsd4_lockt() when nfsd_open() fails
  2012-05-09  5:50 [ 000/167] 3.2.17-stable review Ben Hutchings
                   ` (48 preceding siblings ...)
  2012-05-09  5:51 ` [ 049/167] nfsd: fix b0rken error value for setattr on read-only mount Ben Hutchings
@ 2012-05-09  5:51 ` Ben Hutchings
  2012-05-09  5:51 ` [ 051/167] nfsd: fix endianness breakage in TEST_STATEID handling Ben Hutchings
                   ` (116 subsequent siblings)
  166 siblings, 0 replies; 195+ messages in thread
From: Ben Hutchings @ 2012-05-09  5:51 UTC (permalink / raw)
  To: linux-kernel, stable; +Cc: torvalds, akpm, alan, Al Viro

3.2-stable review patch.  If anyone has any objections, please let me know.

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

From: Al Viro <viro@zeniv.linux.org.uk>

commit 04da6e9d63427b2d0fd04766712200c250b3278f upstream.

nfsd_open() already returns an NFS error value; only vfs_test_lock()
result needs to be fed through nfserrno().  Broken by commit 55ef12
(nfsd: Ensure nfsv4 calls the underlying filesystem on LOCKT)
three years ago...

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
---
 fs/nfsd/nfs4state.c |   23 +++++++++--------------
 1 file changed, 9 insertions(+), 14 deletions(-)

diff --git a/fs/nfsd/nfs4state.c b/fs/nfsd/nfs4state.c
index 1841f8b..7f71c69 100644
--- a/fs/nfsd/nfs4state.c
+++ b/fs/nfsd/nfs4state.c
@@ -4211,16 +4211,14 @@ out:
  * vfs_test_lock.  (Arguably perhaps test_lock should be done with an
  * inode operation.)
  */
-static int nfsd_test_lock(struct svc_rqst *rqstp, struct svc_fh *fhp, struct file_lock *lock)
+static __be32 nfsd_test_lock(struct svc_rqst *rqstp, struct svc_fh *fhp, struct file_lock *lock)
 {
 	struct file *file;
-	int err;
-
-	err = nfsd_open(rqstp, fhp, S_IFREG, NFSD_MAY_READ, &file);
-	if (err)
-		return err;
-	err = vfs_test_lock(file, lock);
-	nfsd_close(file);
+	__be32 err = nfsd_open(rqstp, fhp, S_IFREG, NFSD_MAY_READ, &file);
+	if (!err) {
+		err = nfserrno(vfs_test_lock(file, lock));
+		nfsd_close(file);
+	}
 	return err;
 }
 
@@ -4234,7 +4232,6 @@ nfsd4_lockt(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate,
 	struct inode *inode;
 	struct file_lock file_lock;
 	struct nfs4_lockowner *lo;
-	int error;
 	__be32 status;
 
 	if (locks_in_grace())
@@ -4280,12 +4277,10 @@ nfsd4_lockt(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate,
 
 	nfs4_transform_lock_offset(&file_lock);
 
-	status = nfs_ok;
-	error = nfsd_test_lock(rqstp, &cstate->current_fh, &file_lock);
-	if (error) {
-		status = nfserrno(error);
+	status = nfsd_test_lock(rqstp, &cstate->current_fh, &file_lock);
+	if (status)
 		goto out;
-	}
+
 	if (file_lock.fl_type != F_UNLCK) {
 		status = nfserr_denied;
 		nfs4_set_lock_denied(&file_lock, &lockt->lt_denied);
-- 
1.7.10




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

* [ 051/167] nfsd: fix endianness breakage in TEST_STATEID handling
  2012-05-09  5:50 [ 000/167] 3.2.17-stable review Ben Hutchings
                   ` (49 preceding siblings ...)
  2012-05-09  5:51 ` [ 050/167] [PATCH] nfsd: fix error values returned by nfsd4_lockt() when nfsd_open() fails Ben Hutchings
@ 2012-05-09  5:51 ` Ben Hutchings
  2012-05-09  5:51 ` [ 052/167] [PATCH] nfsd: fix compose_entry_fh() failure exits Ben Hutchings
                   ` (115 subsequent siblings)
  166 siblings, 0 replies; 195+ messages in thread
From: Ben Hutchings @ 2012-05-09  5:51 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: torvalds, akpm, alan, Al Viro, J. Bruce Fields, Greg Kroah-Hartman

3.2-stable review patch.  If anyone has any objections, please let me know.

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

From: Al Viro <viro@zeniv.linux.org.uk>

From: Al Viro <viro@zeniv.linux.org.uk>

commit 02f5fde5df0ea930e70f93763dd48beff182b208 upstream.

->ts_id_status gets nfs errno, i.e. it's already big-endian; no need
to apply htonl() to it.  Broken by commit 174568 (NFSD: Added TEST_STATEID
operation) last year...

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Cc: "J. Bruce Fields" <bfields@fieldses.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
---
 fs/nfsd/nfs4xdr.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- a/fs/nfsd/nfs4xdr.c
+++ b/fs/nfsd/nfs4xdr.c
@@ -3410,7 +3410,7 @@ nfsd4_encode_test_stateid(struct nfsd4_c
 		nfsd4_decode_stateid(argp, &si);
 		valid = nfs4_validate_stateid(cl, &si);
 		RESERVE_SPACE(4);
-		*p++ = htonl(valid);
+		*p++ = valid;
 		resp->p = p;
 	}
 	nfs4_unlock_state();



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

* [ 052/167] [PATCH] nfsd: fix compose_entry_fh() failure exits
  2012-05-09  5:50 [ 000/167] 3.2.17-stable review Ben Hutchings
                   ` (50 preceding siblings ...)
  2012-05-09  5:51 ` [ 051/167] nfsd: fix endianness breakage in TEST_STATEID handling Ben Hutchings
@ 2012-05-09  5:51 ` Ben Hutchings
  2012-05-09  5:51 ` [ 053/167] [PATCH] btrfs: btrfs_root_readonly() broken on big-endian Ben Hutchings
                   ` (114 subsequent siblings)
  166 siblings, 0 replies; 195+ messages in thread
From: Ben Hutchings @ 2012-05-09  5:51 UTC (permalink / raw)
  To: linux-kernel, stable; +Cc: torvalds, akpm, alan, Al Viro

3.2-stable review patch.  If anyone has any objections, please let me know.

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

From: Al Viro <viro@zeniv.linux.org.uk>

commit efe39651f08813180f37dc508d950fc7d92b29a8 upstream.

Restore the original logics ("fail on mountpoints, negatives and in
case of fh_compose() failures").  Since commit 8177e (nfsd: clean up
readdirplus encoding) that got broken -
	rv = fh_compose(fhp, exp, dchild, &cd->fh);
	if (rv)
	       goto out;
	if (!dchild->d_inode)
		goto out;
	rv = 0;
out:
is equivalent to
	rv = fh_compose(fhp, exp, dchild, &cd->fh);
out:
and the second check has no effect whatsoever...

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
---
 fs/nfsd/nfs3xdr.c |   22 ++++++++--------------
 1 file changed, 8 insertions(+), 14 deletions(-)

diff --git a/fs/nfsd/nfs3xdr.c b/fs/nfsd/nfs3xdr.c
index 08c6e36..43f46cd 100644
--- a/fs/nfsd/nfs3xdr.c
+++ b/fs/nfsd/nfs3xdr.c
@@ -803,13 +803,13 @@ encode_entry_baggage(struct nfsd3_readdirres *cd, __be32 *p, const char *name,
 	return p;
 }
 
-static int
+static __be32
 compose_entry_fh(struct nfsd3_readdirres *cd, struct svc_fh *fhp,
 		const char *name, int namlen)
 {
 	struct svc_export	*exp;
 	struct dentry		*dparent, *dchild;
-	int rv = 0;
+	__be32 rv = nfserr_noent;
 
 	dparent = cd->fh.fh_dentry;
 	exp  = cd->fh.fh_export;
@@ -817,26 +817,20 @@ compose_entry_fh(struct nfsd3_readdirres *cd, struct svc_fh *fhp,
 	if (isdotent(name, namlen)) {
 		if (namlen == 2) {
 			dchild = dget_parent(dparent);
-			if (dchild == dparent) {
-				/* filesystem root - cannot return filehandle for ".." */
-				dput(dchild);
-				return -ENOENT;
-			}
+			/* filesystem root - cannot return filehandle for ".." */
+			if (dchild == dparent)
+				goto out;
 		} else
 			dchild = dget(dparent);
 	} else
 		dchild = lookup_one_len(name, dparent, namlen);
 	if (IS_ERR(dchild))
-		return -ENOENT;
-	rv = -ENOENT;
+		return rv;
 	if (d_mountpoint(dchild))
 		goto out;
-	rv = fh_compose(fhp, exp, dchild, &cd->fh);
-	if (rv)
-		goto out;
 	if (!dchild->d_inode)
 		goto out;
-	rv = 0;
+	rv = fh_compose(fhp, exp, dchild, &cd->fh);
 out:
 	dput(dchild);
 	return rv;
@@ -845,7 +839,7 @@ out:
 static __be32 *encode_entryplus_baggage(struct nfsd3_readdirres *cd, __be32 *p, const char *name, int namlen)
 {
 	struct svc_fh	fh;
-	int err;
+	__be32 err;
 
 	fh_init(&fh, NFS3_FHSIZE);
 	err = compose_entry_fh(cd, &fh, name, namlen);
-- 
1.7.10




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

* [ 053/167] [PATCH] btrfs: btrfs_root_readonly() broken on big-endian
  2012-05-09  5:50 [ 000/167] 3.2.17-stable review Ben Hutchings
                   ` (51 preceding siblings ...)
  2012-05-09  5:51 ` [ 052/167] [PATCH] nfsd: fix compose_entry_fh() failure exits Ben Hutchings
@ 2012-05-09  5:51 ` Ben Hutchings
  2012-05-09  5:51 ` [ 054/167] [PATCH 1/4] ocfs2: ->l_next_free_req breakage " Ben Hutchings
                   ` (113 subsequent siblings)
  166 siblings, 0 replies; 195+ messages in thread
From: Ben Hutchings @ 2012-05-09  5:51 UTC (permalink / raw)
  To: linux-kernel, stable; +Cc: torvalds, akpm, alan, Al Viro

3.2-stable review patch.  If anyone has any objections, please let me know.

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

From: Al Viro <viro@zeniv.linux.org.uk>

commit 6ed3cf2cdfce4c9f1d73171bd3f27d9cb77b734e upstream.

->root_flags is __le64 and all accesses to it go through the helpers
that do proper conversions.  Except for btrfs_root_readonly(), which
checks bit 0 as in host-endian...

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
---
 fs/btrfs/ctree.h |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/btrfs/ctree.h b/fs/btrfs/ctree.h
index 5b8ef8e..3f65a81 100644
--- a/fs/btrfs/ctree.h
+++ b/fs/btrfs/ctree.h
@@ -2166,7 +2166,7 @@ BTRFS_SETGET_STACK_FUNCS(root_last_snapshot, struct btrfs_root_item,
 
 static inline bool btrfs_root_readonly(struct btrfs_root *root)
 {
-	return root->root_item.flags & BTRFS_ROOT_SUBVOL_RDONLY;
+	return (root->root_item.flags & cpu_to_le64(BTRFS_ROOT_SUBVOL_RDONLY)) != 0;
 }
 
 /* struct btrfs_root_backup */
-- 
1.7.10




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

* [ 054/167] [PATCH 1/4] ocfs2: ->l_next_free_req breakage on big-endian
  2012-05-09  5:50 [ 000/167] 3.2.17-stable review Ben Hutchings
                   ` (52 preceding siblings ...)
  2012-05-09  5:51 ` [ 053/167] [PATCH] btrfs: btrfs_root_readonly() broken on big-endian Ben Hutchings
@ 2012-05-09  5:51 ` Ben Hutchings
  2012-05-09  5:51 ` [ 055/167] [PATCH 2/4] ocfs: ->rl_used " Ben Hutchings
                   ` (112 subsequent siblings)
  166 siblings, 0 replies; 195+ messages in thread
From: Ben Hutchings @ 2012-05-09  5:51 UTC (permalink / raw)
  To: linux-kernel, stable; +Cc: torvalds, akpm, alan, Al Viro

3.2-stable review patch.  If anyone has any objections, please let me know.

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

From: Al Viro <viro@zeniv.linux.org.uk>

commit 3a251f04fe97c3d335b745c98e4b377e3c3899f2 upstream.

It's le16, not le32...

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
---
 fs/ocfs2/alloc.c        |    2 +-
 fs/ocfs2/refcounttree.c |    4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/fs/ocfs2/alloc.c b/fs/ocfs2/alloc.c
index 3165aeb..31b9463 100644
--- a/fs/ocfs2/alloc.c
+++ b/fs/ocfs2/alloc.c
@@ -1134,7 +1134,7 @@ static int ocfs2_adjust_rightmost_branch(handle_t *handle,
 	}
 
 	el = path_leaf_el(path);
-	rec = &el->l_recs[le32_to_cpu(el->l_next_free_rec) - 1];
+	rec = &el->l_recs[le16_to_cpu(el->l_next_free_rec) - 1];
 
 	ocfs2_adjust_rightmost_records(handle, et, path, rec);
 
diff --git a/fs/ocfs2/refcounttree.c b/fs/ocfs2/refcounttree.c
index cf78233..a7b7217 100644
--- a/fs/ocfs2/refcounttree.c
+++ b/fs/ocfs2/refcounttree.c
@@ -1036,14 +1036,14 @@ static int ocfs2_get_refcount_cpos_end(struct ocfs2_caching_info *ci,
 
 	tmp_el = left_path->p_node[subtree_root].el;
 	blkno = left_path->p_node[subtree_root+1].bh->b_blocknr;
-	for (i = 0; i < le32_to_cpu(tmp_el->l_next_free_rec); i++) {
+	for (i = 0; i < le16_to_cpu(tmp_el->l_next_free_rec); i++) {
 		if (le64_to_cpu(tmp_el->l_recs[i].e_blkno) == blkno) {
 			*cpos_end = le32_to_cpu(tmp_el->l_recs[i+1].e_cpos);
 			break;
 		}
 	}
 
-	BUG_ON(i == le32_to_cpu(tmp_el->l_next_free_rec));
+	BUG_ON(i == le16_to_cpu(tmp_el->l_next_free_rec));
 
 out:
 	ocfs2_free_path(left_path);
-- 
1.7.10




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

* [ 055/167] [PATCH 2/4] ocfs: ->rl_used breakage on big-endian
  2012-05-09  5:50 [ 000/167] 3.2.17-stable review Ben Hutchings
                   ` (53 preceding siblings ...)
  2012-05-09  5:51 ` [ 054/167] [PATCH 1/4] ocfs2: ->l_next_free_req breakage " Ben Hutchings
@ 2012-05-09  5:51 ` Ben Hutchings
  2012-05-09  5:51 ` [ 056/167] [PATCH 3/4] ocfs2: ->rl_count endianness breakage Ben Hutchings
                   ` (111 subsequent siblings)
  166 siblings, 0 replies; 195+ messages in thread
From: Ben Hutchings @ 2012-05-09  5:51 UTC (permalink / raw)
  To: linux-kernel, stable; +Cc: torvalds, akpm, alan, Al Viro

3.2-stable review patch.  If anyone has any objections, please let me know.

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

From: Al Viro <viro@zeniv.linux.org.uk>

commit e1bf4cc620fd143766ddfcee3b004a1d1bb34fd0 upstream.

it's le16, not le32 or le64...

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
---
 fs/ocfs2/refcounttree.c |    8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/fs/ocfs2/refcounttree.c b/fs/ocfs2/refcounttree.c
index a7b7217..bc90ebc 100644
--- a/fs/ocfs2/refcounttree.c
+++ b/fs/ocfs2/refcounttree.c
@@ -1468,7 +1468,7 @@ static int ocfs2_divide_leaf_refcount_block(struct buffer_head *ref_leaf_bh,
 
 	trace_ocfs2_divide_leaf_refcount_block(
 		(unsigned long long)ref_leaf_bh->b_blocknr,
-		le32_to_cpu(rl->rl_count), le32_to_cpu(rl->rl_used));
+		le32_to_cpu(rl->rl_count), le16_to_cpu(rl->rl_used));
 
 	/*
 	 * XXX: Improvement later.
@@ -2411,7 +2411,7 @@ static int ocfs2_calc_refcount_meta_credits(struct super_block *sb,
 				rb = (struct ocfs2_refcount_block *)
 							prev_bh->b_data;
 
-				if (le64_to_cpu(rb->rf_records.rl_used) +
+				if (le16_to_cpu(rb->rf_records.rl_used) +
 				    recs_add >
 				    le16_to_cpu(rb->rf_records.rl_count))
 					ref_blocks++;
@@ -2476,7 +2476,7 @@ static int ocfs2_calc_refcount_meta_credits(struct super_block *sb,
 	if (prev_bh) {
 		rb = (struct ocfs2_refcount_block *)prev_bh->b_data;
 
-		if (le64_to_cpu(rb->rf_records.rl_used) + recs_add >
+		if (le16_to_cpu(rb->rf_records.rl_used) + recs_add >
 		    le16_to_cpu(rb->rf_records.rl_count))
 			ref_blocks++;
 
@@ -3629,7 +3629,7 @@ int ocfs2_refcounted_xattr_delete_need(struct inode *inode,
 			 * one will split a refcount rec, so totally we need
 			 * clusters * 2 new refcount rec.
 			 */
-			if (le64_to_cpu(rb->rf_records.rl_used) + clusters * 2 >
+			if (le16_to_cpu(rb->rf_records.rl_used) + clusters * 2 >
 			    le16_to_cpu(rb->rf_records.rl_count))
 				ref_blocks++;
 
-- 
1.7.10




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

* [ 056/167] [PATCH 3/4] ocfs2: ->rl_count endianness breakage
  2012-05-09  5:50 [ 000/167] 3.2.17-stable review Ben Hutchings
                   ` (54 preceding siblings ...)
  2012-05-09  5:51 ` [ 055/167] [PATCH 2/4] ocfs: ->rl_used " Ben Hutchings
@ 2012-05-09  5:51 ` Ben Hutchings
  2012-05-09  5:51 ` [ 057/167] [PATCH 4/4] ocfs2: ->e_leaf_clusters " Ben Hutchings
                   ` (110 subsequent siblings)
  166 siblings, 0 replies; 195+ messages in thread
From: Ben Hutchings @ 2012-05-09  5:51 UTC (permalink / raw)
  To: linux-kernel, stable; +Cc: torvalds, akpm, alan, Al Viro

3.2-stable review patch.  If anyone has any objections, please let me know.

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

From: Al Viro <viro@zeniv.linux.org.uk>

commit 28748b325dc2d730ccc312830a91c4ae0c0d9379 upstream.

le16, not le32...

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
---
 fs/ocfs2/refcounttree.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/ocfs2/refcounttree.c b/fs/ocfs2/refcounttree.c
index bc90ebc..9f32d7c 100644
--- a/fs/ocfs2/refcounttree.c
+++ b/fs/ocfs2/refcounttree.c
@@ -1468,7 +1468,7 @@ static int ocfs2_divide_leaf_refcount_block(struct buffer_head *ref_leaf_bh,
 
 	trace_ocfs2_divide_leaf_refcount_block(
 		(unsigned long long)ref_leaf_bh->b_blocknr,
-		le32_to_cpu(rl->rl_count), le16_to_cpu(rl->rl_used));
+		le16_to_cpu(rl->rl_count), le16_to_cpu(rl->rl_used));
 
 	/*
 	 * XXX: Improvement later.
-- 
1.7.10




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

* [ 057/167] [PATCH 4/4] ocfs2: ->e_leaf_clusters endianness breakage
  2012-05-09  5:50 [ 000/167] 3.2.17-stable review Ben Hutchings
                   ` (55 preceding siblings ...)
  2012-05-09  5:51 ` [ 056/167] [PATCH 3/4] ocfs2: ->rl_count endianness breakage Ben Hutchings
@ 2012-05-09  5:51 ` Ben Hutchings
  2012-05-09  5:51 ` [ 058/167] [PATCH] lockd: fix the endianness bug Ben Hutchings
                   ` (109 subsequent siblings)
  166 siblings, 0 replies; 195+ messages in thread
From: Ben Hutchings @ 2012-05-09  5:51 UTC (permalink / raw)
  To: linux-kernel, stable; +Cc: torvalds, akpm, alan, Al Viro

3.2-stable review patch.  If anyone has any objections, please let me know.

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

From: Al Viro <viro@zeniv.linux.org.uk>

commit 72094e43e3af5020510f920321d71f1798fa896d upstream.

le16, not le32...

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
---
 fs/ocfs2/suballoc.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/fs/ocfs2/suballoc.c b/fs/ocfs2/suballoc.c
index ba5d97e..f169da4 100644
--- a/fs/ocfs2/suballoc.c
+++ b/fs/ocfs2/suballoc.c
@@ -600,7 +600,7 @@ static void ocfs2_bg_alloc_cleanup(handle_t *handle,
 		ret = ocfs2_free_clusters(handle, cluster_ac->ac_inode,
 					  cluster_ac->ac_bh,
 					  le64_to_cpu(rec->e_blkno),
-					  le32_to_cpu(rec->e_leaf_clusters));
+					  le16_to_cpu(rec->e_leaf_clusters));
 		if (ret)
 			mlog_errno(ret);
 		/* Try all the clusters to free */
@@ -1628,7 +1628,7 @@ static int ocfs2_bg_discontig_fix_by_rec(struct ocfs2_suballoc_result *res,
 {
 	unsigned int bpc = le16_to_cpu(cl->cl_bpc);
 	unsigned int bitoff = le32_to_cpu(rec->e_cpos) * bpc;
-	unsigned int bitcount = le32_to_cpu(rec->e_leaf_clusters) * bpc;
+	unsigned int bitcount = le16_to_cpu(rec->e_leaf_clusters) * bpc;
 
 	if (res->sr_bit_offset < bitoff)
 		return 0;
-- 
1.7.10




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

* [ 058/167] [PATCH] lockd: fix the endianness bug
  2012-05-09  5:50 [ 000/167] 3.2.17-stable review Ben Hutchings
                   ` (56 preceding siblings ...)
  2012-05-09  5:51 ` [ 057/167] [PATCH 4/4] ocfs2: ->e_leaf_clusters " Ben Hutchings
@ 2012-05-09  5:51 ` Ben Hutchings
  2012-05-09  5:51 ` [ 059/167] [PATCH] usb: dwc3: ep0: increment "actual" on bounced ep0 case Ben Hutchings
                   ` (108 subsequent siblings)
  166 siblings, 0 replies; 195+ messages in thread
From: Ben Hutchings @ 2012-05-09  5:51 UTC (permalink / raw)
  To: linux-kernel, stable; +Cc: torvalds, akpm, alan, Al Viro

3.2-stable review patch.  If anyone has any objections, please let me know.

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

From: Al Viro <viro@zeniv.linux.org.uk>

commit e847469bf77a1d339274074ed068d461f0c872bc upstream.

comparing be32 values for < is not doing the right thing...

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
---
 fs/lockd/clnt4xdr.c |    2 +-
 fs/lockd/clntxdr.c  |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/fs/lockd/clnt4xdr.c b/fs/lockd/clnt4xdr.c
index 3ddcbb1..13ad153 100644
--- a/fs/lockd/clnt4xdr.c
+++ b/fs/lockd/clnt4xdr.c
@@ -241,7 +241,7 @@ static int decode_nlm4_stat(struct xdr_stream *xdr, __be32 *stat)
 	p = xdr_inline_decode(xdr, 4);
 	if (unlikely(p == NULL))
 		goto out_overflow;
-	if (unlikely(*p > nlm4_failed))
+	if (unlikely(ntohl(*p) > ntohl(nlm4_failed)))
 		goto out_bad_xdr;
 	*stat = *p;
 	return 0;
diff --git a/fs/lockd/clntxdr.c b/fs/lockd/clntxdr.c
index 3d35e3e..d269ada 100644
--- a/fs/lockd/clntxdr.c
+++ b/fs/lockd/clntxdr.c
@@ -236,7 +236,7 @@ static int decode_nlm_stat(struct xdr_stream *xdr,
 	p = xdr_inline_decode(xdr, 4);
 	if (unlikely(p == NULL))
 		goto out_overflow;
-	if (unlikely(*p > nlm_lck_denied_grace_period))
+	if (unlikely(ntohl(*p) > ntohl(nlm_lck_denied_grace_period)))
 		goto out_enum;
 	*stat = *p;
 	return 0;
-- 
1.7.10




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

* [ 059/167] [PATCH] usb: dwc3: ep0: increment "actual" on bounced ep0 case
  2012-05-09  5:50 [ 000/167] 3.2.17-stable review Ben Hutchings
                   ` (57 preceding siblings ...)
  2012-05-09  5:51 ` [ 058/167] [PATCH] lockd: fix the endianness bug Ben Hutchings
@ 2012-05-09  5:51 ` Ben Hutchings
  2012-05-09  5:51 ` [ 060/167] [PATCH 01/26] net: fix /proc/net/dev regression Ben Hutchings
                   ` (107 subsequent siblings)
  166 siblings, 0 replies; 195+ messages in thread
From: Ben Hutchings @ 2012-05-09  5:51 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: torvalds, akpm, alan, Felipe Balbi, Greg Kroah-Hartman

3.2-stable review patch.  If anyone has any objections, please let me know.

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

From: Felipe Balbi <balbi@ti.com>

commit cd423dd3634a5232a3019eb372b144619a61cd16 upstream.

due to a HW limitation we have a bounce buffer for ep0
out transfers which are not aligned with MaxPacketSize.

On such case we were not increment r->actual as we should.

This patch fixes that mistake.

Signed-off-by: Felipe Balbi <balbi@ti.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
---
 drivers/usb/dwc3/ep0.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

--- a/drivers/usb/dwc3/ep0.c
+++ b/drivers/usb/dwc3/ep0.c
@@ -583,9 +583,10 @@ static void dwc3_ep0_complete_data(struc
 		dwc->ep0_bounced = false;
 	} else {
 		transferred = ur->length - trb.length;
-		ur->actual += transferred;
 	}
 
+	ur->actual += transferred;
+
 	if ((epnum & 1) && ur->actual < ur->length) {
 		/* for some reason we did not get everything out */
 



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

* [ 060/167] [PATCH 01/26] net: fix /proc/net/dev regression
  2012-05-09  5:50 [ 000/167] 3.2.17-stable review Ben Hutchings
                   ` (58 preceding siblings ...)
  2012-05-09  5:51 ` [ 059/167] [PATCH] usb: dwc3: ep0: increment "actual" on bounced ep0 case Ben Hutchings
@ 2012-05-09  5:51 ` Ben Hutchings
  2012-05-09  5:51 ` [ 061/167] [PATCH] nfsd: dont fail unchecked creates of non-special files Ben Hutchings
                   ` (106 subsequent siblings)
  166 siblings, 0 replies; 195+ messages in thread
From: Ben Hutchings @ 2012-05-09  5:51 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: torvalds, akpm, alan, Eric Dumazet, Ben Greear, Mihai Maruseac,
	David S. Miller

3.2-stable review patch.  If anyone has any objections, please let me know.

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

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

[ Upstream commit 2def16ae6b0c77571200f18ba4be049b03d75579 ]

Commit f04565ddf52 (dev: use name hash for dev_seq_ops) added a second
regression, as some devices are missing from /proc/net/dev if many
devices are defined.

When seq_file buffer is filled, the last ->next/show() method is
canceled (pos value is reverted to value prior ->next() call)

Problem is after above commit, we dont restart the lookup at right
position in ->start() method.

Fix this by removing the internal 'pos' pointer added in commit, since
we need to use the 'loff_t *pos' provided by seq_file layer.

This also reverts commit 5cac98dd0 (net: Fix corruption
in /proc/*/net/dev_mcast), since its not needed anymore.

Reported-by: Ben Greear <greearb@candelatech.com>
Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Cc: Mihai Maruseac <mmaruseac@ixiacom.com>
Tested-by:  Ben Greear <greearb@candelatech.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
---
 include/linux/netdevice.h |    2 --
 net/core/dev.c            |   58 ++++++++++-----------------------------------
 net/core/dev_addr_lists.c |    3 ++-
 3 files changed, 15 insertions(+), 48 deletions(-)

diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h
index a82ad4d..cbeb586 100644
--- a/include/linux/netdevice.h
+++ b/include/linux/netdevice.h
@@ -2536,8 +2536,6 @@ extern void		net_disable_timestamp(void);
 extern void *dev_seq_start(struct seq_file *seq, loff_t *pos);
 extern void *dev_seq_next(struct seq_file *seq, void *v, loff_t *pos);
 extern void dev_seq_stop(struct seq_file *seq, void *v);
-extern int dev_seq_open_ops(struct inode *inode, struct file *file,
-			    const struct seq_operations *ops);
 #endif
 
 extern int netdev_class_create_file(struct class_attribute *class_attr);
diff --git a/net/core/dev.c b/net/core/dev.c
index 55cd370..cd5050e 100644
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -4102,54 +4102,41 @@ static int dev_ifconf(struct net *net, char __user *arg)
 
 #ifdef CONFIG_PROC_FS
 
-#define BUCKET_SPACE (32 - NETDEV_HASHBITS)
-
-struct dev_iter_state {
-	struct seq_net_private p;
-	unsigned int pos; /* bucket << BUCKET_SPACE + offset */
-};
+#define BUCKET_SPACE (32 - NETDEV_HASHBITS - 1)
 
 #define get_bucket(x) ((x) >> BUCKET_SPACE)
 #define get_offset(x) ((x) & ((1 << BUCKET_SPACE) - 1))
 #define set_bucket_offset(b, o) ((b) << BUCKET_SPACE | (o))
 
-static inline struct net_device *dev_from_same_bucket(struct seq_file *seq)
+static inline struct net_device *dev_from_same_bucket(struct seq_file *seq, loff_t *pos)
 {
-	struct dev_iter_state *state = seq->private;
 	struct net *net = seq_file_net(seq);
 	struct net_device *dev;
 	struct hlist_node *p;
 	struct hlist_head *h;
-	unsigned int count, bucket, offset;
+	unsigned int count = 0, offset = get_offset(*pos);
 
-	bucket = get_bucket(state->pos);
-	offset = get_offset(state->pos);
-	h = &net->dev_name_head[bucket];
-	count = 0;
+	h = &net->dev_name_head[get_bucket(*pos)];
 	hlist_for_each_entry_rcu(dev, p, h, name_hlist) {
-		if (count++ == offset) {
-			state->pos = set_bucket_offset(bucket, count);
+		if (++count == offset)
 			return dev;
-		}
 	}
 
 	return NULL;
 }
 
-static inline struct net_device *dev_from_new_bucket(struct seq_file *seq)
+static inline struct net_device *dev_from_bucket(struct seq_file *seq, loff_t *pos)
 {
-	struct dev_iter_state *state = seq->private;
 	struct net_device *dev;
 	unsigned int bucket;
 
-	bucket = get_bucket(state->pos);
 	do {
-		dev = dev_from_same_bucket(seq);
+		dev = dev_from_same_bucket(seq, pos);
 		if (dev)
 			return dev;
 
-		bucket++;
-		state->pos = set_bucket_offset(bucket, 0);
+		bucket = get_bucket(*pos) + 1;
+		*pos = set_bucket_offset(bucket, 1);
 	} while (bucket < NETDEV_HASHENTRIES);
 
 	return NULL;
@@ -4162,33 +4149,20 @@ static inline struct net_device *dev_from_new_bucket(struct seq_file *seq)
 void *dev_seq_start(struct seq_file *seq, loff_t *pos)
 	__acquires(RCU)
 {
-	struct dev_iter_state *state = seq->private;
-
 	rcu_read_lock();
 	if (!*pos)
 		return SEQ_START_TOKEN;
 
-	/* check for end of the hash */
-	if (state->pos == 0 && *pos > 1)
+	if (get_bucket(*pos) >= NETDEV_HASHENTRIES)
 		return NULL;
 
-	return dev_from_new_bucket(seq);
+	return dev_from_bucket(seq, pos);
 }
 
 void *dev_seq_next(struct seq_file *seq, void *v, loff_t *pos)
 {
-	struct net_device *dev;
-
 	++*pos;
-
-	if (v == SEQ_START_TOKEN)
-		return dev_from_new_bucket(seq);
-
-	dev = dev_from_same_bucket(seq);
-	if (dev)
-		return dev;
-
-	return dev_from_new_bucket(seq);
+	return dev_from_bucket(seq, pos);
 }
 
 void dev_seq_stop(struct seq_file *seq, void *v)
@@ -4287,13 +4261,7 @@ static const struct seq_operations dev_seq_ops = {
 static int dev_seq_open(struct inode *inode, struct file *file)
 {
 	return seq_open_net(inode, file, &dev_seq_ops,
-			    sizeof(struct dev_iter_state));
-}
-
-int dev_seq_open_ops(struct inode *inode, struct file *file,
-		     const struct seq_operations *ops)
-{
-	return seq_open_net(inode, file, ops, sizeof(struct dev_iter_state));
+			    sizeof(struct seq_net_private));
 }
 
 static const struct file_operations dev_seq_fops = {
diff --git a/net/core/dev_addr_lists.c b/net/core/dev_addr_lists.c
index febba51..277faef 100644
--- a/net/core/dev_addr_lists.c
+++ b/net/core/dev_addr_lists.c
@@ -696,7 +696,8 @@ static const struct seq_operations dev_mc_seq_ops = {
 
 static int dev_mc_seq_open(struct inode *inode, struct file *file)
 {
-	return dev_seq_open_ops(inode, file, &dev_mc_seq_ops);
+	return seq_open_net(inode, file, &dev_mc_seq_ops,
+			    sizeof(struct seq_net_private));
 }
 
 static const struct file_operations dev_mc_seq_fops = {
-- 
1.7.10




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

* [ 061/167] [PATCH] nfsd: dont fail unchecked creates of non-special files
  2012-05-09  5:50 [ 000/167] 3.2.17-stable review Ben Hutchings
                   ` (59 preceding siblings ...)
  2012-05-09  5:51 ` [ 060/167] [PATCH 01/26] net: fix /proc/net/dev regression Ben Hutchings
@ 2012-05-09  5:51 ` Ben Hutchings
  2012-05-09  7:07   ` Jonathan Nieder
  2012-05-09  5:51 ` [ 062/167] [PATCH 02/26] ppp: Dont stop and restart queue on every TX packet Ben Hutchings
                   ` (105 subsequent siblings)
  166 siblings, 1 reply; 195+ messages in thread
From: Ben Hutchings @ 2012-05-09  5:51 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: torvalds, akpm, alan, J. Bruce Fields, Orion Poplawski

3.2-stable review patch.  If anyone has any objections, please let me know.

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

From: "J. Bruce Fields" <bfields@redhat.com>

commit 9dc4e6c4d1182d34604ea40fef641775f5b15456 upstream.

Allow a v3 unchecked open of a non-regular file succeed as if it were a
lookup; typically a client in such a case will want to fall back on a
local open, so succeeding and giving it the filehandle is more useful
than failing with nfserr_exist, which makes it appear that nothing at
all exists by that name.

Similarly for v4, on an open-create, return the same errors we would on
an attempt to open a non-regular file, instead of returning
nfserr_exist.

This fixes a problem found doing a v4 open of a symlink with
O_RDONLY|O_CREAT, which resulted in the current client returning EEXIST.

Thanks also to Trond for analysis.

Reported-by: Orion Poplawski <orion@cora.nwra.com>
Tested-by: Orion Poplawski <orion@cora.nwra.com>
Signed-off-by: J. Bruce Fields <bfields@redhat.com>
[bwh: Backported to 3.2: use &resfh, not resfh]
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
---
 fs/nfsd/nfs4proc.c |    8 ++++----
 fs/nfsd/vfs.c      |    2 +-
 2 files changed, 5 insertions(+), 5 deletions(-)

--- a/fs/nfsd/nfs4proc.c
+++ b/fs/nfsd/nfs4proc.c
@@ -235,17 +235,17 @@ do_open_lookup(struct svc_rqst *rqstp, struct svc_fh *current_fh, struct nfsd4_o
 		 */
 		if (open->op_createmode == NFS4_CREATE_EXCLUSIVE && status == 0)
 			open->op_bmval[1] = (FATTR4_WORD1_TIME_ACCESS |
-						FATTR4_WORD1_TIME_MODIFY);
+							FATTR4_WORD1_TIME_MODIFY);
 	} else {
 		status = nfsd_lookup(rqstp, current_fh,
 				     open->op_fname.data, open->op_fname.len, &resfh);
 		fh_unlock(current_fh);
-		if (status)
-			goto out;
-		status = nfsd_check_obj_isreg(&resfh);
 	}
 	if (status)
 		goto out;
+	status = nfsd_check_obj_isreg(&resfh);
+	if (status)
+		goto out;
 
 	if (is_create_with_attrs(open) && open->op_acl != NULL)
 		do_set_nfs4_acl(rqstp, &resfh, open->op_acl, open->op_bmval);
--- a/fs/nfsd/vfs.c
+++ b/fs/nfsd/vfs.c
@@ -1458,7 +1458,7 @@ do_nfsd_create(struct svc_rqst *rqstp, struct svc_fh *fhp,
 		switch (createmode) {
 		case NFS3_CREATE_UNCHECKED:
 			if (! S_ISREG(dchild->d_inode->i_mode))
-				err = nfserr_exist;
+				goto out;
 			else if (truncp) {
 				/* in nfsv4, we need to treat this case a little
 				 * differently.  we don't want to truncate the



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

* [ 062/167] [PATCH 02/26] ppp: Dont stop and restart queue on every TX packet
  2012-05-09  5:50 [ 000/167] 3.2.17-stable review Ben Hutchings
                   ` (60 preceding siblings ...)
  2012-05-09  5:51 ` [ 061/167] [PATCH] nfsd: dont fail unchecked creates of non-special files Ben Hutchings
@ 2012-05-09  5:51 ` Ben Hutchings
  2012-05-09  5:51 ` [ 063/167] [PATCH 03/26] tcp: allow splice() to build full TSO packets Ben Hutchings
                   ` (104 subsequent siblings)
  166 siblings, 0 replies; 195+ messages in thread
From: Ben Hutchings @ 2012-05-09  5:51 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: torvalds, akpm, alan, David Woodhouse, David S. Miller

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

3.2-stable review patch.  If anyone has any objections, please let me know.

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

From: David Woodhouse <David.Woodhouse@intel.com>

[ This combines upstream commit
  e675f0cc9a872fd152edc0c77acfed19bf28b81e and follow-on bug fix
  commit 9a5d2bd99e0dfe9a31b3c160073ac445ba3d773f ]

For every transmitted packet, ppp_start_xmit() will stop the netdev
queue and then, if appropriate, restart it. This causes the TX softirq
to run, entirely gratuitously.

This is "only" a waste of CPU time in the normal case, but it's actively
harmful when the PPP device is a TEQL slave — the wakeup will cause the
offending device to receive the next TX packet from the TEQL queue, when
it *should* have gone to the next slave in the list. We end up seeing
large bursts of packets on just *one* slave device, rather than using
the full available bandwidth over all slaves.

This patch fixes the problem by *not* unconditionally stopping the queue
in ppp_start_xmit(). It adds a return value from ppp_xmit_process()
which indicates whether the queue should be stopped or not.

It *doesn't* remove the call to netif_wake_queue() from
ppp_xmit_process(), because other code paths (especially from
ppp_output_wakeup()) need it there and it's messy to push it out to the
other callers to do it based on the return value. So we leave it in
place — it's a no-op in the case where the queue wasn't stopped, so it's
harmless in the TX path.

Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
---
 drivers/net/ppp/ppp_generic.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/net/ppp/ppp_generic.c b/drivers/net/ppp/ppp_generic.c
index 486b404..3ed983c 100644
--- a/drivers/net/ppp/ppp_generic.c
+++ b/drivers/net/ppp/ppp_generic.c
@@ -968,7 +968,6 @@ ppp_start_xmit(struct sk_buff *skb, struct net_device *dev)
 	proto = npindex_to_proto[npi];
 	put_unaligned_be16(proto, pp);
 
-	netif_stop_queue(dev);
 	skb_queue_tail(&ppp->file.xq, skb);
 	ppp_xmit_process(ppp);
 	return NETDEV_TX_OK;
@@ -1063,6 +1062,8 @@ ppp_xmit_process(struct ppp *ppp)
 		   code that we can accept some more. */
 		if (!ppp->xmit_pending && !skb_peek(&ppp->file.xq))
 			netif_wake_queue(ppp->dev);
+		else
+			netif_stop_queue(ppp->dev);
 	}
 	ppp_xmit_unlock(ppp);
 }
-- 
1.7.10




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

* [ 063/167] [PATCH 03/26] tcp: allow splice() to build full TSO packets
  2012-05-09  5:50 [ 000/167] 3.2.17-stable review Ben Hutchings
                   ` (61 preceding siblings ...)
  2012-05-09  5:51 ` [ 062/167] [PATCH 02/26] ppp: Dont stop and restart queue on every TX packet Ben Hutchings
@ 2012-05-09  5:51 ` Ben Hutchings
  2012-05-09  5:51 ` [ 064/167] [PATCH 04/26] sctp: Allow struct sctp_event_subscribe to grow without breaking binaries Ben Hutchings
                   ` (103 subsequent siblings)
  166 siblings, 0 replies; 195+ messages in thread
From: Ben Hutchings @ 2012-05-09  5:51 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: torvalds, akpm, alan, Eric Dumazet, Tom Herbert,
	Nandita Dukkipati, Neal Cardwell, Yuchung Cheng, H.K. Jerry Chu,
	Maciej Żenczykowski, Mahesh Bandewar,
	Ilpo JÀrvinen, David S. Miller

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

3.2-stable review patch.  If anyone has any objections, please let me know.

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

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

[ This combines upstream commit
  2f53384424251c06038ae612e56231b96ab610ee and the follow-on bug fix
  commit 35f9c09fe9c72eb8ca2b8e89a593e1c151f28fc2 ]

vmsplice()/splice(pipe, socket) call do_tcp_sendpages() one page at a
time, adding at most 4096 bytes to an skb. (assuming PAGE_SIZE=4096)

The call to tcp_push() at the end of do_tcp_sendpages() forces an
immediate xmit when pipe is not already filled, and tso_fragment() try
to split these skb to MSS multiples.

4096 bytes are usually split in a skb with 2 MSS, and a remaining
sub-mss skb (assuming MTU=1500)

This makes slow start suboptimal because many small frames are sent to
qdisc/driver layers instead of big ones (constrained by cwnd and packets
in flight of course)

In fact, applications using sendmsg() (adding an additional memory copy)
instead of vmsplice()/splice()/sendfile() are a bit faster because of
this anomaly, especially if serving small files in environments with
large initial [c]wnd.

Call tcp_push() only if MSG_MORE is not set in the flags parameter.

This bit is automatically provided by splice() internals but for the
last page, or on all pages if user specified SPLICE_F_MORE splice()
flag.

In some workloads, this can reduce number of sent logical packets by an
order of magnitude, making zero-copy TCP actually faster than
one-copy :)

Reported-by: Tom Herbert <therbert@google.com>
Cc: Nandita Dukkipati <nanditad@google.com>
Cc: Neal Cardwell <ncardwell@google.com>
Cc: Tom Herbert <therbert@google.com>
Cc: Yuchung Cheng <ycheng@google.com>
Cc: H.K. Jerry Chu <hkchu@google.com>
Cc: Maciej Żenczykowski <maze@google.com>
Cc: Mahesh Bandewar <maheshb@google.com>
Cc: Ilpo Järvinen <ilpo.jarvinen@helsinki.fi>
Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
---
 fs/splice.c            |    5 ++++-
 include/linux/socket.h |    2 +-
 net/ipv4/tcp.c         |    2 +-
 net/socket.c           |    6 +++---
 4 files changed, 9 insertions(+), 6 deletions(-)

diff --git a/fs/splice.c b/fs/splice.c
index fa2defa..6d0dfb8 100644
--- a/fs/splice.c
+++ b/fs/splice.c
@@ -31,6 +31,7 @@
 #include <linux/uio.h>
 #include <linux/security.h>
 #include <linux/gfp.h>
+#include <linux/socket.h>
 
 /*
  * Attempt to steal a page from a pipe buffer. This should perhaps go into
@@ -691,7 +692,9 @@ static int pipe_to_sendpage(struct pipe_inode_info *pipe,
 	if (!likely(file->f_op && file->f_op->sendpage))
 		return -EINVAL;
 
-	more = (sd->flags & SPLICE_F_MORE) || sd->len < sd->total_len;
+	more = (sd->flags & SPLICE_F_MORE) ? MSG_MORE : 0;
+	if (sd->len < sd->total_len)
+		more |= MSG_SENDPAGE_NOTLAST;
 	return file->f_op->sendpage(file, buf->page, buf->offset,
 				    sd->len, &pos, more);
 }
diff --git a/include/linux/socket.h b/include/linux/socket.h
index d0e77f6..ad919e0 100644
--- a/include/linux/socket.h
+++ b/include/linux/socket.h
@@ -265,7 +265,7 @@ struct ucred {
 #define MSG_NOSIGNAL	0x4000	/* Do not generate SIGPIPE */
 #define MSG_MORE	0x8000	/* Sender will send more */
 #define MSG_WAITFORONE	0x10000	/* recvmmsg(): block until 1+ packets avail */
-
+#define MSG_SENDPAGE_NOTLAST 0x20000 /* sendpage() internal : not the last page */
 #define MSG_EOF         MSG_FIN
 
 #define MSG_CMSG_CLOEXEC 0x40000000	/* Set close_on_exit for file
diff --git a/net/ipv4/tcp.c b/net/ipv4/tcp.c
index 34f5db1..36611ab 100644
--- a/net/ipv4/tcp.c
+++ b/net/ipv4/tcp.c
@@ -860,7 +860,7 @@ wait_for_memory:
 	}
 
 out:
-	if (copied)
+	if (copied && !(flags & MSG_SENDPAGE_NOTLAST))
 		tcp_push(sk, flags, mss_now, tp->nonagle);
 	return copied;
 
diff --git a/net/socket.c b/net/socket.c
index 2dce67a..273cbce 100644
--- a/net/socket.c
+++ b/net/socket.c
@@ -791,9 +791,9 @@ static ssize_t sock_sendpage(struct file *file, struct page *page,
 
 	sock = file->private_data;
 
-	flags = !(file->f_flags & O_NONBLOCK) ? 0 : MSG_DONTWAIT;
-	if (more)
-		flags |= MSG_MORE;
+	flags = (file->f_flags & O_NONBLOCK) ? MSG_DONTWAIT : 0;
+	/* more is a combination of MSG_MORE and MSG_SENDPAGE_NOTLAST */
+	flags |= more;
 
 	return kernel_sendpage(sock, page, offset, size, flags);
 }
-- 
1.7.10




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

* [ 064/167] [PATCH 04/26] sctp: Allow struct sctp_event_subscribe to grow without breaking binaries
  2012-05-09  5:50 [ 000/167] 3.2.17-stable review Ben Hutchings
                   ` (62 preceding siblings ...)
  2012-05-09  5:51 ` [ 063/167] [PATCH 03/26] tcp: allow splice() to build full TSO packets Ben Hutchings
@ 2012-05-09  5:51 ` Ben Hutchings
  2012-05-09  5:51   ` Ben Hutchings
                   ` (102 subsequent siblings)
  166 siblings, 0 replies; 195+ messages in thread
From: Ben Hutchings @ 2012-05-09  5:51 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: torvalds, akpm, alan, Thomas Graf, Thomas Graf, Vlad Yasevich,
	David S. Miller

3.2-stable review patch.  If anyone has any objections, please let me know.

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

From: Thomas Graf <tgraf@infradead.org>

[ Upstream commit acdd5985364f8dc511a0762fab2e683f29d9d692 ]

getsockopt(..., SCTP_EVENTS, ...) performs a length check and returns
an error if the user provides less bytes than the size of struct
sctp_event_subscribe.

Struct sctp_event_subscribe needs to be extended by an u8 for every
new event or notification type that is added.

This obviously makes getsockopt fail for binaries that are compiled
against an older versions of <net/sctp/user.h> which do not contain
all event types.

This patch changes getsockopt behaviour to no longer return an error
if not enough bytes are being provided by the user. Instead, it
returns as much of sctp_event_subscribe as fits into the provided buffer.

This leads to the new behavior that users see what they have been aware
of at compile time.

The setsockopt(..., SCTP_EVENTS, ...) API is already behaving like this.

Signed-off-by: Thomas Graf <tgraf@suug.ch>
Acked-by: Vlad Yasevich <vladislav.yasevich@hp.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
---
 net/sctp/socket.c |    5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/net/sctp/socket.c b/net/sctp/socket.c
index 54a7cd2..0075554 100644
--- a/net/sctp/socket.c
+++ b/net/sctp/socket.c
@@ -4133,9 +4133,10 @@ static int sctp_getsockopt_disable_fragments(struct sock *sk, int len,
 static int sctp_getsockopt_events(struct sock *sk, int len, char __user *optval,
 				  int __user *optlen)
 {
-	if (len < sizeof(struct sctp_event_subscribe))
+	if (len <= 0)
 		return -EINVAL;
-	len = sizeof(struct sctp_event_subscribe);
+	if (len > sizeof(struct sctp_event_subscribe))
+		len = sizeof(struct sctp_event_subscribe);
 	if (put_user(len, optlen))
 		return -EFAULT;
 	if (copy_to_user(optval, &sctp_sk(sk)->subscribe, len))
-- 
1.7.10




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

* [ 065/167] [PATCH 05/26] bridge: Do not send queries on multicast group leaves
  2012-05-09  5:50 [ 000/167] 3.2.17-stable review Ben Hutchings
@ 2012-05-09  5:51   ` Ben Hutchings
  2012-05-09  5:50   ` Ben Hutchings
                     ` (165 subsequent siblings)
  166 siblings, 0 replies; 195+ messages in thread
From: Ben Hutchings @ 2012-05-09  5:51 UTC (permalink / raw)
  To: linux-kernel, stable; +Cc: torvalds, akpm, alan, Herbert Xu, David S. Miller

3.2-stable review patch.  If anyone has any objections, please let me know.

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

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

[ Upstream commit 996304bbea3d2a094b7ba54c3bd65d3fffeac57b ]

As it stands the bridge IGMP snooping system will respond to
group leave messages with queries for remaining membership.
This is both unnecessary and undesirable.  First of all any
multicast routers present should be doing this rather than us.
What's more the queries that we send may end up upsetting other
multicast snooping swithces in the system that are buggy.

In fact, we can simply remove the code that send these queries
because the existing membership expiry mechanism doesn't rely
on them anyway.

So this patch simply removes all code associated with group
queries in response to group leave messages.

Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
---
 net/bridge/br_multicast.c |   81 ---------------------------------------------
 net/bridge/br_private.h   |    4 ---
 2 files changed, 85 deletions(-)

diff --git a/net/bridge/br_multicast.c b/net/bridge/br_multicast.c
index 8eb6b15..5ac1811 100644
--- a/net/bridge/br_multicast.c
+++ b/net/bridge/br_multicast.c
@@ -241,7 +241,6 @@ static void br_multicast_group_expired(unsigned long data)
 	hlist_del_rcu(&mp->hlist[mdb->ver]);
 	mdb->size--;
 
-	del_timer(&mp->query_timer);
 	call_rcu_bh(&mp->rcu, br_multicast_free_group);
 
 out:
@@ -271,7 +270,6 @@ static void br_multicast_del_pg(struct net_bridge *br,
 		rcu_assign_pointer(*pp, p->next);
 		hlist_del_init(&p->mglist);
 		del_timer(&p->timer);
-		del_timer(&p->query_timer);
 		call_rcu_bh(&p->rcu, br_multicast_free_pg);
 
 		if (!mp->ports && !mp->mglist &&
@@ -507,74 +505,6 @@ static struct sk_buff *br_multicast_alloc_query(struct net_bridge *br,
 	return NULL;
 }
 
-static void br_multicast_send_group_query(struct net_bridge_mdb_entry *mp)
-{
-	struct net_bridge *br = mp->br;
-	struct sk_buff *skb;
-
-	skb = br_multicast_alloc_query(br, &mp->addr);
-	if (!skb)
-		goto timer;
-
-	netif_rx(skb);
-
-timer:
-	if (++mp->queries_sent < br->multicast_last_member_count)
-		mod_timer(&mp->query_timer,
-			  jiffies + br->multicast_last_member_interval);
-}
-
-static void br_multicast_group_query_expired(unsigned long data)
-{
-	struct net_bridge_mdb_entry *mp = (void *)data;
-	struct net_bridge *br = mp->br;
-
-	spin_lock(&br->multicast_lock);
-	if (!netif_running(br->dev) || !mp->mglist ||
-	    mp->queries_sent >= br->multicast_last_member_count)
-		goto out;
-
-	br_multicast_send_group_query(mp);
-
-out:
-	spin_unlock(&br->multicast_lock);
-}
-
-static void br_multicast_send_port_group_query(struct net_bridge_port_group *pg)
-{
-	struct net_bridge_port *port = pg->port;
-	struct net_bridge *br = port->br;
-	struct sk_buff *skb;
-
-	skb = br_multicast_alloc_query(br, &pg->addr);
-	if (!skb)
-		goto timer;
-
-	br_deliver(port, skb);
-
-timer:
-	if (++pg->queries_sent < br->multicast_last_member_count)
-		mod_timer(&pg->query_timer,
-			  jiffies + br->multicast_last_member_interval);
-}
-
-static void br_multicast_port_group_query_expired(unsigned long data)
-{
-	struct net_bridge_port_group *pg = (void *)data;
-	struct net_bridge_port *port = pg->port;
-	struct net_bridge *br = port->br;
-
-	spin_lock(&br->multicast_lock);
-	if (!netif_running(br->dev) || hlist_unhashed(&pg->mglist) ||
-	    pg->queries_sent >= br->multicast_last_member_count)
-		goto out;
-
-	br_multicast_send_port_group_query(pg);
-
-out:
-	spin_unlock(&br->multicast_lock);
-}
-
 static struct net_bridge_mdb_entry *br_multicast_get_group(
 	struct net_bridge *br, struct net_bridge_port *port,
 	struct br_ip *group, int hash)
@@ -690,8 +620,6 @@ rehash:
 	mp->addr = *group;
 	setup_timer(&mp->timer, br_multicast_group_expired,
 		    (unsigned long)mp);
-	setup_timer(&mp->query_timer, br_multicast_group_query_expired,
-		    (unsigned long)mp);
 
 	hlist_add_head_rcu(&mp->hlist[mdb->ver], &mdb->mhash[hash]);
 	mdb->size++;
@@ -746,8 +674,6 @@ static int br_multicast_add_group(struct net_bridge *br,
 	hlist_add_head(&p->mglist, &port->mglist);
 	setup_timer(&p->timer, br_multicast_port_group_expired,
 		    (unsigned long)p);
-	setup_timer(&p->query_timer, br_multicast_port_group_query_expired,
-		    (unsigned long)p);
 
 	rcu_assign_pointer(*pp, p);
 
@@ -1291,9 +1217,6 @@ static void br_multicast_leave_group(struct net_bridge *br,
 		     time_after(mp->timer.expires, time) :
 		     try_to_del_timer_sync(&mp->timer) >= 0)) {
 			mod_timer(&mp->timer, time);
-
-			mp->queries_sent = 0;
-			mod_timer(&mp->query_timer, now);
 		}
 
 		goto out;
@@ -1310,9 +1233,6 @@ static void br_multicast_leave_group(struct net_bridge *br,
 		     time_after(p->timer.expires, time) :
 		     try_to_del_timer_sync(&p->timer) >= 0)) {
 			mod_timer(&p->timer, time);
-
-			p->queries_sent = 0;
-			mod_timer(&p->query_timer, now);
 		}
 
 		break;
@@ -1680,7 +1600,6 @@ void br_multicast_stop(struct net_bridge *br)
 		hlist_for_each_entry_safe(mp, p, n, &mdb->mhash[i],
 					  hlist[ver]) {
 			del_timer(&mp->timer);
-			del_timer(&mp->query_timer);
 			call_rcu_bh(&mp->rcu, br_multicast_free_group);
 		}
 	}
diff --git a/net/bridge/br_private.h b/net/bridge/br_private.h
index d7d6fb0..93264df 100644
--- a/net/bridge/br_private.h
+++ b/net/bridge/br_private.h
@@ -82,9 +82,7 @@ struct net_bridge_port_group {
 	struct hlist_node		mglist;
 	struct rcu_head			rcu;
 	struct timer_list		timer;
-	struct timer_list		query_timer;
 	struct br_ip			addr;
-	u32				queries_sent;
 };
 
 struct net_bridge_mdb_entry
@@ -94,10 +92,8 @@ struct net_bridge_mdb_entry
 	struct net_bridge_port_group __rcu *ports;
 	struct rcu_head			rcu;
 	struct timer_list		timer;
-	struct timer_list		query_timer;
 	struct br_ip			addr;
 	bool				mglist;
-	u32				queries_sent;
 };
 
 struct net_bridge_mdb_htable
-- 
1.7.10




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

* [ 065/167] [PATCH 05/26] bridge: Do not send queries on multicast group leaves
@ 2012-05-09  5:51   ` Ben Hutchings
  0 siblings, 0 replies; 195+ messages in thread
From: Ben Hutchings @ 2012-05-09  5:51 UTC (permalink / raw)
  To: linux-kernel, stable; +Cc: torvalds, akpm, alan, Herbert Xu, David S. Miller

3.2-stable review patch.  If anyone has any objections, please let me know.

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

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

[ Upstream commit 996304bbea3d2a094b7ba54c3bd65d3fffeac57b ]

As it stands the bridge IGMP snooping system will respond to
group leave messages with queries for remaining membership.
This is both unnecessary and undesirable.  First of all any
multicast routers present should be doing this rather than us.
What's more the queries that we send may end up upsetting other
multicast snooping swithces in the system that are buggy.

In fact, we can simply remove the code that send these queries
because the existing membership expiry mechanism doesn't rely
on them anyway.

So this patch simply removes all code associated with group
queries in response to group leave messages.

Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
---
 net/bridge/br_multicast.c |   81 ---------------------------------------------
 net/bridge/br_private.h   |    4 ---
 2 files changed, 85 deletions(-)

diff --git a/net/bridge/br_multicast.c b/net/bridge/br_multicast.c
index 8eb6b15..5ac1811 100644
--- a/net/bridge/br_multicast.c
+++ b/net/bridge/br_multicast.c
@@ -241,7 +241,6 @@ static void br_multicast_group_expired(unsigned long data)
 	hlist_del_rcu(&mp->hlist[mdb->ver]);
 	mdb->size--;
 
-	del_timer(&mp->query_timer);
 	call_rcu_bh(&mp->rcu, br_multicast_free_group);
 
 out:
@@ -271,7 +270,6 @@ static void br_multicast_del_pg(struct net_bridge *br,
 		rcu_assign_pointer(*pp, p->next);
 		hlist_del_init(&p->mglist);
 		del_timer(&p->timer);
-		del_timer(&p->query_timer);
 		call_rcu_bh(&p->rcu, br_multicast_free_pg);
 
 		if (!mp->ports && !mp->mglist &&
@@ -507,74 +505,6 @@ static struct sk_buff *br_multicast_alloc_query(struct net_bridge *br,
 	return NULL;
 }
 
-static void br_multicast_send_group_query(struct net_bridge_mdb_entry *mp)
-{
-	struct net_bridge *br = mp->br;
-	struct sk_buff *skb;
-
-	skb = br_multicast_alloc_query(br, &mp->addr);
-	if (!skb)
-		goto timer;
-
-	netif_rx(skb);
-
-timer:
-	if (++mp->queries_sent < br->multicast_last_member_count)
-		mod_timer(&mp->query_timer,
-			  jiffies + br->multicast_last_member_interval);
-}
-
-static void br_multicast_group_query_expired(unsigned long data)
-{
-	struct net_bridge_mdb_entry *mp = (void *)data;
-	struct net_bridge *br = mp->br;
-
-	spin_lock(&br->multicast_lock);
-	if (!netif_running(br->dev) || !mp->mglist ||
-	    mp->queries_sent >= br->multicast_last_member_count)
-		goto out;
-
-	br_multicast_send_group_query(mp);
-
-out:
-	spin_unlock(&br->multicast_lock);
-}
-
-static void br_multicast_send_port_group_query(struct net_bridge_port_group *pg)
-{
-	struct net_bridge_port *port = pg->port;
-	struct net_bridge *br = port->br;
-	struct sk_buff *skb;
-
-	skb = br_multicast_alloc_query(br, &pg->addr);
-	if (!skb)
-		goto timer;
-
-	br_deliver(port, skb);
-
-timer:
-	if (++pg->queries_sent < br->multicast_last_member_count)
-		mod_timer(&pg->query_timer,
-			  jiffies + br->multicast_last_member_interval);
-}
-
-static void br_multicast_port_group_query_expired(unsigned long data)
-{
-	struct net_bridge_port_group *pg = (void *)data;
-	struct net_bridge_port *port = pg->port;
-	struct net_bridge *br = port->br;
-
-	spin_lock(&br->multicast_lock);
-	if (!netif_running(br->dev) || hlist_unhashed(&pg->mglist) ||
-	    pg->queries_sent >= br->multicast_last_member_count)
-		goto out;
-
-	br_multicast_send_port_group_query(pg);
-
-out:
-	spin_unlock(&br->multicast_lock);
-}
-
 static struct net_bridge_mdb_entry *br_multicast_get_group(
 	struct net_bridge *br, struct net_bridge_port *port,
 	struct br_ip *group, int hash)
@@ -690,8 +620,6 @@ rehash:
 	mp->addr = *group;
 	setup_timer(&mp->timer, br_multicast_group_expired,
 		    (unsigned long)mp);
-	setup_timer(&mp->query_timer, br_multicast_group_query_expired,
-		    (unsigned long)mp);
 
 	hlist_add_head_rcu(&mp->hlist[mdb->ver], &mdb->mhash[hash]);
 	mdb->size++;
@@ -746,8 +674,6 @@ static int br_multicast_add_group(struct net_bridge *br,
 	hlist_add_head(&p->mglist, &port->mglist);
 	setup_timer(&p->timer, br_multicast_port_group_expired,
 		    (unsigned long)p);
-	setup_timer(&p->query_timer, br_multicast_port_group_query_expired,
-		    (unsigned long)p);
 
 	rcu_assign_pointer(*pp, p);
 
@@ -1291,9 +1217,6 @@ static void br_multicast_leave_group(struct net_bridge *br,
 		     time_after(mp->timer.expires, time) :
 		     try_to_del_timer_sync(&mp->timer) >= 0)) {
 			mod_timer(&mp->timer, time);
-
-			mp->queries_sent = 0;
-			mod_timer(&mp->query_timer, now);
 		}
 
 		goto out;
@@ -1310,9 +1233,6 @@ static void br_multicast_leave_group(struct net_bridge *br,
 		     time_after(p->timer.expires, time) :
 		     try_to_del_timer_sync(&p->timer) >= 0)) {
 			mod_timer(&p->timer, time);
-
-			p->queries_sent = 0;
-			mod_timer(&p->query_timer, now);
 		}
 
 		break;
@@ -1680,7 +1600,6 @@ void br_multicast_stop(struct net_bridge *br)
 		hlist_for_each_entry_safe(mp, p, n, &mdb->mhash[i],
 					  hlist[ver]) {
 			del_timer(&mp->timer);
-			del_timer(&mp->query_timer);
 			call_rcu_bh(&mp->rcu, br_multicast_free_group);
 		}
 	}
diff --git a/net/bridge/br_private.h b/net/bridge/br_private.h
index d7d6fb0..93264df 100644
--- a/net/bridge/br_private.h
+++ b/net/bridge/br_private.h
@@ -82,9 +82,7 @@ struct net_bridge_port_group {
 	struct hlist_node		mglist;
 	struct rcu_head			rcu;
 	struct timer_list		timer;
-	struct timer_list		query_timer;
 	struct br_ip			addr;
-	u32				queries_sent;
 };
 
 struct net_bridge_mdb_entry
@@ -94,10 +92,8 @@ struct net_bridge_mdb_entry
 	struct net_bridge_port_group __rcu *ports;
 	struct rcu_head			rcu;
 	struct timer_list		timer;
-	struct timer_list		query_timer;
 	struct br_ip			addr;
 	bool				mglist;
-	u32				queries_sent;
 };
 
 struct net_bridge_mdb_htable
-- 
1.7.10




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

* [ 066/167] [PATCH 06/26] ipv6: fix array index in ip6_mc_add_src()
  2012-05-09  5:50 [ 000/167] 3.2.17-stable review Ben Hutchings
                   ` (64 preceding siblings ...)
  2012-05-09  5:51   ` Ben Hutchings
@ 2012-05-09  5:51 ` Ben Hutchings
  2012-05-09  5:51 ` [ 067/167] [PATCH 07/26] phonet: Check input from user before allocating Ben Hutchings
                   ` (100 subsequent siblings)
  166 siblings, 0 replies; 195+ messages in thread
From: Ben Hutchings @ 2012-05-09  5:51 UTC (permalink / raw)
  To: linux-kernel, stable; +Cc: torvalds, akpm, alan, RongQing.Li, David S. Miller

3.2-stable review patch.  If anyone has any objections, please let me know.

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

From: "RongQing.Li" <roy.qing.li@gmail.com>

[ Upstream commit 78d50217baf36093ab320f95bae0d6452daec85c ]

Convert array index from the loop bound to the loop index.

And remove the void type conversion to ip6_mc_del1_src() return
code, seem it is unnecessary, since ip6_mc_del1_src() does not
use __must_check similar attribute, no compiler will report the
warning when it is removed.

v2: enrich the commit header

Signed-off-by: RongQing.Li <roy.qing.li@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
---
 net/ipv6/mcast.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net/ipv6/mcast.c b/net/ipv6/mcast.c
index 2257366..f2d74ea 100644
--- a/net/ipv6/mcast.c
+++ b/net/ipv6/mcast.c
@@ -2054,7 +2054,7 @@ static int ip6_mc_add_src(struct inet6_dev *idev, const struct in6_addr *pmca,
 		if (!delta)
 			pmc->mca_sfcount[sfmode]--;
 		for (j=0; j<i; j++)
-			(void) ip6_mc_del1_src(pmc, sfmode, &psfsrc[i]);
+			ip6_mc_del1_src(pmc, sfmode, &psfsrc[j]);
 	} else if (isexclude != (pmc->mca_sfcount[MCAST_EXCLUDE] != 0)) {
 		struct ip6_sf_list *psf;
 
-- 
1.7.10




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

* [ 067/167] [PATCH 07/26] phonet: Check input from user before allocating
  2012-05-09  5:50 [ 000/167] 3.2.17-stable review Ben Hutchings
                   ` (65 preceding siblings ...)
  2012-05-09  5:51 ` [ 066/167] [PATCH 06/26] ipv6: fix array index in ip6_mc_add_src() Ben Hutchings
@ 2012-05-09  5:51 ` Ben Hutchings
  2012-05-09  5:51 ` [ 068/167] [PATCH 08/26] bonding: properly unset current_arp_slave on slave link up Ben Hutchings
                   ` (99 subsequent siblings)
  166 siblings, 0 replies; 195+ messages in thread
From: Ben Hutchings @ 2012-05-09  5:51 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: torvalds, akpm, alan, Sasha Levin,
	Rémi Denis-Courmont, David S. Miller

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

3.2-stable review patch.  If anyone has any objections, please let me know.

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

From: Sasha Levin <levinsasha928@gmail.com>

[ Upstream commit bcf1b70ac6eb0ed8286c66e6bf37cb747cbaa04c ]

A phonet packet is limited to USHRT_MAX bytes, this is never checked during
tx which means that the user can specify any size he wishes, and the kernel
will attempt to allocate that size.

In the good case, it'll lead to the following warning, but it may also cause
the kernel to kick in the OOM and kill a random task on the server.

[ 8921.744094] WARNING: at mm/page_alloc.c:2255 __alloc_pages_slowpath+0x65/0x730()
[ 8921.749770] Pid: 5081, comm: trinity Tainted: G        W    3.4.0-rc1-next-20120402-sasha #46
[ 8921.756672] Call Trace:
[ 8921.758185]  [<ffffffff810b2ba7>] warn_slowpath_common+0x87/0xb0
[ 8921.762868]  [<ffffffff810b2be5>] warn_slowpath_null+0x15/0x20
[ 8921.765399]  [<ffffffff8117eae5>] __alloc_pages_slowpath+0x65/0x730
[ 8921.769226]  [<ffffffff81179c8a>] ? zone_watermark_ok+0x1a/0x20
[ 8921.771686]  [<ffffffff8117d045>] ? get_page_from_freelist+0x625/0x660
[ 8921.773919]  [<ffffffff8117f3a8>] __alloc_pages_nodemask+0x1f8/0x240
[ 8921.776248]  [<ffffffff811c03e0>] kmalloc_large_node+0x70/0xc0
[ 8921.778294]  [<ffffffff811c4bd4>] __kmalloc_node_track_caller+0x34/0x1c0
[ 8921.780847]  [<ffffffff821b0e3c>] ? sock_alloc_send_pskb+0xbc/0x260
[ 8921.783179]  [<ffffffff821b3c65>] __alloc_skb+0x75/0x170
[ 8921.784971]  [<ffffffff821b0e3c>] sock_alloc_send_pskb+0xbc/0x260
[ 8921.787111]  [<ffffffff821b002e>] ? release_sock+0x7e/0x90
[ 8921.788973]  [<ffffffff821b0ff0>] sock_alloc_send_skb+0x10/0x20
[ 8921.791052]  [<ffffffff824cfc20>] pep_sendmsg+0x60/0x380
[ 8921.792931]  [<ffffffff824cb4a6>] ? pn_socket_bind+0x156/0x180
[ 8921.794917]  [<ffffffff824cb50f>] ? pn_socket_autobind+0x3f/0x90
[ 8921.797053]  [<ffffffff824cb63f>] pn_socket_sendmsg+0x4f/0x70
[ 8921.798992]  [<ffffffff821ab8e7>] sock_aio_write+0x187/0x1b0
[ 8921.801395]  [<ffffffff810e325e>] ? sub_preempt_count+0xae/0xf0
[ 8921.803501]  [<ffffffff8111842c>] ? __lock_acquire+0x42c/0x4b0
[ 8921.805505]  [<ffffffff821ab760>] ? __sock_recv_ts_and_drops+0x140/0x140
[ 8921.807860]  [<ffffffff811e07cc>] do_sync_readv_writev+0xbc/0x110
[ 8921.809986]  [<ffffffff811958e7>] ? might_fault+0x97/0xa0
[ 8921.811998]  [<ffffffff817bd99e>] ? security_file_permission+0x1e/0x90
[ 8921.814595]  [<ffffffff811e17e2>] do_readv_writev+0xe2/0x1e0
[ 8921.816702]  [<ffffffff810b8dac>] ? do_setitimer+0x1ac/0x200
[ 8921.818819]  [<ffffffff810e2ec1>] ? get_parent_ip+0x11/0x50
[ 8921.820863]  [<ffffffff810e325e>] ? sub_preempt_count+0xae/0xf0
[ 8921.823318]  [<ffffffff811e1926>] vfs_writev+0x46/0x60
[ 8921.825219]  [<ffffffff811e1a3f>] sys_writev+0x4f/0xb0
[ 8921.827127]  [<ffffffff82658039>] system_call_fastpath+0x16/0x1b
[ 8921.829384] ---[ end trace dffe390f30db9eb7 ]---

Signed-off-by: Sasha Levin <levinsasha928@gmail.com>
Acked-by: Rémi Denis-Courmont <remi.denis-courmont@nokia.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
---
 net/phonet/pep.c |    3 +++
 1 file changed, 3 insertions(+)

diff --git a/net/phonet/pep.c b/net/phonet/pep.c
index 2ba6e9f..007546d 100644
--- a/net/phonet/pep.c
+++ b/net/phonet/pep.c
@@ -1046,6 +1046,9 @@ static int pep_sendmsg(struct kiocb *iocb, struct sock *sk,
 	int flags = msg->msg_flags;
 	int err, done;
 
+	if (len > USHRT_MAX)
+		return -EMSGSIZE;
+
 	if ((msg->msg_flags & ~(MSG_DONTWAIT|MSG_EOR|MSG_NOSIGNAL|
 				MSG_CMSG_COMPAT)) ||
 			!(msg->msg_flags & MSG_EOR))
-- 
1.7.10




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

* [ 068/167] [PATCH 08/26] bonding: properly unset current_arp_slave on slave link up
  2012-05-09  5:50 [ 000/167] 3.2.17-stable review Ben Hutchings
                   ` (66 preceding siblings ...)
  2012-05-09  5:51 ` [ 067/167] [PATCH 07/26] phonet: Check input from user before allocating Ben Hutchings
@ 2012-05-09  5:51 ` Ben Hutchings
  2012-05-09  5:51 ` [ 069/167] [PATCH 09/26] wimax: i2400m - prevent a possible kernel bug due to missing fw_name string Ben Hutchings
                   ` (98 subsequent siblings)
  166 siblings, 0 replies; 195+ messages in thread
From: Ben Hutchings @ 2012-05-09  5:51 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: torvalds, akpm, alan, Veaceslav Falico, Jay Vosburgh,
	Andy Gospodarek, Marcelo Ricardo Leitner, David S. Miller

3.2-stable review patch.  If anyone has any objections, please let me know.

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

From: Veaceslav Falico <vfalico@redhat.com>

[ Upstream commit 5a4309746cd74734daa964acb02690c22b3c8911 ]

When a slave comes up, we're unsetting the current_arp_slave without
removing active flags from it, which can lead to situations where we have
more than one slave with active flags in active-backup mode.

To avoid this situation we must remove the active flags from a slave before
removing it as a current_arp_slave.

Signed-off-by: Veaceslav Falico <vfalico@redhat.com>
Signed-off-by: Jay Vosburgh <fubar@us.ibm.com>
Signed-off-by: Andy Gospodarek <andy@greyhouse.net>
Signed-off-by: Marcelo Ricardo Leitner <mleitner@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
---
 drivers/net/bonding/bond_main.c |    6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c
index e58aa2b..f65e0b9 100644
--- a/drivers/net/bonding/bond_main.c
+++ b/drivers/net/bonding/bond_main.c
@@ -2982,7 +2982,11 @@ static void bond_ab_arp_commit(struct bonding *bond, int delta_in_ticks)
 					   trans_start + delta_in_ticks)) ||
 			    bond->curr_active_slave != slave) {
 				slave->link = BOND_LINK_UP;
-				bond->current_arp_slave = NULL;
+				if (bond->current_arp_slave) {
+					bond_set_slave_inactive_flags(
+						bond->current_arp_slave);
+					bond->current_arp_slave = NULL;
+				}
 
 				pr_info("%s: link status definitely up for interface %s.\n",
 					bond->dev->name, slave->dev->name);
-- 
1.7.10




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

* [ 069/167] [PATCH 09/26] wimax: i2400m - prevent a possible kernel bug due to missing fw_name string
  2012-05-09  5:50 [ 000/167] 3.2.17-stable review Ben Hutchings
                   ` (67 preceding siblings ...)
  2012-05-09  5:51 ` [ 068/167] [PATCH 08/26] bonding: properly unset current_arp_slave on slave link up Ben Hutchings
@ 2012-05-09  5:51 ` Ben Hutchings
  2012-05-09  5:51 ` [ 070/167] [PATCH 10/26] netlink: fix races after skb queueing Ben Hutchings
                   ` (97 subsequent siblings)
  166 siblings, 0 replies; 195+ messages in thread
From: Ben Hutchings @ 2012-05-09  5:51 UTC (permalink / raw)
  To: linux-kernel, stable; +Cc: torvalds, akpm, alan, Phil Sutter, David S. Miller

3.2-stable review patch.  If anyone has any objections, please let me know.

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

From: Phil Sutter <phil.sutter@viprinet.com>

[ Upstream commit 4eee6a3a04e8bb53fbe7de0f64d0524d3fbe3f80 ]

This happened on a machine with a custom hotplug script calling nameif,
probably due to slow firmware loading. At the time nameif uses ethtool
to gather interface information, i2400m->fw_name is zero and so a null
pointer dereference occurs from within i2400m_get_drvinfo().

Signed-off-by: Phil Sutter <phil.sutter@viprinet.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
---
 drivers/net/wimax/i2400m/netdev.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/net/wimax/i2400m/netdev.c b/drivers/net/wimax/i2400m/netdev.c
index 64a1106..4697cf3 100644
--- a/drivers/net/wimax/i2400m/netdev.c
+++ b/drivers/net/wimax/i2400m/netdev.c
@@ -607,7 +607,8 @@ static void i2400m_get_drvinfo(struct net_device *net_dev,
 	struct i2400m *i2400m = net_dev_to_i2400m(net_dev);
 
 	strncpy(info->driver, KBUILD_MODNAME, sizeof(info->driver) - 1);
-	strncpy(info->fw_version, i2400m->fw_name, sizeof(info->fw_version) - 1);
+	strncpy(info->fw_version,
+	        i2400m->fw_name ? : "", sizeof(info->fw_version) - 1);
 	if (net_dev->dev.parent)
 		strncpy(info->bus_info, dev_name(net_dev->dev.parent),
 			sizeof(info->bus_info) - 1);
-- 
1.7.10




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

* [ 070/167] [PATCH 10/26] netlink: fix races after skb queueing
  2012-05-09  5:50 [ 000/167] 3.2.17-stable review Ben Hutchings
                   ` (68 preceding siblings ...)
  2012-05-09  5:51 ` [ 069/167] [PATCH 09/26] wimax: i2400m - prevent a possible kernel bug due to missing fw_name string Ben Hutchings
@ 2012-05-09  5:51 ` Ben Hutchings
  2012-05-09  5:51 ` [ 071/167] [PATCH 11/26] net: fix a race in sock_queue_err_skb() Ben Hutchings
                   ` (96 subsequent siblings)
  166 siblings, 0 replies; 195+ messages in thread
From: Ben Hutchings @ 2012-05-09  5:51 UTC (permalink / raw)
  To: linux-kernel, stable; +Cc: torvalds, akpm, alan, Eric Dumazet, David S. Miller

3.2-stable review patch.  If anyone has any objections, please let me know.

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

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

[ Upstream commit 4a7e7c2ad540e54c75489a70137bf0ec15d3a127 ]

As soon as an skb is queued into socket receive_queue, another thread
can consume it, so we are not allowed to reference skb anymore, or risk
use after free.

Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
---
 net/netlink/af_netlink.c |   24 +++++++++++++-----------
 1 file changed, 13 insertions(+), 11 deletions(-)

diff --git a/net/netlink/af_netlink.c b/net/netlink/af_netlink.c
index 1201b6d..a99fb41 100644
--- a/net/netlink/af_netlink.c
+++ b/net/netlink/af_netlink.c
@@ -830,12 +830,19 @@ int netlink_attachskb(struct sock *sk, struct sk_buff *skb,
 	return 0;
 }
 
-int netlink_sendskb(struct sock *sk, struct sk_buff *skb)
+static int __netlink_sendskb(struct sock *sk, struct sk_buff *skb)
 {
 	int len = skb->len;
 
 	skb_queue_tail(&sk->sk_receive_queue, skb);
 	sk->sk_data_ready(sk, len);
+	return len;
+}
+
+int netlink_sendskb(struct sock *sk, struct sk_buff *skb)
+{
+	int len = __netlink_sendskb(sk, skb);
+
 	sock_put(sk);
 	return len;
 }
@@ -960,8 +967,7 @@ static inline int netlink_broadcast_deliver(struct sock *sk,
 	if (atomic_read(&sk->sk_rmem_alloc) <= sk->sk_rcvbuf &&
 	    !test_bit(0, &nlk->state)) {
 		skb_set_owner_r(skb, sk);
-		skb_queue_tail(&sk->sk_receive_queue, skb);
-		sk->sk_data_ready(sk, skb->len);
+		__netlink_sendskb(sk, skb);
 		return atomic_read(&sk->sk_rmem_alloc) > sk->sk_rcvbuf;
 	}
 	return -1;
@@ -1684,10 +1690,8 @@ static int netlink_dump(struct sock *sk)
 
 		if (sk_filter(sk, skb))
 			kfree_skb(skb);
-		else {
-			skb_queue_tail(&sk->sk_receive_queue, skb);
-			sk->sk_data_ready(sk, skb->len);
-		}
+		else
+			__netlink_sendskb(sk, skb);
 		return 0;
 	}
 
@@ -1701,10 +1705,8 @@ static int netlink_dump(struct sock *sk)
 
 	if (sk_filter(sk, skb))
 		kfree_skb(skb);
-	else {
-		skb_queue_tail(&sk->sk_receive_queue, skb);
-		sk->sk_data_ready(sk, skb->len);
-	}
+	else
+		__netlink_sendskb(sk, skb);
 
 	if (cb->done)
 		cb->done(cb);
-- 
1.7.10




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

* [ 071/167] [PATCH 11/26] net: fix a race in sock_queue_err_skb()
  2012-05-09  5:50 [ 000/167] 3.2.17-stable review Ben Hutchings
                   ` (69 preceding siblings ...)
  2012-05-09  5:51 ` [ 070/167] [PATCH 10/26] netlink: fix races after skb queueing Ben Hutchings
@ 2012-05-09  5:51 ` Ben Hutchings
  2012-05-09  5:51 ` [ 072/167] [PATCH 12/26] tcp: fix tcp_rcv_rtt_update() use of an unscaled RTT sample Ben Hutchings
                   ` (95 subsequent siblings)
  166 siblings, 0 replies; 195+ messages in thread
From: Ben Hutchings @ 2012-05-09  5:51 UTC (permalink / raw)
  To: linux-kernel, stable; +Cc: torvalds, akpm, alan, Eric Dumazet, David S. Miller

3.2-stable review patch.  If anyone has any objections, please let me know.

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

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

[ Upstream commit 110c43304db6f06490961529536c362d9ac5732f ]

As soon as an skb is queued into socket error queue, another thread
can consume it, so we are not allowed to reference skb anymore, or risk
use after free.

Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
---
 net/core/skbuff.c |    4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/net/core/skbuff.c b/net/core/skbuff.c
index 3c30ee4..29cb392 100644
--- a/net/core/skbuff.c
+++ b/net/core/skbuff.c
@@ -3111,6 +3111,8 @@ static void sock_rmem_free(struct sk_buff *skb)
  */
 int sock_queue_err_skb(struct sock *sk, struct sk_buff *skb)
 {
+	int len = skb->len;
+
 	if (atomic_read(&sk->sk_rmem_alloc) + skb->truesize >=
 	    (unsigned)sk->sk_rcvbuf)
 		return -ENOMEM;
@@ -3125,7 +3127,7 @@ int sock_queue_err_skb(struct sock *sk, struct sk_buff *skb)
 
 	skb_queue_tail(&sk->sk_error_queue, skb);
 	if (!sock_flag(sk, SOCK_DEAD))
-		sk->sk_data_ready(sk, skb->len);
+		sk->sk_data_ready(sk, len);
 	return 0;
 }
 EXPORT_SYMBOL(sock_queue_err_skb);
-- 
1.7.10




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

* [ 072/167] [PATCH 12/26] tcp: fix tcp_rcv_rtt_update() use of an unscaled RTT sample
  2012-05-09  5:50 [ 000/167] 3.2.17-stable review Ben Hutchings
                   ` (70 preceding siblings ...)
  2012-05-09  5:51 ` [ 071/167] [PATCH 11/26] net: fix a race in sock_queue_err_skb() Ben Hutchings
@ 2012-05-09  5:51 ` Ben Hutchings
  2012-05-09  5:51 ` [ 073/167] [PATCH 13/26] net: allow pskb_expand_head() to get maximum tailroom Ben Hutchings
                   ` (94 subsequent siblings)
  166 siblings, 0 replies; 195+ messages in thread
From: Ben Hutchings @ 2012-05-09  5:51 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: torvalds, akpm, alan, Neal Cardwell, Eric Dumazet, David S. Miller

3.2-stable review patch.  If anyone has any objections, please let me know.

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

From: Neal Cardwell <ncardwell@google.com>

[ Upstream commit 18a223e0b9ec8979320ba364b47c9772391d6d05 ]

Fix a code path in tcp_rcv_rtt_update() that was comparing scaled and
unscaled RTT samples.

The intent in the code was to only use the 'm' measurement if it was a
new minimum.  However, since 'm' had not yet been shifted left 3 bits
but 'new_sample' had, this comparison would nearly always succeed,
leading us to erroneously set our receive-side RTT estimate to the 'm'
sample when that sample could be nearly 8x too high to use.

The overall effect is to often cause the receive-side RTT estimate to
be significantly too large (up to 40% too large for brief periods in
my tests).

Signed-off-by: Neal Cardwell <ncardwell@google.com>
Acked-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
---
 net/ipv4/tcp_input.c |    7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c
index e4d1e4a..4c46fa7 100644
--- a/net/ipv4/tcp_input.c
+++ b/net/ipv4/tcp_input.c
@@ -473,8 +473,11 @@ static void tcp_rcv_rtt_update(struct tcp_sock *tp, u32 sample, int win_dep)
 		if (!win_dep) {
 			m -= (new_sample >> 3);
 			new_sample += m;
-		} else if (m < new_sample)
-			new_sample = m << 3;
+		} else {
+			m <<= 3;
+			if (m < new_sample)
+				new_sample = m;
+		}
 	} else {
 		/* No previous measure. */
 		new_sample = m << 3;
-- 
1.7.10




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

* [ 073/167] [PATCH 13/26] net: allow pskb_expand_head() to get maximum tailroom
  2012-05-09  5:50 [ 000/167] 3.2.17-stable review Ben Hutchings
                   ` (71 preceding siblings ...)
  2012-05-09  5:51 ` [ 072/167] [PATCH 12/26] tcp: fix tcp_rcv_rtt_update() use of an unscaled RTT sample Ben Hutchings
@ 2012-05-09  5:51 ` Ben Hutchings
  2012-05-09  5:51 ` [ 074/167] [PATCH 14/26] tcp: fix tcp_trim_head() Ben Hutchings
                   ` (93 subsequent siblings)
  166 siblings, 0 replies; 195+ messages in thread
From: Ben Hutchings @ 2012-05-09  5:51 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: torvalds, akpm, alan, Eric Dumazet, Marc MERLIN, David S. Miller

3.2-stable review patch.  If anyone has any objections, please let me know.

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

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

[ Upstream commit 87151b8689d890dfb495081f7be9b9e257f7a2df ]

Marc Merlin reported many order-1 allocations failures in TX path on its
wireless setup, that dont make any sense with MTU=1500 network, and non
SG capable hardware.

Turns out part of the problem comes from pskb_expand_head() not using
ksize() to get exact head size given by kmalloc(). Doing the same thing
than __alloc_skb() allows more tailroom in skb and can prevent future
reallocations.

As a bonus, struct skb_shared_info becomes cache line aligned.

Reported-by: Marc MERLIN <marc@merlins.org>
Tested-by: Marc MERLIN <marc@merlins.org>
Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
---
 net/core/skbuff.c |    4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/net/core/skbuff.c b/net/core/skbuff.c
index 29cb392..2ec200de 100644
--- a/net/core/skbuff.c
+++ b/net/core/skbuff.c
@@ -903,9 +903,11 @@ int pskb_expand_head(struct sk_buff *skb, int nhead, int ntail,
 		goto adjust_others;
 	}
 
-	data = kmalloc(size + sizeof(struct skb_shared_info), gfp_mask);
+	data = kmalloc(size + SKB_DATA_ALIGN(sizeof(struct skb_shared_info)),
+		       gfp_mask);
 	if (!data)
 		goto nodata;
+	size = SKB_WITH_OVERHEAD(ksize(data));
 
 	/* Copy only real data... and, alas, header. This should be
 	 * optimized for the cases when header is void.
-- 
1.7.10




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

* [ 074/167] [PATCH 14/26] tcp: fix tcp_trim_head()
  2012-05-09  5:50 [ 000/167] 3.2.17-stable review Ben Hutchings
                   ` (72 preceding siblings ...)
  2012-05-09  5:51 ` [ 073/167] [PATCH 13/26] net: allow pskb_expand_head() to get maximum tailroom Ben Hutchings
@ 2012-05-09  5:51 ` Ben Hutchings
  2012-05-09  8:16   ` Jonathan Nieder
  2012-05-09  5:51 ` [ 075/167] [PATCH 15/26] tcp: avoid order-1 allocations on wifi and tx path Ben Hutchings
                   ` (92 subsequent siblings)
  166 siblings, 1 reply; 195+ messages in thread
From: Ben Hutchings @ 2012-05-09  5:51 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: torvalds, akpm, alan, Eric Dumazet, Vijay Subramanian, David S. Miller

3.2-stable review patch.  If anyone has any objections, please let me know.

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

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

[ Upstream commit 4fa48bf3c75069d636fc8830743c929a062e80dc ]

commit f07d960df3 (tcp: avoid frag allocation for small frames)
breaked assumption in tcp stack that skb is either linear (skb->data_len
== 0), or fully fragged (skb->data_len == skb->len)

tcp_trim_head() made this assumption, we must fix it.

Thanks to Vijay for providing a very detailed explanation.

Reported-by: Vijay Subramanian <subramanian.vijay@gmail.com>
Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
---
 net/ipv4/tcp_output.c |   13 ++++++++-----
 1 file changed, 8 insertions(+), 5 deletions(-)

diff --git a/net/ipv4/tcp_output.c b/net/ipv4/tcp_output.c
index 097e0c7..7413437 100644
--- a/net/ipv4/tcp_output.c
+++ b/net/ipv4/tcp_output.c
@@ -1093,6 +1093,13 @@ static void __pskb_trim_head(struct sk_buff *skb, int len)
 {
 	int i, k, eat;
 
+	eat = min_t(int, len, skb_headlen(skb));
+	if (eat) {
+		__skb_pull(skb, eat);
+		len -= eat;
+		if (!len)
+			return;
+	}
 	eat = len;
 	k = 0;
 	for (i = 0; i < skb_shinfo(skb)->nr_frags; i++) {
@@ -1124,11 +1131,7 @@ int tcp_trim_head(struct sock *sk, struct sk_buff *skb, u32 len)
 	if (skb_cloned(skb) && pskb_expand_head(skb, 0, 0, GFP_ATOMIC))
 		return -ENOMEM;
 
-	/* If len == headlen, we avoid __skb_pull to preserve alignment. */
-	if (unlikely(len < skb_headlen(skb)))
-		__skb_pull(skb, len);
-	else
-		__pskb_trim_head(skb, len - skb_headlen(skb));
+	__pskb_trim_head(skb, len);
 
 	TCP_SKB_CB(skb)->seq += len;
 	skb->ip_summed = CHECKSUM_PARTIAL;
-- 
1.7.10




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

* [ 075/167] [PATCH 15/26] tcp: avoid order-1 allocations on wifi and tx path
  2012-05-09  5:50 [ 000/167] 3.2.17-stable review Ben Hutchings
                   ` (73 preceding siblings ...)
  2012-05-09  5:51 ` [ 074/167] [PATCH 14/26] tcp: fix tcp_trim_head() Ben Hutchings
@ 2012-05-09  5:51 ` Ben Hutchings
  2012-05-09  8:19   ` Jonathan Nieder
  2012-05-09  5:51 ` [ 076/167] [PATCH 16/26] atl1: fix kernel panic in case of DMA errors Ben Hutchings
                   ` (91 subsequent siblings)
  166 siblings, 1 reply; 195+ messages in thread
From: Ben Hutchings @ 2012-05-09  5:51 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: torvalds, akpm, alan, Eric Dumazet, Marc MERLIN, David S. Miller

3.2-stable review patch.  If anyone has any objections, please let me know.

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

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

[ This combines upstream commit
  a21d45726acacc963d8baddf74607d9b74e2b723 and the follow-on bug fix
  commit 22b4a4f22da4b39c6f7f679fd35f3d35c91bf851 ]

Marc Merlin reported many order-1 allocations failures in TX path on its
wireless setup, that dont make any sense with MTU=1500 network, and non
SG capable hardware.

After investigation, it turns out TCP uses sk_stream_alloc_skb() and
used as a convention skb_tailroom(skb) to know how many bytes of data
payload could be put in this skb (for non SG capable devices)

Note : these skb used kmalloc-4096 (MTU=1500 + MAX_HEADER +
sizeof(struct skb_shared_info) being above 2048)

Later, mac80211 layer need to add some bytes at the tail of skb
(IEEE80211_ENCRYPT_TAILROOM = 18 bytes) and since no more tailroom is
available has to call pskb_expand_head() and request order-1
allocations.

This patch changes sk_stream_alloc_skb() so that only
sk->sk_prot->max_header bytes of headroom are reserved, and use a new
skb field, avail_size to hold the data payload limit.

This way, order-0 allocations done by TCP stack can leave more than 2 KB
of tailroom and no more allocation is performed in mac80211 layer (or
any layer needing some tailroom)

avail_size is unioned with mark/dropcount, since mark will be set later
in IP stack for output packets. Therefore, skb size is unchanged.

Reported-by: Marc MERLIN <marc@merlins.org>
Tested-by: Marc MERLIN <marc@merlins.org>
Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
[bwh: Correct commit hash for follow-on bug fix]
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
---
 include/linux/skbuff.h |   13 +++++++++++++
 net/ipv4/tcp.c         |    8 ++++----
 net/ipv4/tcp_output.c  |    3 ++-
 3 files changed, 19 insertions(+), 5 deletions(-)

diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h
index 6cf8b53..e689b47 100644
--- a/include/linux/skbuff.h
+++ b/include/linux/skbuff.h
@@ -458,6 +458,7 @@ struct sk_buff {
 	union {
 		__u32		mark;
 		__u32		dropcount;
+		__u32		avail_size;
 	};
 
 	__u16			vlan_tci;
@@ -1326,6 +1327,18 @@ static inline int skb_tailroom(const struct sk_buff *skb)
 }
 
 /**
+ *	skb_availroom - bytes at buffer end
+ *	@skb: buffer to check
+ *
+ *	Return the number of bytes of free space at the tail of an sk_buff
+ *	allocated by sk_stream_alloc()
+ */
+static inline int skb_availroom(const struct sk_buff *skb)
+{
+	return skb_is_nonlinear(skb) ? 0 : skb->avail_size - skb->len;
+}
+
+/**
  *	skb_reserve - adjust headroom
  *	@skb: buffer to alter
  *	@len: bytes to move
diff --git a/net/ipv4/tcp.c b/net/ipv4/tcp.c
index 36611ab..7904db4 100644
--- a/net/ipv4/tcp.c
+++ b/net/ipv4/tcp.c
@@ -701,11 +701,12 @@ struct sk_buff *sk_stream_alloc_skb(struct sock *sk, int size, gfp_t gfp)
 	skb = alloc_skb_fclone(size + sk->sk_prot->max_header, gfp);
 	if (skb) {
 		if (sk_wmem_schedule(sk, skb->truesize)) {
+			skb_reserve(skb, sk->sk_prot->max_header);
 			/*
 			 * Make sure that we have exactly size bytes
 			 * available to the caller, no more, no less.
 			 */
-			skb_reserve(skb, skb_tailroom(skb) - size);
+			skb->avail_size = size;
 			return skb;
 		}
 		__kfree_skb(skb);
@@ -995,10 +996,9 @@ new_segment:
 				copy = seglen;
 
 			/* Where to copy to? */
-			if (skb_tailroom(skb) > 0) {
+			if (skb_availroom(skb) > 0) {
 				/* We have some space in skb head. Superb! */
-				if (copy > skb_tailroom(skb))
-					copy = skb_tailroom(skb);
+				copy = min_t(int, copy, skb_availroom(skb));
 				err = skb_add_data_nocache(sk, skb, from, copy);
 				if (err)
 					goto do_fault;
diff --git a/net/ipv4/tcp_output.c b/net/ipv4/tcp_output.c
index 7413437..c51dd5b 100644
--- a/net/ipv4/tcp_output.c
+++ b/net/ipv4/tcp_output.c
@@ -1096,6 +1096,7 @@ static void __pskb_trim_head(struct sk_buff *skb, int len)
 	eat = min_t(int, len, skb_headlen(skb));
 	if (eat) {
 		__skb_pull(skb, eat);
+		skb->avail_size -= eat;
 		len -= eat;
 		if (!len)
 			return;
@@ -2060,7 +2061,7 @@ static void tcp_retrans_try_collapse(struct sock *sk, struct sk_buff *to,
 		/* Punt if not enough space exists in the first SKB for
 		 * the data in the second
 		 */
-		if (skb->len > skb_tailroom(to))
+		if (skb->len > skb_availroom(to))
 			break;
 
 		if (after(TCP_SKB_CB(skb)->end_seq, tcp_wnd_end(tp)))
-- 
1.7.10




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

* [ 076/167] [PATCH 16/26] atl1: fix kernel panic in case of DMA errors
  2012-05-09  5:50 [ 000/167] 3.2.17-stable review Ben Hutchings
                   ` (74 preceding siblings ...)
  2012-05-09  5:51 ` [ 075/167] [PATCH 15/26] tcp: avoid order-1 allocations on wifi and tx path Ben Hutchings
@ 2012-05-09  5:51 ` Ben Hutchings
  2012-05-09  5:51 ` [ 077/167] [PATCH 17/26] 8139cp: set intr mask after its handler is registered Ben Hutchings
                   ` (90 subsequent siblings)
  166 siblings, 0 replies; 195+ messages in thread
From: Ben Hutchings @ 2012-05-09  5:51 UTC (permalink / raw)
  To: linux-kernel, stable; +Cc: torvalds, akpm, alan, Tony Zelenoff, David S. Miller

3.2-stable review patch.  If anyone has any objections, please let me know.

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

From: Tony Zelenoff <antonz@parallels.com>

[ Upstream commit 03662e41c7cff64a776bfb1b3816de4be43de881 ]

Problem:
There was two separate work_struct structures which share one
handler. Unfortunately getting atl1_adapter structure from
work_struct in case of DMA error was done from incorrect
offset which cause kernel panics.

Solution:
The useless work_struct for DMA error removed and
handler name changed to more generic one.

Signed-off-by: Tony Zelenoff <antonz@parallels.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
---
 drivers/net/ethernet/atheros/atlx/atl1.c |   12 +++++-------
 drivers/net/ethernet/atheros/atlx/atl1.h |    3 +--
 drivers/net/ethernet/atheros/atlx/atlx.c |    2 +-
 3 files changed, 7 insertions(+), 10 deletions(-)

diff --git a/drivers/net/ethernet/atheros/atlx/atl1.c b/drivers/net/ethernet/atheros/atlx/atl1.c
index 33a4e35..ee532e1 100644
--- a/drivers/net/ethernet/atheros/atlx/atl1.c
+++ b/drivers/net/ethernet/atheros/atlx/atl1.c
@@ -2473,7 +2473,7 @@ static irqreturn_t atl1_intr(int irq, void *data)
 					"pcie phy link down %x\n", status);
 			if (netif_running(adapter->netdev)) {	/* reset MAC */
 				iowrite32(0, adapter->hw.hw_addr + REG_IMR);
-				schedule_work(&adapter->pcie_dma_to_rst_task);
+				schedule_work(&adapter->reset_dev_task);
 				return IRQ_HANDLED;
 			}
 		}
@@ -2485,7 +2485,7 @@ static irqreturn_t atl1_intr(int irq, void *data)
 					"pcie DMA r/w error (status = 0x%x)\n",
 					status);
 			iowrite32(0, adapter->hw.hw_addr + REG_IMR);
-			schedule_work(&adapter->pcie_dma_to_rst_task);
+			schedule_work(&adapter->reset_dev_task);
 			return IRQ_HANDLED;
 		}
 
@@ -2630,10 +2630,10 @@ static void atl1_down(struct atl1_adapter *adapter)
 	atl1_clean_rx_ring(adapter);
 }
 
-static void atl1_tx_timeout_task(struct work_struct *work)
+static void atl1_reset_dev_task(struct work_struct *work)
 {
 	struct atl1_adapter *adapter =
-		container_of(work, struct atl1_adapter, tx_timeout_task);
+		container_of(work, struct atl1_adapter, reset_dev_task);
 	struct net_device *netdev = adapter->netdev;
 
 	netif_device_detach(netdev);
@@ -3032,12 +3032,10 @@ static int __devinit atl1_probe(struct pci_dev *pdev,
 		    (unsigned long)adapter);
 	adapter->phy_timer_pending = false;
 
-	INIT_WORK(&adapter->tx_timeout_task, atl1_tx_timeout_task);
+	INIT_WORK(&adapter->reset_dev_task, atl1_reset_dev_task);
 
 	INIT_WORK(&adapter->link_chg_task, atlx_link_chg_task);
 
-	INIT_WORK(&adapter->pcie_dma_to_rst_task, atl1_tx_timeout_task);
-
 	err = register_netdev(netdev);
 	if (err)
 		goto err_common;
diff --git a/drivers/net/ethernet/atheros/atlx/atl1.h b/drivers/net/ethernet/atheros/atlx/atl1.h
index 109d6da..e04bf4d 100644
--- a/drivers/net/ethernet/atheros/atlx/atl1.h
+++ b/drivers/net/ethernet/atheros/atlx/atl1.h
@@ -758,9 +758,8 @@ struct atl1_adapter {
 	u16 link_speed;
 	u16 link_duplex;
 	spinlock_t lock;
-	struct work_struct tx_timeout_task;
+	struct work_struct reset_dev_task;
 	struct work_struct link_chg_task;
-	struct work_struct pcie_dma_to_rst_task;
 
 	struct timer_list phy_config_timer;
 	bool phy_timer_pending;
diff --git a/drivers/net/ethernet/atheros/atlx/atlx.c b/drivers/net/ethernet/atheros/atlx/atlx.c
index aabcf4b..41c6d83 100644
--- a/drivers/net/ethernet/atheros/atlx/atlx.c
+++ b/drivers/net/ethernet/atheros/atlx/atlx.c
@@ -193,7 +193,7 @@ static void atlx_tx_timeout(struct net_device *netdev)
 {
 	struct atlx_adapter *adapter = netdev_priv(netdev);
 	/* Do the reset outside of interrupt context */
-	schedule_work(&adapter->tx_timeout_task);
+	schedule_work(&adapter->reset_dev_task);
 }
 
 /*
-- 
1.7.10




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

* [ 077/167] [PATCH 17/26] 8139cp: set intr mask after its handler is registered
  2012-05-09  5:50 [ 000/167] 3.2.17-stable review Ben Hutchings
                   ` (75 preceding siblings ...)
  2012-05-09  5:51 ` [ 076/167] [PATCH 16/26] atl1: fix kernel panic in case of DMA errors Ben Hutchings
@ 2012-05-09  5:51 ` Ben Hutchings
  2012-05-09  5:51 ` [ 078/167] [PATCH 18/26] net: smsc911x: fix skb handling in receive path Ben Hutchings
                   ` (89 subsequent siblings)
  166 siblings, 0 replies; 195+ messages in thread
From: Ben Hutchings @ 2012-05-09  5:51 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: torvalds, akpm, alan, Jason Wang, Flavio Leitner, David S. Miller

3.2-stable review patch.  If anyone has any objections, please let me know.

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

From: Jason Wang <jasowang@redhat.com>

[ Upstream commit a8c9cb106fe79c28d6b7f1397652cadd228715ff ]

We set intr mask before its handler is registered, this does not work well when
8139cp is sharing irq line with other devices. As the irq could be enabled by
the device before 8139cp's hander is registered which may lead unhandled
irq. Fix this by introducing an helper cp_irq_enable() and call it after
request_irq().

Signed-off-by: Jason Wang <jasowang@redhat.com>
Reviewed-by: Flavio Leitner <fbl@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
---
 drivers/net/ethernet/realtek/8139cp.c |   10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/drivers/net/ethernet/realtek/8139cp.c b/drivers/net/ethernet/realtek/8139cp.c
index aba4f67..8f47907 100644
--- a/drivers/net/ethernet/realtek/8139cp.c
+++ b/drivers/net/ethernet/realtek/8139cp.c
@@ -961,6 +961,11 @@ static inline void cp_start_hw (struct cp_private *cp)
 	cpw8(Cmd, RxOn | TxOn);
 }
 
+static void cp_enable_irq(struct cp_private *cp)
+{
+	cpw16_f(IntrMask, cp_intr_mask);
+}
+
 static void cp_init_hw (struct cp_private *cp)
 {
 	struct net_device *dev = cp->dev;
@@ -1000,8 +1005,6 @@ static void cp_init_hw (struct cp_private *cp)
 
 	cpw16(MultiIntr, 0);
 
-	cpw16_f(IntrMask, cp_intr_mask);
-
 	cpw8_f(Cfg9346, Cfg9346_Lock);
 }
 
@@ -1133,6 +1136,8 @@ static int cp_open (struct net_device *dev)
 	if (rc)
 		goto err_out_hw;
 
+	cp_enable_irq(cp);
+
 	netif_carrier_off(dev);
 	mii_check_media(&cp->mii_if, netif_msg_link(cp), true);
 	netif_start_queue(dev);
@@ -2034,6 +2039,7 @@ static int cp_resume (struct pci_dev *pdev)
 	/* FIXME: sh*t may happen if the Rx ring buffer is depleted */
 	cp_init_rings_index (cp);
 	cp_init_hw (cp);
+	cp_enable_irq(cp);
 	netif_start_queue (dev);
 
 	spin_lock_irqsave (&cp->lock, flags);
-- 
1.7.10




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

* [ 078/167] [PATCH 18/26] net: smsc911x: fix skb handling in receive path
  2012-05-09  5:50 [ 000/167] 3.2.17-stable review Ben Hutchings
                   ` (76 preceding siblings ...)
  2012-05-09  5:51 ` [ 077/167] [PATCH 17/26] 8139cp: set intr mask after its handler is registered Ben Hutchings
@ 2012-05-09  5:51 ` Ben Hutchings
  2012-05-09  5:51 ` [ 079/167] [PATCH 19/26] net/ethernet: ks8851_mll fix rx frame buffer overflow Ben Hutchings
                   ` (88 subsequent siblings)
  166 siblings, 0 replies; 195+ messages in thread
From: Ben Hutchings @ 2012-05-09  5:51 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: torvalds, akpm, alan, Will Deacon, Eric Dumazet, David S. Miller

3.2-stable review patch.  If anyone has any objections, please let me know.

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

From: Will Deacon <will.deacon@arm.com>

[ Upstream commit 3c5e979bd037888dd7d722da22da4b43659af485 ]

The SMSC911x driver resets the ->head, ->data and ->tail pointers in the
skb on the reset path in order to avoid buffer overflow due to packet
padding performed by the hardware.

This patch fixes the receive path so that the skb pointers are fixed up
after the data has been read from the device, The error path is also
fixed to use number of words consistently and prevent erroneous FIFO
fastforwarding when skipping over bad data.

Signed-off-by: Will Deacon <will.deacon@arm.com>
Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
---
 drivers/net/ethernet/smsc/smsc911x.c |   14 +++++---------
 1 file changed, 5 insertions(+), 9 deletions(-)

diff --git a/drivers/net/ethernet/smsc/smsc911x.c b/drivers/net/ethernet/smsc/smsc911x.c
index 8843071..8c7dd21 100644
--- a/drivers/net/ethernet/smsc/smsc911x.c
+++ b/drivers/net/ethernet/smsc/smsc911x.c
@@ -1089,10 +1089,8 @@ smsc911x_rx_counterrors(struct net_device *dev, unsigned int rxstat)
 
 /* Quickly dumps bad packets */
 static void
-smsc911x_rx_fastforward(struct smsc911x_data *pdata, unsigned int pktbytes)
+smsc911x_rx_fastforward(struct smsc911x_data *pdata, unsigned int pktwords)
 {
-	unsigned int pktwords = (pktbytes + NET_IP_ALIGN + 3) >> 2;
-
 	if (likely(pktwords >= 4)) {
 		unsigned int timeout = 500;
 		unsigned int val;
@@ -1156,7 +1154,7 @@ static int smsc911x_poll(struct napi_struct *napi, int budget)
 			continue;
 		}
 
-		skb = netdev_alloc_skb(dev, pktlength + NET_IP_ALIGN);
+		skb = netdev_alloc_skb(dev, pktwords << 2);
 		if (unlikely(!skb)) {
 			SMSC_WARN(pdata, rx_err,
 				  "Unable to allocate skb for rx packet");
@@ -1166,14 +1164,12 @@ static int smsc911x_poll(struct napi_struct *napi, int budget)
 			break;
 		}
 
-		skb->data = skb->head;
-		skb_reset_tail_pointer(skb);
+		pdata->ops->rx_readfifo(pdata,
+				 (unsigned int *)skb->data, pktwords);
 
 		/* Align IP on 16B boundary */
 		skb_reserve(skb, NET_IP_ALIGN);
 		skb_put(skb, pktlength - 4);
-		pdata->ops->rx_readfifo(pdata,
-				 (unsigned int *)skb->head, pktwords);
 		skb->protocol = eth_type_trans(skb, dev);
 		skb_checksum_none_assert(skb);
 		netif_receive_skb(skb);
@@ -1396,7 +1392,7 @@ static int smsc911x_open(struct net_device *dev)
 	smsc911x_reg_write(pdata, FIFO_INT, temp);
 
 	/* set RX Data offset to 2 bytes for alignment */
-	smsc911x_reg_write(pdata, RX_CFG, (2 << 8));
+	smsc911x_reg_write(pdata, RX_CFG, (NET_IP_ALIGN << 8));
 
 	/* enable NAPI polling before enabling RX interrupts */
 	napi_enable(&pdata->napi);
-- 
1.7.10




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

* [ 079/167] [PATCH 19/26] net/ethernet: ks8851_mll fix rx frame buffer overflow
  2012-05-09  5:50 [ 000/167] 3.2.17-stable review Ben Hutchings
                   ` (77 preceding siblings ...)
  2012-05-09  5:51 ` [ 078/167] [PATCH 18/26] net: smsc911x: fix skb handling in receive path Ben Hutchings
@ 2012-05-09  5:51 ` Ben Hutchings
  2012-05-09  5:51 ` [ 080/167] [PATCH 20/26] net_sched: gred: Fix oops in gred_dump() in WRED mode Ben Hutchings
                   ` (87 subsequent siblings)
  166 siblings, 0 replies; 195+ messages in thread
From: Ben Hutchings @ 2012-05-09  5:51 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: torvalds, akpm, alan, Davide Ciminaghi, Raffaele Recalcati,
	David S. Miller

3.2-stable review patch.  If anyone has any objections, please let me know.

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

From: Davide Ciminaghi <ciminaghi@gnudd.com>

[ Upstream commit 8a9a0ea6032186e3030419262678d652b88bf6a8 ]

At the beginning of ks_rcv(), a for loop retrieves the
header information relevant to all the frames stored
in the mac's internal buffers. The number of pending
frames is stored as an 8 bits field in KS_RXFCTR.
If interrupts are disabled long enough to allow for more than
32 frames to accumulate in the MAC's internal buffers, a buffer
overflow occurs.
This patch fixes the problem by making the
driver's frame_head_info buffer big enough.
Well actually, since the chip appears to have 12K of
internal rx buffers and the shortest ethernet frame should
be 64 bytes long, maybe the limit could be set to
12*1024/64 = 192 frames, but 255 should be safer.

Signed-off-by: Davide Ciminaghi <ciminaghi@gnudd.com>
Signed-off-by: Raffaele Recalcati <raffaele.recalcati@bticino.it>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
---
 drivers/net/ethernet/micrel/ks8851_mll.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/micrel/ks8851_mll.c b/drivers/net/ethernet/micrel/ks8851_mll.c
index d19c849..77241b6 100644
--- a/drivers/net/ethernet/micrel/ks8851_mll.c
+++ b/drivers/net/ethernet/micrel/ks8851_mll.c
@@ -40,7 +40,7 @@
 #define	DRV_NAME	"ks8851_mll"
 
 static u8 KS_DEFAULT_MAC_ADDRESS[] = { 0x00, 0x10, 0xA1, 0x86, 0x95, 0x11 };
-#define MAX_RECV_FRAMES			32
+#define MAX_RECV_FRAMES			255
 #define MAX_BUF_SIZE			2048
 #define TX_BUF_SIZE			2000
 #define RX_BUF_SIZE			2000
-- 
1.7.10




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

* [ 080/167] [PATCH 20/26] net_sched: gred: Fix oops in gred_dump() in WRED mode
  2012-05-09  5:50 [ 000/167] 3.2.17-stable review Ben Hutchings
                   ` (78 preceding siblings ...)
  2012-05-09  5:51 ` [ 079/167] [PATCH 19/26] net/ethernet: ks8851_mll fix rx frame buffer overflow Ben Hutchings
@ 2012-05-09  5:51 ` Ben Hutchings
  2012-05-09  5:51 ` [ 081/167] [PATCH 21/26] net: usb: smsc75xx: fix mtu Ben Hutchings
                   ` (86 subsequent siblings)
  166 siblings, 0 replies; 195+ messages in thread
From: Ben Hutchings @ 2012-05-09  5:51 UTC (permalink / raw)
  To: linux-kernel, stable; +Cc: torvalds, akpm, alan, David Ward, David S. Miller

3.2-stable review patch.  If anyone has any objections, please let me know.

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

From: David Ward <david.ward@ll.mit.edu>

[ Upstream commit 244b65dbfede788f2fa3fe2463c44d0809e97c6b ]

A parameter set exists for WRED mode, called wred_set, to hold the same
values for qavg and qidlestart across all VQs. The WRED mode values had
been previously held in the VQ for the default DP. After these values
were moved to wred_set, the VQ for the default DP was no longer created
automatically (so that it could be omitted on purpose, to have packets
in the default DP enqueued directly to the device without using RED).

However, gred_dump() was overlooked during that change; in WRED mode it
still reads qavg/qidlestart from the VQ for the default DP, which might
not even exist. As a result, this command sequence will cause an oops:

tc qdisc add dev $DEV handle $HANDLE parent $PARENT gred setup \
    DPs 3 default 2 grio
tc qdisc change dev $DEV handle $HANDLE gred DP 0 prio 8 $RED_OPTIONS
tc qdisc change dev $DEV handle $HANDLE gred DP 1 prio 8 $RED_OPTIONS

This fixes gred_dump() in WRED mode to use the values held in wred_set.

Signed-off-by: David Ward <david.ward@ll.mit.edu>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
---
 net/sched/sch_gred.c |    7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)

diff --git a/net/sched/sch_gred.c b/net/sched/sch_gred.c
index 6cd8ddf..e1afe0c 100644
--- a/net/sched/sch_gred.c
+++ b/net/sched/sch_gred.c
@@ -544,11 +544,8 @@ static int gred_dump(struct Qdisc *sch, struct sk_buff *skb)
 		opt.packets	= q->packetsin;
 		opt.bytesin	= q->bytesin;
 
-		if (gred_wred_mode(table)) {
-			q->parms.qidlestart =
-				table->tab[table->def]->parms.qidlestart;
-			q->parms.qavg = table->tab[table->def]->parms.qavg;
-		}
+		if (gred_wred_mode(table))
+			gred_load_wred_set(table, q);
 
 		opt.qave = red_calc_qavg(&q->parms, q->parms.qavg);
 
-- 
1.7.10




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

* [ 081/167] [PATCH 21/26] net: usb: smsc75xx: fix mtu
  2012-05-09  5:50 [ 000/167] 3.2.17-stable review Ben Hutchings
                   ` (79 preceding siblings ...)
  2012-05-09  5:51 ` [ 080/167] [PATCH 20/26] net_sched: gred: Fix oops in gred_dump() in WRED mode Ben Hutchings
@ 2012-05-09  5:51 ` Ben Hutchings
  2012-05-09  5:51 ` [ 082/167] [PATCH] dummy: Add ndo_uninit() Ben Hutchings
                   ` (85 subsequent siblings)
  166 siblings, 0 replies; 195+ messages in thread
From: Ben Hutchings @ 2012-05-09  5:51 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: torvalds, akpm, alan, Stephane Fillod, David S. Miller

3.2-stable review patch.  If anyone has any objections, please let me know.

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

From: Stephane Fillod <fillods@users.sf.net>

[ Upstream commit a99ff7d0123b19ecad3b589480b6542716ab6b52 ]

Make smsc75xx recalculate the hard_mtu after adjusting the
hard_header_len.

Without this, usbnet adjusts the MTU down to 1492 bytes, and the host is
unable to receive standard 1500-byte frames from the device.

Inspired by same fix on cdc_eem 78fb72f7936c01d5b426c03a691eca082b03f2b9.

Tested on ARM/Omap3 with EVB-LAN7500-LC.

Signed-off-by: Stephane Fillod <fillods@users.sf.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
---
 drivers/net/usb/smsc75xx.c |    1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/net/usb/smsc75xx.c b/drivers/net/usb/smsc75xx.c
index a5b9b12..7bd219b 100644
--- a/drivers/net/usb/smsc75xx.c
+++ b/drivers/net/usb/smsc75xx.c
@@ -1050,6 +1050,7 @@ static int smsc75xx_bind(struct usbnet *dev, struct usb_interface *intf)
 	dev->net->ethtool_ops = &smsc75xx_ethtool_ops;
 	dev->net->flags |= IFF_MULTICAST;
 	dev->net->hard_header_len += SMSC75XX_TX_OVERHEAD;
+	dev->hard_mtu = dev->net->mtu + dev->net->hard_header_len;
 	return 0;
 }
 
-- 
1.7.10




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

* [ 082/167] [PATCH] dummy: Add ndo_uninit().
  2012-05-09  5:50 [ 000/167] 3.2.17-stable review Ben Hutchings
                   ` (80 preceding siblings ...)
  2012-05-09  5:51 ` [ 081/167] [PATCH 21/26] net: usb: smsc75xx: fix mtu Ben Hutchings
@ 2012-05-09  5:51 ` Ben Hutchings
  2012-05-09  5:51 ` [ 083/167] [PATCH 22/26] tcp: fix tcp_grow_window() for large incoming frames Ben Hutchings
                   ` (84 subsequent siblings)
  166 siblings, 0 replies; 195+ messages in thread
From: Ben Hutchings @ 2012-05-09  5:51 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: torvalds, akpm, alan, Hiroaki SHIMODA, David S. Miller

3.2-stable review patch.  If anyone has any objections, please let me know.

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

From: Hiroaki SHIMODA <shimoda.hiroaki@gmail.com>

commit 890fdf2a0cb88202d1427589db2cf29c1bdd3c1d upstream.

In register_netdevice(), when ndo_init() is successful and later
some error occurred, ndo_uninit() will be called.
So dummy deivce is desirable to implement ndo_uninit() method
to free percpu stats for this case.
And, ndo_uninit() is also called along with dev->destructor() when
device is unregistered, so in order to prevent dev->dstats from
being freed twice, dev->destructor is modified to free_netdev().

Signed-off-by: Hiroaki SHIMODA <shimoda.hiroaki@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
---
 drivers/net/dummy.c |    6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/net/dummy.c b/drivers/net/dummy.c
index d5c6d92..442d91a 100644
--- a/drivers/net/dummy.c
+++ b/drivers/net/dummy.c
@@ -107,14 +107,14 @@ static int dummy_dev_init(struct net_device *dev)
 	return 0;
 }
 
-static void dummy_dev_free(struct net_device *dev)
+static void dummy_dev_uninit(struct net_device *dev)
 {
 	free_percpu(dev->dstats);
-	free_netdev(dev);
 }
 
 static const struct net_device_ops dummy_netdev_ops = {
 	.ndo_init		= dummy_dev_init,
+	.ndo_uninit		= dummy_dev_uninit,
 	.ndo_start_xmit		= dummy_xmit,
 	.ndo_validate_addr	= eth_validate_addr,
 	.ndo_set_rx_mode	= set_multicast_list,
@@ -128,7 +128,7 @@ static void dummy_setup(struct net_device *dev)
 
 	/* Initialize the device structure. */
 	dev->netdev_ops = &dummy_netdev_ops;
-	dev->destructor = dummy_dev_free;
+	dev->destructor = free_netdev;
 
 	/* Fill in device structure with ethernet-generic values. */
 	dev->tx_queue_len = 0;
-- 
1.7.10




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

* [ 083/167] [PATCH 22/26] tcp: fix tcp_grow_window() for large incoming frames
  2012-05-09  5:50 [ 000/167] 3.2.17-stable review Ben Hutchings
                   ` (81 preceding siblings ...)
  2012-05-09  5:51 ` [ 082/167] [PATCH] dummy: Add ndo_uninit() Ben Hutchings
@ 2012-05-09  5:51 ` Ben Hutchings
  2012-05-09  5:51 ` [ 084/167] [PATCH 23/26] netns: do not leak net_generic data on failed init Ben Hutchings
                   ` (83 subsequent siblings)
  166 siblings, 0 replies; 195+ messages in thread
From: Ben Hutchings @ 2012-05-09  5:51 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: torvalds, akpm, alan, Eric Dumazet, Neal Cardwell, Tom Herbert,
	David S. Miller

3.2-stable review patch.  If anyone has any objections, please let me know.

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

From: Eric Dumazet <edumazet@google.com>

[ Upstream commit 4d846f02392a710f9604892ac3329e628e60a230 ]

tcp_grow_window() has to grow rcv_ssthresh up to window_clamp, allowing
sender to increase its window.

tcp_grow_window() still assumes a tcp frame is under MSS, but its no
longer true with LRO/GRO.

This patch fixes one of the performance issue we noticed with GRO on.

Signed-off-by: Eric Dumazet <edumazet@google.com>
Cc: Neal Cardwell <ncardwell@google.com>
Cc: Tom Herbert <therbert@google.com>
Acked-by: Neal Cardwell <ncardwell@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
---
 net/ipv4/tcp_input.c |    1 +
 1 file changed, 1 insertion(+)

diff --git a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c
index 4c46fa7..daedc07 100644
--- a/net/ipv4/tcp_input.c
+++ b/net/ipv4/tcp_input.c
@@ -334,6 +334,7 @@ static void tcp_grow_window(struct sock *sk, const struct sk_buff *skb)
 			incr = __tcp_grow_window(sk, skb);
 
 		if (incr) {
+			incr = max_t(int, incr, 2 * skb->len);
 			tp->rcv_ssthresh = min(tp->rcv_ssthresh + incr,
 					       tp->window_clamp);
 			inet_csk(sk)->icsk_ack.quick |= 1;
-- 
1.7.10




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

* [ 084/167] [PATCH 23/26] netns: do not leak net_generic data on failed init
  2012-05-09  5:50 [ 000/167] 3.2.17-stable review Ben Hutchings
                   ` (82 preceding siblings ...)
  2012-05-09  5:51 ` [ 083/167] [PATCH 22/26] tcp: fix tcp_grow_window() for large incoming frames Ben Hutchings
@ 2012-05-09  5:51 ` Ben Hutchings
  2012-05-09  5:51 ` [ 085/167] [PATCH 24/26] ksz884x: dont copy too much in netdev_set_mac_address() Ben Hutchings
                   ` (82 subsequent siblings)
  166 siblings, 0 replies; 195+ messages in thread
From: Ben Hutchings @ 2012-05-09  5:51 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: torvalds, akpm, alan, Julian Anastasov, Eric W. Biederman,
	David S. Miller

3.2-stable review patch.  If anyone has any objections, please let me know.

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

From: Julian Anastasov <ja@ssi.bg>

[ Upstream commit b922934d017f1cc831b017913ed7d1a56c558b43 ]

ops_init should free the net_generic data on
init failure and __register_pernet_operations should not
call ops_free when NET_NS is not enabled.

Signed-off-by: Julian Anastasov <ja@ssi.bg>
Reviewed-by: "Eric W. Biederman" <ebiederm@xmission.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
---
 net/core/net_namespace.c |   33 ++++++++++++++++++---------------
 1 file changed, 18 insertions(+), 15 deletions(-)

diff --git a/net/core/net_namespace.c b/net/core/net_namespace.c
index 0e950fd..31a5ae5 100644
--- a/net/core/net_namespace.c
+++ b/net/core/net_namespace.c
@@ -83,21 +83,29 @@ assign:
 
 static int ops_init(const struct pernet_operations *ops, struct net *net)
 {
-	int err;
+	int err = -ENOMEM;
+	void *data = NULL;
+
 	if (ops->id && ops->size) {
-		void *data = kzalloc(ops->size, GFP_KERNEL);
+		data = kzalloc(ops->size, GFP_KERNEL);
 		if (!data)
-			return -ENOMEM;
+			goto out;
 
 		err = net_assign_generic(net, *ops->id, data);
-		if (err) {
-			kfree(data);
-			return err;
-		}
+		if (err)
+			goto cleanup;
 	}
+	err = 0;
 	if (ops->init)
-		return ops->init(net);
-	return 0;
+		err = ops->init(net);
+	if (!err)
+		return 0;
+
+cleanup:
+	kfree(data);
+
+out:
+	return err;
 }
 
 static void ops_free(const struct pernet_operations *ops, struct net *net)
@@ -448,12 +456,7 @@ static void __unregister_pernet_operations(struct pernet_operations *ops)
 static int __register_pernet_operations(struct list_head *list,
 					struct pernet_operations *ops)
 {
-	int err = 0;
-	err = ops_init(ops, &init_net);
-	if (err)
-		ops_free(ops, &init_net);
-	return err;
-	
+	return ops_init(ops, &init_net);
 }
 
 static void __unregister_pernet_operations(struct pernet_operations *ops)
-- 
1.7.10




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

* [ 085/167] [PATCH 24/26] ksz884x: dont copy too much in netdev_set_mac_address()
  2012-05-09  5:50 [ 000/167] 3.2.17-stable review Ben Hutchings
                   ` (83 preceding siblings ...)
  2012-05-09  5:51 ` [ 084/167] [PATCH 23/26] netns: do not leak net_generic data on failed init Ben Hutchings
@ 2012-05-09  5:51 ` Ben Hutchings
  2012-05-09  5:51 ` [ 086/167] [PATCH 25/26] net ax25: Reorder ax25_exit to remove races Ben Hutchings
                   ` (81 subsequent siblings)
  166 siblings, 0 replies; 195+ messages in thread
From: Ben Hutchings @ 2012-05-09  5:51 UTC (permalink / raw)
  To: linux-kernel, stable; +Cc: torvalds, akpm, alan, Dan Carpenter, David S. Miller

3.2-stable review patch.  If anyone has any objections, please let me know.

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

From: Dan Carpenter <dan.carpenter@oracle.com>

[ Upstream commit 716af4abd6e6370226f567af50bfaca274515980 ]

MAX_ADDR_LEN is 32.  ETH_ALEN is 6.  mac->sa_data is a 14 byte array, so
the memcpy() is doing a read past the end of the array.  I asked about
this on netdev and Ben Hutchings told me it's supposed to be copying
ETH_ALEN bytes (thanks Ben).

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
---
 drivers/net/ethernet/micrel/ksz884x.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/micrel/ksz884x.c b/drivers/net/ethernet/micrel/ksz884x.c
index 7ece990..4b9f4bd 100644
--- a/drivers/net/ethernet/micrel/ksz884x.c
+++ b/drivers/net/ethernet/micrel/ksz884x.c
@@ -5679,7 +5679,7 @@ static int netdev_set_mac_address(struct net_device *dev, void *addr)
 		memcpy(hw->override_addr, mac->sa_data, MAC_ADDR_LEN);
 	}
 
-	memcpy(dev->dev_addr, mac->sa_data, MAX_ADDR_LEN);
+	memcpy(dev->dev_addr, mac->sa_data, ETH_ALEN);
 
 	interrupt = hw_block_intr(hw);
 
-- 
1.7.10




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

* [ 086/167] [PATCH 25/26] net ax25: Reorder ax25_exit to remove races.
  2012-05-09  5:50 [ 000/167] 3.2.17-stable review Ben Hutchings
                   ` (84 preceding siblings ...)
  2012-05-09  5:51 ` [ 085/167] [PATCH 24/26] ksz884x: dont copy too much in netdev_set_mac_address() Ben Hutchings
@ 2012-05-09  5:51 ` Ben Hutchings
  2012-05-09  5:51 ` [ 087/167] [PATCH 26/26] tcp: fix TCP_MAXSEG for established IPv6 passive sockets Ben Hutchings
                   ` (80 subsequent siblings)
  166 siblings, 0 replies; 195+ messages in thread
From: Ben Hutchings @ 2012-05-09  5:51 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: torvalds, akpm, alan, Eric W. Biederman, David S. Miller

3.2-stable review patch.  If anyone has any objections, please let me know.

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

From: "Eric W. Biederman" <ebiederm@xmission.com>

[ Upstream commit 3adadc08cc1e2cbcc15a640d639297ef5fcb17f5 ]

While reviewing the sysctl code in ax25 I spotted races in ax25_exit
where it is possible to receive notifications and packets after already
freeing up some of the data structures needed to process those
notifications and updates.

Call unregister_netdevice_notifier early so that the rest of the cleanup
code does not need to deal with network devices.  This takes advantage
of my recent enhancement to unregister_netdevice_notifier to send
unregister notifications of all network devices that are current
registered.

Move the unregistration for packet types, socket types and protocol
types before we cleanup any of the ax25 data structures to remove the
possibilities of other races.

Signed-off-by: Eric W. Biederman <ebiederm@xmission.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
---
 net/ax25/af_ax25.c |    9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/net/ax25/af_ax25.c b/net/ax25/af_ax25.c
index e7c69f4..b04a6ef 100644
--- a/net/ax25/af_ax25.c
+++ b/net/ax25/af_ax25.c
@@ -2006,16 +2006,17 @@ static void __exit ax25_exit(void)
 	proc_net_remove(&init_net, "ax25_route");
 	proc_net_remove(&init_net, "ax25");
 	proc_net_remove(&init_net, "ax25_calls");
-	ax25_rt_free();
-	ax25_uid_free();
-	ax25_dev_free();
 
-	ax25_unregister_sysctl();
 	unregister_netdevice_notifier(&ax25_dev_notifier);
+	ax25_unregister_sysctl();
 
 	dev_remove_pack(&ax25_packet_type);
 
 	sock_unregister(PF_AX25);
 	proto_unregister(&ax25_proto);
+
+	ax25_rt_free();
+	ax25_uid_free();
+	ax25_dev_free();
 }
 module_exit(ax25_exit);
-- 
1.7.10




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

* [ 087/167] [PATCH 26/26] tcp: fix TCP_MAXSEG for established IPv6 passive sockets
  2012-05-09  5:50 [ 000/167] 3.2.17-stable review Ben Hutchings
                   ` (85 preceding siblings ...)
  2012-05-09  5:51 ` [ 086/167] [PATCH 25/26] net ax25: Reorder ax25_exit to remove races Ben Hutchings
@ 2012-05-09  5:51 ` Ben Hutchings
  2012-05-09  5:51 ` [ 088/167] [PATCH] nfs: Enclose hostname in brackets when needed in nfs_do_root_mount Ben Hutchings
                   ` (79 subsequent siblings)
  166 siblings, 0 replies; 195+ messages in thread
From: Ben Hutchings @ 2012-05-09  5:51 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: torvalds, akpm, alan, Neal Cardwell, Eric Dumazet, David S. Miller

3.2-stable review patch.  If anyone has any objections, please let me know.

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

From: Neal Cardwell <ncardwell@google.com>

[ Upstream commit d135c522f1234f62e81be29cebdf59e9955139ad ]

Commit f5fff5d forgot to fix TCP_MAXSEG behavior IPv6 sockets, so IPv6
TCP server sockets that used TCP_MAXSEG would find that the advmss of
child sockets would be incorrect. This commit mirrors the advmss logic
from tcp_v4_syn_recv_sock in tcp_v6_syn_recv_sock. Eventually this
logic should probably be shared between IPv4 and IPv6, but this at
least fixes this issue.

Signed-off-by: Neal Cardwell <ncardwell@google.com>
Acked-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
---
 net/ipv6/tcp_ipv6.c |    4 ++++
 1 file changed, 4 insertions(+)

diff --git a/net/ipv6/tcp_ipv6.c b/net/ipv6/tcp_ipv6.c
index b859e4a..4a56574 100644
--- a/net/ipv6/tcp_ipv6.c
+++ b/net/ipv6/tcp_ipv6.c
@@ -1494,6 +1494,10 @@ static struct sock * tcp_v6_syn_recv_sock(struct sock *sk, struct sk_buff *skb,
 	tcp_mtup_init(newsk);
 	tcp_sync_mss(newsk, dst_mtu(dst));
 	newtp->advmss = dst_metric_advmss(dst);
+	if (tcp_sk(sk)->rx_opt.user_mss &&
+	    tcp_sk(sk)->rx_opt.user_mss < newtp->advmss)
+		newtp->advmss = tcp_sk(sk)->rx_opt.user_mss;
+
 	tcp_initialize_rcv_mss(newsk);
 	if (tcp_rsk(req)->snt_synack)
 		tcp_valid_rtt_meas(newsk,
-- 
1.7.10




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

* [ 088/167] [PATCH] nfs: Enclose hostname in brackets when needed in nfs_do_root_mount
  2012-05-09  5:50 [ 000/167] 3.2.17-stable review Ben Hutchings
                   ` (86 preceding siblings ...)
  2012-05-09  5:51 ` [ 087/167] [PATCH 26/26] tcp: fix TCP_MAXSEG for established IPv6 passive sockets Ben Hutchings
@ 2012-05-09  5:51 ` Ben Hutchings
  2012-05-09  5:51 ` [ 089/167] [PATCH] NFSv4: Ensure that the LOCK code sets exception->inode Ben Hutchings
                   ` (78 subsequent siblings)
  166 siblings, 0 replies; 195+ messages in thread
From: Ben Hutchings @ 2012-05-09  5:51 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: torvalds, akpm, alan, Jan Kara, Josh Boyer, Trond Myklebust

3.2-stable review patch.  If anyone has any objections, please let me know.

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

From: Jan Kara <jack@suse.cz>

commit 98a2139f4f4d7b5fcc3a54c7fddbe88612abed20 upstream.

When hostname contains colon (e.g. when it is an IPv6 address) it needs
to be enclosed in brackets to make parsing of NFS device string possible.
Fix nfs_do_root_mount() to enclose hostname properly when needed. NFS code
actually does not need this as it does not parse the string passed by
nfs_do_root_mount() but the device string is exposed to userspace in
/proc/mounts.

CC: Josh Boyer <jwboyer@redhat.com>
CC: Trond Myklebust <Trond.Myklebust@netapp.com>
Signed-off-by: Jan Kara <jack@suse.cz>
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
---
 fs/nfs/super.c |    8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/fs/nfs/super.c b/fs/nfs/super.c
index 37412f7..1e6715f 100644
--- a/fs/nfs/super.c
+++ b/fs/nfs/super.c
@@ -2767,11 +2767,15 @@ static struct vfsmount *nfs_do_root_mount(struct file_system_type *fs_type,
 	char *root_devname;
 	size_t len;
 
-	len = strlen(hostname) + 3;
+	len = strlen(hostname) + 5;
 	root_devname = kmalloc(len, GFP_KERNEL);
 	if (root_devname == NULL)
 		return ERR_PTR(-ENOMEM);
-	snprintf(root_devname, len, "%s:/", hostname);
+	/* Does hostname needs to be enclosed in brackets? */
+	if (strchr(hostname, ':'))
+		snprintf(root_devname, len, "[%s]:/", hostname);
+	else
+		snprintf(root_devname, len, "%s:/", hostname);
 	root_mnt = vfs_kern_mount(fs_type, flags, root_devname, data);
 	kfree(root_devname);
 	return root_mnt;
-- 
1.7.10




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

* [ 089/167] [PATCH] NFSv4: Ensure that the LOCK code sets exception->inode
  2012-05-09  5:50 [ 000/167] 3.2.17-stable review Ben Hutchings
                   ` (87 preceding siblings ...)
  2012-05-09  5:51 ` [ 088/167] [PATCH] nfs: Enclose hostname in brackets when needed in nfs_do_root_mount Ben Hutchings
@ 2012-05-09  5:51 ` Ben Hutchings
  2012-05-09  5:51 ` [ 090/167] [PATCH] NFSv4: Ensure that we check lock exclusive/shared type against open modes Ben Hutchings
                   ` (77 subsequent siblings)
  166 siblings, 0 replies; 195+ messages in thread
From: Ben Hutchings @ 2012-05-09  5:51 UTC (permalink / raw)
  To: linux-kernel, stable; +Cc: torvalds, akpm, alan, Trond Myklebust

3.2-stable review patch.  If anyone has any objections, please let me know.

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

From: Trond Myklebust <Trond.Myklebust@netapp.com>

commit 05ffe24f5290dc095f98fbaf84afe51ef404ccc5 upstream.

All callers of nfs4_handle_exception() that need to handle
NFS4ERR_OPENMODE correctly should set exception->inode

Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
---
 fs/nfs/nfs4proc.c |    9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/fs/nfs/nfs4proc.c b/fs/nfs/nfs4proc.c
index f82bde0..3c787d0 100644
--- a/fs/nfs/nfs4proc.c
+++ b/fs/nfs/nfs4proc.c
@@ -4558,7 +4558,9 @@ static int _nfs4_do_setlk(struct nfs4_state *state, int cmd, struct file_lock *f
 static int nfs4_lock_reclaim(struct nfs4_state *state, struct file_lock *request)
 {
 	struct nfs_server *server = NFS_SERVER(state->inode);
-	struct nfs4_exception exception = { };
+	struct nfs4_exception exception = {
+		.inode = state->inode,
+	};
 	int err;
 
 	do {
@@ -4576,7 +4578,9 @@ static int nfs4_lock_reclaim(struct nfs4_state *state, struct file_lock *request
 static int nfs4_lock_expired(struct nfs4_state *state, struct file_lock *request)
 {
 	struct nfs_server *server = NFS_SERVER(state->inode);
-	struct nfs4_exception exception = { };
+	struct nfs4_exception exception = {
+		.inode = state->inode,
+	};
 	int err;
 
 	err = nfs4_set_lock_state(state, request);
@@ -4676,6 +4680,7 @@ static int nfs4_proc_setlk(struct nfs4_state *state, int cmd, struct file_lock *
 {
 	struct nfs4_exception exception = {
 		.state = state,
+		.inode = state->inode,
 	};
 	int err;
 
-- 
1.7.10




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

* [ 090/167] [PATCH] NFSv4: Ensure that we check lock exclusive/shared type against open modes
  2012-05-09  5:50 [ 000/167] 3.2.17-stable review Ben Hutchings
                   ` (88 preceding siblings ...)
  2012-05-09  5:51 ` [ 089/167] [PATCH] NFSv4: Ensure that the LOCK code sets exception->inode Ben Hutchings
@ 2012-05-09  5:51 ` Ben Hutchings
  2012-05-09  5:52 ` [ 091/167] [PATCH] NFS: put open context on error in nfs_pagein_multi Ben Hutchings
                   ` (76 subsequent siblings)
  166 siblings, 0 replies; 195+ messages in thread
From: Ben Hutchings @ 2012-05-09  5:51 UTC (permalink / raw)
  To: linux-kernel, stable; +Cc: torvalds, akpm, alan, Trond Myklebust

3.2-stable review patch.  If anyone has any objections, please let me know.

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

From: Trond Myklebust <Trond.Myklebust@netapp.com>

commit 55725513b5ef9d462aa3e18527658a0362aaae83 upstream.

Since we may be simulating flock() locks using NFS byte range locks,
we can't rely on the VFS having checked the file open mode for us.

Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
---
 fs/nfs/nfs4proc.c |   14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/fs/nfs/nfs4proc.c b/fs/nfs/nfs4proc.c
index 3c787d0..ba837d9 100644
--- a/fs/nfs/nfs4proc.c
+++ b/fs/nfs/nfs4proc.c
@@ -4726,6 +4726,20 @@ nfs4_proc_lock(struct file *filp, int cmd, struct file_lock *request)
 
 	if (state == NULL)
 		return -ENOLCK;
+	/*
+	 * Don't rely on the VFS having checked the file open mode,
+	 * since it won't do this for flock() locks.
+	 */
+	switch (request->fl_type & (F_RDLCK|F_WRLCK|F_UNLCK)) {
+	case F_RDLCK:
+		if (!(filp->f_mode & FMODE_READ))
+			return -EBADF;
+		break;
+	case F_WRLCK:
+		if (!(filp->f_mode & FMODE_WRITE))
+			return -EBADF;
+	}
+
 	do {
 		status = nfs4_proc_setlk(state, cmd, request);
 		if ((status != -EAGAIN) || IS_SETLK(cmd))
-- 
1.7.10




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

* [ 091/167] [PATCH] NFS: put open context on error in nfs_pagein_multi
  2012-05-09  5:50 [ 000/167] 3.2.17-stable review Ben Hutchings
                   ` (89 preceding siblings ...)
  2012-05-09  5:51 ` [ 090/167] [PATCH] NFSv4: Ensure that we check lock exclusive/shared type against open modes Ben Hutchings
@ 2012-05-09  5:52 ` Ben Hutchings
  2012-05-09  5:52 ` [ 092/167] [PATCH] NFS: put open context on error in nfs_flush_multi Ben Hutchings
                   ` (75 subsequent siblings)
  166 siblings, 0 replies; 195+ messages in thread
From: Ben Hutchings @ 2012-05-09  5:52 UTC (permalink / raw)
  To: linux-kernel, stable; +Cc: torvalds, akpm, alan, Fred Isaman, Trond Myklebust

3.2-stable review patch.  If anyone has any objections, please let me know.

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

From: Fred Isaman <iisaman@netapp.com>

commit 73fb7bc7c57d971b11f2e00536ac2d3e316e0609 upstream.

Signed-off-by: Fred Isaman <iisaman@netapp.com>
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
---
 fs/nfs/read.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/nfs/read.c b/fs/nfs/read.c
index 9a0e8ef..0a4be28 100644
--- a/fs/nfs/read.c
+++ b/fs/nfs/read.c
@@ -322,7 +322,7 @@ out_bad:
 	while (!list_empty(res)) {
 		data = list_entry(res->next, struct nfs_read_data, list);
 		list_del(&data->list);
-		nfs_readdata_free(data);
+		nfs_readdata_release(data);
 	}
 	nfs_readpage_release(req);
 	return -ENOMEM;
-- 
1.7.10




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

* [ 092/167] [PATCH] NFS: put open context on error in nfs_flush_multi
  2012-05-09  5:50 [ 000/167] 3.2.17-stable review Ben Hutchings
                   ` (90 preceding siblings ...)
  2012-05-09  5:52 ` [ 091/167] [PATCH] NFS: put open context on error in nfs_pagein_multi Ben Hutchings
@ 2012-05-09  5:52 ` Ben Hutchings
  2012-05-09  5:52 ` [ 093/167] [PATCH] x86, microcode: Fix sysfs warning during module unload on unsupported CPUs Ben Hutchings
                   ` (74 subsequent siblings)
  166 siblings, 0 replies; 195+ messages in thread
From: Ben Hutchings @ 2012-05-09  5:52 UTC (permalink / raw)
  To: linux-kernel, stable; +Cc: torvalds, akpm, alan, Fred Isaman, Trond Myklebust

3.2-stable review patch.  If anyone has any objections, please let me know.

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

From: Fred Isaman <iisaman@netapp.com>

commit 8ccd271f7a3a846ce6f85ead0760d9d12994a611 upstream.

Signed-off-by: Fred Isaman <iisaman@netapp.com>
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
---
 fs/nfs/write.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/nfs/write.c b/fs/nfs/write.c
index 9b8d4d4..c074623 100644
--- a/fs/nfs/write.c
+++ b/fs/nfs/write.c
@@ -1019,7 +1019,7 @@ out_bad:
 	while (!list_empty(res)) {
 		data = list_entry(res->next, struct nfs_write_data, list);
 		list_del(&data->list);
-		nfs_writedata_free(data);
+		nfs_writedata_release(data);
 	}
 	nfs_redirty_request(req);
 	return -ENOMEM;
-- 
1.7.10




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

* [ 093/167] [PATCH] x86, microcode: Fix sysfs warning during module unload on unsupported CPUs
  2012-05-09  5:50 [ 000/167] 3.2.17-stable review Ben Hutchings
                   ` (91 preceding siblings ...)
  2012-05-09  5:52 ` [ 092/167] [PATCH] NFS: put open context on error in nfs_flush_multi Ben Hutchings
@ 2012-05-09  5:52 ` Ben Hutchings
  2012-05-09  5:52 ` [ 094/167] [PATCH] x86, apic: APIC code touches invalid MSR on P5 class machines Ben Hutchings
                   ` (73 subsequent siblings)
  166 siblings, 0 replies; 195+ messages in thread
From: Ben Hutchings @ 2012-05-09  5:52 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: torvalds, akpm, alan, Andreas Herrmann, Tigran Aivazian,
	Greg Kroah-Hartman, Borislav Petkov

3.2-stable review patch.  If anyone has any objections, please let me know.

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

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

commit a956bd6f8583326b18348ab1452b4686778f785d upstream.

Loading the microcode driver on an unsupported CPU and subsequently
unloading the driver causes

 WARNING: at fs/sysfs/group.c:138 mc_device_remove+0x5f/0x70 [microcode]()
 Hardware name: 01972NG
 sysfs group ffffffffa00013d0 not found for kobject 'cpu0'
 Modules linked in: snd_hda_codec_hdmi snd_hda_codec_conexant snd_hda_intel btusb snd_hda_codec bluetooth thinkpad_acpi rfkill microcode(-) [last unloaded: cfg80211]
 Pid: 4560, comm: modprobe Not tainted 3.4.0-rc2-00002-g258f742 #5
 Call Trace:
  [<ffffffff8103113b>] ? warn_slowpath_common+0x7b/0xc0
  [<ffffffff81031235>] ? warn_slowpath_fmt+0x45/0x50
  [<ffffffff81120e74>] ? sysfs_remove_group+0x34/0x120
  [<ffffffffa00000ef>] ? mc_device_remove+0x5f/0x70 [microcode]
  [<ffffffff81331eb9>] ? subsys_interface_unregister+0x69/0xa0
  [<ffffffff81563526>] ? mutex_lock+0x16/0x40
  [<ffffffffa0000c3e>] ? microcode_exit+0x50/0x92 [microcode]
  [<ffffffff8107051d>] ? sys_delete_module+0x16d/0x260
  [<ffffffff810a0065>] ? wait_iff_congested+0x45/0x110
  [<ffffffff815656af>] ? page_fault+0x1f/0x30
  [<ffffffff81565ba2>] ? system_call_fastpath+0x16/0x1b

on recent kernels.

This is due to commit 8a25a2fd126c ("cpu: convert 'cpu' and
'machinecheck' sysdev_class to a regular subsystem") which renders
commit 6c53cbfced04 ("x86, microcode: Correct sysdev_add error path")
useless.

See http://marc.info/?l=linux-kernel&m=133416246406478

Avoid above warning by restoring the old driver behaviour before
6c53cbfced04 ("x86, microcode: Correct sysdev_add error path").

Cc: Tigran Aivazian <tigran@aivazian.fsnet.co.uk>
Signed-off-by: Andreas Herrmann <andreas.herrmann3@amd.com>
Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Link: http://lkml.kernel.org/r/20120411163849.GE4794@alberich.amd.com
Signed-off-by: Borislav Petkov <borislav.petkov@amd.com>
[bwh: Backported to 3.2: deleted line uses sys_dev, not dev]
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
---
 arch/x86/kernel/microcode_core.c |    4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

--- a/arch/x86/kernel/microcode_core.c
+++ b/arch/x86/kernel/microcode_core.c
@@ -419,10 +419,8 @@ static int mc_device_add(struct device *dev, struct subsys_interface *sif)
 	if (err)
 		return err;
 
-	if (microcode_init_cpu(cpu) == UCODE_ERROR) {
-		sysfs_remove_group(&sys_dev->kobj, &mc_attr_group);
+	if (microcode_init_cpu(cpu) == UCODE_ERROR)
 		return -EINVAL;
-	}
 
 	return err;
 }



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

* [ 094/167] [PATCH] x86, apic: APIC code touches invalid MSR on P5 class machines
  2012-05-09  5:50 [ 000/167] 3.2.17-stable review Ben Hutchings
                   ` (92 preceding siblings ...)
  2012-05-09  5:52 ` [ 093/167] [PATCH] x86, microcode: Fix sysfs warning during module unload on unsupported CPUs Ben Hutchings
@ 2012-05-09  5:52 ` Ben Hutchings
  2012-05-09  5:52 ` [ 095/167] [PATCH] Revert "autofs: work around unhappy compat problem on x86-64" Ben Hutchings
                   ` (72 subsequent siblings)
  166 siblings, 0 replies; 195+ messages in thread
From: Ben Hutchings @ 2012-05-09  5:52 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: torvalds, akpm, alan, Bryan ODonoghue, H. Peter Anvin

3.2-stable review patch.  If anyone has any objections, please let me know.

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

From: Bryan O'Donoghue <bryan.odonoghue@linux.intel.com>

commit cbf2829b61c136edcba302a5e1b6b40e97d32c00 upstream.

Current APIC code assumes MSR_IA32_APICBASE is present for all systems.
Pentium Classic P5 and friends didn't have this MSR. MSR_IA32_APICBASE
was introduced as an architectural MSR by Intel @ P6.

Code paths that can touch this MSR invalidly are when vendor == Intel &&
cpu-family == 5 and APIC bit is set in CPUID - or when you simply pass
lapic on the kernel command line, on a P5.

The below patch stops Linux incorrectly interfering with the
MSR_IA32_APICBASE for P5 class machines. Other code paths exist that
touch the MSR - however those paths are not currently reachable for a
conformant P5.

Signed-off-by: Bryan O'Donoghue <bryan.odonoghue@linux.intel.com>
Link: http://lkml.kernel.org/r/4F8EEDD3.1080404@linux.intel.com
Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
---
 arch/x86/kernel/apic/apic.c |   34 ++++++++++++++++++++--------------
 1 file changed, 20 insertions(+), 14 deletions(-)

diff --git a/arch/x86/kernel/apic/apic.c b/arch/x86/kernel/apic/apic.c
index 11544d8..edc2448 100644
--- a/arch/x86/kernel/apic/apic.c
+++ b/arch/x86/kernel/apic/apic.c
@@ -1637,9 +1637,11 @@ static int __init apic_verify(void)
 	mp_lapic_addr = APIC_DEFAULT_PHYS_BASE;
 
 	/* The BIOS may have set up the APIC at some other address */
-	rdmsr(MSR_IA32_APICBASE, l, h);
-	if (l & MSR_IA32_APICBASE_ENABLE)
-		mp_lapic_addr = l & MSR_IA32_APICBASE_BASE;
+	if (boot_cpu_data.x86 >= 6) {
+		rdmsr(MSR_IA32_APICBASE, l, h);
+		if (l & MSR_IA32_APICBASE_ENABLE)
+			mp_lapic_addr = l & MSR_IA32_APICBASE_BASE;
+	}
 
 	pr_info("Found and enabled local APIC!\n");
 	return 0;
@@ -1657,13 +1659,15 @@ int __init apic_force_enable(unsigned long addr)
 	 * MSR. This can only be done in software for Intel P6 or later
 	 * and AMD K7 (Model > 1) or later.
 	 */
-	rdmsr(MSR_IA32_APICBASE, l, h);
-	if (!(l & MSR_IA32_APICBASE_ENABLE)) {
-		pr_info("Local APIC disabled by BIOS -- reenabling.\n");
-		l &= ~MSR_IA32_APICBASE_BASE;
-		l |= MSR_IA32_APICBASE_ENABLE | addr;
-		wrmsr(MSR_IA32_APICBASE, l, h);
-		enabled_via_apicbase = 1;
+	if (boot_cpu_data.x86 >= 6) {
+		rdmsr(MSR_IA32_APICBASE, l, h);
+		if (!(l & MSR_IA32_APICBASE_ENABLE)) {
+			pr_info("Local APIC disabled by BIOS -- reenabling.\n");
+			l &= ~MSR_IA32_APICBASE_BASE;
+			l |= MSR_IA32_APICBASE_ENABLE | addr;
+			wrmsr(MSR_IA32_APICBASE, l, h);
+			enabled_via_apicbase = 1;
+		}
 	}
 	return apic_verify();
 }
@@ -2209,10 +2213,12 @@ static void lapic_resume(void)
 		 * FIXME! This will be wrong if we ever support suspend on
 		 * SMP! We'll need to do this as part of the CPU restore!
 		 */
-		rdmsr(MSR_IA32_APICBASE, l, h);
-		l &= ~MSR_IA32_APICBASE_BASE;
-		l |= MSR_IA32_APICBASE_ENABLE | mp_lapic_addr;
-		wrmsr(MSR_IA32_APICBASE, l, h);
+		if (boot_cpu_data.x86 >= 6) {
+			rdmsr(MSR_IA32_APICBASE, l, h);
+			l &= ~MSR_IA32_APICBASE_BASE;
+			l |= MSR_IA32_APICBASE_ENABLE | mp_lapic_addr;
+			wrmsr(MSR_IA32_APICBASE, l, h);
+		}
 	}
 
 	maxlvt = lapic_get_maxlvt();
-- 
1.7.10




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

* [ 095/167] [PATCH] Revert "autofs: work around unhappy compat problem on x86-64"
  2012-05-09  5:50 [ 000/167] 3.2.17-stable review Ben Hutchings
                   ` (93 preceding siblings ...)
  2012-05-09  5:52 ` [ 094/167] [PATCH] x86, apic: APIC code touches invalid MSR on P5 class machines Ben Hutchings
@ 2012-05-09  5:52 ` Ben Hutchings
  2012-05-09  5:52 ` [ 096/167] [PATCH] xen: correctly check for pending events when restoring irq flags Ben Hutchings
                   ` (71 subsequent siblings)
  166 siblings, 0 replies; 195+ messages in thread
From: Ben Hutchings @ 2012-05-09  5:52 UTC (permalink / raw)
  To: linux-kernel, stable; +Cc: torvalds, akpm, alan, Ian Kent

3.2-stable review patch.  If anyone has any objections, please let me know.

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

From: Linus Torvalds <torvalds@linux-foundation.org>

commit fcbf94b9dedd2ce08e798a99aafc94fec8668161 upstream.

This reverts commit a32744d4abae24572eff7269bc17895c41bd0085.

While that commit was technically the right thing to do, and made the
x86-64 compat mode work identically to native 32-bit mode (and thus
fixing the problem with a 32-bit systemd install on a 64-bit kernel), it
turns out that the automount binaries had workarounds for this compat
problem.

Now, the workarounds are disgusting: doing an "uname()" to find out the
architecture of the kernel, and then comparing it for the 64-bit cases
and fixing up the size of the read() in automount for those.  And they
were confused: it's not actually a generic 64-bit issue at all, it's
very much tied to just x86-64, which has different alignment for an
'u64' in 64-bit mode than in 32-bit mode.

But the end result is that fixing the compat layer actually breaks the
case of a 32-bit automount on a x86-64 kernel.

There are various approaches to fix this (including just doing a
"strcmp()" on current->comm and comparing it to "automount"), but I
think that I will do the one that teaches pipes about a special "packet
mode", which will allow user space to not have to care too deeply about
the padding at the end of the autofs packet.

That change will make the compat workaround unnecessary, so let's revert
it first, and get automount working again in compat mode.  The
packetized pipes will then fix autofs for systemd.

Reported-and-requested-by: Michael Tokarev <mjt@tls.msk.ru>
Cc: Ian Kent <raven@themaw.net>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
[bwh: Backported to 3.2: adjust context]
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
---
 fs/autofs4/autofs_i.h  |    1 -
 fs/autofs4/dev-ioctl.c |    1 -
 fs/autofs4/inode.c     |    2 --
 fs/autofs4/waitq.c     |   22 +++-------------------
 4 files changed, 3 insertions(+), 23 deletions(-)

--- linux.orig/fs/autofs4/autofs_i.h
+++ linux/fs/autofs4/autofs_i.h
@@ -110,7 +110,6 @@
 	int sub_version;
 	int min_proto;
 	int max_proto;
-	int compat_daemon;
 	unsigned long exp_timeout;
 	unsigned int type;
 	int reghost_enabled;
--- linux.orig/fs/autofs4/dev-ioctl.c
+++ linux/fs/autofs4/dev-ioctl.c
@@ -385,7 +385,6 @@
 		sbi->pipefd = pipefd;
 		sbi->pipe = pipe;
 		sbi->catatonic = 0;
-		sbi->compat_daemon = is_compat_task();
 	}
 out:
 	mutex_unlock(&sbi->wq_mutex);
--- linux.orig/fs/autofs4/inode.c
+++ linux/fs/autofs4/inode.c
@@ -19,7 +19,6 @@
 #include <linux/parser.h>
 #include <linux/bitops.h>
 #include <linux/magic.h>
-#include <linux/compat.h>
 #include "autofs_i.h"
 #include <linux/module.h>
 
@@ -225,7 +224,6 @@
 	set_autofs_type_indirect(&sbi->type);
 	sbi->min_proto = 0;
 	sbi->max_proto = 0;
-	sbi->compat_daemon = is_compat_task();
 	mutex_init(&sbi->wq_mutex);
 	spin_lock_init(&sbi->fs_lock);
 	sbi->queues = NULL;
--- linux.orig/fs/autofs4/waitq.c
+++ linux/fs/autofs4/waitq.c
@@ -90,24 +90,7 @@
 
 	return (bytes > 0);
 }
-
-/*
- * The autofs_v5 packet was misdesigned.
- *
- * The packets are identical on x86-32 and x86-64, but have different
- * alignment. Which means that 'sizeof()' will give different results.
- * Fix it up for the case of running 32-bit user mode on a 64-bit kernel.
- */
-static noinline size_t autofs_v5_packet_size(struct autofs_sb_info *sbi)
-{
-	size_t pktsz = sizeof(struct autofs_v5_packet);
-#if defined(CONFIG_X86_64) && defined(CONFIG_COMPAT)
-	if (sbi->compat_daemon > 0)
-		pktsz -= 4;
-#endif
-	return pktsz;
-}
-
+	
 static void autofs4_notify_daemon(struct autofs_sb_info *sbi,
 				 struct autofs_wait_queue *wq,
 				 int type)
@@ -164,7 +147,8 @@
 	{
 		struct autofs_v5_packet *packet = &pkt.v5_pkt.v5_packet;
 
-		pktsz = autofs_v5_packet_size(sbi);
+		pktsz = sizeof(*packet);
+
 		packet->wait_queue_token = wq->wait_queue_token;
 		packet->len = wq->name.len;
 		memcpy(packet->name, wq->name.name, wq->name.len);



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

* [ 096/167] [PATCH] xen: correctly check for pending events when restoring irq flags
  2012-05-09  5:50 [ 000/167] 3.2.17-stable review Ben Hutchings
                   ` (94 preceding siblings ...)
  2012-05-09  5:52 ` [ 095/167] [PATCH] Revert "autofs: work around unhappy compat problem on x86-64" Ben Hutchings
@ 2012-05-09  5:52 ` Ben Hutchings
  2012-05-09  5:52 ` [ 097/167] [PATCH] xen/smp: Fix crash when booting with ACPI hotplug CPUs Ben Hutchings
                   ` (70 subsequent siblings)
  166 siblings, 0 replies; 195+ messages in thread
From: Ben Hutchings @ 2012-05-09  5:52 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: torvalds, akpm, alan, David Vrabel, Ian Campbell, Konrad Rzeszutek Wilk

3.2-stable review patch.  If anyone has any objections, please let me know.

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

From: David Vrabel <david.vrabel@citrix.com>

commit 7eb7ce4d2e8991aff4ecb71a81949a907ca755ac upstream.

In xen_restore_fl_direct(), xen_force_evtchn_callback() was being
called even if no events were pending.  This resulted in (depending on
workload) about a 100 times as many xen_version hypercalls as
necessary.

Fix this by correcting the sense of the conditional jump.

This seems to give a significant performance benefit for some
workloads.

There is some subtle tricksy "..since the check here is trying to
check both pending and masked in a single cmpw, but I think this is
correct. It will call check_events now only when the combined
mask+pending word is 0x0001 (aka unmasked, pending)." (Ian)

Acked-by: Ian Campbell <ian.campbell@citrix.com>
Signed-off-by: David Vrabel <david.vrabel@citrix.com>
Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
---
 arch/x86/xen/xen-asm.S |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/x86/xen/xen-asm.S b/arch/x86/xen/xen-asm.S
index 79d7362..3e45aa0 100644
--- a/arch/x86/xen/xen-asm.S
+++ b/arch/x86/xen/xen-asm.S
@@ -96,7 +96,7 @@ ENTRY(xen_restore_fl_direct)
 
 	/* check for unmasked and pending */
 	cmpw $0x0001, PER_CPU_VAR(xen_vcpu_info) + XEN_vcpu_info_pending
-	jz 1f
+	jnz 1f
 2:	call check_events
 1:
 ENDPATCH(xen_restore_fl_direct)
-- 
1.7.10




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

* [ 097/167] [PATCH] xen/smp: Fix crash when booting with ACPI hotplug CPUs.
  2012-05-09  5:50 [ 000/167] 3.2.17-stable review Ben Hutchings
                   ` (95 preceding siblings ...)
  2012-05-09  5:52 ` [ 096/167] [PATCH] xen: correctly check for pending events when restoring irq flags Ben Hutchings
@ 2012-05-09  5:52 ` Ben Hutchings
  2012-05-09  5:52 ` [ 098/167] [PATCH] ASoC: dapm: Ensure power gets managed for line widgets Ben Hutchings
                   ` (69 subsequent siblings)
  166 siblings, 0 replies; 195+ messages in thread
From: Ben Hutchings @ 2012-05-09  5:52 UTC (permalink / raw)
  To: linux-kernel, stable; +Cc: torvalds, akpm, alan, Konrad Rzeszutek Wilk

3.2-stable review patch.  If anyone has any objections, please let me know.

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

From: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>

commit cf405ae612b0f7e2358db7ff594c0e94846137aa upstream.

When we boot on a machine that can hotplug CPUs and we
are using 'dom0_max_vcpus=X' on the Xen hypervisor line
to clip the amount of CPUs available to the initial domain,
we get this:

(XEN) Command line: com1=115200,8n1 dom0_mem=8G noreboot dom0_max_vcpus=8 sync_console mce_verbosity=verbose console=com1,vga loglvl=all guest_loglvl=all
.. snip..
DMI: Intel Corporation S2600CP/S2600CP, BIOS SE5C600.86B.99.99.x032.072520111118 07/25/2011
.. snip.
SMP: Allowing 64 CPUs, 32 hotplug CPUs
installing Xen timer for CPU 7
cpu 7 spinlock event irq 361
NMI watchdog: disabled (cpu7): hardware events not enabled
Brought up 8 CPUs
.. snip..
	[acpi processor finds the CPUs are not initialized and starts calling
	arch_register_cpu, which creates /sys/devices/system/cpu/cpu8/online]
CPU 8 got hotplugged
CPU 9 got hotplugged
CPU 10 got hotplugged
.. snip..
initcall 1_acpi_battery_init_async+0x0/0x1b returned 0 after 406 usecs
calling  erst_init+0x0/0x2bb @ 1

	[and the scheduler sticks newly started tasks on the new CPUs, but
	said CPUs cannot be initialized b/c the hypervisor has limited the
	amount of vCPUS to 8 - as per the dom0_max_vcpus=8 flag.
	The spinlock tries to kick the other CPU, but the structure for that
	is not initialized and we crash.]
BUG: unable to handle kernel paging request at fffffffffffffed8
IP: [<ffffffff81035289>] xen_spin_lock+0x29/0x60
PGD 180d067 PUD 180e067 PMD 0
Oops: 0002 [#1] SMP
CPU 7
Modules linked in:

Pid: 1, comm: swapper/0 Not tainted 3.4.0-rc2upstream-00001-gf5154e8 #1 Intel Corporation S2600CP/S2600CP
RIP: e030:[<ffffffff81035289>]  [<ffffffff81035289>] xen_spin_lock+0x29/0x60
RSP: e02b:ffff8801fb9b3a70  EFLAGS: 00010282

With this patch, we cap the amount of vCPUS that the initial domain
can run, to exactly what dom0_max_vcpus=X has specified.

In the future, if there is a hypercall that will allow a running
domain to expand past its initial set of vCPUS, this patch should
be re-evaluated.

Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
---
 arch/x86/xen/smp.c |   15 +++++++++++++++
 1 file changed, 15 insertions(+)

diff --git a/arch/x86/xen/smp.c b/arch/x86/xen/smp.c
index 5fac691..0503c0c 100644
--- a/arch/x86/xen/smp.c
+++ b/arch/x86/xen/smp.c
@@ -178,6 +178,7 @@ static void __init xen_fill_possible_map(void)
 static void __init xen_filter_cpu_maps(void)
 {
 	int i, rc;
+	unsigned int subtract = 0;
 
 	if (!xen_initial_domain())
 		return;
@@ -192,8 +193,22 @@ static void __init xen_filter_cpu_maps(void)
 		} else {
 			set_cpu_possible(i, false);
 			set_cpu_present(i, false);
+			subtract++;
 		}
 	}
+#ifdef CONFIG_HOTPLUG_CPU
+	/* This is akin to using 'nr_cpus' on the Linux command line.
+	 * Which is OK as when we use 'dom0_max_vcpus=X' we can only
+	 * have up to X, while nr_cpu_ids is greater than X. This
+	 * normally is not a problem, except when CPU hotplugging
+	 * is involved and then there might be more than X CPUs
+	 * in the guest - which will not work as there is no
+	 * hypercall to expand the max number of VCPUs an already
+	 * running guest has. So cap it up to X. */
+	if (subtract)
+		nr_cpu_ids = nr_cpu_ids - subtract;
+#endif
+
 }
 
 static void __init xen_smp_prepare_boot_cpu(void)
-- 
1.7.10




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

* [ 098/167] [PATCH] ASoC: dapm: Ensure power gets managed for line widgets
  2012-05-09  5:50 [ 000/167] 3.2.17-stable review Ben Hutchings
                   ` (96 preceding siblings ...)
  2012-05-09  5:52 ` [ 097/167] [PATCH] xen/smp: Fix crash when booting with ACPI hotplug CPUs Ben Hutchings
@ 2012-05-09  5:52 ` Ben Hutchings
  2012-05-09  5:52 ` [ 099/167] [PATCH] ASoC: wm8994: Improve sequencing of AIF channel enables Ben Hutchings
                   ` (68 subsequent siblings)
  166 siblings, 0 replies; 195+ messages in thread
From: Ben Hutchings @ 2012-05-09  5:52 UTC (permalink / raw)
  To: linux-kernel, stable; +Cc: torvalds, akpm, alan, Mark Brown

3.2-stable review patch.  If anyone has any objections, please let me know.

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

From: Mark Brown <broonie@opensource.wolfsonmicro.com>

commit 7e1f7c8a6e517900cd84da1b8ae020f08f286c3b upstream.

Line widgets had not been included in either the power up or power down
sequences so if a widget had an event associated with it that event would
never be run. Fix this minimally by adding them to the sequences, we
should probably be doing away with the specific widget types as they all
have the same priority anyway.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
---
 sound/soc/soc-dapm.c |    2 ++
 1 file changed, 2 insertions(+)

diff --git a/sound/soc/soc-dapm.c b/sound/soc/soc-dapm.c
index 6241490..dc7dbfe 100644
--- a/sound/soc/soc-dapm.c
+++ b/sound/soc/soc-dapm.c
@@ -67,6 +67,7 @@ static int dapm_up_seq[] = {
 	[snd_soc_dapm_out_drv] = 10,
 	[snd_soc_dapm_hp] = 10,
 	[snd_soc_dapm_spk] = 10,
+	[snd_soc_dapm_line] = 10,
 	[snd_soc_dapm_post] = 11,
 };
 
@@ -75,6 +76,7 @@ static int dapm_down_seq[] = {
 	[snd_soc_dapm_adc] = 1,
 	[snd_soc_dapm_hp] = 2,
 	[snd_soc_dapm_spk] = 2,
+	[snd_soc_dapm_line] = 2,
 	[snd_soc_dapm_out_drv] = 2,
 	[snd_soc_dapm_pga] = 4,
 	[snd_soc_dapm_mixer_named_ctl] = 5,
-- 
1.7.10




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

* [ 099/167] [PATCH] ASoC: wm8994: Improve sequencing of AIF channel enables
  2012-05-09  5:50 [ 000/167] 3.2.17-stable review Ben Hutchings
                   ` (97 preceding siblings ...)
  2012-05-09  5:52 ` [ 098/167] [PATCH] ASoC: dapm: Ensure power gets managed for line widgets Ben Hutchings
@ 2012-05-09  5:52 ` Ben Hutchings
  2012-05-09  5:52 ` [ 100/167] [PATCH] dmaengine: at_hdmac: remove clear-on-read in atc_dostart() Ben Hutchings
                   ` (67 subsequent siblings)
  166 siblings, 0 replies; 195+ messages in thread
From: Ben Hutchings @ 2012-05-09  5:52 UTC (permalink / raw)
  To: linux-kernel, stable; +Cc: torvalds, akpm, alan, Mark Brown

3.2-stable review patch.  If anyone has any objections, please let me know.

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

From: Mark Brown <broonie@opensource.wolfsonmicro.com>

commit 1a38336b8611a04f0a624330c1f815421f4bf5f4 upstream.

This ensures a clean startup of the channels, without this change some
use cases could result in issues in a small proportion of cases.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
---
 sound/soc/codecs/wm8994.c |  276 ++++++++++++++++++++++++++++++++++++---------
 1 file changed, 222 insertions(+), 54 deletions(-)

--- linux.orig/sound/soc/codecs/wm8994.c
+++ linux/sound/soc/codecs/wm8994.c
@@ -883,61 +883,170 @@
 	}
 }
 
-static int late_enable_ev(struct snd_soc_dapm_widget *w,
-			  struct snd_kcontrol *kcontrol, int event)
+static int aif1clk_ev(struct snd_soc_dapm_widget *w,
+		      struct snd_kcontrol *kcontrol, int event)
 {
 	struct snd_soc_codec *codec = w->codec;
-	struct wm8994_priv *wm8994 = snd_soc_codec_get_drvdata(codec);
+	struct wm8994 *control = codec->control_data;
+	int mask = WM8994_AIF1DAC1L_ENA | WM8994_AIF1DAC1R_ENA;
+	int dac;
+	int adc;
+	int val;
+
+	switch (control->type) {
+	case WM8994:
+	case WM8958:
+		mask |= WM8994_AIF1DAC2L_ENA | WM8994_AIF1DAC2R_ENA;
+		break;
+	default:
+		break;
+	}
 
 	switch (event) {
 	case SND_SOC_DAPM_PRE_PMU:
-		if (wm8994->aif1clk_enable) {
-			snd_soc_update_bits(codec, WM8994_AIF1_CLOCKING_1,
-					    WM8994_AIF1CLK_ENA_MASK,
-					    WM8994_AIF1CLK_ENA);
-			wm8994->aif1clk_enable = 0;
-		}
-		if (wm8994->aif2clk_enable) {
-			snd_soc_update_bits(codec, WM8994_AIF2_CLOCKING_1,
-					    WM8994_AIF2CLK_ENA_MASK,
-					    WM8994_AIF2CLK_ENA);
-			wm8994->aif2clk_enable = 0;
-		}
+		val = snd_soc_read(codec, WM8994_AIF1_CONTROL_1);
+		if ((val & WM8994_AIF1ADCL_SRC) &&
+		    (val & WM8994_AIF1ADCR_SRC))
+			adc = WM8994_AIF1ADC1R_ENA | WM8994_AIF1ADC2R_ENA;
+		else if (!(val & WM8994_AIF1ADCL_SRC) &&
+			 !(val & WM8994_AIF1ADCR_SRC))
+			adc = WM8994_AIF1ADC1L_ENA | WM8994_AIF1ADC2L_ENA;
+		else
+			adc = WM8994_AIF1ADC1R_ENA | WM8994_AIF1ADC2R_ENA |
+				WM8994_AIF1ADC1L_ENA | WM8994_AIF1ADC2L_ENA;
+
+		val = snd_soc_read(codec, WM8994_AIF1_CONTROL_2);
+		if ((val & WM8994_AIF1DACL_SRC) &&
+		    (val & WM8994_AIF1DACR_SRC))
+			dac = WM8994_AIF1DAC1R_ENA | WM8994_AIF1DAC2R_ENA;
+		else if (!(val & WM8994_AIF1DACL_SRC) &&
+			 !(val & WM8994_AIF1DACR_SRC))
+			dac = WM8994_AIF1DAC1L_ENA | WM8994_AIF1DAC2L_ENA;
+		else
+			dac = WM8994_AIF1DAC1R_ENA | WM8994_AIF1DAC2R_ENA |
+				WM8994_AIF1DAC1L_ENA | WM8994_AIF1DAC2L_ENA;
+
+		snd_soc_update_bits(codec, WM8994_POWER_MANAGEMENT_4,
+				    mask, adc);
+		snd_soc_update_bits(codec, WM8994_POWER_MANAGEMENT_5,
+				    mask, dac);
+		snd_soc_update_bits(codec, WM8994_CLOCKING_1,
+				    WM8994_AIF1DSPCLK_ENA |
+				    WM8994_SYSDSPCLK_ENA,
+				    WM8994_AIF1DSPCLK_ENA |
+				    WM8994_SYSDSPCLK_ENA);
+		snd_soc_update_bits(codec, WM8994_POWER_MANAGEMENT_4, mask,
+				    WM8994_AIF1ADC1R_ENA |
+				    WM8994_AIF1ADC1L_ENA |
+				    WM8994_AIF1ADC2R_ENA |
+				    WM8994_AIF1ADC2L_ENA);
+		snd_soc_update_bits(codec, WM8994_POWER_MANAGEMENT_5, mask,
+				    WM8994_AIF1DAC1R_ENA |
+				    WM8994_AIF1DAC1L_ENA |
+				    WM8994_AIF1DAC2R_ENA |
+				    WM8994_AIF1DAC2L_ENA);
 		break;
-	}
 
-	/* We may also have postponed startup of DSP, handle that. */
-	wm8958_aif_ev(w, kcontrol, event);
+	case SND_SOC_DAPM_PRE_PMD:
+	case SND_SOC_DAPM_POST_PMD:
+		snd_soc_update_bits(codec, WM8994_POWER_MANAGEMENT_5,
+				    mask, 0);
+		snd_soc_update_bits(codec, WM8994_POWER_MANAGEMENT_4,
+				    mask, 0);
+
+		val = snd_soc_read(codec, WM8994_CLOCKING_1);
+		if (val & WM8994_AIF2DSPCLK_ENA)
+			val = WM8994_SYSDSPCLK_ENA;
+		else
+			val = 0;
+		snd_soc_update_bits(codec, WM8994_CLOCKING_1,
+				    WM8994_SYSDSPCLK_ENA |
+				    WM8994_AIF1DSPCLK_ENA, val);
+		break;
+	}
 
 	return 0;
 }
 
-static int late_disable_ev(struct snd_soc_dapm_widget *w,
-			   struct snd_kcontrol *kcontrol, int event)
+static int aif2clk_ev(struct snd_soc_dapm_widget *w,
+		      struct snd_kcontrol *kcontrol, int event)
 {
 	struct snd_soc_codec *codec = w->codec;
-	struct wm8994_priv *wm8994 = snd_soc_codec_get_drvdata(codec);
+	int dac;
+	int adc;
+	int val;
 
 	switch (event) {
+	case SND_SOC_DAPM_PRE_PMU:
+		val = snd_soc_read(codec, WM8994_AIF2_CONTROL_1);
+		if ((val & WM8994_AIF2ADCL_SRC) &&
+		    (val & WM8994_AIF2ADCR_SRC))
+			adc = WM8994_AIF2ADCR_ENA;
+		else if (!(val & WM8994_AIF2ADCL_SRC) &&
+			 !(val & WM8994_AIF2ADCR_SRC))
+			adc = WM8994_AIF2ADCL_ENA;
+		else
+			adc = WM8994_AIF2ADCL_ENA | WM8994_AIF2ADCR_ENA;
+
+
+		val = snd_soc_read(codec, WM8994_AIF2_CONTROL_2);
+		if ((val & WM8994_AIF2DACL_SRC) &&
+		    (val & WM8994_AIF2DACR_SRC))
+			dac = WM8994_AIF2DACR_ENA;
+		else if (!(val & WM8994_AIF2DACL_SRC) &&
+			 !(val & WM8994_AIF2DACR_SRC))
+			dac = WM8994_AIF2DACL_ENA;
+		else
+			dac = WM8994_AIF2DACL_ENA | WM8994_AIF2DACR_ENA;
+
+		snd_soc_update_bits(codec, WM8994_POWER_MANAGEMENT_4,
+				    WM8994_AIF2ADCL_ENA |
+				    WM8994_AIF2ADCR_ENA, adc);
+		snd_soc_update_bits(codec, WM8994_POWER_MANAGEMENT_5,
+				    WM8994_AIF2DACL_ENA |
+				    WM8994_AIF2DACR_ENA, dac);
+		snd_soc_update_bits(codec, WM8994_CLOCKING_1,
+				    WM8994_AIF2DSPCLK_ENA |
+				    WM8994_SYSDSPCLK_ENA,
+				    WM8994_AIF2DSPCLK_ENA |
+				    WM8994_SYSDSPCLK_ENA);
+		snd_soc_update_bits(codec, WM8994_POWER_MANAGEMENT_4,
+				    WM8994_AIF2ADCL_ENA |
+				    WM8994_AIF2ADCR_ENA,
+				    WM8994_AIF2ADCL_ENA |
+				    WM8994_AIF2ADCR_ENA);
+		snd_soc_update_bits(codec, WM8994_POWER_MANAGEMENT_5,
+				    WM8994_AIF2DACL_ENA |
+				    WM8994_AIF2DACR_ENA,
+				    WM8994_AIF2DACL_ENA |
+				    WM8994_AIF2DACR_ENA);
+		break;
+
+	case SND_SOC_DAPM_PRE_PMD:
 	case SND_SOC_DAPM_POST_PMD:
-		if (wm8994->aif1clk_disable) {
-			snd_soc_update_bits(codec, WM8994_AIF1_CLOCKING_1,
-					    WM8994_AIF1CLK_ENA_MASK, 0);
-			wm8994->aif1clk_disable = 0;
-		}
-		if (wm8994->aif2clk_disable) {
-			snd_soc_update_bits(codec, WM8994_AIF2_CLOCKING_1,
-					    WM8994_AIF2CLK_ENA_MASK, 0);
-			wm8994->aif2clk_disable = 0;
-		}
+		snd_soc_update_bits(codec, WM8994_POWER_MANAGEMENT_5,
+				    WM8994_AIF2DACL_ENA |
+				    WM8994_AIF2DACR_ENA, 0);
+		snd_soc_update_bits(codec, WM8994_POWER_MANAGEMENT_5,
+				    WM8994_AIF2ADCL_ENA |
+				    WM8994_AIF2ADCR_ENA, 0);
+
+		val = snd_soc_read(codec, WM8994_CLOCKING_1);
+		if (val & WM8994_AIF1DSPCLK_ENA)
+			val = WM8994_SYSDSPCLK_ENA;
+		else
+			val = 0;
+		snd_soc_update_bits(codec, WM8994_CLOCKING_1,
+				    WM8994_SYSDSPCLK_ENA |
+				    WM8994_AIF2DSPCLK_ENA, val);
 		break;
 	}
 
 	return 0;
 }
 
-static int aif1clk_ev(struct snd_soc_dapm_widget *w,
-		      struct snd_kcontrol *kcontrol, int event)
+static int aif1clk_late_ev(struct snd_soc_dapm_widget *w,
+			   struct snd_kcontrol *kcontrol, int event)
 {
 	struct snd_soc_codec *codec = w->codec;
 	struct wm8994_priv *wm8994 = snd_soc_codec_get_drvdata(codec);
@@ -954,8 +1063,8 @@
 	return 0;
 }
 
-static int aif2clk_ev(struct snd_soc_dapm_widget *w,
-		      struct snd_kcontrol *kcontrol, int event)
+static int aif2clk_late_ev(struct snd_soc_dapm_widget *w,
+			   struct snd_kcontrol *kcontrol, int event)
 {
 	struct snd_soc_codec *codec = w->codec;
 	struct wm8994_priv *wm8994 = snd_soc_codec_get_drvdata(codec);
@@ -972,6 +1081,63 @@
 	return 0;
 }
 
+static int late_enable_ev(struct snd_soc_dapm_widget *w,
+			  struct snd_kcontrol *kcontrol, int event)
+{
+	struct snd_soc_codec *codec = w->codec;
+	struct wm8994_priv *wm8994 = snd_soc_codec_get_drvdata(codec);
+
+	switch (event) {
+	case SND_SOC_DAPM_PRE_PMU:
+		if (wm8994->aif1clk_enable) {
+			aif1clk_ev(w, kcontrol, event);
+			snd_soc_update_bits(codec, WM8994_AIF1_CLOCKING_1,
+					    WM8994_AIF1CLK_ENA_MASK,
+					    WM8994_AIF1CLK_ENA);
+			wm8994->aif1clk_enable = 0;
+		}
+		if (wm8994->aif2clk_enable) {
+			aif2clk_ev(w, kcontrol, event);
+			snd_soc_update_bits(codec, WM8994_AIF2_CLOCKING_1,
+					    WM8994_AIF2CLK_ENA_MASK,
+					    WM8994_AIF2CLK_ENA);
+			wm8994->aif2clk_enable = 0;
+		}
+		break;
+	}
+
+	/* We may also have postponed startup of DSP, handle that. */
+	wm8958_aif_ev(w, kcontrol, event);
+
+	return 0;
+}
+
+static int late_disable_ev(struct snd_soc_dapm_widget *w,
+			   struct snd_kcontrol *kcontrol, int event)
+{
+	struct snd_soc_codec *codec = w->codec;
+	struct wm8994_priv *wm8994 = snd_soc_codec_get_drvdata(codec);
+
+	switch (event) {
+	case SND_SOC_DAPM_POST_PMD:
+		if (wm8994->aif1clk_disable) {
+			snd_soc_update_bits(codec, WM8994_AIF1_CLOCKING_1,
+					    WM8994_AIF1CLK_ENA_MASK, 0);
+			aif1clk_ev(w, kcontrol, event);
+			wm8994->aif1clk_disable = 0;
+		}
+		if (wm8994->aif2clk_disable) {
+			snd_soc_update_bits(codec, WM8994_AIF2_CLOCKING_1,
+					    WM8994_AIF2CLK_ENA_MASK, 0);
+			aif2clk_ev(w, kcontrol, event);
+			wm8994->aif2clk_disable = 0;
+		}
+		break;
+	}
+
+	return 0;
+}
+
 static int adc_mux_ev(struct snd_soc_dapm_widget *w,
 		      struct snd_kcontrol *kcontrol, int event)
 {
@@ -1268,9 +1434,9 @@
 	SOC_DAPM_ENUM("AIF2DACR Mux", aif2dacr_src_enum);
 
 static const struct snd_soc_dapm_widget wm8994_lateclk_revd_widgets[] = {
-SND_SOC_DAPM_SUPPLY("AIF1CLK", SND_SOC_NOPM, 0, 0, aif1clk_ev,
+SND_SOC_DAPM_SUPPLY("AIF1CLK", SND_SOC_NOPM, 0, 0, aif1clk_late_ev,
 	SND_SOC_DAPM_PRE_PMU | SND_SOC_DAPM_POST_PMD),
-SND_SOC_DAPM_SUPPLY("AIF2CLK", SND_SOC_NOPM, 0, 0, aif2clk_ev,
+SND_SOC_DAPM_SUPPLY("AIF2CLK", SND_SOC_NOPM, 0, 0, aif2clk_late_ev,
 	SND_SOC_DAPM_PRE_PMU | SND_SOC_DAPM_POST_PMD),
 
 SND_SOC_DAPM_PGA_E("Late DAC1L Enable PGA", SND_SOC_NOPM, 0, 0, NULL, 0,
@@ -1299,8 +1465,10 @@
 };
 
 static const struct snd_soc_dapm_widget wm8994_lateclk_widgets[] = {
-SND_SOC_DAPM_SUPPLY("AIF1CLK", WM8994_AIF1_CLOCKING_1, 0, 0, NULL, 0),
-SND_SOC_DAPM_SUPPLY("AIF2CLK", WM8994_AIF2_CLOCKING_1, 0, 0, NULL, 0),
+SND_SOC_DAPM_SUPPLY("AIF1CLK", WM8994_AIF1_CLOCKING_1, 0, 0, aif1clk_ev,
+		    SND_SOC_DAPM_PRE_PMU | SND_SOC_DAPM_PRE_PMD),
+SND_SOC_DAPM_SUPPLY("AIF2CLK", WM8994_AIF2_CLOCKING_1, 0, 0, aif2clk_ev,
+		    SND_SOC_DAPM_PRE_PMU | SND_SOC_DAPM_PRE_PMD),
 SND_SOC_DAPM_PGA("Direct Voice", SND_SOC_NOPM, 0, 0, NULL, 0),
 SND_SOC_DAPM_MIXER("SPKL", WM8994_POWER_MANAGEMENT_3, 8, 0,
 		   left_speaker_mixer, ARRAY_SIZE(left_speaker_mixer)),
@@ -1353,30 +1521,30 @@
 SND_SOC_DAPM_SUPPLY("CLK_SYS", SND_SOC_NOPM, 0, 0, clk_sys_event,
 		    SND_SOC_DAPM_POST_PMU | SND_SOC_DAPM_PRE_PMD),
 
-SND_SOC_DAPM_SUPPLY("DSP1CLK", WM8994_CLOCKING_1, 3, 0, NULL, 0),
-SND_SOC_DAPM_SUPPLY("DSP2CLK", WM8994_CLOCKING_1, 2, 0, NULL, 0),
-SND_SOC_DAPM_SUPPLY("DSPINTCLK", WM8994_CLOCKING_1, 1, 0, NULL, 0),
+SND_SOC_DAPM_SUPPLY("DSP1CLK", SND_SOC_NOPM, 3, 0, NULL, 0),
+SND_SOC_DAPM_SUPPLY("DSP2CLK", SND_SOC_NOPM, 2, 0, NULL, 0),
+SND_SOC_DAPM_SUPPLY("DSPINTCLK", SND_SOC_NOPM, 1, 0, NULL, 0),
 
 SND_SOC_DAPM_AIF_OUT("AIF1ADC1L", NULL,
-		     0, WM8994_POWER_MANAGEMENT_4, 9, 0),
+		     0, SND_SOC_NOPM, 9, 0),
 SND_SOC_DAPM_AIF_OUT("AIF1ADC1R", NULL,
-		     0, WM8994_POWER_MANAGEMENT_4, 8, 0),
+		     0, SND_SOC_NOPM, 8, 0),
 SND_SOC_DAPM_AIF_IN_E("AIF1DAC1L", NULL, 0,
-		      WM8994_POWER_MANAGEMENT_5, 9, 0, wm8958_aif_ev,
+		      SND_SOC_NOPM, 9, 0, wm8958_aif_ev,
 		      SND_SOC_DAPM_POST_PMU | SND_SOC_DAPM_POST_PMD),
 SND_SOC_DAPM_AIF_IN_E("AIF1DAC1R", NULL, 0,
-		      WM8994_POWER_MANAGEMENT_5, 8, 0, wm8958_aif_ev,
+		      SND_SOC_NOPM, 8, 0, wm8958_aif_ev,
 		      SND_SOC_DAPM_POST_PMU | SND_SOC_DAPM_POST_PMD),
 
 SND_SOC_DAPM_AIF_OUT("AIF1ADC2L", NULL,
-		     0, WM8994_POWER_MANAGEMENT_4, 11, 0),
+		     0, SND_SOC_NOPM, 11, 0),
 SND_SOC_DAPM_AIF_OUT("AIF1ADC2R", NULL,
-		     0, WM8994_POWER_MANAGEMENT_4, 10, 0),
+		     0, SND_SOC_NOPM, 10, 0),
 SND_SOC_DAPM_AIF_IN_E("AIF1DAC2L", NULL, 0,
-		      WM8994_POWER_MANAGEMENT_5, 11, 0, wm8958_aif_ev,
+		      SND_SOC_NOPM, 11, 0, wm8958_aif_ev,
 		      SND_SOC_DAPM_POST_PMU | SND_SOC_DAPM_POST_PMD),
 SND_SOC_DAPM_AIF_IN_E("AIF1DAC2R", NULL, 0,
-		      WM8994_POWER_MANAGEMENT_5, 10, 0, wm8958_aif_ev,
+		      SND_SOC_NOPM, 10, 0, wm8958_aif_ev,
 		      SND_SOC_DAPM_POST_PMU | SND_SOC_DAPM_POST_PMD),
 
 SND_SOC_DAPM_MIXER("AIF1ADC1L Mixer", SND_SOC_NOPM, 0, 0,
@@ -1403,14 +1571,14 @@
 		   dac1r_mix, ARRAY_SIZE(dac1r_mix)),
 
 SND_SOC_DAPM_AIF_OUT("AIF2ADCL", NULL, 0,
-		     WM8994_POWER_MANAGEMENT_4, 13, 0),
+		     SND_SOC_NOPM, 13, 0),
 SND_SOC_DAPM_AIF_OUT("AIF2ADCR", NULL, 0,
-		     WM8994_POWER_MANAGEMENT_4, 12, 0),
+		     SND_SOC_NOPM, 12, 0),
 SND_SOC_DAPM_AIF_IN_E("AIF2DACL", NULL, 0,
-		      WM8994_POWER_MANAGEMENT_5, 13, 0, wm8958_aif_ev,
+		      SND_SOC_NOPM, 13, 0, wm8958_aif_ev,
 		      SND_SOC_DAPM_POST_PMU | SND_SOC_DAPM_PRE_PMD),
 SND_SOC_DAPM_AIF_IN_E("AIF2DACR", NULL, 0,
-		      WM8994_POWER_MANAGEMENT_5, 12, 0, wm8958_aif_ev,
+		      SND_SOC_NOPM, 12, 0, wm8958_aif_ev,
 		      SND_SOC_DAPM_POST_PMU | SND_SOC_DAPM_PRE_PMD),
 
 SND_SOC_DAPM_AIF_IN("AIF1DACDAT", "AIF1 Playback", 0, SND_SOC_NOPM, 0, 0),



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

* [ 100/167] [PATCH] dmaengine: at_hdmac: remove clear-on-read in atc_dostart()
  2012-05-09  5:50 [ 000/167] 3.2.17-stable review Ben Hutchings
                   ` (98 preceding siblings ...)
  2012-05-09  5:52 ` [ 099/167] [PATCH] ASoC: wm8994: Improve sequencing of AIF channel enables Ben Hutchings
@ 2012-05-09  5:52 ` Ben Hutchings
  2012-05-09  5:52 ` [ 101/167] [PATCH] sched: Fix OOPS when build_sched_domains() percpu allocation fails Ben Hutchings
                   ` (66 subsequent siblings)
  166 siblings, 0 replies; 195+ messages in thread
From: Ben Hutchings @ 2012-05-09  5:52 UTC (permalink / raw)
  To: linux-kernel, stable; +Cc: torvalds, akpm, alan, Nicolas Ferre, Vinod Koul

3.2-stable review patch.  If anyone has any objections, please let me know.

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

From: Nicolas Ferre <nicolas.ferre@atmel.com>

commit ed8b0d67f33518a16c6b2450fe5ebebf180c2d04 upstream.

This loop on EBCISR register was designed to clear IRQ sources before enabling
a DMA channel. This register is clear-on-read so a race condition can appear if
another channel is already active and has just finished its transfer.
Removing this read on EBCISR is fixing the issue as there is no case where an IRQ
could be pending: we already make sure that this register is drained at probe()
time and during resume.

Signed-off-by: Nicolas Ferre <nicolas.ferre@atmel.com>
Signed-off-by: Vinod Koul <vinod.koul@linux.intel.com>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
---
 drivers/dma/at_hdmac.c |    4 ----
 1 file changed, 4 deletions(-)

diff --git a/drivers/dma/at_hdmac.c b/drivers/dma/at_hdmac.c
index 7aa58d2..445fdf8 100644
--- a/drivers/dma/at_hdmac.c
+++ b/drivers/dma/at_hdmac.c
@@ -221,10 +221,6 @@ static void atc_dostart(struct at_dma_chan *atchan, struct at_desc *first)
 
 	vdbg_dump_regs(atchan);
 
-	/* clear any pending interrupt */
-	while (dma_readl(atdma, EBCISR))
-		cpu_relax();
-
 	channel_writel(atchan, SADDR, 0);
 	channel_writel(atchan, DADDR, 0);
 	channel_writel(atchan, CTRLA, 0);
-- 
1.7.10




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

* [ 101/167] [PATCH] sched: Fix OOPS when build_sched_domains() percpu allocation fails
  2012-05-09  5:50 [ 000/167] 3.2.17-stable review Ben Hutchings
                   ` (99 preceding siblings ...)
  2012-05-09  5:52 ` [ 100/167] [PATCH] dmaengine: at_hdmac: remove clear-on-read in atc_dostart() Ben Hutchings
@ 2012-05-09  5:52 ` Ben Hutchings
  2012-05-09  5:52 ` [ 102/167] [PATCH] tracing: Fix stacktrace of latency tracers (irqsoff and friends) Ben Hutchings
                   ` (65 subsequent siblings)
  166 siblings, 0 replies; 195+ messages in thread
From: Ben Hutchings @ 2012-05-09  5:52 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: torvalds, akpm, alan, he, bo, Zhang, Yanmin, Srivatsa S. Bhat,
	Peter Zijlstra, Ingo Molnar

3.2-stable review patch.  If anyone has any objections, please let me know.

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

From: "he, bo" <bo.he@intel.com>

commit fb2cf2c660971bea0ad86a9a5c19ad39eab61344 upstream.

Under extreme memory used up situations, percpu allocation
might fail. We hit it when system goes to suspend-to-ram,
causing a kworker panic:

 EIP: [<c124411a>] build_sched_domains+0x23a/0xad0
 Kernel panic - not syncing: Fatal exception
 Pid: 3026, comm: kworker/u:3
 3.0.8-137473-gf42fbef #1

 Call Trace:
  [<c18cc4f2>] panic+0x66/0x16c
  [...]
  [<c1244c37>] partition_sched_domains+0x287/0x4b0
  [<c12a77be>] cpuset_update_active_cpus+0x1fe/0x210
  [<c123712d>] cpuset_cpu_inactive+0x1d/0x30
  [...]

With this fix applied build_sched_domains() will return -ENOMEM and
the suspend attempt fails.

Signed-off-by: he, bo <bo.he@intel.com>
Reviewed-by: Zhang, Yanmin <yanmin.zhang@intel.com>
Reviewed-by: Srivatsa S. Bhat <srivatsa.bhat@linux.vnet.ibm.com>
Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Andrew Morton <akpm@linux-foundation.org>
Link: http://lkml.kernel.org/r/1335355161.5892.17.camel@hebo
[ So, we fail to deallocate a CPU because we cannot allocate RAM :-/
  I don't like that kind of sad behavior but nevertheless it should
  not crash under high memory load. ]
Signed-off-by: Ingo Molnar <mingo@kernel.org>
[bwh: Backported to 3.2: change filename]
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
---
--- linux.orig/kernel/sched.c
+++ linux/kernel/sched.c
@@ -7605,16 +7605,26 @@
 		struct sd_data *sdd = &tl->data;
 
 		for_each_cpu(j, cpu_map) {
-			struct sched_domain *sd = *per_cpu_ptr(sdd->sd, j);
-			if (sd && (sd->flags & SD_OVERLAP))
-				free_sched_groups(sd->groups, 0);
-			kfree(*per_cpu_ptr(sdd->sd, j));
-			kfree(*per_cpu_ptr(sdd->sg, j));
-			kfree(*per_cpu_ptr(sdd->sgp, j));
+			struct sched_domain *sd;
+
+			if (sdd->sd) {
+				sd = *per_cpu_ptr(sdd->sd, j);
+				if (sd && (sd->flags & SD_OVERLAP))
+					free_sched_groups(sd->groups, 0);
+				kfree(*per_cpu_ptr(sdd->sd, j));
+			}
+
+			if (sdd->sg)
+				kfree(*per_cpu_ptr(sdd->sg, j));
+			if (sdd->sgp)
+				kfree(*per_cpu_ptr(sdd->sgp, j));
 		}
 		free_percpu(sdd->sd);
+		sdd->sd = NULL;
 		free_percpu(sdd->sg);
+		sdd->sg = NULL;
 		free_percpu(sdd->sgp);
+		sdd->sgp = NULL;
 	}
 }
 



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

* [ 102/167] [PATCH] tracing: Fix stacktrace of latency tracers (irqsoff and friends)
  2012-05-09  5:50 [ 000/167] 3.2.17-stable review Ben Hutchings
                   ` (100 preceding siblings ...)
  2012-05-09  5:52 ` [ 101/167] [PATCH] sched: Fix OOPS when build_sched_domains() percpu allocation fails Ben Hutchings
@ 2012-05-09  5:52 ` Ben Hutchings
  2012-05-09  5:52 ` [ 103/167] [PATCH] hwmon: fam15h_power: fix bogus values with current BIOSes Ben Hutchings
                   ` (64 subsequent siblings)
  166 siblings, 0 replies; 195+ messages in thread
From: Ben Hutchings @ 2012-05-09  5:52 UTC (permalink / raw)
  To: linux-kernel, stable; +Cc: torvalds, akpm, alan, Steven Rostedt, Steven Rostedt

3.2-stable review patch.  If anyone has any objections, please let me know.

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

From: Steven Rostedt <srostedt@redhat.com>

commit db4c75cbebd7e5910cd3bcb6790272fcc3042857 upstream.

While debugging a latency with someone on IRC (mirage335) on #linux-rt (OFTC),
we discovered that the stacktrace output of the latency tracers
(preemptirqsoff) was empty.

This bug was caused by the creation of the dynamic length stack trace
again (like commit 12b5da3 "tracing: Fix ent_size in trace output" was).

This bug is caused by the latency tracers requiring the next event
to determine the time between the current event and the next. But by
grabbing the next event, the iter->ent_size is set to the next event
instead of the current one. As the stacktrace event is the last event,
this makes the ent_size zero and causes nothing to be printed for
the stack trace. The dynamic stacktrace uses the ent_size to determine
how much of the stack can be printed. The ent_size of zero means
no stack.

The simple fix is to save the iter->ent_size before finding the next event.

Note, mirage335 asked to remain anonymous from LKML and git, so I will
not add the Reported-by and Tested-by tags, even though he did report
the issue and tested the fix.

Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
---
 kernel/trace/trace_output.c |    5 +++++
 1 file changed, 5 insertions(+)

diff --git a/kernel/trace/trace_output.c b/kernel/trace/trace_output.c
index 859fae6..df611a0 100644
--- a/kernel/trace/trace_output.c
+++ b/kernel/trace/trace_output.c
@@ -652,6 +652,8 @@ int trace_print_lat_context(struct trace_iterator *iter)
 {
 	u64 next_ts;
 	int ret;
+	/* trace_find_next_entry will reset ent_size */
+	int ent_size = iter->ent_size;
 	struct trace_seq *s = &iter->seq;
 	struct trace_entry *entry = iter->ent,
 			   *next_entry = trace_find_next_entry(iter, NULL,
@@ -660,6 +662,9 @@ int trace_print_lat_context(struct trace_iterator *iter)
 	unsigned long abs_usecs = ns2usecs(iter->ts - iter->tr->time_start);
 	unsigned long rel_usecs;
 
+	/* Restore the original ent_size */
+	iter->ent_size = ent_size;
+
 	if (!next_entry)
 		next_ts = iter->ts;
 	rel_usecs = ns2usecs(next_ts - iter->ts);
-- 
1.7.10




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

* [ 103/167] [PATCH] hwmon: fam15h_power: fix bogus values with current BIOSes
  2012-05-09  5:50 [ 000/167] 3.2.17-stable review Ben Hutchings
                   ` (101 preceding siblings ...)
  2012-05-09  5:52 ` [ 102/167] [PATCH] tracing: Fix stacktrace of latency tracers (irqsoff and friends) Ben Hutchings
@ 2012-05-09  5:52 ` Ben Hutchings
  2012-05-09  5:52 ` [ 104/167] [PATCH] hwmon: (fam15h_power) Fix pci_device_id array Ben Hutchings
                   ` (63 subsequent siblings)
  166 siblings, 0 replies; 195+ messages in thread
From: Ben Hutchings @ 2012-05-09  5:52 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: torvalds, akpm, alan, Andre Przywara, Jean Delvare, Guenter Roeck

3.2-stable review patch.  If anyone has any objections, please let me know.

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

From: Andre Przywara <andre.przywara@amd.com>

commit 00250ec90963b7ef6678438888f3244985ecde14 upstream.

Newer BKDG[1] versions recommend a different initialization value for
the running average range register in the northbridge. This improves
the power reading by avoiding counter saturations resulting in bogus
values for anything below about 80% of TDP power consumption.
Updated BIOSes will have this new value set up from the beginning,
but meanwhile we correct this value ourselves.
This needs to be done on all northbridges, even on those where the
driver itself does not register at.

This fixes the driver on all current machines to provide proper
values for idle load.

[1]
http://support.amd.com/us/Processor_TechDocs/42301_15h_Mod_00h-0Fh_BKDG.pdf
Chapter 3.8: D18F5xE0 Processor TDP Running Average (p. 452)

Signed-off-by: Andre Przywara <andre.przywara@amd.com>
Acked-by: Jean Delvare <khali@linux-fr.org>
[guenter.roeck@ericsson.com: Removed unnecessary return statement]
Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
---
 drivers/hwmon/fam15h_power.c |   39 +++++++++++++++++++++++++++++++++++++++
 1 file changed, 39 insertions(+)

diff --git a/drivers/hwmon/fam15h_power.c b/drivers/hwmon/fam15h_power.c
index b7494af..37a8fc9 100644
--- a/drivers/hwmon/fam15h_power.c
+++ b/drivers/hwmon/fam15h_power.c
@@ -122,6 +122,38 @@ static bool __devinit fam15h_power_is_internal_node0(struct pci_dev *f4)
 	return true;
 }
 
+/*
+ * Newer BKDG versions have an updated recommendation on how to properly
+ * initialize the running average range (was: 0xE, now: 0x9). This avoids
+ * counter saturations resulting in bogus power readings.
+ * We correct this value ourselves to cope with older BIOSes.
+ */
+static void __devinit tweak_runavg_range(struct pci_dev *pdev)
+{
+	u32 val;
+	const struct pci_device_id affected_device = {
+		PCI_VDEVICE(AMD, PCI_DEVICE_ID_AMD_15H_NB_F4) };
+
+	/*
+	 * let this quirk apply only to the current version of the
+	 * northbridge, since future versions may change the behavior
+	 */
+	if (!pci_match_id(&affected_device, pdev))
+		return;
+
+	pci_bus_read_config_dword(pdev->bus,
+		PCI_DEVFN(PCI_SLOT(pdev->devfn), 5),
+		REG_TDP_RUNNING_AVERAGE, &val);
+	if ((val & 0xf) != 0xe)
+		return;
+
+	val &= ~0xf;
+	val |=  0x9;
+	pci_bus_write_config_dword(pdev->bus,
+		PCI_DEVFN(PCI_SLOT(pdev->devfn), 5),
+		REG_TDP_RUNNING_AVERAGE, val);
+}
+
 static void __devinit fam15h_power_init_data(struct pci_dev *f4,
 					     struct fam15h_power_data *data)
 {
@@ -155,6 +187,13 @@ static int __devinit fam15h_power_probe(struct pci_dev *pdev,
 	struct device *dev;
 	int err;
 
+	/*
+	 * though we ignore every other northbridge, we still have to
+	 * do the tweaking on _each_ node in MCM processors as the counters
+	 * are working hand-in-hand
+	 */
+	tweak_runavg_range(pdev);
+
 	if (!fam15h_power_is_internal_node0(pdev)) {
 		err = -ENODEV;
 		goto exit;
-- 
1.7.10




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

* [ 104/167] [PATCH] hwmon: (fam15h_power) Fix pci_device_id array
  2012-05-09  5:50 [ 000/167] 3.2.17-stable review Ben Hutchings
                   ` (102 preceding siblings ...)
  2012-05-09  5:52 ` [ 103/167] [PATCH] hwmon: fam15h_power: fix bogus values with current BIOSes Ben Hutchings
@ 2012-05-09  5:52 ` Ben Hutchings
  2012-05-09  5:52 ` [ 105/167] [PATCH] dell-laptop: Terminate quirks list properly Ben Hutchings
                   ` (62 subsequent siblings)
  166 siblings, 0 replies; 195+ messages in thread
From: Ben Hutchings @ 2012-05-09  5:52 UTC (permalink / raw)
  To: linux-kernel, stable; +Cc: torvalds, akpm, alan, Guenter Roeck, Jean Delvare

3.2-stable review patch.  If anyone has any objections, please let me know.

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

From: Guenter Roeck <guenter.roeck@ericsson.com>

commit c3e40a9972428d6e2d8e287ed0233a57a218c30f upstream.

pci_match_id() takes an *array* of IDs which must be properly zero-
terminated.

Reported-by: Ben Hutchings <ben@decadent.org.uk>
Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com>
Acked-by: Jean Delvare <khali@linux-fr.org>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
---
 drivers/hwmon/fam15h_power.c |    9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/drivers/hwmon/fam15h_power.c b/drivers/hwmon/fam15h_power.c
index 37a8fc9..e8e18ca 100644
--- a/drivers/hwmon/fam15h_power.c
+++ b/drivers/hwmon/fam15h_power.c
@@ -128,17 +128,20 @@ static bool __devinit fam15h_power_is_internal_node0(struct pci_dev *f4)
  * counter saturations resulting in bogus power readings.
  * We correct this value ourselves to cope with older BIOSes.
  */
+static DEFINE_PCI_DEVICE_TABLE(affected_device) = {
+	{ PCI_VDEVICE(AMD, PCI_DEVICE_ID_AMD_15H_NB_F4) },
+	{ 0 }
+};
+
 static void __devinit tweak_runavg_range(struct pci_dev *pdev)
 {
 	u32 val;
-	const struct pci_device_id affected_device = {
-		PCI_VDEVICE(AMD, PCI_DEVICE_ID_AMD_15H_NB_F4) };
 
 	/*
 	 * let this quirk apply only to the current version of the
 	 * northbridge, since future versions may change the behavior
 	 */
-	if (!pci_match_id(&affected_device, pdev))
+	if (!pci_match_id(affected_device, pdev))
 		return;
 
 	pci_bus_read_config_dword(pdev->bus,
-- 
1.7.10




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

* [ 105/167] [PATCH] dell-laptop: Terminate quirks list properly
  2012-05-09  5:50 [ 000/167] 3.2.17-stable review Ben Hutchings
                   ` (103 preceding siblings ...)
  2012-05-09  5:52 ` [ 104/167] [PATCH] hwmon: (fam15h_power) Fix pci_device_id array Ben Hutchings
@ 2012-05-09  5:52 ` Ben Hutchings
  2012-05-09  5:52 ` [ 106/167] [PATCH] drm/radeon/kms: need to set up ss on DP bridges as well Ben Hutchings
                   ` (61 subsequent siblings)
  166 siblings, 0 replies; 195+ messages in thread
From: Ben Hutchings @ 2012-05-09  5:52 UTC (permalink / raw)
  To: linux-kernel, stable; +Cc: torvalds, akpm, alan, Martin Nyhus, Matthew Garrett

3.2-stable review patch.  If anyone has any objections, please let me know.

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

From: Martin Nyhus <martin.nyhus@gmx.com>

commit d62d421b071b08249361044d8e56c8b5c3ed6aa7 upstream.

Add missing DMI_NONE entry to end of the quirks list so
dmi_check_system() won't read past the end of the list.

Signed-off-by: Martin Nyhus <martin.nyhus@gmx.com>
Signed-off-by: Matthew Garrett <mjg@redhat.com>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
---
 drivers/platform/x86/dell-laptop.c |    1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/platform/x86/dell-laptop.c b/drivers/platform/x86/dell-laptop.c
index a05fc9c..e6c08ee 100644
--- a/drivers/platform/x86/dell-laptop.c
+++ b/drivers/platform/x86/dell-laptop.c
@@ -212,6 +212,7 @@ static struct dmi_system_id __devinitdata dell_quirks[] = {
 		},
 		.driver_data = &quirk_dell_vostro_v130,
 	},
+	{ }
 };
 
 static struct calling_interface_buffer *buffer;
-- 
1.7.10




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

* [ 106/167] [PATCH] drm/radeon/kms: need to set up ss on DP bridges as well
  2012-05-09  5:50 [ 000/167] 3.2.17-stable review Ben Hutchings
                   ` (104 preceding siblings ...)
  2012-05-09  5:52 ` [ 105/167] [PATCH] dell-laptop: Terminate quirks list properly Ben Hutchings
@ 2012-05-09  5:52 ` Ben Hutchings
  2012-05-09  5:52 ` [ 107/167] [PATCH] drm/i915: handle input/output sdvo timings separately in mode_set Ben Hutchings
                   ` (60 subsequent siblings)
  166 siblings, 0 replies; 195+ messages in thread
From: Ben Hutchings @ 2012-05-09  5:52 UTC (permalink / raw)
  To: linux-kernel, stable; +Cc: torvalds, akpm, alan, Alex Deucher, Dave Airlie

3.2-stable review patch.  If anyone has any objections, please let me know.

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

From: Alex Deucher <alexander.deucher@amd.com>

commit 700698e7c303f5095107c62a81872c2c3dad1702 upstream.

Makes Nutmeg DP to VGA bridges work for me.

Fixes:
https://bugs.freedesktop.org/show_bug.cgi?id=42490

Noticed by Jerome Glisse (after weeks of debugging).

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
---
 drivers/gpu/drm/radeon/atombios_crtc.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/radeon/atombios_crtc.c b/drivers/gpu/drm/radeon/atombios_crtc.c
index c5c31e0..af1054f 100644
--- a/drivers/gpu/drm/radeon/atombios_crtc.c
+++ b/drivers/gpu/drm/radeon/atombios_crtc.c
@@ -958,8 +958,8 @@ static void atombios_crtc_set_pll(struct drm_crtc *crtc, struct drm_display_mode
 		break;
 	}
 
-	if (radeon_encoder->active_device &
-	    (ATOM_DEVICE_LCD_SUPPORT | ATOM_DEVICE_DFP_SUPPORT)) {
+	if ((radeon_encoder->active_device & (ATOM_DEVICE_LCD_SUPPORT | ATOM_DEVICE_DFP_SUPPORT)) ||
+	    (radeon_encoder_get_dp_bridge_encoder_id(encoder) != ENCODER_OBJECT_ID_NONE)) {
 		struct radeon_encoder_atom_dig *dig = radeon_encoder->enc_priv;
 		struct drm_connector *connector =
 			radeon_get_connector_for_encoder(encoder);
-- 
1.7.10




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

* [ 107/167] [PATCH] drm/i915: handle input/output sdvo timings separately in mode_set
  2012-05-09  5:50 [ 000/167] 3.2.17-stable review Ben Hutchings
                   ` (105 preceding siblings ...)
  2012-05-09  5:52 ` [ 106/167] [PATCH] drm/radeon/kms: need to set up ss on DP bridges as well Ben Hutchings
@ 2012-05-09  5:52 ` Ben Hutchings
  2012-05-09  5:52 ` [ 108/167] [PATCH] drm/i915: relative_constants_mode race fix Ben Hutchings
                   ` (59 subsequent siblings)
  166 siblings, 0 replies; 195+ messages in thread
From: Ben Hutchings @ 2012-05-09  5:52 UTC (permalink / raw)
  To: linux-kernel, stable; +Cc: torvalds, akpm, alan, Daniel Vetter, Jesse Barnes

3.2-stable review patch.  If anyone has any objections, please let me know.

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

From: Daniel Vetter <daniel.vetter@ffwll.ch>

commit 6651819b4b4fc3caa6964c5d825eb4bb996f3905 upstream.

We seem to have a decent confusion between the output timings and the
input timings of the sdvo encoder. If I understand the code correctly,
we use the original mode unchanged for the output timings, safe for
the lvds case. And we should use the adjusted mode for input timings.

Clarify the situation by adding an explicit output_dtd to the sdvo
mode_set function and streamline the code-flow by moving the input and
output mode setting in the sdvo encode together.

Furthermore testing showed that the sdvo input timing needs the
unadjusted dotclock, the sdvo chip will automatically compute the
required pixel multiplier to get a dotclock above 100 MHz.

Fix this up when converting a drm mode to an sdvo dtd.

This regression was introduced in

commit c74696b9c890074c1e1ee3d7496fc71eb3680ced
Author: Pavel Roskin <proski@gnu.org>
Date:   Thu Sep 2 14:46:34 2010 -0400

    i915: revert some checks added by commit 32aad86f

particularly the following hunk:

> diff --git a/drivers/gpu/drm/i915/intel_sdvo.c
> b/drivers/gpu/drm/i915/intel_sdvo.c
> index 093e914..62d22ae 100644
> --- a/drivers/gpu/drm/i915/intel_sdvo.c
> +++ b/drivers/gpu/drm/i915/intel_sdvo.c
> @@ -1122,11 +1123,9 @@ static void intel_sdvo_mode_set(struct drm_encoder *encoder,
> 
>      /* We have tried to get input timing in mode_fixup, and filled into
>         adjusted_mode */
> -    if (intel_sdvo->is_tv || intel_sdvo->is_lvds) {
> -        intel_sdvo_get_dtd_from_mode(&input_dtd, adjusted_mode);
> +    intel_sdvo_get_dtd_from_mode(&input_dtd, adjusted_mode);
> +    if (intel_sdvo->is_tv || intel_sdvo->is_lvds)
>          input_dtd.part2.sdvo_flags = intel_sdvo->sdvo_flags;
> -    } else
> -        intel_sdvo_get_dtd_from_mode(&input_dtd, mode);
> 
>      /* If it's a TV, we already set the output timing in mode_fixup.
>       * Otherwise, the output timing is equal to the input timing.

Due to questions raised in review, below a more elaborate analysis of
the bug at hand:

Sdvo seems to have two timings, one is the output timing which will be
sent over whatever is connected on the other side of the sdvo chip (panel,
hdmi screen, tv), the other is the input timing which will be generated by
the gmch pipe. It looks like sdvo is expected to scale between the two.

To make things slightly more complicated, we have a bunch of special
cases:
- For lvds panel we always use a fixed output timing, namely
  intel_sdvo->sdvo_lvds_fixed_mode, hence that special case.
- Sdvo has an interface to generate a preferred input timing for a given
  output timing. This is the confusing thing that I've tried to clear up
  with the follow-on patches.
- A special requirement is that the input pixel clock needs to be between
  100MHz and 200MHz (likely to keep it within the electromechanical design
  range of PCIe), 270MHz on later gen4+. Lower pixel clocks are
  doubled/quadrupled.

The thing this patch tries to fix is that the pipe needs to be
explicitly instructed to double/quadruple the pixels and needs the
correspondingly higher pixel clock, whereas the sdvo adaptor seems to
do that itself and needs the unadjusted pixel clock. For the sdvo
encode side we already set the pixel mutliplier with a different
command (0x21).

This patch tries to fix this mess by:
- Keeping the output mode timing in the unadjusted plain mode, safe
  for the lvds case.
- Storing the input timing in the adjusted_mode with the adjusted
  pixel clock. This way we don't need to frob around with the core
  crtc mode set code.
- Fixing up the pixelclock when constructing the sdvo dtd timing
  struct. This is why the first hunk of the patch is an integral part
  of the series.
- Dropping the is_tv special case because input_dtd is equivalent to
  adjusted_mode after these changes. Follow-up patches clear this up
  further (by simply ripping out intel_sdvo->input_dtd because it's
  not needed).

v2: Extend commit message with an in-depth bug analysis.

Reported-and-Tested-by: Bernard Blackham <b-linuxgit@largestprime.net>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=48157
Reviewed-by: Jesse Barnes <jbarnes@virtuousgeek.org>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
[bwh: Indented the hunk quoted above so quilt doesn't try to apply it]
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
---
 drivers/gpu/drm/i915/intel_sdvo.c |   34 ++++++++++++++++++----------------
 1 file changed, 18 insertions(+), 16 deletions(-)

diff --git a/drivers/gpu/drm/i915/intel_sdvo.c b/drivers/gpu/drm/i915/intel_sdvo.c
index e36b171..232d77d 100644
--- a/drivers/gpu/drm/i915/intel_sdvo.c
+++ b/drivers/gpu/drm/i915/intel_sdvo.c
@@ -731,6 +731,7 @@ static void intel_sdvo_get_dtd_from_mode(struct intel_sdvo_dtd *dtd,
 	uint16_t width, height;
 	uint16_t h_blank_len, h_sync_len, v_blank_len, v_sync_len;
 	uint16_t h_sync_offset, v_sync_offset;
+	int mode_clock;
 
 	width = mode->crtc_hdisplay;
 	height = mode->crtc_vdisplay;
@@ -745,7 +746,11 @@ static void intel_sdvo_get_dtd_from_mode(struct intel_sdvo_dtd *dtd,
 	h_sync_offset = mode->crtc_hsync_start - mode->crtc_hblank_start;
 	v_sync_offset = mode->crtc_vsync_start - mode->crtc_vblank_start;
 
-	dtd->part1.clock = mode->clock / 10;
+	mode_clock = mode->clock;
+	mode_clock /= intel_mode_get_pixel_multiplier(mode) ?: 1;
+	mode_clock /= 10;
+	dtd->part1.clock = mode_clock;
+
 	dtd->part1.h_active = width & 0xff;
 	dtd->part1.h_blank = h_blank_len & 0xff;
 	dtd->part1.h_high = (((width >> 8) & 0xf) << 4) |
@@ -996,7 +1001,7 @@ static void intel_sdvo_mode_set(struct drm_encoder *encoder,
 	struct intel_sdvo *intel_sdvo = to_intel_sdvo(encoder);
 	u32 sdvox;
 	struct intel_sdvo_in_out_map in_out;
-	struct intel_sdvo_dtd input_dtd;
+	struct intel_sdvo_dtd input_dtd, output_dtd;
 	int pixel_multiplier = intel_mode_get_pixel_multiplier(adjusted_mode);
 	int rate;
 
@@ -1021,20 +1026,13 @@ static void intel_sdvo_mode_set(struct drm_encoder *encoder,
 					  intel_sdvo->attached_output))
 		return;
 
-	/* We have tried to get input timing in mode_fixup, and filled into
-	 * adjusted_mode.
-	 */
-	if (intel_sdvo->is_tv || intel_sdvo->is_lvds) {
-		input_dtd = intel_sdvo->input_dtd;
-	} else {
-		/* Set the output timing to the screen */
-		if (!intel_sdvo_set_target_output(intel_sdvo,
-						  intel_sdvo->attached_output))
-			return;
-
-		intel_sdvo_get_dtd_from_mode(&input_dtd, adjusted_mode);
-		(void) intel_sdvo_set_output_timing(intel_sdvo, &input_dtd);
-	}
+	/* lvds has a special fixed output timing. */
+	if (intel_sdvo->is_lvds)
+		intel_sdvo_get_dtd_from_mode(&output_dtd,
+					     intel_sdvo->sdvo_lvds_fixed_mode);
+	else
+		intel_sdvo_get_dtd_from_mode(&output_dtd, mode);
+	(void) intel_sdvo_set_output_timing(intel_sdvo, &output_dtd);
 
 	/* Set the input timing to the screen. Assume always input 0. */
 	if (!intel_sdvo_set_target_input(intel_sdvo))
@@ -1052,6 +1050,10 @@ static void intel_sdvo_mode_set(struct drm_encoder *encoder,
 	    !intel_sdvo_set_tv_format(intel_sdvo))
 		return;
 
+	/* We have tried to get input timing in mode_fixup, and filled into
+	 * adjusted_mode.
+	 */
+	intel_sdvo_get_dtd_from_mode(&input_dtd, adjusted_mode);
 	(void) intel_sdvo_set_input_timing(intel_sdvo, &input_dtd);
 
 	switch (pixel_multiplier) {
-- 
1.7.10




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

* [ 108/167] [PATCH] drm/i915: relative_constants_mode race fix
  2012-05-09  5:50 [ 000/167] 3.2.17-stable review Ben Hutchings
                   ` (106 preceding siblings ...)
  2012-05-09  5:52 ` [ 107/167] [PATCH] drm/i915: handle input/output sdvo timings separately in mode_set Ben Hutchings
@ 2012-05-09  5:52 ` Ben Hutchings
  2012-05-09  5:52 ` [ 109/167] [PATCH] drm/i915: Force sync command ordering (Gen6+) Ben Hutchings
                   ` (58 subsequent siblings)
  166 siblings, 0 replies; 195+ messages in thread
From: Ben Hutchings @ 2012-05-09  5:52 UTC (permalink / raw)
  To: linux-kernel, stable; +Cc: torvalds, akpm, alan, Daniel Vetter, Keith Packard

3.2-stable review patch.  If anyone has any objections, please let me know.

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

From: Ben Widawsky <ben@bwidawsk.net>

commit e2971bdab2b761683353da383c0fd5ac704d1cca upstream.

dev_priv keeps track of the current addressing mode that gets set at
execbuffer time. Unfortunately the existing code was doing this before
acquiring struct_mutex which leaves a race with another thread also
doing an execbuffer. If that wasn't bad enough, relocate_slow drops
struct_mutex which opens a much more likely error where another thread
comes in and modifies the state while relocate_slow is being slow.

The solution here is to just defer setting this state until we
absolutely need it, and we know we'll have struct_mutex for the
remainder of our code path.

v2: Keith noticed a bug in the original patch.

Signed-off-by: Ben Widawsky <ben@bwidawsk.net>
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
---
 drivers/gpu/drm/i915/i915_gem_execbuffer.c |   29 +++++++++++++++-------------
 1 file changed, 16 insertions(+), 13 deletions(-)

diff --git a/drivers/gpu/drm/i915/i915_gem_execbuffer.c b/drivers/gpu/drm/i915/i915_gem_execbuffer.c
index c681dc1..68e5b41 100644
--- a/drivers/gpu/drm/i915/i915_gem_execbuffer.c
+++ b/drivers/gpu/drm/i915/i915_gem_execbuffer.c
@@ -1033,19 +1033,6 @@ i915_gem_do_execbuffer(struct drm_device *dev, void *data,
 			if (INTEL_INFO(dev)->gen > 5 &&
 			    mode == I915_EXEC_CONSTANTS_REL_SURFACE)
 				return -EINVAL;
-
-			ret = intel_ring_begin(ring, 4);
-			if (ret)
-				return ret;
-
-			intel_ring_emit(ring, MI_NOOP);
-			intel_ring_emit(ring, MI_LOAD_REGISTER_IMM(1));
-			intel_ring_emit(ring, INSTPM);
-			intel_ring_emit(ring,
-					I915_EXEC_CONSTANTS_MASK << 16 | mode);
-			intel_ring_advance(ring);
-
-			dev_priv->relative_constants_mode = mode;
 		}
 		break;
 	default:
@@ -1176,6 +1163,22 @@ i915_gem_do_execbuffer(struct drm_device *dev, void *data,
 		}
 	}
 
+	if (ring == &dev_priv->ring[RCS] &&
+	    mode != dev_priv->relative_constants_mode) {
+		ret = intel_ring_begin(ring, 4);
+		if (ret)
+				goto err;
+
+		intel_ring_emit(ring, MI_NOOP);
+		intel_ring_emit(ring, MI_LOAD_REGISTER_IMM(1));
+		intel_ring_emit(ring, INSTPM);
+		intel_ring_emit(ring,
+				I915_EXEC_CONSTANTS_MASK << 16 | mode);
+		intel_ring_advance(ring);
+
+		dev_priv->relative_constants_mode = mode;
+	}
+
 	trace_i915_gem_ring_dispatch(ring, seqno);
 
 	exec_start = batch_obj->gtt_offset + args->batch_start_offset;
-- 
1.7.10




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

* [ 109/167] [PATCH] drm/i915: Force sync command ordering (Gen6+)
  2012-05-09  5:50 [ 000/167] 3.2.17-stable review Ben Hutchings
                   ` (107 preceding siblings ...)
  2012-05-09  5:52 ` [ 108/167] [PATCH] drm/i915: relative_constants_mode race fix Ben Hutchings
@ 2012-05-09  5:52 ` Ben Hutchings
  2012-05-09  5:52 ` [ 110/167] [PATCH] drm/i915: Set the Stencil Cache eviction policy to non-LRA mode Ben Hutchings
                   ` (57 subsequent siblings)
  166 siblings, 0 replies; 195+ messages in thread
From: Ben Hutchings @ 2012-05-09  5:52 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: torvalds, akpm, alan, Kenneth Graunke, Chris Wilson,
	Daniel Vetter, Eric Anholt, Keith Packard

3.2-stable review patch.  If anyone has any objections, please let me know.

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

From: Ben Widawsky <ben@bwidawsk.net>

commit 84f9f938be4156e4baea466688bd6abae1c9e6ba upstream.

The docs say this is required for Gen7, and since the bit was added for
Gen6, we are also setting it there pit pf paranoia. Particularly as
Chris points out, if PIPE_CONTROL counts as a 3d state packet.

This was found through doc inspection by Ken and applies to Gen6+;

Reported-by: Kenneth Graunke <kenneth@whitecape.org>
Signed-off-by: Ben Widawsky <ben@bwidawsk.net>
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
---
 drivers/gpu/drm/i915/i915_gem_execbuffer.c |    9 +++++++--
 drivers/gpu/drm/i915/i915_reg.h            |    1 +
 drivers/gpu/drm/i915/intel_ringbuffer.c    |    5 +++++
 3 files changed, 13 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/i915/i915_gem_execbuffer.c b/drivers/gpu/drm/i915/i915_gem_execbuffer.c
index 68e5b41..11545ff 100644
--- a/drivers/gpu/drm/i915/i915_gem_execbuffer.c
+++ b/drivers/gpu/drm/i915/i915_gem_execbuffer.c
@@ -984,6 +984,7 @@ i915_gem_do_execbuffer(struct drm_device *dev, void *data,
 	struct intel_ring_buffer *ring;
 	u32 exec_start, exec_len;
 	u32 seqno;
+	u32 mask;
 	int ret, mode, i;
 
 	if (!i915_gem_check_execbuffer(args)) {
@@ -1021,6 +1022,7 @@ i915_gem_do_execbuffer(struct drm_device *dev, void *data,
 	}
 
 	mode = args->flags & I915_EXEC_CONSTANTS_MASK;
+	mask = I915_EXEC_CONSTANTS_MASK;
 	switch (mode) {
 	case I915_EXEC_CONSTANTS_REL_GENERAL:
 	case I915_EXEC_CONSTANTS_ABSOLUTE:
@@ -1033,6 +1035,10 @@ i915_gem_do_execbuffer(struct drm_device *dev, void *data,
 			if (INTEL_INFO(dev)->gen > 5 &&
 			    mode == I915_EXEC_CONSTANTS_REL_SURFACE)
 				return -EINVAL;
+
+			/* The HW changed the meaning on this bit on gen6 */
+			if (INTEL_INFO(dev)->gen >= 6)
+				mask &= ~I915_EXEC_CONSTANTS_REL_SURFACE;
 		}
 		break;
 	default:
@@ -1172,8 +1178,7 @@ i915_gem_do_execbuffer(struct drm_device *dev, void *data,
 		intel_ring_emit(ring, MI_NOOP);
 		intel_ring_emit(ring, MI_LOAD_REGISTER_IMM(1));
 		intel_ring_emit(ring, INSTPM);
-		intel_ring_emit(ring,
-				I915_EXEC_CONSTANTS_MASK << 16 | mode);
+		intel_ring_emit(ring, mask << 16 | mode);
 		intel_ring_advance(ring);
 
 		dev_priv->relative_constants_mode = mode;
diff --git a/drivers/gpu/drm/i915/i915_reg.h b/drivers/gpu/drm/i915/i915_reg.h
index 194d987..3ae2c7c 100644
--- a/drivers/gpu/drm/i915/i915_reg.h
+++ b/drivers/gpu/drm/i915/i915_reg.h
@@ -442,6 +442,7 @@
 #define   INSTPM_AGPBUSY_DIS (1<<11) /* gen3: when disabled, pending interrupts
 					will not assert AGPBUSY# and will only
 					be delivered when out of C3. */
+#define   INSTPM_FORCE_ORDERING				(1<<7) /* GEN6+ */
 #define ACTHD	        0x020c8
 #define FW_BLC		0x020d8
 #define FW_BLC2		0x020dc
diff --git a/drivers/gpu/drm/i915/intel_ringbuffer.c b/drivers/gpu/drm/i915/intel_ringbuffer.c
index ca70e2f..f5dae5de 100644
--- a/drivers/gpu/drm/i915/intel_ringbuffer.c
+++ b/drivers/gpu/drm/i915/intel_ringbuffer.c
@@ -414,6 +414,11 @@ static int init_render_ring(struct intel_ring_buffer *ring)
 			return ret;
 	}
 
+	if (INTEL_INFO(dev)->gen >= 6) {
+		I915_WRITE(INSTPM,
+			   INSTPM_FORCE_ORDERING << 16 | INSTPM_FORCE_ORDERING);
+	}
+
 	return ret;
 }
 
-- 
1.7.10




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

* [ 110/167] [PATCH] drm/i915: Set the Stencil Cache eviction policy to non-LRA mode.
  2012-05-09  5:50 [ 000/167] 3.2.17-stable review Ben Hutchings
                   ` (108 preceding siblings ...)
  2012-05-09  5:52 ` [ 109/167] [PATCH] drm/i915: Force sync command ordering (Gen6+) Ben Hutchings
@ 2012-05-09  5:52 ` Ben Hutchings
  2012-05-09  5:52 ` [ 111/167] [PATCH] drm/i915: fix integer overflow in i915_gem_execbuffer2() Ben Hutchings
                   ` (56 subsequent siblings)
  166 siblings, 0 replies; 195+ messages in thread
From: Ben Hutchings @ 2012-05-09  5:52 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: torvalds, akpm, alan, Kenneth Graunke, Rob Castle, Eric Appleman,
	Keith Packard, Daniel Vetter, Dave Airlie

3.2-stable review patch.  If anyone has any objections, please let me know.

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

From: Kenneth Graunke <kenneth@whitecape.org>

commit 3a69ddd6f872180b6f61fda87152b37202118fbc upstream.

Clearing bit 5 of CACHE_MODE_0 is necessary to prevent GPU hangs in
OpenGL programs such as Google MapsGL, Google Earth, and gzdoom when
using separate stencil buffers.  Without it, the GPU tries to use the
LRA eviction policy, which isn't supported.  This was supposed to be off
by default, but seems to be on for many machines.

This cannot be done in gen6_init_clock_gating with most of the other
workaround bits; the render ring needs to exist.  Otherwise, the
register write gets dropped on the floor (one printk will show it
changed, but a second printk immediately following shows the value
reverts to the old one).

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=47535
Cc: Rob Castle <futuredub@gmail.com>
Cc: Eric Appleman <erappleman@gmail.com>
Cc: aaron667@gmx.net
Cc: Keith Packard <keithp@keithp.com>
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Acked-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
---
 drivers/gpu/drm/i915/i915_reg.h         |    1 +
 drivers/gpu/drm/i915/intel_ringbuffer.c |    8 ++++++++
 2 files changed, 9 insertions(+)

diff --git a/drivers/gpu/drm/i915/i915_reg.h b/drivers/gpu/drm/i915/i915_reg.h
index b4bb1ef..9d24d65 100644
--- a/drivers/gpu/drm/i915/i915_reg.h
+++ b/drivers/gpu/drm/i915/i915_reg.h
@@ -568,6 +568,7 @@
 #define   CM0_MASK_SHIFT          16
 #define   CM0_IZ_OPT_DISABLE      (1<<6)
 #define   CM0_ZR_OPT_DISABLE      (1<<5)
+#define	  CM0_STC_EVICT_DISABLE_LRA_SNB	(1<<5)
 #define   CM0_DEPTH_EVICT_DISABLE (1<<4)
 #define   CM0_COLOR_EVICT_DISABLE (1<<3)
 #define   CM0_DEPTH_WRITE_DISABLE (1<<1)
diff --git a/drivers/gpu/drm/i915/intel_ringbuffer.c b/drivers/gpu/drm/i915/intel_ringbuffer.c
index f75806e..80fce51 100644
--- a/drivers/gpu/drm/i915/intel_ringbuffer.c
+++ b/drivers/gpu/drm/i915/intel_ringbuffer.c
@@ -401,6 +401,14 @@ static int init_render_ring(struct intel_ring_buffer *ring)
 	if (INTEL_INFO(dev)->gen >= 6) {
 		I915_WRITE(INSTPM,
 			   INSTPM_FORCE_ORDERING << 16 | INSTPM_FORCE_ORDERING);
+
+		/* From the Sandybridge PRM, volume 1 part 3, page 24:
+		 * "If this bit is set, STCunit will have LRA as replacement
+		 *  policy. [...] This bit must be reset.  LRA replacement
+		 *  policy is not supported."
+		 */
+		I915_WRITE(CACHE_MODE_0,
+			   CM0_STC_EVICT_DISABLE_LRA_SNB << CM0_MASK_SHIFT);
 	}
 
 	return ret;
-- 
1.7.10




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

* [ 111/167] [PATCH] drm/i915: fix integer overflow in i915_gem_execbuffer2()
  2012-05-09  5:50 [ 000/167] 3.2.17-stable review Ben Hutchings
                   ` (109 preceding siblings ...)
  2012-05-09  5:52 ` [ 110/167] [PATCH] drm/i915: Set the Stencil Cache eviction policy to non-LRA mode Ben Hutchings
@ 2012-05-09  5:52 ` Ben Hutchings
  2012-05-09  5:52 ` [ 112/167] [PATCH] drm/i915: fix integer overflow in i915_gem_do_execbuffer() Ben Hutchings
                   ` (55 subsequent siblings)
  166 siblings, 0 replies; 195+ messages in thread
From: Ben Hutchings @ 2012-05-09  5:52 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: torvalds, akpm, alan, Xi Wang, Chris Wilson, Daniel Vetter

3.2-stable review patch.  If anyone has any objections, please let me know.

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

From: Xi Wang <xi.wang@gmail.com>

commit ed8cd3b2cd61004cab85380c52b1817aca1ca49b upstream.

On 32-bit systems, a large args->buffer_count from userspace via ioctl
may overflow the allocation size, leading to out-of-bounds access.

This vulnerability was introduced in commit 8408c282 ("drm/i915:
First try a normal large kmalloc for the temporary exec buffers").

Signed-off-by: Xi Wang <xi.wang@gmail.com>
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
[bwh: Backported to 3.2: adjust context]
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
---
 drivers/gpu/drm/i915/i915_gem_execbuffer.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/i915/i915_gem_execbuffer.c b/drivers/gpu/drm/i915/i915_gem_execbuffer.c
index f51a696..7c50e58 100644
--- a/drivers/gpu/drm/i915/i915_gem_execbuffer.c
+++ b/drivers/gpu/drm/i915/i915_gem_execbuffer.c
@@ -1404,7 +1404,8 @@ i915_gem_execbuffer2(struct drm_device *dev, void *data,
 	struct drm_i915_gem_exec_object2 *exec2_list = NULL;
 	int ret;
 
-	if (args->buffer_count < 1) {
+	if (args->buffer_count < 1 ||
+	    args->buffer_count > UINT_MAX / sizeof(*exec2_list)) {
 		DRM_ERROR("execbuf2 with %d buffers\n", args->buffer_count);
 		return -EINVAL;
 	}



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

* [ 112/167] [PATCH] drm/i915: fix integer overflow in i915_gem_do_execbuffer()
  2012-05-09  5:50 [ 000/167] 3.2.17-stable review Ben Hutchings
                   ` (110 preceding siblings ...)
  2012-05-09  5:52 ` [ 111/167] [PATCH] drm/i915: fix integer overflow in i915_gem_execbuffer2() Ben Hutchings
@ 2012-05-09  5:52 ` Ben Hutchings
  2012-05-09  5:52 ` [ 113/167] nl80211: ensure interface is up in various APIs Ben Hutchings
                   ` (54 subsequent siblings)
  166 siblings, 0 replies; 195+ messages in thread
From: Ben Hutchings @ 2012-05-09  5:52 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: torvalds, akpm, alan, Xi Wang, Chris Wilson, Daniel Vetter

3.2-stable review patch.  If anyone has any objections, please let me know.

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

From: Xi Wang <xi.wang@gmail.com>

commit 44afb3a04391a74309d16180d1e4f8386fdfa745 upstream.

On 32-bit systems, a large args->num_cliprects from userspace via ioctl
may overflow the allocation size, leading to out-of-bounds access.

This vulnerability was introduced in commit 432e58ed ("drm/i915: Avoid
allocation for execbuffer object list").

Signed-off-by: Xi Wang <xi.wang@gmail.com>
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
---
 drivers/gpu/drm/i915/i915_gem_execbuffer.c |    5 +++++
 1 file changed, 5 insertions(+)

diff --git a/drivers/gpu/drm/i915/i915_gem_execbuffer.c b/drivers/gpu/drm/i915/i915_gem_execbuffer.c
index 7c50e58..de43194 100644
--- a/drivers/gpu/drm/i915/i915_gem_execbuffer.c
+++ b/drivers/gpu/drm/i915/i915_gem_execbuffer.c
@@ -1133,6 +1133,11 @@ i915_gem_do_execbuffer(struct drm_device *dev, void *data,
 			return -EINVAL;
 		}
 
+		if (args->num_cliprects > UINT_MAX / sizeof(*cliprects)) {
+			DRM_DEBUG("execbuf with %u cliprects\n",
+				  args->num_cliprects);
+			return -EINVAL;
+		}
 		cliprects = kmalloc(args->num_cliprects * sizeof(*cliprects),
 				    GFP_KERNEL);
 		if (cliprects == NULL) {
-- 
1.7.10




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

* [ 113/167] nl80211: ensure interface is up in various APIs
  2012-05-09  5:50 [ 000/167] 3.2.17-stable review Ben Hutchings
                   ` (111 preceding siblings ...)
  2012-05-09  5:52 ` [ 112/167] [PATCH] drm/i915: fix integer overflow in i915_gem_do_execbuffer() Ben Hutchings
@ 2012-05-09  5:52 ` Ben Hutchings
  2012-05-09  5:52 ` [ 114/167] [PATCH] ALSA: HDA: Add external mic quirk for Asus Zenbook UX31E Ben Hutchings
                   ` (53 subsequent siblings)
  166 siblings, 0 replies; 195+ messages in thread
From: Ben Hutchings @ 2012-05-09  5:52 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: torvalds, akpm, alan, Johannes Berg, Ben Greear, John W. Linville

3.2-stable review patch.  If anyone has any objections, please let me know.

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

From: Johannes Berg <johannes.berg@intel.com>

From: Johannes Berg <johannes.berg@intel.com>

commit 2b5f8b0b44e17e625cfba1e7b88db44f4dcc0441 upstream.
[backported by Ben Greear]

The nl80211 handling code should ensure as much as
it can that the interface is in a valid state, it
can certainly ensure the interface is running.

Not doing so can cause calls through mac80211 into
the driver that result in warnings and unspecified
behaviour in the driver.

Reported-by: Ben Greear <greearb@candelatech.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Signed-off-by: Ben Greear <greearb@candelatech.com>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
---
 net/wireless/nl80211.c |   29 +++++++++++++++++------------
 1 file changed, 17 insertions(+), 12 deletions(-)

--- a/net/wireless/nl80211.c
+++ b/net/wireless/nl80211.c
@@ -1181,6 +1181,11 @@ static int nl80211_set_wiphy(struct sk_b
 			goto bad_res;
 		}
 
+		if (!netif_running(netdev)) {
+			result = -ENETDOWN;
+			goto bad_res;
+		}
+
 		nla_for_each_nested(nl_txq_params,
 				    info->attrs[NL80211_ATTR_WIPHY_TXQ_PARAMS],
 				    rem_txq_params) {
@@ -5432,7 +5437,7 @@ static struct genl_ops nl80211_ops[] = {
 		.doit = nl80211_get_key,
 		.policy = nl80211_policy,
 		.flags = GENL_ADMIN_PERM,
-		.internal_flags = NL80211_FLAG_NEED_NETDEV |
+		.internal_flags = NL80211_FLAG_NEED_NETDEV_UP |
 				  NL80211_FLAG_NEED_RTNL,
 	},
 	{
@@ -5464,7 +5469,7 @@ static struct genl_ops nl80211_ops[] = {
 		.policy = nl80211_policy,
 		.flags = GENL_ADMIN_PERM,
 		.doit = nl80211_addset_beacon,
-		.internal_flags = NL80211_FLAG_NEED_NETDEV |
+		.internal_flags = NL80211_FLAG_NEED_NETDEV_UP |
 				  NL80211_FLAG_NEED_RTNL,
 	},
 	{
@@ -5472,7 +5477,7 @@ static struct genl_ops nl80211_ops[] = {
 		.policy = nl80211_policy,
 		.flags = GENL_ADMIN_PERM,
 		.doit = nl80211_addset_beacon,
-		.internal_flags = NL80211_FLAG_NEED_NETDEV |
+		.internal_flags = NL80211_FLAG_NEED_NETDEV_UP |
 				  NL80211_FLAG_NEED_RTNL,
 	},
 	{
@@ -5496,7 +5501,7 @@ static struct genl_ops nl80211_ops[] = {
 		.doit = nl80211_set_station,
 		.policy = nl80211_policy,
 		.flags = GENL_ADMIN_PERM,
-		.internal_flags = NL80211_FLAG_NEED_NETDEV |
+		.internal_flags = NL80211_FLAG_NEED_NETDEV_UP |
 				  NL80211_FLAG_NEED_RTNL,
 	},
 	{
@@ -5512,7 +5517,7 @@ static struct genl_ops nl80211_ops[] = {
 		.doit = nl80211_del_station,
 		.policy = nl80211_policy,
 		.flags = GENL_ADMIN_PERM,
-		.internal_flags = NL80211_FLAG_NEED_NETDEV |
+		.internal_flags = NL80211_FLAG_NEED_NETDEV_UP |
 				  NL80211_FLAG_NEED_RTNL,
 	},
 	{
@@ -5545,7 +5550,7 @@ static struct genl_ops nl80211_ops[] = {
 		.doit = nl80211_del_mpath,
 		.policy = nl80211_policy,
 		.flags = GENL_ADMIN_PERM,
-		.internal_flags = NL80211_FLAG_NEED_NETDEV |
+		.internal_flags = NL80211_FLAG_NEED_NETDEV_UP |
 				  NL80211_FLAG_NEED_RTNL,
 	},
 	{
@@ -5553,7 +5558,7 @@ static struct genl_ops nl80211_ops[] = {
 		.doit = nl80211_set_bss,
 		.policy = nl80211_policy,
 		.flags = GENL_ADMIN_PERM,
-		.internal_flags = NL80211_FLAG_NEED_NETDEV |
+		.internal_flags = NL80211_FLAG_NEED_NETDEV_UP |
 				  NL80211_FLAG_NEED_RTNL,
 	},
 	{
@@ -5579,7 +5584,7 @@ static struct genl_ops nl80211_ops[] = {
 		.doit = nl80211_get_mesh_config,
 		.policy = nl80211_policy,
 		/* can be retrieved by unprivileged users */
-		.internal_flags = NL80211_FLAG_NEED_NETDEV |
+		.internal_flags = NL80211_FLAG_NEED_NETDEV_UP |
 				  NL80211_FLAG_NEED_RTNL,
 	},
 	{
@@ -5711,7 +5716,7 @@ static struct genl_ops nl80211_ops[] = {
 		.doit = nl80211_setdel_pmksa,
 		.policy = nl80211_policy,
 		.flags = GENL_ADMIN_PERM,
-		.internal_flags = NL80211_FLAG_NEED_NETDEV |
+		.internal_flags = NL80211_FLAG_NEED_NETDEV_UP |
 				  NL80211_FLAG_NEED_RTNL,
 	},
 	{
@@ -5719,7 +5724,7 @@ static struct genl_ops nl80211_ops[] = {
 		.doit = nl80211_setdel_pmksa,
 		.policy = nl80211_policy,
 		.flags = GENL_ADMIN_PERM,
-		.internal_flags = NL80211_FLAG_NEED_NETDEV |
+		.internal_flags = NL80211_FLAG_NEED_NETDEV_UP |
 				  NL80211_FLAG_NEED_RTNL,
 	},
 	{
@@ -5727,7 +5732,7 @@ static struct genl_ops nl80211_ops[] = {
 		.doit = nl80211_flush_pmksa,
 		.policy = nl80211_policy,
 		.flags = GENL_ADMIN_PERM,
-		.internal_flags = NL80211_FLAG_NEED_NETDEV |
+		.internal_flags = NL80211_FLAG_NEED_NETDEV_UP |
 				  NL80211_FLAG_NEED_RTNL,
 	},
 	{
@@ -5815,7 +5820,7 @@ static struct genl_ops nl80211_ops[] = {
 		.doit = nl80211_set_wds_peer,
 		.policy = nl80211_policy,
 		.flags = GENL_ADMIN_PERM,
-		.internal_flags = NL80211_FLAG_NEED_NETDEV |
+		.internal_flags = NL80211_FLAG_NEED_NETDEV_UP |
 				  NL80211_FLAG_NEED_RTNL,
 	},
 	{



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

* [ 114/167] [PATCH] ALSA: HDA: Add external mic quirk for Asus Zenbook UX31E
  2012-05-09  5:50 [ 000/167] 3.2.17-stable review Ben Hutchings
                   ` (112 preceding siblings ...)
  2012-05-09  5:52 ` [ 113/167] nl80211: ensure interface is up in various APIs Ben Hutchings
@ 2012-05-09  5:52 ` Ben Hutchings
  2012-05-09  5:52 ` [ 115/167] [PATCH] USB: cdc-wdm: fix race leading leading to memory corruption Ben Hutchings
                   ` (52 subsequent siblings)
  166 siblings, 0 replies; 195+ messages in thread
From: Ben Hutchings @ 2012-05-09  5:52 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: torvalds, akpm, alan, David Henningsson, Takashi Iwai

3.2-stable review patch.  If anyone has any objections, please let me know.

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

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

commit 5ac57550f279c3d991ef0b398681bcaca18169f7 upstream.

According to the reporter, external mic starts to work if the
laptop-dmic model is used. According to BIOS pin config, all
pins are consistent with the alc269vb_laptop_dmic fixup, except
for the external mic, which is not present.

BugLink: https://bugs.launchpad.net/bugs/950490
Signed-off-by: David Henningsson <david.henningsson@canonical.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
[bwh: Backported to 3.2: adjust context]
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
---
 sound/pci/hda/patch_realtek.c |    1 +
 1 file changed, 1 insertion(+)

--- a/sound/pci/hda/patch_realtek.c
+++ b/sound/pci/hda/patch_realtek.c
@@ -6109,6 +6109,7 @@ static const struct alc_fixup alc269_fixups[] = {
 };
 
 static const struct snd_pci_quirk alc269_fixup_tbl[] = {
+	SND_PCI_QUIRK(0x1043, 0x1427, "Asus Zenbook UX31E", ALC269VB_FIXUP_DMIC),
 	SND_PCI_QUIRK(0x1043, 0x1a13, "Asus G73Jw", ALC269_FIXUP_ASUS_G73JW),
 	SND_PCI_QUIRK(0x1043, 0x16e3, "ASUS UX50", ALC269_FIXUP_STEREO_DMIC),
 	SND_PCI_QUIRK(0x1043, 0x831a, "ASUS P901", ALC269_FIXUP_STEREO_DMIC),



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

* [ 115/167] [PATCH] USB: cdc-wdm: fix race leading leading to memory corruption
  2012-05-09  5:50 [ 000/167] 3.2.17-stable review Ben Hutchings
                   ` (113 preceding siblings ...)
  2012-05-09  5:52 ` [ 114/167] [PATCH] ALSA: HDA: Add external mic quirk for Asus Zenbook UX31E Ben Hutchings
@ 2012-05-09  5:52 ` Ben Hutchings
  2012-05-09  5:52 ` [ 116/167] [PATCH] USB: EHCI: fix crash during suspend on ASUS computers Ben Hutchings
                   ` (51 subsequent siblings)
  166 siblings, 0 replies; 195+ messages in thread
From: Ben Hutchings @ 2012-05-09  5:52 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: torvalds, akpm, alan, Oliver Neukum, Oliver Neukum,
	BjÞrn Mork, Greg Kroah-Hartman

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

3.2-stable review patch.  If anyone has any objections, please let me know.

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

From: Oliver Neukum <oliver@neukum.org>

commit 5c22837adca7c30b66121cf18ad3e160134268d4 upstream.

This patch fixes a race whereby a pointer to a buffer
would be overwritten while the buffer was in use leading
to a double free and a memory leak. This causes crashes.
This bug was introduced in 2.6.34

Signed-off-by: Oliver Neukum <oneukum@suse.de>
Tested-by: Bjørn Mork <bjorn@mork.no>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
---
 drivers/usb/class/cdc-wdm.c |    7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/drivers/usb/class/cdc-wdm.c b/drivers/usb/class/cdc-wdm.c
index c6f6560..0bb2b32 100644
--- a/drivers/usb/class/cdc-wdm.c
+++ b/drivers/usb/class/cdc-wdm.c
@@ -157,8 +157,9 @@ static void wdm_out_callback(struct urb *urb)
 	spin_lock(&desc->iuspin);
 	desc->werr = urb->status;
 	spin_unlock(&desc->iuspin);
-	clear_bit(WDM_IN_USE, &desc->flags);
 	kfree(desc->outbuf);
+	desc->outbuf = NULL;
+	clear_bit(WDM_IN_USE, &desc->flags);
 	wake_up(&desc->wait);
 }
 
@@ -338,7 +339,7 @@ static ssize_t wdm_write
 	if (we < 0)
 		return -EIO;
 
-	desc->outbuf = buf = kmalloc(count, GFP_KERNEL);
+	buf = kmalloc(count, GFP_KERNEL);
 	if (!buf) {
 		rv = -ENOMEM;
 		goto outnl;
@@ -406,10 +407,12 @@ static ssize_t wdm_write
 	req->wIndex = desc->inum;
 	req->wLength = cpu_to_le16(count);
 	set_bit(WDM_IN_USE, &desc->flags);
+	desc->outbuf = buf;
 
 	rv = usb_submit_urb(desc->command, GFP_KERNEL);
 	if (rv < 0) {
 		kfree(buf);
+		desc->outbuf = NULL;
 		clear_bit(WDM_IN_USE, &desc->flags);
 		dev_err(&desc->intf->dev, "Tx URB error: %d\n", rv);
 	} else {
-- 
1.7.10




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

* [ 116/167] [PATCH] USB: EHCI: fix crash during suspend on ASUS computers
  2012-05-09  5:50 [ 000/167] 3.2.17-stable review Ben Hutchings
                   ` (114 preceding siblings ...)
  2012-05-09  5:52 ` [ 115/167] [PATCH] USB: cdc-wdm: fix race leading leading to memory corruption Ben Hutchings
@ 2012-05-09  5:52 ` Ben Hutchings
  2012-05-09  6:25   ` Oleksij Rempel
  2012-05-09  5:52 ` [ 117/167] [PATCH] USB: gadget: storage gadgets send wrong error code for unknown commands Ben Hutchings
                   ` (50 subsequent siblings)
  166 siblings, 1 reply; 195+ messages in thread
From: Ben Hutchings @ 2012-05-09  5:52 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: torvalds, akpm, alan, Alan Stern, Steven Rostedt,
	Andrey Rahmatullin, Oleksij Rempel (fishor),
	Greg Kroah-Hartman

3.2-stable review patch.  If anyone has any objections, please let me know.

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

From: Alan Stern <stern@rowland.harvard.edu>

commit 151b61284776be2d6f02d48c23c3625678960b97 upstream.

This patch (as1545) fixes a problem affecting several ASUS computers:
The machine crashes or corrupts memory when going into suspend if the
ehci-hcd driver is bound to any controllers.  Users have been forced
to unbind or unload ehci-hcd before putting their systems to sleep.

After extensive testing, it was determined that the machines don't
like going into suspend when any EHCI controllers are in the PCI D3
power state.  Presumably this is a firmware bug, but there's nothing
we can do about it except to avoid putting the controllers in D3
during system sleep.

The patch adds a new flag to indicate whether the problem is present,
and avoids changing the controller's power state if the flag is set.
Runtime suspend is unaffected; this matters only for system suspend.
However as a side effect, the controller will not respond to remote
wakeup requests while the system is asleep.  Hence USB wakeup is not
functional -- but of course, this is already true in the current state
of affairs.

This fixes Bugzilla #42728.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Tested-by: Steven Rostedt <rostedt@goodmis.org>
Tested-by: Andrey Rahmatullin <wrar@wrar.name>
Tested-by: Oleksij Rempel (fishor) <bug-track@fisher-privat.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
[bwh: Backported to 3.2: adjust context]
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
---
 drivers/usb/core/hcd-pci.c  |    9 +++++++++
 drivers/usb/host/ehci-pci.c |    8 ++++++++
 include/linux/usb/hcd.h     |    2 ++
 3 files changed, 19 insertions(+)

--- linux.orig/drivers/usb/core/hcd-pci.c
+++ linux/drivers/usb/core/hcd-pci.c
@@ -495,6 +495,15 @@
 
 	pci_save_state(pci_dev);
 
+	/*
+	 * Some systems crash if an EHCI controller is in D3 during
+	 * a sleep transition.  We have to leave such controllers in D0.
+	 */
+	if (hcd->broken_pci_sleep) {
+		dev_dbg(dev, "Staying in PCI D0\n");
+		return retval;
+	}
+
 	/* If the root hub is dead rather than suspended, disallow remote
 	 * wakeup.  usb_hc_died() should ensure that both hosts are marked as
 	 * dying, so we only need to check the primary roothub.
--- linux.orig/drivers/usb/host/ehci-pci.c
+++ linux/drivers/usb/host/ehci-pci.c
@@ -144,6 +144,14 @@
 			hcd->has_tt = 1;
 			tdi_reset(ehci);
 		}
+		if (pdev->subsystem_vendor == PCI_VENDOR_ID_ASUSTEK) {
+			/* EHCI #1 or #2 on 6 Series/C200 Series chipset */
+			if (pdev->device == 0x1c26 || pdev->device == 0x1c2d) {
+				ehci_info(ehci, "broken D3 during system sleep on ASUS\n");
+				hcd->broken_pci_sleep = 1;
+				device_set_wakeup_capable(&pdev->dev, false);
+			}
+		}
 		break;
 	case PCI_VENDOR_ID_TDI:
 		if (pdev->device == PCI_DEVICE_ID_TDI_EHCI) {
--- linux.orig/include/linux/usb/hcd.h
+++ linux/include/linux/usb/hcd.h
@@ -128,6 +128,8 @@
 	unsigned		wireless:1;	/* Wireless USB HCD */
 	unsigned		authorized_default:1;
 	unsigned		has_tt:1;	/* Integrated TT in root hub */
+	unsigned		broken_pci_sleep:1;	/* Don't put the
+			controller in PCI-D3 for system sleep */
 
 	int			irq;		/* irq allocated */
 	void __iomem		*regs;		/* device memory/io */



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

* [ 117/167] [PATCH] USB: gadget: storage gadgets send wrong error code for unknown commands
  2012-05-09  5:50 [ 000/167] 3.2.17-stable review Ben Hutchings
                   ` (115 preceding siblings ...)
  2012-05-09  5:52 ` [ 116/167] [PATCH] USB: EHCI: fix crash during suspend on ASUS computers Ben Hutchings
@ 2012-05-09  5:52 ` Ben Hutchings
  2012-05-09  5:52 ` [ 118/167] [PATCH] usb: gadget: dummy: do not call pullup() on udc_stop() Ben Hutchings
                   ` (49 subsequent siblings)
  166 siblings, 0 replies; 195+ messages in thread
From: Ben Hutchings @ 2012-05-09  5:52 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: torvalds, akpm, alan, Alan Stern, Felipe Balbi, Michal Nazarewicz

3.2-stable review patch.  If anyone has any objections, please let me know.

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

From: Alan Stern <stern@rowland.harvard.edu>

commit c85dcdac5852295cf6822f5c4331a6ddab72581f upstream.

This patch (as1539) fixes a minor bug in the mass-storage gadget
drivers.  When an unknown command is received, the error code sent
back is "Invalid Field in CDB" rather than "Invalid Command".  This is
because the bitmask of CDB bytes allowed to be nonzero is incorrect.

When handling an unknown command, we don't care which command bytes
are nonzero.  All the bits in the mask should be set, not just eight
of them.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
CC: <Michal Nazarewicz <mina86@mina86.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
---
 drivers/usb/gadget/f_mass_storage.c |    2 +-
 drivers/usb/gadget/file_storage.c   |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/usb/gadget/f_mass_storage.c b/drivers/usb/gadget/f_mass_storage.c
index a371e96..cb8c162 100644
--- a/drivers/usb/gadget/f_mass_storage.c
+++ b/drivers/usb/gadget/f_mass_storage.c
@@ -2189,7 +2189,7 @@ unknown_cmnd:
 		common->data_size_from_cmnd = 0;
 		sprintf(unknown, "Unknown x%02x", common->cmnd[0]);
 		reply = check_command(common, common->cmnd_size,
-				      DATA_DIR_UNKNOWN, 0xff, 0, unknown);
+				      DATA_DIR_UNKNOWN, ~0, 0, unknown);
 		if (reply == 0) {
 			common->curlun->sense_data = SS_INVALID_COMMAND;
 			reply = -EINVAL;
diff --git a/drivers/usb/gadget/file_storage.c b/drivers/usb/gadget/file_storage.c
index 4fac569..a896d73 100644
--- a/drivers/usb/gadget/file_storage.c
+++ b/drivers/usb/gadget/file_storage.c
@@ -2579,7 +2579,7 @@ static int do_scsi_command(struct fsg_dev *fsg)
 		fsg->data_size_from_cmnd = 0;
 		sprintf(unknown, "Unknown x%02x", fsg->cmnd[0]);
 		if ((reply = check_command(fsg, fsg->cmnd_size,
-				DATA_DIR_UNKNOWN, 0xff, 0, unknown)) == 0) {
+				DATA_DIR_UNKNOWN, ~0, 0, unknown)) == 0) {
 			fsg->curlun->sense_data = SS_INVALID_COMMAND;
 			reply = -EINVAL;
 		}
-- 
1.7.10




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

* [ 118/167] [PATCH] usb: gadget: dummy: do not call pullup() on udc_stop()
  2012-05-09  5:50 [ 000/167] 3.2.17-stable review Ben Hutchings
                   ` (116 preceding siblings ...)
  2012-05-09  5:52 ` [ 117/167] [PATCH] USB: gadget: storage gadgets send wrong error code for unknown commands Ben Hutchings
@ 2012-05-09  5:52 ` Ben Hutchings
  2012-05-09  5:52 ` [ 119/167] [PATCH] usb gadget: uvc: uvc_request_data::length field must be signed Ben Hutchings
                   ` (48 subsequent siblings)
  166 siblings, 0 replies; 195+ messages in thread
From: Ben Hutchings @ 2012-05-09  5:52 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: torvalds, akpm, alan, Felipe Balbi, Alexander Shishkin, Alan Stern

3.2-stable review patch.  If anyone has any objections, please let me know.

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

From: Felipe Balbi <balbi@ti.com>

commit 15b120d67019d691e4389372967332d74a80522a upstream.

pullup() is already called properly by udc-core.c and
there's no need to call it from udc_stop(), in fact that
will cause issues.

Reviewed-by: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Acked-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Felipe Balbi <balbi@ti.com>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
---
 drivers/usb/gadget/dummy_hcd.c |    1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/usb/gadget/dummy_hcd.c b/drivers/usb/gadget/dummy_hcd.c
index a6dfd21..170cbe8 100644
--- a/drivers/usb/gadget/dummy_hcd.c
+++ b/drivers/usb/gadget/dummy_hcd.c
@@ -927,7 +927,6 @@ static int dummy_udc_stop(struct usb_gadget *g,
 
 	dum->driver = NULL;
 
-	dummy_pullup(&dum->gadget, 0);
 	return 0;
 }
 
-- 
1.7.10




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

* [ 119/167] [PATCH] usb gadget: uvc: uvc_request_data::length field must be signed
  2012-05-09  5:50 [ 000/167] 3.2.17-stable review Ben Hutchings
                   ` (117 preceding siblings ...)
  2012-05-09  5:52 ` [ 118/167] [PATCH] usb: gadget: dummy: do not call pullup() on udc_stop() Ben Hutchings
@ 2012-05-09  5:52 ` Ben Hutchings
  2012-05-09  5:52 ` [ 120/167] [PATCH] pipes: add a "packetized pipe" mode for writing Ben Hutchings
                   ` (47 subsequent siblings)
  166 siblings, 0 replies; 195+ messages in thread
From: Ben Hutchings @ 2012-05-09  5:52 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: torvalds, akpm, alan, Laurent Pinchart, Fernandez Gonzalo,
	Greg Kroah-Hartman

3.2-stable review patch.  If anyone has any objections, please let me know.

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

From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>

commit 6f6543f53f9ce136e01d7114bf6f0818ca54fb41 upstream.

The field is used to pass the UVC request data length, but can also be
used to signal an error when setting it to a negative value. Switch from
unsigned int to __s32.

Reported-by: Fernandez Gonzalo <gfernandez@copreci.es>
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
---
 drivers/usb/gadget/uvc.h      |    2 +-
 drivers/usb/gadget/uvc_v4l2.c |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/usb/gadget/uvc.h b/drivers/usb/gadget/uvc.h
index bc78c60..ca4e03a 100644
--- a/drivers/usb/gadget/uvc.h
+++ b/drivers/usb/gadget/uvc.h
@@ -28,7 +28,7 @@
 
 struct uvc_request_data
 {
-	unsigned int length;
+	__s32 length;
 	__u8 data[60];
 };
 
diff --git a/drivers/usb/gadget/uvc_v4l2.c b/drivers/usb/gadget/uvc_v4l2.c
index f6e083b..54d7ca5 100644
--- a/drivers/usb/gadget/uvc_v4l2.c
+++ b/drivers/usb/gadget/uvc_v4l2.c
@@ -39,7 +39,7 @@ uvc_send_response(struct uvc_device *uvc, struct uvc_request_data *data)
 	if (data->length < 0)
 		return usb_ep_set_halt(cdev->gadget->ep0);
 
-	req->length = min(uvc->event_length, data->length);
+	req->length = min_t(unsigned int, uvc->event_length, data->length);
 	req->zero = data->length < uvc->event_length;
 	req->dma = DMA_ADDR_INVALID;
 
-- 
1.7.10




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

* [ 120/167] [PATCH] pipes: add a "packetized pipe" mode for writing
  2012-05-09  5:50 [ 000/167] 3.2.17-stable review Ben Hutchings
                   ` (118 preceding siblings ...)
  2012-05-09  5:52 ` [ 119/167] [PATCH] usb gadget: uvc: uvc_request_data::length field must be signed Ben Hutchings
@ 2012-05-09  5:52 ` Ben Hutchings
  2012-05-09  5:52 ` [ 121/167] [PATCH] autofs: make the autofsv5 packet file descriptor use a packetized pipe Ben Hutchings
                   ` (46 subsequent siblings)
  166 siblings, 0 replies; 195+ messages in thread
From: Ben Hutchings @ 2012-05-09  5:52 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: torvalds, akpm, alan, Michael Tokarev, David Miller, Ian Kent,
	Thomas Meyer

3.2-stable review patch.  If anyone has any objections, please let me know.

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

From: Linus Torvalds <torvalds@linux-foundation.org>

commit 9883035ae7edef3ec62ad215611cb8e17d6a1a5d upstream.

The actual internal pipe implementation is already really about
individual packets (called "pipe buffers"), and this simply exposes that
as a special packetized mode.

When we are in the packetized mode (marked by O_DIRECT as suggested by
Alan Cox), a write() on a pipe will not merge the new data with previous
writes, so each write will get a pipe buffer of its own.  The pipe
buffer is then marked with the PIPE_BUF_FLAG_PACKET flag, which in turn
will tell the reader side to break the read at that boundary (and throw
away any partial packet contents that do not fit in the read buffer).

End result: as long as you do writes less than PIPE_BUF in size (so that
the pipe doesn't have to split them up), you can now treat the pipe as a
packet interface, where each read() system call will read one packet at
a time.  You can just use a sufficiently big read buffer (PIPE_BUF is
sufficient, since bigger than that doesn't guarantee atomicity anyway),
and the return value of the read() will naturally give you the size of
the packet.

NOTE! We do not support zero-sized packets, and zero-sized reads and
writes to a pipe continue to be no-ops.  Also note that big packets will
currently be split at write time, but that the size at which that
happens is not really specified (except that it's bigger than PIPE_BUF).
Currently that limit is the system page size, but we might want to
explicitly support bigger packets some day.

The main user for this is going to be the autofs packet interface,
allowing us to stop having to care so deeply about exact packet sizes
(which have had bugs with 32/64-bit compatibility modes).  But user
space can create packetized pipes with "pipe2(fd, O_DIRECT)", which will
fail with an EINVAL on kernels that do not support this interface.

Tested-by: Michael Tokarev <mjt@tls.msk.ru>
Cc: Alan Cox <alan@lxorguk.ukuu.org.uk>
Cc: David Miller <davem@davemloft.net>
Cc: Ian Kent <raven@themaw.net>
Cc: Thomas Meyer <thomas@m3y3r.de>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
---
 fs/pipe.c                 |   31 +++++++++++++++++++++++++++++--
 include/linux/pipe_fs_i.h |    1 +
 2 files changed, 30 insertions(+), 2 deletions(-)

diff --git a/fs/pipe.c b/fs/pipe.c
index 25feaa3..fec5e4a 100644
--- a/fs/pipe.c
+++ b/fs/pipe.c
@@ -346,6 +346,16 @@ static const struct pipe_buf_operations anon_pipe_buf_ops = {
 	.get = generic_pipe_buf_get,
 };
 
+static const struct pipe_buf_operations packet_pipe_buf_ops = {
+	.can_merge = 0,
+	.map = generic_pipe_buf_map,
+	.unmap = generic_pipe_buf_unmap,
+	.confirm = generic_pipe_buf_confirm,
+	.release = anon_pipe_buf_release,
+	.steal = generic_pipe_buf_steal,
+	.get = generic_pipe_buf_get,
+};
+
 static ssize_t
 pipe_read(struct kiocb *iocb, const struct iovec *_iov,
 	   unsigned long nr_segs, loff_t pos)
@@ -407,6 +417,13 @@ redo:
 			ret += chars;
 			buf->offset += chars;
 			buf->len -= chars;
+
+			/* Was it a packet buffer? Clean up and exit */
+			if (buf->flags & PIPE_BUF_FLAG_PACKET) {
+				total_len = chars;
+				buf->len = 0;
+			}
+
 			if (!buf->len) {
 				buf->ops = NULL;
 				ops->release(pipe, buf);
@@ -459,6 +476,11 @@ redo:
 	return ret;
 }
 
+static inline int is_packetized(struct file *file)
+{
+	return (file->f_flags & O_DIRECT) != 0;
+}
+
 static ssize_t
 pipe_write(struct kiocb *iocb, const struct iovec *_iov,
 	    unsigned long nr_segs, loff_t ppos)
@@ -593,6 +615,11 @@ redo2:
 			buf->ops = &anon_pipe_buf_ops;
 			buf->offset = 0;
 			buf->len = chars;
+			buf->flags = 0;
+			if (is_packetized(filp)) {
+				buf->ops = &packet_pipe_buf_ops;
+				buf->flags = PIPE_BUF_FLAG_PACKET;
+			}
 			pipe->nrbufs = ++bufs;
 			pipe->tmp_page = NULL;
 
@@ -1013,7 +1040,7 @@ struct file *create_write_pipe(int flags)
 		goto err_dentry;
 	f->f_mapping = inode->i_mapping;
 
-	f->f_flags = O_WRONLY | (flags & O_NONBLOCK);
+	f->f_flags = O_WRONLY | (flags & (O_NONBLOCK | O_DIRECT));
 	f->f_version = 0;
 
 	return f;
@@ -1057,7 +1084,7 @@ int do_pipe_flags(int *fd, int flags)
 	int error;
 	int fdw, fdr;
 
-	if (flags & ~(O_CLOEXEC | O_NONBLOCK))
+	if (flags & ~(O_CLOEXEC | O_NONBLOCK | O_DIRECT))
 		return -EINVAL;
 
 	fw = create_write_pipe(flags);
diff --git a/include/linux/pipe_fs_i.h b/include/linux/pipe_fs_i.h
index 6d626ff..e1ac1ce 100644
--- a/include/linux/pipe_fs_i.h
+++ b/include/linux/pipe_fs_i.h
@@ -6,6 +6,7 @@
 #define PIPE_BUF_FLAG_LRU	0x01	/* page is on the LRU */
 #define PIPE_BUF_FLAG_ATOMIC	0x02	/* was atomically mapped */
 #define PIPE_BUF_FLAG_GIFT	0x04	/* page is a gift */
+#define PIPE_BUF_FLAG_PACKET	0x08	/* read() as a packet */
 
 /**
  *	struct pipe_buffer - a linux kernel pipe buffer
-- 
1.7.10




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

* [ 121/167] [PATCH] autofs: make the autofsv5 packet file descriptor use a packetized pipe
  2012-05-09  5:50 [ 000/167] 3.2.17-stable review Ben Hutchings
                   ` (119 preceding siblings ...)
  2012-05-09  5:52 ` [ 120/167] [PATCH] pipes: add a "packetized pipe" mode for writing Ben Hutchings
@ 2012-05-09  5:52 ` Ben Hutchings
  2012-05-09  5:52 ` [ 122/167] [PATCH] ARM: 7396/1: errata: only handle ARM erratum #326103 on affected cores Ben Hutchings
                   ` (45 subsequent siblings)
  166 siblings, 0 replies; 195+ messages in thread
From: Ben Hutchings @ 2012-05-09  5:52 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: torvalds, akpm, alan, Michael Tokarev, David Miller, Ian Kent,
	Thomas Meyer

3.2-stable review patch.  If anyone has any objections, please let me know.

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

From: Linus Torvalds <torvalds@linux-foundation.org>

commit 64f371bc3107e69efce563a3d0f0e6880de0d537 upstream.

The autofs packet size has had a very unfortunate size problem on x86:
because the alignment of 'u64' differs in 32-bit and 64-bit modes, and
because the packet data was not 8-byte aligned, the size of the autofsv5
packet structure differed between 32-bit and 64-bit modes despite
looking otherwise identical (300 vs 304 bytes respectively).

We first fixed that up by making the 64-bit compat mode know about this
problem in commit a32744d4abae ("autofs: work around unhappy compat
problem on x86-64"), and that made a 32-bit 'systemd' work happily on a
64-bit kernel because everything then worked the same way as on a 32-bit
kernel.

But it turned out that 'automount' had actually known and worked around
this problem in user space, so fixing the kernel to do the proper 32-bit
compatibility handling actually *broke* 32-bit automount on a 64-bit
kernel, because it knew that the packet sizes were wrong and expected
those incorrect sizes.

As a result, we ended up reverting that compatibility mode fix, and
thus breaking systemd again, in commit fcbf94b9dedd.

With both automount and systemd doing a single read() system call, and
verifying that they get *exactly* the size they expect but using
different sizes, it seemed that fixing one of them inevitably seemed to
break the other.  At one point, a patch I seriously considered applying
from Michael Tokarev did a "strcmp()" to see if it was automount that
was doing the operation.  Ugly, ugly.

However, a prettier solution exists now thanks to the packetized pipe
mode.  By marking the communication pipe as being packetized (by simply
setting the O_DIRECT flag), we can always just write the bigger packet
size, and if user-space does a smaller read, it will just get that
partial end result and the extra alignment padding will simply be thrown
away.

This makes both automount and systemd happy, since they now get the size
they asked for, and the kernel side of autofs simply no longer needs to
care - it could pad out the packet arbitrarily.

Of course, if there is some *other* user of autofs (please, please,
please tell me it ain't so - and we haven't heard of any) that tries to
read the packets with multiple writes, that other user will now be
broken - the whole point of the packetized mode is that one system call
gets exactly one packet, and you cannot read a packet in pieces.

Tested-by: Michael Tokarev <mjt@tls.msk.ru>
Cc: Alan Cox <alan@lxorguk.ukuu.org.uk>
Cc: David Miller <davem@davemloft.net>
Cc: Ian Kent <raven@themaw.net>
Cc: Thomas Meyer <thomas@m3y3r.de>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
---
 fs/autofs4/autofs_i.h  |   11 +++++++++++
 fs/autofs4/dev-ioctl.c |    2 +-
 fs/autofs4/inode.c     |    2 +-
 3 files changed, 13 insertions(+), 2 deletions(-)

diff --git a/fs/autofs4/autofs_i.h b/fs/autofs4/autofs_i.h
index d8d8e7b..908e184 100644
--- a/fs/autofs4/autofs_i.h
+++ b/fs/autofs4/autofs_i.h
@@ -269,6 +269,17 @@ int autofs4_fill_super(struct super_block *, void *, int);
 struct autofs_info *autofs4_new_ino(struct autofs_sb_info *);
 void autofs4_clean_ino(struct autofs_info *);
 
+static inline int autofs_prepare_pipe(struct file *pipe)
+{
+	if (!pipe->f_op || !pipe->f_op->write)
+		return -EINVAL;
+	if (!S_ISFIFO(pipe->f_dentry->d_inode->i_mode))
+		return -EINVAL;
+	/* We want a packet pipe */
+	pipe->f_flags |= O_DIRECT;
+	return 0;
+}
+
 /* Queue management functions */
 
 int autofs4_wait(struct autofs_sb_info *,struct dentry *, enum autofs_notify);
diff --git a/fs/autofs4/dev-ioctl.c b/fs/autofs4/dev-ioctl.c
index 3dfd615..aa9103f 100644
--- a/fs/autofs4/dev-ioctl.c
+++ b/fs/autofs4/dev-ioctl.c
@@ -376,7 +376,7 @@ static int autofs_dev_ioctl_setpipefd(struct file *fp,
 			err = -EBADF;
 			goto out;
 		}
-		if (!pipe->f_op || !pipe->f_op->write) {
+		if (autofs_prepare_pipe(pipe) < 0) {
 			err = -EPIPE;
 			fput(pipe);
 			goto out;
diff --git a/fs/autofs4/inode.c b/fs/autofs4/inode.c
index 14c7bc0..6e488eb 100644
--- a/fs/autofs4/inode.c
+++ b/fs/autofs4/inode.c
@@ -290,7 +290,7 @@ int autofs4_fill_super(struct super_block *s, void *data, int silent)
 		printk("autofs: could not open pipe file descriptor\n");
 		goto fail_dput;
 	}
-	if (!pipe->f_op || !pipe->f_op->write)
+	if (autofs_prepare_pipe(pipe) < 0)
 		goto fail_fput;
 	sbi->pipe = pipe;
 	sbi->pipefd = pipefd;
-- 
1.7.10




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

* [ 122/167] [PATCH] ARM: 7396/1: errata: only handle ARM erratum #326103 on affected cores
  2012-05-09  5:50 [ 000/167] 3.2.17-stable review Ben Hutchings
                   ` (120 preceding siblings ...)
  2012-05-09  5:52 ` [ 121/167] [PATCH] autofs: make the autofsv5 packet file descriptor use a packetized pipe Ben Hutchings
@ 2012-05-09  5:52 ` Ben Hutchings
  2012-05-09  5:52 ` [ 123/167] [PATCH] ARM: 7397/1: l2x0: only apply workaround for erratum #753970 on PL310 Ben Hutchings
                   ` (44 subsequent siblings)
  166 siblings, 0 replies; 195+ messages in thread
From: Ben Hutchings @ 2012-05-09  5:52 UTC (permalink / raw)
  To: linux-kernel, stable; +Cc: torvalds, akpm, alan, Will Deacon, Russell King

3.2-stable review patch.  If anyone has any objections, please let me know.

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

From: Will Deacon <will.deacon@arm.com>

commit f0c4b8d653f5ee091fb8d4d02ed7eaad397491bb upstream.

Erratum #326103 ("FSR write bit incorrect on a SWP to read-only memory")
only affects the ARM 1136 core prior to r1p0. The workaround
disassembles the faulting instruction to determine whether it was a read
or write access on all v6 cores.

An issue has been reported on the ARM 11MPCore whereby loading the
faulting instruction may happen in parallel with that page being
unmapped, resulting in a deadlock due to the lack of TLB broadcasting
in hardware:

http://lists.infradead.org/pipermail/linux-arm-kernel/2012-March/091561.html

This patch limits the workaround so that it is only used on affected
cores, which are known to be UP only. Other v6 cores can rely on the
FSR to indicate the access type correctly.

Signed-off-by: Will Deacon <will.deacon@arm.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
---
 arch/arm/Kconfig        |    9 +++++++++
 arch/arm/mm/abort-ev6.S |   17 +++++++++++------
 2 files changed, 20 insertions(+), 6 deletions(-)

diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
index cf006d4..36586dba 100644
--- a/arch/arm/Kconfig
+++ b/arch/arm/Kconfig
@@ -1186,6 +1186,15 @@ if !MMU
 source "arch/arm/Kconfig-nommu"
 endif
 
+config ARM_ERRATA_326103
+	bool "ARM errata: FSR write bit incorrect on a SWP to read-only memory"
+	depends on CPU_V6
+	help
+	  Executing a SWP instruction to read-only memory does not set bit 11
+	  of the FSR on the ARM 1136 prior to r1p0. This causes the kernel to
+	  treat the access as a read, preventing a COW from occurring and
+	  causing the faulting task to livelock.
+
 config ARM_ERRATA_411920
 	bool "ARM errata: Invalidation of the Instruction Cache operation can fail"
 	depends on CPU_V6 || CPU_V6K
diff --git a/arch/arm/mm/abort-ev6.S b/arch/arm/mm/abort-ev6.S
index ff1f7cc..8074199 100644
--- a/arch/arm/mm/abort-ev6.S
+++ b/arch/arm/mm/abort-ev6.S
@@ -26,18 +26,23 @@ ENTRY(v6_early_abort)
 	mrc	p15, 0, r1, c5, c0, 0		@ get FSR
 	mrc	p15, 0, r0, c6, c0, 0		@ get FAR
 /*
- * Faulty SWP instruction on 1136 doesn't set bit 11 in DFSR (erratum 326103).
- * The test below covers all the write situations, including Java bytecodes
+ * Faulty SWP instruction on 1136 doesn't set bit 11 in DFSR.
  */
-	bic	r1, r1, #1 << 11		@ clear bit 11 of FSR
+#ifdef CONFIG_ARM_ERRATA_326103
+	ldr	ip, =0x4107b36
+	mrc	p15, 0, r3, c0, c0, 0		@ get processor id
+	teq	ip, r3, lsr #4			@ r0 ARM1136?
+	bne	do_DataAbort
 	tst	r5, #PSR_J_BIT			@ Java?
+	tsteq	r5, #PSR_T_BIT			@ Thumb?
 	bne	do_DataAbort
-	do_thumb_abort fsr=r1, pc=r4, psr=r5, tmp=r3
-	ldreq	r3, [r4]			@ read aborted ARM instruction
+	bic	r1, r1, #1 << 11		@ clear bit 11 of FSR
+	ldr	r3, [r4]			@ read aborted ARM instruction
 #ifdef CONFIG_CPU_ENDIAN_BE8
-	reveq	r3, r3
+	rev	r3, r3
 #endif
 	do_ldrd_abort tmp=ip, insn=r3
 	tst	r3, #1 << 20			@ L = 0 -> write
 	orreq	r1, r1, #1 << 11		@ yes.
+#endif
 	b	do_DataAbort
-- 
1.7.10




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

* [ 123/167] [PATCH] ARM: 7397/1: l2x0: only apply workaround for erratum #753970 on PL310
  2012-05-09  5:50 [ 000/167] 3.2.17-stable review Ben Hutchings
                   ` (121 preceding siblings ...)
  2012-05-09  5:52 ` [ 122/167] [PATCH] ARM: 7396/1: errata: only handle ARM erratum #326103 on affected cores Ben Hutchings
@ 2012-05-09  5:52 ` Ben Hutchings
  2012-05-09  5:52 ` [ 124/167] [PATCH] ARM: 7398/1: l2x0: only write to debug registers " Ben Hutchings
                   ` (43 subsequent siblings)
  166 siblings, 0 replies; 195+ messages in thread
From: Ben Hutchings @ 2012-05-09  5:52 UTC (permalink / raw)
  To: linux-kernel, stable; +Cc: torvalds, akpm, alan, Will Deacon, Russell King

3.2-stable review patch.  If anyone has any objections, please let me know.

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

From: Will Deacon <will.deacon@arm.com>

commit f154fe9b806574437b47f08e924ad10c0e240b23 upstream.

The workaround for PL310 erratum #753970 can lead to deadlock on systems
with an L220 cache controller.

This patch makes the workaround effective only when the cache controller
is identified as a PL310 at probe time.

Signed-off-by: Will Deacon <will.deacon@arm.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
[bwh: Backported to 3.2: adjust context]
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
---
 arch/arm/mm/cache-l2x0.c |   12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

--- linux.orig/arch/arm/mm/cache-l2x0.c
+++ linux/arch/arm/mm/cache-l2x0.c
@@ -32,6 +32,7 @@
 static DEFINE_RAW_SPINLOCK(l2x0_lock);
 static uint32_t l2x0_way_mask;	/* Bitmask of active ways */
 static uint32_t l2x0_size;
+static unsigned long sync_reg_offset = L2X0_CACHE_SYNC;
 
 struct l2x0_regs l2x0_saved_regs;
 
@@ -61,12 +62,7 @@
 {
 	void __iomem *base = l2x0_base;
 
-#ifdef CONFIG_PL310_ERRATA_753970
-	/* write to an unmmapped register */
-	writel_relaxed(0, base + L2X0_DUMMY_REG);
-#else
-	writel_relaxed(0, base + L2X0_CACHE_SYNC);
-#endif
+	writel_relaxed(0, base + sync_reg_offset);
 	cache_wait(base + L2X0_CACHE_SYNC, 1);
 }
 
@@ -331,6 +327,10 @@
 		else
 			ways = 8;
 		type = "L310";
+#ifdef CONFIG_PL310_ERRATA_753970
+		/* Unmapped register. */
+		sync_reg_offset = L2X0_DUMMY_REG;
+#endif
 		break;
 	case L2X0_CACHE_ID_PART_L210:
 		ways = (aux >> 13) & 0xf;



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

* [ 124/167] [PATCH] ARM: 7398/1: l2x0: only write to debug registers on PL310
  2012-05-09  5:50 [ 000/167] 3.2.17-stable review Ben Hutchings
                   ` (122 preceding siblings ...)
  2012-05-09  5:52 ` [ 123/167] [PATCH] ARM: 7397/1: l2x0: only apply workaround for erratum #753970 on PL310 Ben Hutchings
@ 2012-05-09  5:52 ` Ben Hutchings
  2012-05-09  5:52 ` [ 125/167] [PATCH] ARM: 7403/1: tls: remove covert channel via TPIDRURW Ben Hutchings
                   ` (42 subsequent siblings)
  166 siblings, 0 replies; 195+ messages in thread
From: Ben Hutchings @ 2012-05-09  5:52 UTC (permalink / raw)
  To: linux-kernel, stable; +Cc: torvalds, akpm, alan, Will Deacon, Russell King

3.2-stable review patch.  If anyone has any objections, please let me know.

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

From: Will Deacon <will.deacon@arm.com>

commit ab4d536890853ab6675ede65db40e2c0980cb0ea upstream.

PL310 errata #588369 and #727915 require writes to the debug registers
of the cache controller to work around known problems. Writing these
registers on L220 may cause deadlock, so ensure that we only perform
this operation when we identify a PL310 at probe time.

Signed-off-by: Will Deacon <will.deacon@arm.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
---
 arch/arm/mm/cache-l2x0.c |   13 ++++++++-----
 1 file changed, 8 insertions(+), 5 deletions(-)

diff --git a/arch/arm/mm/cache-l2x0.c b/arch/arm/mm/cache-l2x0.c
index a8d02c0..2a8e380 100644
--- a/arch/arm/mm/cache-l2x0.c
+++ b/arch/arm/mm/cache-l2x0.c
@@ -81,10 +81,13 @@ static inline void l2x0_inv_line(unsigned long addr)
 }
 
 #if defined(CONFIG_PL310_ERRATA_588369) || defined(CONFIG_PL310_ERRATA_727915)
+static inline void debug_writel(unsigned long val)
+{
+	if (outer_cache.set_debug)
+		outer_cache.set_debug(val);
+}
 
-#define debug_writel(val)	outer_cache.set_debug(val)
-
-static void l2x0_set_debug(unsigned long val)
+static void pl310_set_debug(unsigned long val)
 {
 	writel_relaxed(val, l2x0_base + L2X0_DEBUG_CTRL);
 }
@@ -94,7 +97,7 @@ static inline void debug_writel(unsigned long val)
 {
 }
 
-#define l2x0_set_debug	NULL
+#define pl310_set_debug	NULL
 #endif
 
 #ifdef CONFIG_PL310_ERRATA_588369
@@ -331,6 +334,7 @@ void __init l2x0_init(void __iomem *base, u32 aux_val, u32 aux_mask)
 		/* Unmapped register. */
 		sync_reg_offset = L2X0_DUMMY_REG;
 #endif
+		outer_cache.set_debug = pl310_set_debug;
 		break;
 	case L2X0_CACHE_ID_PART_L210:
 		ways = (aux >> 13) & 0xf;
@@ -379,7 +383,6 @@ void __init l2x0_init(void __iomem *base, u32 aux_val, u32 aux_mask)
 	outer_cache.flush_all = l2x0_flush_all;
 	outer_cache.inv_all = l2x0_inv_all;
 	outer_cache.disable = l2x0_disable;
-	outer_cache.set_debug = l2x0_set_debug;
 
 	printk(KERN_INFO "%s cache controller enabled\n", type);
 	printk(KERN_INFO "l2x0: %d ways, CACHE_ID 0x%08x, AUX_CTRL 0x%08x, Cache size: %d B\n",
-- 
1.7.10




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

* [ 125/167] [PATCH] ARM: 7403/1: tls: remove covert channel via TPIDRURW
  2012-05-09  5:50 [ 000/167] 3.2.17-stable review Ben Hutchings
                   ` (123 preceding siblings ...)
  2012-05-09  5:52 ` [ 124/167] [PATCH] ARM: 7398/1: l2x0: only write to debug registers " Ben Hutchings
@ 2012-05-09  5:52 ` Ben Hutchings
  2012-05-09  5:52 ` [ 126/167] [PATCH] ARM: 7406/1: hotplug: copy the affinity mask when forcefully migrating IRQs Ben Hutchings
                   ` (41 subsequent siblings)
  166 siblings, 0 replies; 195+ messages in thread
From: Ben Hutchings @ 2012-05-09  5:52 UTC (permalink / raw)
  To: linux-kernel, stable; +Cc: torvalds, akpm, alan, Will Deacon, Russell King

3.2-stable review patch.  If anyone has any objections, please let me know.

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

From: Will Deacon <will.deacon@arm.com>

commit 6a1c53124aa161eb624ce7b1e40ade728186d34c upstream.

TPIDRURW is a user read/write register forming part of the group of
thread registers in more recent versions of the ARM architecture (~v6+).

Currently, the kernel does not touch this register, which allows tasks
to communicate covertly by reading and writing to the register without
context-switching affecting its contents.

This patch clears TPIDRURW when TPIDRURO is updated via the set_tls
macro, which is called directly from __switch_to. Since the current
behaviour makes the register useless to userspace as far as thread
pointers are concerned, simply clearing the register (rather than saving
and restoring it) will not cause any problems to userspace.

Signed-off-by: Will Deacon <will.deacon@arm.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
---
 arch/arm/include/asm/tls.h |    4 ++++
 1 file changed, 4 insertions(+)

diff --git a/arch/arm/include/asm/tls.h b/arch/arm/include/asm/tls.h
index 60843eb..73409e6 100644
--- a/arch/arm/include/asm/tls.h
+++ b/arch/arm/include/asm/tls.h
@@ -7,6 +7,8 @@
 
 	.macro set_tls_v6k, tp, tmp1, tmp2
 	mcr	p15, 0, \tp, c13, c0, 3		@ set TLS register
+	mov	\tmp1, #0
+	mcr	p15, 0, \tmp1, c13, c0, 2	@ clear user r/w TLS register
 	.endm
 
 	.macro set_tls_v6, tp, tmp1, tmp2
@@ -15,6 +17,8 @@
 	mov	\tmp2, #0xffff0fff
 	tst	\tmp1, #HWCAP_TLS		@ hardware TLS available?
 	mcrne	p15, 0, \tp, c13, c0, 3		@ yes, set TLS register
+	movne	\tmp1, #0
+	mcrne	p15, 0, \tmp1, c13, c0, 2	@ clear user r/w TLS register
 	streq	\tp, [\tmp2, #-15]		@ set TLS value at 0xffff0ff0
 	.endm
 
-- 
1.7.10




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

* [ 126/167] [PATCH] ARM: 7406/1: hotplug: copy the affinity mask when forcefully migrating IRQs
  2012-05-09  5:50 [ 000/167] 3.2.17-stable review Ben Hutchings
                   ` (124 preceding siblings ...)
  2012-05-09  5:52 ` [ 125/167] [PATCH] ARM: 7403/1: tls: remove covert channel via TPIDRURW Ben Hutchings
@ 2012-05-09  5:52 ` Ben Hutchings
  2012-05-09  5:52 ` [ 127/167] [PATCH] [SCSI] libsas: fix sas_find_bcast_phy() in the presence of vacant phys Ben Hutchings
                   ` (40 subsequent siblings)
  166 siblings, 0 replies; 195+ messages in thread
From: Ben Hutchings @ 2012-05-09  5:52 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: torvalds, akpm, alan, Will Deacon, Leif Lindholm, Russell King

3.2-stable review patch.  If anyone has any objections, please let me know.

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

From: Will Deacon <will.deacon@arm.com>

commit 5e7371ded05adfcfcee44a8bc070bfc37979b8f2 upstream.

When a CPU is hotplugged off, we migrate any IRQs currently affine to it
away and onto another online CPU by calling the irq_set_affinity
function of the relevant interrupt controller chip. This function
returns either IRQ_SET_MASK_OK or IRQ_SET_MASK_OK_NOCOPY, to indicate
whether irq_data.affinity was updated.

If we are forcefully migrating an interrupt (because the affinity mask
no longer identifies any online CPUs) then we should update the IRQ
affinity mask to reflect the new CPU set. Failure to do so can
potentially leave /proc/irq/n/smp_affinity identifying only offline
CPUs, which may confuse userspace IRQ balancing daemons.

This patch updates migrate_one_irq to copy the affinity mask when
the interrupt chip returns IRQ_SET_MASK_OK after forcefully changing the
affinity of an interrupt.

Reported-by: Leif Lindholm <leif.lindholm@arm.com>
Signed-off-by: Will Deacon <will.deacon@arm.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
---
 arch/arm/kernel/irq.c |    6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/arch/arm/kernel/irq.c b/arch/arm/kernel/irq.c
index 71ccdbf..8349d4e 100644
--- a/arch/arm/kernel/irq.c
+++ b/arch/arm/kernel/irq.c
@@ -155,10 +155,10 @@ static bool migrate_one_irq(struct irq_desc *desc)
 	}
 
 	c = irq_data_get_irq_chip(d);
-	if (c->irq_set_affinity)
-		c->irq_set_affinity(d, affinity, true);
-	else
+	if (!c->irq_set_affinity)
 		pr_debug("IRQ%u: unable to set affinity\n", d->irq);
+	else if (c->irq_set_affinity(d, affinity, true) == IRQ_SET_MASK_OK && ret)
+		cpumask_copy(d->affinity, affinity);
 
 	return ret;
 }
-- 
1.7.10




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

* [ 127/167] [PATCH] [SCSI] libsas: fix sas_find_bcast_phy() in the presence of vacant phys
  2012-05-09  5:50 [ 000/167] 3.2.17-stable review Ben Hutchings
                   ` (125 preceding siblings ...)
  2012-05-09  5:52 ` [ 126/167] [PATCH] ARM: 7406/1: hotplug: copy the affinity mask when forcefully migrating IRQs Ben Hutchings
@ 2012-05-09  5:52 ` Ben Hutchings
  2012-05-09  5:52 ` [ 128/167] [PATCH] [SCSI] libsas: fix false positive device attached conditions Ben Hutchings
                   ` (39 subsequent siblings)
  166 siblings, 0 replies; 195+ messages in thread
From: Ben Hutchings @ 2012-05-09  5:52 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: torvalds, akpm, alan, Thomas Jackson, Dan Williams, James Bottomley

3.2-stable review patch.  If anyone has any objections, please let me know.

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

From: Thomas Jackson <thomas.p.jackson@intel.com>

commit 1699490db339e2c6b3037ea8e7dcd6b2755b688e upstream.

If an expander reports 'PHY VACANT' for a phy index prior to the one
that generated a BCN libsas fails rediscovery.  Since a vacant phy is
defined as a valid phy index that will never have an attached device
just continue the search.

Signed-off-by: Thomas Jackson <thomas.p.jackson@intel.com>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
---
 drivers/scsi/libsas/sas_expander.c |   17 ++++++++++++-----
 1 file changed, 12 insertions(+), 5 deletions(-)

diff --git a/drivers/scsi/libsas/sas_expander.c b/drivers/scsi/libsas/sas_expander.c
index 05acd9e..833bea0 100644
--- a/drivers/scsi/libsas/sas_expander.c
+++ b/drivers/scsi/libsas/sas_expander.c
@@ -1718,9 +1718,17 @@ static int sas_find_bcast_phy(struct domain_device *dev, int *phy_id,
 		int phy_change_count = 0;
 
 		res = sas_get_phy_change_count(dev, i, &phy_change_count);
-		if (res)
-			goto out;
-		else if (phy_change_count != ex->ex_phy[i].phy_change_count) {
+		switch (res) {
+		case SMP_RESP_PHY_VACANT:
+		case SMP_RESP_NO_PHY:
+			continue;
+		case SMP_RESP_FUNC_ACC:
+			break;
+		default:
+			return res;
+		}
+
+		if (phy_change_count != ex->ex_phy[i].phy_change_count) {
 			if (update)
 				ex->ex_phy[i].phy_change_count =
 					phy_change_count;
@@ -1728,8 +1736,7 @@ static int sas_find_bcast_phy(struct domain_device *dev, int *phy_id,
 			return 0;
 		}
 	}
-out:
-	return res;
+	return 0;
 }
 
 static int sas_get_ex_change_count(struct domain_device *dev, int *ecc)
-- 
1.7.10




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

* [ 128/167] [PATCH] [SCSI] libsas: fix false positive device attached conditions
  2012-05-09  5:50 [ 000/167] 3.2.17-stable review Ben Hutchings
                   ` (126 preceding siblings ...)
  2012-05-09  5:52 ` [ 127/167] [PATCH] [SCSI] libsas: fix sas_find_bcast_phy() in the presence of vacant phys Ben Hutchings
@ 2012-05-09  5:52 ` Ben Hutchings
  2012-05-09  5:52 ` [ 129/167] [PATCH] efi: Add new variable attributes Ben Hutchings
                   ` (38 subsequent siblings)
  166 siblings, 0 replies; 195+ messages in thread
From: Ben Hutchings @ 2012-05-09  5:52 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: torvalds, akpm, alan, Dan Williams, Andrzej Jakowski, James Bottomley

3.2-stable review patch.  If anyone has any objections, please let me know.

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

From: Dan Williams <dan.j.williams@intel.com>

commit 7d1d865181185bdf1316d236b1b4bd02c9020729 upstream.

Normalize phy->attached_sas_addr to return a zero-address in the case
when device-type == NO_DEVICE or the linkrate is invalid to handle
expanders that put non-zero sas addresses in the discovery response:

 sas: ex 5001b4da000f903f phy02:U:0 attached: 0100000000000000 (no device)
 sas: ex 5001b4da000f903f phy01:U:0 attached: 0100000000000000 (no device)
 sas: ex 5001b4da000f903f phy03:U:0 attached: 0100000000000000 (no device)
 sas: ex 5001b4da000f903f phy00:U:0 attached: 0100000000000000 (no device)

Reported-by: Andrzej Jakowski <andrzej.jakowski@intel.com>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
---
 drivers/scsi/libsas/sas_expander.c |    9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/drivers/scsi/libsas/sas_expander.c b/drivers/scsi/libsas/sas_expander.c
index 75247a1..caa0525 100644
--- a/drivers/scsi/libsas/sas_expander.c
+++ b/drivers/scsi/libsas/sas_expander.c
@@ -245,7 +245,14 @@ static void sas_set_ex_phy(struct domain_device *dev, int phy_id, void *rsp)
 	phy->attached_sata_ps   = dr->attached_sata_ps;
 	phy->attached_iproto = dr->iproto << 1;
 	phy->attached_tproto = dr->tproto << 1;
-	memcpy(phy->attached_sas_addr, dr->attached_sas_addr, SAS_ADDR_SIZE);
+	/* help some expanders that fail to zero sas_address in the 'no
+	 * device' case
+	 */
+	if (phy->attached_dev_type == NO_DEVICE ||
+	    phy->linkrate < SAS_LINK_RATE_1_5_GBPS)
+		memset(phy->attached_sas_addr, 0, SAS_ADDR_SIZE);
+	else
+		memcpy(phy->attached_sas_addr, dr->attached_sas_addr, SAS_ADDR_SIZE);
 	phy->attached_phy_id = dr->attached_phy_id;
 	phy->phy_change_count = dr->change_count;
 	phy->routing_attr = dr->routing_attr;
-- 
1.7.10




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

* [ 129/167] [PATCH] efi: Add new variable attributes
  2012-05-09  5:50 [ 000/167] 3.2.17-stable review Ben Hutchings
                   ` (127 preceding siblings ...)
  2012-05-09  5:52 ` [ 128/167] [PATCH] [SCSI] libsas: fix false positive device attached conditions Ben Hutchings
@ 2012-05-09  5:52 ` Ben Hutchings
  2012-05-09  5:52 ` [ 130/167] [PATCH] efi: Validate UEFI boot variables Ben Hutchings
                   ` (37 subsequent siblings)
  166 siblings, 0 replies; 195+ messages in thread
From: Ben Hutchings @ 2012-05-09  5:52 UTC (permalink / raw)
  To: linux-kernel, stable; +Cc: torvalds, akpm, alan, Matthew Garrett

3.2-stable review patch.  If anyone has any objections, please let me know.

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

From: Matthew Garrett <mjg@redhat.com>

commit 41b3254c93acc56adc3c4477fef7c9512d47659e upstream.

More recent versions of the UEFI spec have added new attributes for
variables. Add them.

Signed-off-by: Matthew Garrett <mjg@redhat.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
[bwh: Backported to 3.2: adjust context]
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
---
 include/linux/efi.h |   13 ++++++++++++-
 1 file changed, 12 insertions(+), 1 deletion(-)

--- linux.orig/include/linux/efi.h
+++ linux/include/linux/efi.h
@@ -383,7 +383,18 @@
 #define EFI_VARIABLE_NON_VOLATILE       0x0000000000000001
 #define EFI_VARIABLE_BOOTSERVICE_ACCESS 0x0000000000000002
 #define EFI_VARIABLE_RUNTIME_ACCESS     0x0000000000000004
+#define EFI_VARIABLE_HARDWARE_ERROR_RECORD 0x0000000000000008
+#define EFI_VARIABLE_AUTHENTICATED_WRITE_ACCESS 0x0000000000000010
+#define EFI_VARIABLE_TIME_BASED_AUTHENTICATED_WRITE_ACCESS 0x0000000000000020
+#define EFI_VARIABLE_APPEND_WRITE	0x0000000000000040
 
+#define EFI_VARIABLE_MASK 	(EFI_VARIABLE_NON_VOLATILE | \
+				EFI_VARIABLE_BOOTSERVICE_ACCESS | \
+				EFI_VARIABLE_RUNTIME_ACCESS | \
+				EFI_VARIABLE_HARDWARE_ERROR_RECORD | \
+				EFI_VARIABLE_AUTHENTICATED_WRITE_ACCESS | \
+				EFI_VARIABLE_TIME_BASED_AUTHENTICATED_WRITE_ACCESS | \
+				EFI_VARIABLE_APPEND_WRITE)
 /*
  * EFI Device Path information
  */



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

* [ 130/167] [PATCH] efi: Validate UEFI boot variables
  2012-05-09  5:50 [ 000/167] 3.2.17-stable review Ben Hutchings
                   ` (128 preceding siblings ...)
  2012-05-09  5:52 ` [ 129/167] [PATCH] efi: Add new variable attributes Ben Hutchings
@ 2012-05-09  5:52 ` Ben Hutchings
  2012-05-09  5:52 ` [ 131/167] [PATCH] PM / Hibernate: fix the number of pages used for hibernate/thaw buffering Ben Hutchings
                   ` (36 subsequent siblings)
  166 siblings, 0 replies; 195+ messages in thread
From: Ben Hutchings @ 2012-05-09  5:52 UTC (permalink / raw)
  To: linux-kernel, stable; +Cc: torvalds, akpm, alan, Matthew Garrett

3.2-stable review patch.  If anyone has any objections, please let me know.

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

From: Matthew Garrett <mjg@redhat.com>

commit fec6c20b570bcf541e581fc97f2e0cbdb9725b98 upstream.

A common flaw in UEFI systems is a refusal to POST triggered by a malformed
boot variable. Once in this state, machines may only be restored by
reflashing their firmware with an external hardware device. While this is
obviously a firmware bug, the serious nature of the outcome suggests that
operating systems should filter their variable writes in order to prevent
a malicious user from rendering the machine unusable.

Signed-off-by: Matthew Garrett <mjg@redhat.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
---
 drivers/firmware/efivars.c |  182 ++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 182 insertions(+)

diff --git a/drivers/firmware/efivars.c b/drivers/firmware/efivars.c
index d25599f..891e467 100644
--- a/drivers/firmware/efivars.c
+++ b/drivers/firmware/efivars.c
@@ -191,6 +191,176 @@ utf16_strncmp(const efi_char16_t *a, const efi_char16_t *b, size_t len)
 	}
 }
 
+static bool
+validate_device_path(struct efi_variable *var, int match, u8 *buffer, int len)
+{
+	struct efi_generic_dev_path *node;
+	int offset = 0;
+
+	node = (struct efi_generic_dev_path *)buffer;
+
+	while (offset < len) {
+		offset += node->length;
+
+		if (offset > len)
+			return false;
+
+		if ((node->type == EFI_DEV_END_PATH ||
+		     node->type == EFI_DEV_END_PATH2) &&
+		    node->sub_type == EFI_DEV_END_ENTIRE)
+			return true;
+
+		node = (struct efi_generic_dev_path *)(buffer + offset);
+	}
+
+	/*
+	 * If we're here then either node->length pointed past the end
+	 * of the buffer or we reached the end of the buffer without
+	 * finding a device path end node.
+	 */
+	return false;
+}
+
+static bool
+validate_boot_order(struct efi_variable *var, int match, u8 *buffer, int len)
+{
+	/* An array of 16-bit integers */
+	if ((len % 2) != 0)
+		return false;
+
+	return true;
+}
+
+static bool
+validate_load_option(struct efi_variable *var, int match, u8 *buffer, int len)
+{
+	u16 filepathlength;
+	int i, desclength = 0;
+
+	/* Either "Boot" or "Driver" followed by four digits of hex */
+	for (i = match; i < match+4; i++) {
+		if (hex_to_bin(var->VariableName[i] & 0xff) < 0)
+			return true;
+	}
+
+	/* A valid entry must be at least 6 bytes */
+	if (len < 6)
+		return false;
+
+	filepathlength = buffer[4] | buffer[5] << 8;
+
+	/*
+	 * There's no stored length for the description, so it has to be
+	 * found by hand
+	 */
+	desclength = utf16_strsize((efi_char16_t *)(buffer + 6), len) + 2;
+
+	/* Each boot entry must have a descriptor */
+	if (!desclength)
+		return false;
+
+	/*
+	 * If the sum of the length of the description, the claimed filepath
+	 * length and the original header are greater than the length of the
+	 * variable, it's malformed
+	 */
+	if ((desclength + filepathlength + 6) > len)
+		return false;
+
+	/*
+	 * And, finally, check the filepath
+	 */
+	return validate_device_path(var, match, buffer + desclength + 6,
+				    filepathlength);
+}
+
+static bool
+validate_uint16(struct efi_variable *var, int match, u8 *buffer, int len)
+{
+	/* A single 16-bit integer */
+	if (len != 2)
+		return false;
+
+	return true;
+}
+
+static bool
+validate_ascii_string(struct efi_variable *var, int match, u8 *buffer, int len)
+{
+	int i;
+
+	for (i = 0; i < len; i++) {
+		if (buffer[i] > 127)
+			return false;
+
+		if (buffer[i] == 0)
+			return true;
+	}
+
+	return false;
+}
+
+struct variable_validate {
+	char *name;
+	bool (*validate)(struct efi_variable *var, int match, u8 *data,
+			 int len);
+};
+
+static const struct variable_validate variable_validate[] = {
+	{ "BootNext", validate_uint16 },
+	{ "BootOrder", validate_boot_order },
+	{ "DriverOrder", validate_boot_order },
+	{ "Boot*", validate_load_option },
+	{ "Driver*", validate_load_option },
+	{ "ConIn", validate_device_path },
+	{ "ConInDev", validate_device_path },
+	{ "ConOut", validate_device_path },
+	{ "ConOutDev", validate_device_path },
+	{ "ErrOut", validate_device_path },
+	{ "ErrOutDev", validate_device_path },
+	{ "Timeout", validate_uint16 },
+	{ "Lang", validate_ascii_string },
+	{ "PlatformLang", validate_ascii_string },
+	{ "", NULL },
+};
+
+static bool
+validate_var(struct efi_variable *var, u8 *data, int len)
+{
+	int i;
+	u16 *unicode_name = var->VariableName;
+
+	for (i = 0; variable_validate[i].validate != NULL; i++) {
+		const char *name = variable_validate[i].name;
+		int match;
+
+		for (match = 0; ; match++) {
+			char c = name[match];
+			u16 u = unicode_name[match];
+
+			/* All special variables are plain ascii */
+			if (u > 127)
+				return true;
+
+			/* Wildcard in the matching name means we've matched */
+			if (c == '*')
+				return variable_validate[i].validate(var,
+							     match, data, len);
+
+			/* Case sensitive match */
+			if (c != u)
+				break;
+
+			/* Reached the end of the string while matching */
+			if (!c)
+				return variable_validate[i].validate(var,
+							     match, data, len);
+		}
+	}
+
+	return true;
+}
+
 static efi_status_t
 get_var_data_locked(struct efivars *efivars, struct efi_variable *var)
 {
@@ -324,6 +494,12 @@ efivar_store_raw(struct efivar_entry *entry, const char *buf, size_t count)
 		return -EINVAL;
 	}
 
+	if ((new_var->Attributes & ~EFI_VARIABLE_MASK) != 0 ||
+	    validate_var(new_var, new_var->Data, new_var->DataSize) == false) {
+		printk(KERN_ERR "efivars: Malformed variable content\n");
+		return -EINVAL;
+	}
+
 	spin_lock(&efivars->lock);
 	status = efivars->ops->set_variable(new_var->VariableName,
 					    &new_var->VendorGuid,
@@ -626,6 +802,12 @@ static ssize_t efivar_create(struct file *filp, struct kobject *kobj,
 	if (!capable(CAP_SYS_ADMIN))
 		return -EACCES;
 
+	if ((new_var->Attributes & ~EFI_VARIABLE_MASK) != 0 ||
+	    validate_var(new_var, new_var->Data, new_var->DataSize) == false) {
+		printk(KERN_ERR "efivars: Malformed variable content\n");
+		return -EINVAL;
+	}
+
 	spin_lock(&efivars->lock);
 
 	/*
-- 
1.7.10




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

* [ 131/167] [PATCH] PM / Hibernate: fix the number of pages used for hibernate/thaw buffering
  2012-05-09  5:50 [ 000/167] 3.2.17-stable review Ben Hutchings
                   ` (129 preceding siblings ...)
  2012-05-09  5:52 ` [ 130/167] [PATCH] efi: Validate UEFI boot variables Ben Hutchings
@ 2012-05-09  5:52 ` Ben Hutchings
  2012-05-09  5:52 ` [ 132/167] [PATCH] drm/i915: enable dip before writing data on gen4 Ben Hutchings
                   ` (35 subsequent siblings)
  166 siblings, 0 replies; 195+ messages in thread
From: Ben Hutchings @ 2012-05-09  5:52 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: torvalds, akpm, alan, Bojan Smojver, Rafael J. Wysocki

3.2-stable review patch.  If anyone has any objections, please let me know.

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

From: Bojan Smojver <bojan@rexursive.com>

commit f8262d476823a7ea1eb497ff9676d1eab2393c75 upstream.

Hibernation regression fix, since 3.2.

Calculate the number of required free pages based on non-high memory
pages only, because that is where the buffers will come from.

Commit 081a9d043c983f161b78fdc4671324d1342b86bc introduced a new buffer
page allocation logic during hibernation, in order to improve the
performance. The amount of pages allocated was calculated based on total
amount of pages available, although only non-high memory pages are
usable for this purpose. This caused hibernation code to attempt to over
allocate pages on platforms that have high memory, which led to hangs.

Signed-off-by: Bojan Smojver <bojan@rexursive.com>
Signed-off-by: Rafael J. Wysocki <rjw@suse.de>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
---
 kernel/power/swap.c |   28 ++++++++++++++++++++++------
 1 file changed, 22 insertions(+), 6 deletions(-)

diff --git a/kernel/power/swap.c b/kernel/power/swap.c
index 8742fd0..eef311a 100644
--- a/kernel/power/swap.c
+++ b/kernel/power/swap.c
@@ -51,6 +51,23 @@
 
 #define MAP_PAGE_ENTRIES	(PAGE_SIZE / sizeof(sector_t) - 1)
 
+/*
+ * Number of free pages that are not high.
+ */
+static inline unsigned long low_free_pages(void)
+{
+	return nr_free_pages() - nr_free_highpages();
+}
+
+/*
+ * Number of pages required to be kept free while writing the image. Always
+ * half of all available low pages before the writing starts.
+ */
+static inline unsigned long reqd_free_pages(void)
+{
+	return low_free_pages() / 2;
+}
+
 struct swap_map_page {
 	sector_t entries[MAP_PAGE_ENTRIES];
 	sector_t next_swap;
@@ -72,7 +89,7 @@ struct swap_map_handle {
 	sector_t cur_swap;
 	sector_t first_sector;
 	unsigned int k;
-	unsigned long nr_free_pages, written;
+	unsigned long reqd_free_pages;
 	u32 crc32;
 };
 
@@ -316,8 +333,7 @@ static int get_swap_writer(struct swap_map_handle *handle)
 		goto err_rel;
 	}
 	handle->k = 0;
-	handle->nr_free_pages = nr_free_pages() >> 1;
-	handle->written = 0;
+	handle->reqd_free_pages = reqd_free_pages();
 	handle->first_sector = handle->cur_swap;
 	return 0;
 err_rel:
@@ -352,11 +368,11 @@ static int swap_write_page(struct swap_map_handle *handle, void *buf,
 		handle->cur_swap = offset;
 		handle->k = 0;
 	}
-	if (bio_chain && ++handle->written > handle->nr_free_pages) {
+	if (bio_chain && low_free_pages() <= handle->reqd_free_pages) {
 		error = hib_wait_on_bio_chain(bio_chain);
 		if (error)
 			goto out;
-		handle->written = 0;
+		handle->reqd_free_pages = reqd_free_pages();
 	}
  out:
 	return error;
@@ -618,7 +634,7 @@ static int save_image_lzo(struct swap_map_handle *handle,
 	 * Adjust number of free pages after all allocations have been done.
 	 * We don't want to run out of pages when writing.
 	 */
-	handle->nr_free_pages = nr_free_pages() >> 1;
+	handle->reqd_free_pages = reqd_free_pages();
 
 	/*
 	 * Start the CRC32 thread.
-- 
1.7.10




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

* [ 132/167] [PATCH] drm/i915: enable dip before writing data on gen4
  2012-05-09  5:50 [ 000/167] 3.2.17-stable review Ben Hutchings
                   ` (130 preceding siblings ...)
  2012-05-09  5:52 ` [ 131/167] [PATCH] PM / Hibernate: fix the number of pages used for hibernate/thaw buffering Ben Hutchings
@ 2012-05-09  5:52 ` Ben Hutchings
  2012-05-09  5:52 ` [ 133/167] [PATCH] sched: Fix nohz load accounting -- again! Ben Hutchings
                   ` (34 subsequent siblings)
  166 siblings, 0 replies; 195+ messages in thread
From: Ben Hutchings @ 2012-05-09  5:52 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: torvalds, akpm, alan, Paulo Zanoni, Yang Guang, Eugeni Dodonov,
	Daniel Vetter

3.2-stable review patch.  If anyone has any objections, please let me know.

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

From: Paulo Zanoni <paulo.r.zanoni@intel.com>

commit c1230df7e19e0f27655c0eb9d966c7e03be7cc50 upstream.

While testing with the intel_infoframes tool on gen4, I see that when
video DIP is disabled, what we write to the DATA memory is not exactly
what we read back later.

This regression has been introduce in

commit 64a8fc0145a1d0fdc25fc9367c2e6c621955fb3b
Author: Jesse Barnes <jbarnes@virtuousgeek.org>
Date:   Thu Sep 22 11:16:00 2011 +0530

    drm/i915: fix ILK+ infoframe support

That commit was setting VIDEO_DIP_CTL to 0 when initializing, which
caused the problem.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=43947
Tested-by: Yang Guang <guang.a.yang@intel.com>
Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
Reviewed-by: Eugeni Dodonov <eugeni.dodonov@intel.com>
[danvet: Pimped commit message by using the usual commit citation
layout.]
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
---
 drivers/gpu/drm/i915/intel_hdmi.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/i915/intel_hdmi.c b/drivers/gpu/drm/i915/intel_hdmi.c
index cae3e5f..2d7f47b 100644
--- a/drivers/gpu/drm/i915/intel_hdmi.c
+++ b/drivers/gpu/drm/i915/intel_hdmi.c
@@ -136,7 +136,7 @@ static void i9xx_write_infoframe(struct drm_encoder *encoder,
 
 	val &= ~VIDEO_DIP_SELECT_MASK;
 
-	I915_WRITE(VIDEO_DIP_CTL, val | port | flags);
+	I915_WRITE(VIDEO_DIP_CTL, VIDEO_DIP_ENABLE | val | port | flags);
 
 	for (i = 0; i < len; i += 4) {
 		I915_WRITE(VIDEO_DIP_DATA, *data);
-- 
1.7.10




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

* [ 133/167] [PATCH] sched: Fix nohz load accounting -- again!
  2012-05-09  5:50 [ 000/167] 3.2.17-stable review Ben Hutchings
                   ` (131 preceding siblings ...)
  2012-05-09  5:52 ` [ 132/167] [PATCH] drm/i915: enable dip before writing data on gen4 Ben Hutchings
@ 2012-05-09  5:52 ` Ben Hutchings
  2012-05-09  5:52 ` [ 134/167] [PATCH] efivars: Improve variable validation Ben Hutchings
                   ` (33 subsequent siblings)
  166 siblings, 0 replies; 195+ messages in thread
From: Ben Hutchings @ 2012-05-09  5:52 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: torvalds, akpm, alan, Peter Zijlstra, Doug Smythies,
	LesÃ…‚aw Kopeć,
	Aman Gupta, Peter Zijlstra, Ingo Molnar

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

3.2-stable review patch.  If anyone has any objections, please let me know.

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

From: Peter Zijlstra <peterz@infradead.org>

commit c308b56b5398779cd3da0f62ab26b0453494c3d4 upstream.

Various people reported nohz load tracking still being wrecked, but Doug
spotted the actual problem. We fold the nohz remainder in too soon,
causing us to loose samples and under-account.

So instead of playing catch-up up-front, always do a single load-fold
with whatever state we encounter and only then fold the nohz remainder
and play catch-up.

Reported-by: Doug Smythies <dsmythies@telus.net>
Reported-by: LesÅ=82aw Kope=C4=87 <leslaw.kopec@nasza-klasa.pl>
Reported-by: Aman Gupta <aman@tmm1.net>
Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
Link: http://lkml.kernel.org/n/tip-4v31etnhgg9kwd6ocgx3rxl8@git.kernel.org
Signed-off-by: Ingo Molnar <mingo@elte.hu>
[bwh: Backported to 3.2: change filename]
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
---
 kernel/sched.c |   53 +++++++++++++++++++++++++--------------------------
 1 file changed, 26 insertions(+), 27 deletions(-)

--- linux.orig/kernel/sched.c
+++ linux/kernel/sched.c
@@ -3538,13 +3538,10 @@
  * 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)
+static void calc_global_nohz(void)
 {
 	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
@@ -3556,31 +3553,25 @@
 		atomic_long_add(delta, &calc_load_tasks);
 
 	/*
-	 * If we were idle for multiple load cycles, apply them.
+	 * It could be the one fold was all it took, we done!
 	 */
-	if (ticks >= LOAD_FREQ) {
-		n = ticks / LOAD_FREQ;
+	if (time_before(jiffies, calc_load_update + 10))
+		return;
 
-		active = atomic_long_read(&calc_load_tasks);
-		active = active > 0 ? active * FIXED_1 : 0;
+	/*
+	 * Catch-up, fold however many we are behind still
+	 */
+	delta = jiffies - calc_load_update - 10;
+	n = 1 + (delta / LOAD_FREQ);
 
-		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);
+	active = atomic_long_read(&calc_load_tasks);
+	active = active > 0 ? active * FIXED_1 : 0;
 
-		calc_load_update += n * LOAD_FREQ;
-	}
+	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);
 
-	/*
-	 * 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.
-	 */
+	calc_load_update += n * LOAD_FREQ;
 }
 #else
 static void calc_load_account_idle(struct rq *this_rq)
@@ -3592,7 +3583,7 @@
 	return 0;
 }
 
-static void calc_global_nohz(unsigned long ticks)
+static void calc_global_nohz(void)
 {
 }
 #endif
@@ -3620,8 +3611,6 @@
 {
 	long active;
 
-	calc_global_nohz(ticks);
-
 	if (time_before(jiffies, calc_load_update + 10))
 		return;
 
@@ -3633,6 +3622,16 @@
 	avenrun[2] = calc_load(avenrun[2], EXP_15, active);
 
 	calc_load_update += LOAD_FREQ;
+
+	/*
+	 * Account one period with whatever state we found before
+	 * folding in the nohz state and ageing the entire idle period.
+	 *
+	 * This avoids loosing a sample when we go idle between 
+	 * calc_load_account_active() (10 ticks ago) and now and thus
+	 * under-accounting.
+	 */
+	calc_global_nohz();
 }
 
 /*



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

* [ 134/167] [PATCH] efivars: Improve variable validation
  2012-05-09  5:50 [ 000/167] 3.2.17-stable review Ben Hutchings
                   ` (132 preceding siblings ...)
  2012-05-09  5:52 ` [ 133/167] [PATCH] sched: Fix nohz load accounting -- again! Ben Hutchings
@ 2012-05-09  5:52 ` Ben Hutchings
  2012-05-09  5:52 ` [ 135/167] [PATCH] fs/cifs: fix parsing of dfs referrals Ben Hutchings
                   ` (32 subsequent siblings)
  166 siblings, 0 replies; 195+ messages in thread
From: Ben Hutchings @ 2012-05-09  5:52 UTC (permalink / raw)
  To: linux-kernel, stable; +Cc: torvalds, akpm, alan, Matthew Garrett

3.2-stable review patch.  If anyone has any objections, please let me know.

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

From: Matthew Garrett <mjg@redhat.com>

commit 54b3a4d311c98ad94b737802a8b5f2c8c6bfd627 upstream.

Ben Hutchings pointed out that the validation in efivars was inadequate -
most obviously, an entry with size 0 would server as a DoS against the
kernel. Improve this based on his suggestions.

Signed-off-by: Matthew Garrett <mjg@redhat.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
---
 drivers/firmware/efivars.c |   46 +++++++++++++++++++++++++++++---------------
 1 file changed, 30 insertions(+), 16 deletions(-)

diff --git a/drivers/firmware/efivars.c b/drivers/firmware/efivars.c
index 891e467..47408e8 100644
--- a/drivers/firmware/efivars.c
+++ b/drivers/firmware/efivars.c
@@ -192,18 +192,21 @@ utf16_strncmp(const efi_char16_t *a, const efi_char16_t *b, size_t len)
 }
 
 static bool
-validate_device_path(struct efi_variable *var, int match, u8 *buffer, int len)
+validate_device_path(struct efi_variable *var, int match, u8 *buffer,
+		     unsigned long len)
 {
 	struct efi_generic_dev_path *node;
 	int offset = 0;
 
 	node = (struct efi_generic_dev_path *)buffer;
 
-	while (offset < len) {
-		offset += node->length;
+	if (len < sizeof(*node))
+		return false;
 
-		if (offset > len)
-			return false;
+	while (offset <= len - sizeof(*node) &&
+	       node->length >= sizeof(*node) &&
+		node->length <= len - offset) {
+		offset += node->length;
 
 		if ((node->type == EFI_DEV_END_PATH ||
 		     node->type == EFI_DEV_END_PATH2) &&
@@ -222,7 +225,8 @@ validate_device_path(struct efi_variable *var, int match, u8 *buffer, int len)
 }
 
 static bool
-validate_boot_order(struct efi_variable *var, int match, u8 *buffer, int len)
+validate_boot_order(struct efi_variable *var, int match, u8 *buffer,
+		    unsigned long len)
 {
 	/* An array of 16-bit integers */
 	if ((len % 2) != 0)
@@ -232,19 +236,27 @@ validate_boot_order(struct efi_variable *var, int match, u8 *buffer, int len)
 }
 
 static bool
-validate_load_option(struct efi_variable *var, int match, u8 *buffer, int len)
+validate_load_option(struct efi_variable *var, int match, u8 *buffer,
+		     unsigned long len)
 {
 	u16 filepathlength;
-	int i, desclength = 0;
+	int i, desclength = 0, namelen;
+
+	namelen = utf16_strnlen(var->VariableName, sizeof(var->VariableName));
 
 	/* Either "Boot" or "Driver" followed by four digits of hex */
 	for (i = match; i < match+4; i++) {
-		if (hex_to_bin(var->VariableName[i] & 0xff) < 0)
+		if (var->VariableName[i] > 127 ||
+		    hex_to_bin(var->VariableName[i] & 0xff) < 0)
 			return true;
 	}
 
-	/* A valid entry must be at least 6 bytes */
-	if (len < 6)
+	/* Reject it if there's 4 digits of hex and then further content */
+	if (namelen > match + 4)
+		return false;
+
+	/* A valid entry must be at least 8 bytes */
+	if (len < 8)
 		return false;
 
 	filepathlength = buffer[4] | buffer[5] << 8;
@@ -253,7 +265,7 @@ validate_load_option(struct efi_variable *var, int match, u8 *buffer, int len)
 	 * There's no stored length for the description, so it has to be
 	 * found by hand
 	 */
-	desclength = utf16_strsize((efi_char16_t *)(buffer + 6), len) + 2;
+	desclength = utf16_strsize((efi_char16_t *)(buffer + 6), len - 6) + 2;
 
 	/* Each boot entry must have a descriptor */
 	if (!desclength)
@@ -275,7 +287,8 @@ validate_load_option(struct efi_variable *var, int match, u8 *buffer, int len)
 }
 
 static bool
-validate_uint16(struct efi_variable *var, int match, u8 *buffer, int len)
+validate_uint16(struct efi_variable *var, int match, u8 *buffer,
+		unsigned long len)
 {
 	/* A single 16-bit integer */
 	if (len != 2)
@@ -285,7 +298,8 @@ validate_uint16(struct efi_variable *var, int match, u8 *buffer, int len)
 }
 
 static bool
-validate_ascii_string(struct efi_variable *var, int match, u8 *buffer, int len)
+validate_ascii_string(struct efi_variable *var, int match, u8 *buffer,
+		      unsigned long len)
 {
 	int i;
 
@@ -303,7 +317,7 @@ validate_ascii_string(struct efi_variable *var, int match, u8 *buffer, int len)
 struct variable_validate {
 	char *name;
 	bool (*validate)(struct efi_variable *var, int match, u8 *data,
-			 int len);
+			 unsigned long len);
 };
 
 static const struct variable_validate variable_validate[] = {
@@ -325,7 +339,7 @@ static const struct variable_validate variable_validate[] = {
 };
 
 static bool
-validate_var(struct efi_variable *var, u8 *data, int len)
+validate_var(struct efi_variable *var, u8 *data, unsigned long len)
 {
 	int i;
 	u16 *unicode_name = var->VariableName;
-- 
1.7.10




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

* [ 135/167] [PATCH] fs/cifs: fix parsing of dfs referrals
  2012-05-09  5:50 [ 000/167] 3.2.17-stable review Ben Hutchings
                   ` (133 preceding siblings ...)
  2012-05-09  5:52 ` [ 134/167] [PATCH] efivars: Improve variable validation Ben Hutchings
@ 2012-05-09  5:52 ` Ben Hutchings
  2012-05-09  5:52 ` [ 136/167] [PATCH] Fix __read_seqcount_begin() to use ACCESS_ONCE for sequence value read Ben Hutchings
                   ` (31 subsequent siblings)
  166 siblings, 0 replies; 195+ messages in thread
From: Ben Hutchings @ 2012-05-09  5:52 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: torvalds, akpm, alan, Stefan Metzmacher, Björn Jacke,
	Jeff Layton, Steve French

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

3.2-stable review patch.  If anyone has any objections, please let me know.

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

From: Stefan Metzmacher <metze@samba.org>

commit d8f2799b105a24bb0bbd3380a0d56e6348484058 upstream.

The problem was that the first referral was parsed more than once
and so the caller tried the same referrals multiple times.

The problem was introduced partly by commit
066ce6899484d9026acd6ba3a8dbbedb33d7ae1b,
where 'ref += le16_to_cpu(ref->Size);' got lost,
but that was also wrong...

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Tested-by: Björn Jacke <bj@sernet.de>
Reviewed-by: Jeff Layton <jlayton@redhat.com>
Signed-off-by: Steve French <sfrench@us.ibm.com>
[bwh: Backport to 3.2: adjust context]
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
---
 fs/cifs/cifssmb.c |    6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

--- linux.orig/fs/cifs/cifssmb.c
+++ linux/fs/cifs/cifssmb.c
@@ -4826,8 +4826,12 @@
 		max_len = data_end - temp;
 		node->node_name = cifs_strndup_from_ucs(temp, max_len,
 						      is_unicode, nls_codepage);
-		if (!node->node_name)
+		if (!node->node_name) {
 			rc = -ENOMEM;
+			goto parse_DFS_referrals_exit;
+		}
+
+		ref++;
 	}
 
 parse_DFS_referrals_exit:



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

* [ 136/167] [PATCH] Fix __read_seqcount_begin() to use ACCESS_ONCE for sequence value read
  2012-05-09  5:50 [ 000/167] 3.2.17-stable review Ben Hutchings
                   ` (134 preceding siblings ...)
  2012-05-09  5:52 ` [ 135/167] [PATCH] fs/cifs: fix parsing of dfs referrals Ben Hutchings
@ 2012-05-09  5:52 ` Ben Hutchings
  2012-05-09  5:52 ` [ 137/167] [PATCH] hwmon: (coretemp) Increase CPU core limit Ben Hutchings
                   ` (30 subsequent siblings)
  166 siblings, 0 replies; 195+ messages in thread
From: Ben Hutchings @ 2012-05-09  5:52 UTC (permalink / raw)
  To: linux-kernel, stable; +Cc: torvalds, akpm, alan

3.2-stable review patch.  If anyone has any objections, please let me know.

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

From: Linus Torvalds <torvalds@linux-foundation.org>

commit 2f624278626677bfaf73fef97f86b37981621f5c upstream.

We really need to use a ACCESS_ONCE() on the sequence value read in
__read_seqcount_begin(), because otherwise the compiler might end up
reloading the value in between the test and the return of it.  As a
result, it might end up returning an odd value (which means that a write
is in progress).

If the reader is then fast enough that that odd value is still the
current one when the read_seqcount_retry() is done, we might end up with
a "successful" read sequence, even despite the concurrent write being
active.

In practice this probably never really happens - there just isn't
anything else going on around the read of the sequence count, and the
common case is that we end up having a read barrier immediately
afterwards.

So the code sequence in which gcc might decide to reaload from memory is
small, and there's no reason to believe it would ever actually do the
reload.  But if the compiler ever were to decide to do so, it would be
incredibly annoying to debug.  Let's just make sure.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
---
 include/linux/seqlock.h |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/include/linux/seqlock.h b/include/linux/seqlock.h
index c6db9fb..bb1fac5 100644
--- a/include/linux/seqlock.h
+++ b/include/linux/seqlock.h
@@ -141,7 +141,7 @@ static inline unsigned __read_seqcount_begin(const seqcount_t *s)
 	unsigned ret;
 
 repeat:
-	ret = s->sequence;
+	ret = ACCESS_ONCE(s->sequence);
 	if (unlikely(ret & 1)) {
 		cpu_relax();
 		goto repeat;
-- 
1.7.10




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

* [ 137/167] [PATCH] hwmon: (coretemp) Increase CPU core limit
  2012-05-09  5:50 [ 000/167] 3.2.17-stable review Ben Hutchings
                   ` (135 preceding siblings ...)
  2012-05-09  5:52 ` [ 136/167] [PATCH] Fix __read_seqcount_begin() to use ACCESS_ONCE for sequence value read Ben Hutchings
@ 2012-05-09  5:52 ` Ben Hutchings
  2012-05-09  5:52 ` [ 138/167] [PATCH] nouveau: initialise has_optimus variable Ben Hutchings
                   ` (29 subsequent siblings)
  166 siblings, 0 replies; 195+ messages in thread
From: Ben Hutchings @ 2012-05-09  5:52 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: torvalds, akpm, alan, Guenter Roeck, Jean Delvare, Durgadoss R

3.2-stable review patch.  If anyone has any objections, please let me know.

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

From: Guenter Roeck <guenter.roeck@ericsson.com>

commit bdc71c9a87b898e4c380c23b2e3e18071312ecde upstream.

CPU core ID is used to index the core_data[] array. The core ID is, however, not
sequential; 10-core CPUS can have a core ID as high as 25. Increase the limit to
32 to be able to deal with current CPUs.

Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com>
Acked-by: Jean Delvare <khali@linux-fr.org>
Acked-by: Durgadoss R <durgadoss.r@intel.com>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
---
 drivers/hwmon/coretemp.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/hwmon/coretemp.c b/drivers/hwmon/coretemp.c
index 54a70fe..b9d5123 100644
--- a/drivers/hwmon/coretemp.c
+++ b/drivers/hwmon/coretemp.c
@@ -52,7 +52,7 @@ module_param_named(tjmax, force_tjmax, int, 0444);
 MODULE_PARM_DESC(tjmax, "TjMax value in degrees Celsius");
 
 #define BASE_SYSFS_ATTR_NO	2	/* Sysfs Base attr no for coretemp */
-#define NUM_REAL_CORES		16	/* Number of Real cores per cpu */
+#define NUM_REAL_CORES		32	/* Number of Real cores per cpu */
 #define CORETEMP_NAME_LENGTH	17	/* String Length of attrs */
 #define MAX_CORE_ATTRS		4	/* Maximum no of basic attrs */
 #define TOTAL_ATTRS		(MAX_CORE_ATTRS + 1)
-- 
1.7.10




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

* [ 138/167] [PATCH] nouveau: initialise has_optimus variable.
  2012-05-09  5:50 [ 000/167] 3.2.17-stable review Ben Hutchings
                   ` (136 preceding siblings ...)
  2012-05-09  5:52 ` [ 137/167] [PATCH] hwmon: (coretemp) Increase CPU core limit Ben Hutchings
@ 2012-05-09  5:52 ` Ben Hutchings
  2012-05-09  5:52 ` [ 139/167] [PATCH] hwmon: (coretemp) fix oops on cpu unplug Ben Hutchings
                   ` (28 subsequent siblings)
  166 siblings, 0 replies; 195+ messages in thread
From: Ben Hutchings @ 2012-05-09  5:52 UTC (permalink / raw)
  To: linux-kernel, stable; +Cc: torvalds, akpm, alan, Dave Airlie

3.2-stable review patch.  If anyone has any objections, please let me know.

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

From: Dave Airlie <airlied@redhat.com>

commit addde4ec31456c5f1e9b61aae3edcfeb0f338f87 upstream.

We should initialise this to 0 really to avoid getting false positives.

Signed-off-by: Dave Airlie <airlied@redhat.com>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
---
 drivers/gpu/drm/nouveau/nouveau_acpi.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/nouveau/nouveau_acpi.c b/drivers/gpu/drm/nouveau/nouveau_acpi.c
index 7814a76..284bd25 100644
--- a/drivers/gpu/drm/nouveau/nouveau_acpi.c
+++ b/drivers/gpu/drm/nouveau/nouveau_acpi.c
@@ -270,7 +270,7 @@ static bool nouveau_dsm_detect(void)
 	struct acpi_buffer buffer = {sizeof(acpi_method_name), acpi_method_name};
 	struct pci_dev *pdev = NULL;
 	int has_dsm = 0;
-	int has_optimus;
+	int has_optimus = 0;
 	int vga_count = 0;
 	bool guid_valid;
 	int retval;
-- 
1.7.10




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

* [ 139/167] [PATCH] hwmon: (coretemp) fix oops on cpu unplug
  2012-05-09  5:50 [ 000/167] 3.2.17-stable review Ben Hutchings
                   ` (137 preceding siblings ...)
  2012-05-09  5:52 ` [ 138/167] [PATCH] nouveau: initialise has_optimus variable Ben Hutchings
@ 2012-05-09  5:52 ` Ben Hutchings
  2012-05-09  5:52 ` [ 140/167] [PATCH] libata: skip old error history when counting probe trials Ben Hutchings
                   ` (27 subsequent siblings)
  166 siblings, 0 replies; 195+ messages in thread
From: Ben Hutchings @ 2012-05-09  5:52 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: torvalds, akpm, alan, Kirill A. Shutemov, Guenter Roeck

3.2-stable review patch.  If anyone has any objections, please let me know.

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

From: "Kirill A. Shutemov" <kirill.shutemov@linux.intel.com>

commit b704871124b477807966f06789c2b32f2de58bf7 upstream.

coretemp tries to access core_data array beyond bounds on cpu unplug if
core id of the cpu if more than NUM_REAL_CORES-1.

BUG: unable to handle kernel NULL pointer dereference at 000000000000013c
IP: [<ffffffffa00159af>] coretemp_cpu_callback+0x93/0x1ba [coretemp]
PGD 673e5a067 PUD 66e9b3067 PMD 0
Oops: 0000 [#1] SMP
CPU 79
Modules linked in: sunrpc cpufreq_ondemand acpi_cpufreq freq_table mperf bnep bluetooth rfkill ip6t_REJECT nf_conntrack_ipv6 nf_defrag_ipv6 ip6table_filter nf_conntrack_ipv4 nf_defrag_ipv4 ip6_tables xt_state nf_conntrack coretemp crc32c_intel asix tpm_tis pcspkr usbnet iTCO_wdt i2c_i801 microcode mii joydev tpm i2c_core iTCO_vendor_support tpm_bios i7core_edac igb ioatdma edac_core dca megaraid_sas [last unloaded: oprofile]

Pid: 3315, comm: set-cpus Tainted: G        W    3.4.0-rc5+ #2 QCI QSSC-S4R/QSSC-S4R
RIP: 0010:[<ffffffffa00159af>]  [<ffffffffa00159af>] coretemp_cpu_callback+0x93/0x1ba [coretemp]
RSP: 0018:ffff880472fb3d48  EFLAGS: 00010246
RAX: 0000000000000124 RBX: 0000000000000034 RCX: 00000000ffffffff
RDX: 0000000000000000 RSI: 0000000000000046 RDI: 0000000000000246
RBP: ffff880472fb3d88 R08: ffff88077fcd36c0 R09: 0000000000000001
R10: ffffffff8184bc48 R11: 0000000000000000 R12: ffff880273095800
R13: 0000000000000013 R14: ffff8802730a1810 R15: 0000000000000000
FS:  00007f694a20f720(0000) GS:ffff88077fcc0000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 000000008005003b
CR2: 000000000000013c CR3: 000000067209b000 CR4: 00000000000007e0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000ffff0ff0 DR7: 0000000000000400
Process set-cpus (pid: 3315, threadinfo ffff880472fb2000, task ffff880471fa0000)
Stack:
 ffff880277b4c308 0000000000000003 ffff880472fb3d88 0000000000000005
 0000000000000034 00000000ffffffd1 ffffffff81cadc70 ffff880472fb3e14
 ffff880472fb3dc8 ffffffff8161f48d ffff880471fa0000 0000000000000034
Call Trace:
 [<ffffffff8161f48d>] notifier_call_chain+0x4d/0x70
 [<ffffffff8107f1be>] __raw_notifier_call_chain+0xe/0x10
 [<ffffffff81059d30>] __cpu_notify+0x20/0x40
 [<ffffffff815fa251>] _cpu_down+0x81/0x270
 [<ffffffff815fa477>] cpu_down+0x37/0x50
 [<ffffffff815fd6a3>] store_online+0x63/0xc0
 [<ffffffff813c7078>] dev_attr_store+0x18/0x30
 [<ffffffff811f02cf>] sysfs_write_file+0xef/0x170
 [<ffffffff81180443>] vfs_write+0xb3/0x180
 [<ffffffff8118076a>] sys_write+0x4a/0x90
 [<ffffffff816236a9>] system_call_fastpath+0x16/0x1b
Code: 48 c7 c7 94 60 01 a0 44 0f b7 ac 10 ac 00 00 00 31 c0 e8 41 b7 5f e1 41 83 c5 02 49 63 c5 49 8b 44 c4 10 48 85 c0 74 56 45 31 ff <39> 58 18 75 4e eb 1f 49 63 d7 4c 89 f7 48 89 45 c8 48 6b d2 28
RIP  [<ffffffffa00159af>] coretemp_cpu_callback+0x93/0x1ba [coretemp]
 RSP <ffff880472fb3d48>
CR2: 000000000000013c

Signed-off-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
---
 drivers/hwmon/coretemp.c |    4 ++++
 1 file changed, 4 insertions(+)

diff --git a/drivers/hwmon/coretemp.c b/drivers/hwmon/coretemp.c
index 0d3141f..54a70fe 100644
--- a/drivers/hwmon/coretemp.c
+++ b/drivers/hwmon/coretemp.c
@@ -709,6 +709,10 @@ static void __cpuinit put_core_offline(unsigned int cpu)
 
 	indx = TO_ATTR_NO(cpu);
 
+	/* The core id is too big, just return */
+	if (indx > MAX_CORE_DATA - 1)
+		return;
+
 	if (pdata->core_data[indx] && pdata->core_data[indx]->cpu == cpu)
 		coretemp_remove_core(pdata, &pdev->dev, indx);
 
-- 
1.7.10




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

* [ 140/167] [PATCH] libata: skip old error history when counting probe trials
  2012-05-09  5:50 [ 000/167] 3.2.17-stable review Ben Hutchings
                   ` (138 preceding siblings ...)
  2012-05-09  5:52 ` [ 139/167] [PATCH] hwmon: (coretemp) fix oops on cpu unplug Ben Hutchings
@ 2012-05-09  5:52 ` Ben Hutchings
  2012-05-09  5:52 ` [ 141/167] [PATCH] b43: only reload config after successful initialization Ben Hutchings
                   ` (26 subsequent siblings)
  166 siblings, 0 replies; 195+ messages in thread
From: Ben Hutchings @ 2012-05-09  5:52 UTC (permalink / raw)
  To: linux-kernel, stable; +Cc: torvalds, akpm, alan, Lin Ming, Jeff Garzik

3.2-stable review patch.  If anyone has any objections, please let me know.

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

From: Lin Ming <ming.m.lin@intel.com>

commit 6868225e3e92399068be9a5f1635752d91012ad5 upstream.

Commit d902747("[libata] Add ATA transport class") introduced
ATA_EFLAG_OLD_ER to mark entries in the error ring as cleared.

But ata_count_probe_trials_cb() didn't check this flag and it still
counts the old error history. So wrong probe trials count is returned
and it causes problem, for example, SATA link speed is slowed down from
3.0Gbps to 1.5Gbps.

Fix it by checking ATA_EFLAG_OLD_ER in ata_count_probe_trials_cb().

Signed-off-by: Lin Ming <ming.m.lin@intel.com>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
---
 drivers/ata/libata-eh.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/ata/libata-eh.c b/drivers/ata/libata-eh.c
index c61316e..d1fbd59 100644
--- a/drivers/ata/libata-eh.c
+++ b/drivers/ata/libata-eh.c
@@ -3501,7 +3501,8 @@ static int ata_count_probe_trials_cb(struct ata_ering_entry *ent, void *void_arg
 	u64 now = get_jiffies_64();
 	int *trials = void_arg;
 
-	if (ent->timestamp < now - min(now, interval))
+	if ((ent->eflags & ATA_EFLAG_OLD_ER) ||
+	    (ent->timestamp < now - min(now, interval)))
 		return -1;
 
 	(*trials)++;
-- 
1.7.10




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

* [ 141/167] [PATCH] b43: only reload config after successful initialization
  2012-05-09  5:50 [ 000/167] 3.2.17-stable review Ben Hutchings
                   ` (139 preceding siblings ...)
  2012-05-09  5:52 ` [ 140/167] [PATCH] libata: skip old error history when counting probe trials Ben Hutchings
@ 2012-05-09  5:52 ` Ben Hutchings
  2012-05-09  5:52 ` [ 142/167] [PATCH] i2c: pnx: Disable clk in suspend Ben Hutchings
                   ` (25 subsequent siblings)
  166 siblings, 0 replies; 195+ messages in thread
From: Ben Hutchings @ 2012-05-09  5:52 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: torvalds, akpm, alan, Seth Forshee, Felix Fietkau, John W. Linville

3.2-stable review patch.  If anyone has any objections, please let me know.

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

From: Seth Forshee <seth.forshee@canonical.com>

commit dbdedbdf4fbff3d4962a0786f37aa86dfdc48a7e upstream.

Commit 2a19032 (b43: reload phy and bss settings after core restarts)
introduced an unconditional call to b43_op_config() at the end of
b43_op_start(). When firmware fails to load this can wedge the system.
There's no need to reload the configuration after a failed
initialization anyway, so only make the call if initialization was
successful.

BugLink: http://bugs.launchpad.net/bugs/950295
Cc: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
---
 drivers/net/wireless/b43/main.c |   10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/drivers/net/wireless/b43/main.c b/drivers/net/wireless/b43/main.c
index c79e663..e4d6dc2 100644
--- a/drivers/net/wireless/b43/main.c
+++ b/drivers/net/wireless/b43/main.c
@@ -4827,8 +4827,14 @@ static int b43_op_start(struct ieee80211_hw *hw)
  out_mutex_unlock:
 	mutex_unlock(&wl->mutex);
 
-	/* reload configuration */
-	b43_op_config(hw, ~0);
+	/*
+	 * Configuration may have been overwritten during initialization.
+	 * Reload the configuration, but only if initialization was
+	 * successful. Reloading the configuration after a failed init
+	 * may hang the system.
+	 */
+	if (!err)
+		b43_op_config(hw, ~0);
 
 	return err;
 }
-- 
1.7.10




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

* [ 142/167] [PATCH] i2c: pnx: Disable clk in suspend
  2012-05-09  5:50 [ 000/167] 3.2.17-stable review Ben Hutchings
                   ` (140 preceding siblings ...)
  2012-05-09  5:52 ` [ 141/167] [PATCH] b43: only reload config after successful initialization Ben Hutchings
@ 2012-05-09  5:52 ` Ben Hutchings
  2012-05-09  5:52 ` [ 143/167] [PATCH] ipw2200: Fix race condition in the command completion acknowledge Ben Hutchings
                   ` (24 subsequent siblings)
  166 siblings, 0 replies; 195+ messages in thread
From: Ben Hutchings @ 2012-05-09  5:52 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: torvalds, akpm, alan, Roland Stigge, Arnd Bergmann, Wolfram Sang

3.2-stable review patch.  If anyone has any objections, please let me know.

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

From: Roland Stigge <stigge@antcom.de>

commit 6c557cfee08751d22aed34840f389b846f0f4508 upstream.

In the driver's suspend function, clk_enable() was used instead of
clk_disable(). This is corrected with this patch.

Signed-off-by: Roland Stigge <stigge@antcom.de>
Reviewed-by: Arnd Bergmann <arnd@arndb.de>

[wsa: reworded commit header slightly]

Signed-off-by: Wolfram Sang <w.sang@pengutronix.de>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
---
 drivers/i2c/busses/i2c-pnx.c |    3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/i2c/busses/i2c-pnx.c b/drivers/i2c/busses/i2c-pnx.c
index 04be9f8..eb8ad53 100644
--- a/drivers/i2c/busses/i2c-pnx.c
+++ b/drivers/i2c/busses/i2c-pnx.c
@@ -546,8 +546,7 @@ static int i2c_pnx_controller_suspend(struct platform_device *pdev,
 {
 	struct i2c_pnx_algo_data *alg_data = platform_get_drvdata(pdev);
 
-	/* FIXME: shouldn't this be clk_disable? */
-	clk_enable(alg_data->clk);
+	clk_disable(alg_data->clk);
 
 	return 0;
 }
-- 
1.7.10




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

* [ 143/167] [PATCH] ipw2200: Fix race condition in the command completion acknowledge
  2012-05-09  5:50 [ 000/167] 3.2.17-stable review Ben Hutchings
                   ` (141 preceding siblings ...)
  2012-05-09  5:52 ` [ 142/167] [PATCH] i2c: pnx: Disable clk in suspend Ben Hutchings
@ 2012-05-09  5:52 ` Ben Hutchings
  2012-05-09  5:52 ` [ 144/167] [PATCH] mac80211: fix AP mode EAP tx for VLAN stations Ben Hutchings
                   ` (23 subsequent siblings)
  166 siblings, 0 replies; 195+ messages in thread
From: Ben Hutchings @ 2012-05-09  5:52 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: torvalds, akpm, alan, Stanislav Yakovlev, John W. Linville

3.2-stable review patch.  If anyone has any objections, please let me know.

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

From: Stanislav Yakovlev <stas.yakovlev@gmail.com>

commit dd447319895d0c0af423e483d9b63f84f3f8869a upstream.

Driver incorrectly validates command completion: instead of waiting
for a command to be acknowledged it continues execution.  Most of the
time driver gets acknowledge of the command completion in a tasklet
before it executes the next one. But sometimes it sends the next
command before it gets acknowledge for the previous one. In such a
case one of the following error messages appear in the log:

Failed to send SYSTEM_CONFIG: Already sending a command.
Failed to send ASSOCIATE: Already sending a command.
Failed to send TX_POWER: Already sending a command.

After that you need to reload the driver to get it working again.

This bug occurs during roaming (reported by Sam Varshavchik)
https://bugzilla.redhat.com/show_bug.cgi?id=738508
and machine booting (reported by Tom Gundersen and Mads Kiilerich)
https://bugs.archlinux.org/task/28097
https://bugzilla.redhat.com/show_bug.cgi?id=802106

This patch doesn't fix the delay issue during firmware load.
But at least device now works as usual after boot.

Signed-off-by: Stanislav Yakovlev <stas.yakovlev@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
---
 drivers/net/wireless/ipw2x00/ipw2200.c |   13 ++++++++++++-
 1 file changed, 12 insertions(+), 1 deletion(-)

diff --git a/drivers/net/wireless/ipw2x00/ipw2200.c b/drivers/net/wireless/ipw2x00/ipw2200.c
index 2b02257..1779db3 100644
--- a/drivers/net/wireless/ipw2x00/ipw2200.c
+++ b/drivers/net/wireless/ipw2x00/ipw2200.c
@@ -2191,6 +2191,7 @@ static int __ipw_send_cmd(struct ipw_priv *priv, struct host_cmd *cmd)
 {
 	int rc = 0;
 	unsigned long flags;
+	unsigned long now, end;
 
 	spin_lock_irqsave(&priv->lock, flags);
 	if (priv->status & STATUS_HCMD_ACTIVE) {
@@ -2232,10 +2233,20 @@ static int __ipw_send_cmd(struct ipw_priv *priv, struct host_cmd *cmd)
 	}
 	spin_unlock_irqrestore(&priv->lock, flags);
 
+	now = jiffies;
+	end = now + HOST_COMPLETE_TIMEOUT;
+again:
 	rc = wait_event_interruptible_timeout(priv->wait_command_queue,
 					      !(priv->
 						status & STATUS_HCMD_ACTIVE),
-					      HOST_COMPLETE_TIMEOUT);
+					      end - now);
+	if (rc < 0) {
+		now = jiffies;
+		if (time_before(now, end))
+			goto again;
+		rc = 0;
+	}
+
 	if (rc == 0) {
 		spin_lock_irqsave(&priv->lock, flags);
 		if (priv->status & STATUS_HCMD_ACTIVE) {
-- 
1.7.10




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

* [ 144/167] [PATCH] mac80211: fix AP mode EAP tx for VLAN stations
  2012-05-09  5:50 [ 000/167] 3.2.17-stable review Ben Hutchings
                   ` (142 preceding siblings ...)
  2012-05-09  5:52 ` [ 143/167] [PATCH] ipw2200: Fix race condition in the command completion acknowledge Ben Hutchings
@ 2012-05-09  5:52 ` Ben Hutchings
  2012-05-09  5:52 ` [ 145/167] [PATCH] rtlwifi: Fix oops on unload Ben Hutchings
                   ` (22 subsequent siblings)
  166 siblings, 0 replies; 195+ messages in thread
From: Ben Hutchings @ 2012-05-09  5:52 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: torvalds, akpm, alan, Felix Fietkau, John W. Linville

3.2-stable review patch.  If anyone has any objections, please let me know.

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

From: Felix Fietkau <nbd@openwrt.org>

commit 66f2c99af3d6f2d0aa1120884cf1c60613ef61c0 upstream.

EAP frames for stations in an AP VLAN are sent on the main AP interface
to avoid race conditions wrt. moving stations.
For that to work properly, sta_info_get_bss must be used instead of
sta_info_get when sending EAP packets.
Previously this was only done for cooked monitor injected packets, so
this patch adds a check for tx->skb->protocol to the same place.

Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
---
 net/mac80211/tx.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/net/mac80211/tx.c b/net/mac80211/tx.c
index 782a601..e76facc 100644
--- a/net/mac80211/tx.c
+++ b/net/mac80211/tx.c
@@ -1158,7 +1158,8 @@ ieee80211_tx_prepare(struct ieee80211_sub_if_data *sdata,
 		tx->sta = rcu_dereference(sdata->u.vlan.sta);
 		if (!tx->sta && sdata->dev->ieee80211_ptr->use_4addr)
 			return TX_DROP;
-	} else if (info->flags & IEEE80211_TX_CTL_INJECTED) {
+	} else if (info->flags & IEEE80211_TX_CTL_INJECTED ||
+		   tx->sdata->control_port_protocol == tx->skb->protocol) {
 		tx->sta = sta_info_get_bss(sdata, hdr->addr1);
 	}
 	if (!tx->sta)
-- 
1.7.10




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

* [ 145/167] [PATCH] rtlwifi: Fix oops on unload
  2012-05-09  5:50 [ 000/167] 3.2.17-stable review Ben Hutchings
                   ` (143 preceding siblings ...)
  2012-05-09  5:52 ` [ 144/167] [PATCH] mac80211: fix AP mode EAP tx for VLAN stations Ben Hutchings
@ 2012-05-09  5:52 ` Ben Hutchings
  2012-05-09  5:52 ` [ 146/167] [PATCH] wl1251: fix crash on remove due to premature kfree Ben Hutchings
                   ` (21 subsequent siblings)
  166 siblings, 0 replies; 195+ messages in thread
From: Ben Hutchings @ 2012-05-09  5:52 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: torvalds, akpm, alan, Larry Finger, Dave Airlie, John W. Linville

3.2-stable review patch.  If anyone has any objections, please let me know.

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

From: Larry Finger <Larry.Finger@lwfinger.net>

commit 44eb65cfd8da4b9c231238998729e858e963a980 upstream.

Under some circumstances, a PCI-based driver reports the following OOPs:

Mar 19 08:14:35 kvothe kernel: [ 6584.626011] Oops: 0000 [#1] SMP
--snip--
Mar 19 08:14:35 kvothe kernel: [ 6584.626011] Pid: 19627, comm: rmmod
Not tainted 3.2.9-2.fc16.x86_64 #1 LENOVO 05962RU/05962RU
Mar 19 08:14:35 kvothe kernel: [ 6584.626011] RIP:
0010:[<ffffffffa0418d39>]  [<ffffffffa0418d39>]
rtl92ce_get_desc+0x19/0xd0 [rtl8192ce]
--snip--
Mar 19 08:14:35 kvothe kernel: [ 6584.626011] Process rmmod (pid:
19627, threadinfo ffff880050262000, task ffff8801156d5cc0)
Mar 19 08:14:35 kvothe kernel: [ 6584.626011] Stack:
Mar 19 08:14:35 kvothe kernel: [ 6584.626011]  0000000000000002
ffff8801176c2540 ffff880050263ca8 ffffffffa03348e7
Mar 19 08:14:35 kvothe kernel: [ 6584.626011]  0000000000000282
0000000180150014 ffff880050263fd8 ffff8801176c2810
Mar 19 08:14:35 kvothe kernel: [ 6584.626011]  ffff880050263bc8
ffffffff810550e2 00000000000002c0 ffff8801176c0d40
Mar 19 08:14:35 kvothe kernel: [ 6584.626011] Call Trace:
Mar 19 08:14:35 kvothe kernel: [ 6584.626011]  [<ffffffffa03348e7>]
_rtl_pci_rx_interrupt+0x187/0x650 [rtlwifi]
--snip--
Mar 19 08:14:35 kvothe kernel: [ 6584.626011] Code: ff 09 d0 89 07 48
83 c4 08 5b 5d c3 66 0f 1f 44 00 00 55 48 89 e5 53 48 83 ec 08 66 66
66 66 90 40 84 f6 89 d3 74 13 84 d2 75 57 <8b> 07 48 83 c4 08 5b 5d c1
e8 1f c3 0f 1f 00 84 d2 74 ed 80 fa
Mar 19 08:14:35 kvothe kernel: [ 6584.626011] RIP
[<ffffffffa0418d39>] rtl92ce_get_desc+0x19/0xd0 [rtl8192ce]
Mar 19 08:14:35 kvothe kernel: [ 6584.626011]  RSP <ffff880050263b58>
Mar 19 08:14:35 kvothe kernel: [ 6584.626011] CR2: 00000000000006e0
Mar 19 08:14:35 kvothe kernel: [ 6584.646491] ---[ end trace
8636c766dcfbe0e6 ]---

This oops is due to interrupts not being disabled in this particular path.

Reported-by: Dave Airlie <airlied@gmail.com>
Tested-by: Dave Airlie <airlied@gmail.com>
Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
---
 drivers/net/wireless/rtlwifi/pci.c |    1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/net/wireless/rtlwifi/pci.c b/drivers/net/wireless/rtlwifi/pci.c
index 288b035..cc15fdb 100644
--- a/drivers/net/wireless/rtlwifi/pci.c
+++ b/drivers/net/wireless/rtlwifi/pci.c
@@ -1941,6 +1941,7 @@ void rtl_pci_disconnect(struct pci_dev *pdev)
 		rtl_deinit_deferred_work(hw);
 		rtlpriv->intf_ops->adapter_stop(hw);
 	}
+	rtlpriv->cfg->ops->disable_interrupt(hw);
 
 	/*deinit rfkill */
 	rtl_deinit_rfkill(hw);
-- 
1.7.10




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

* [ 146/167] [PATCH] wl1251: fix crash on remove due to premature kfree
  2012-05-09  5:50 [ 000/167] 3.2.17-stable review Ben Hutchings
                   ` (144 preceding siblings ...)
  2012-05-09  5:52 ` [ 145/167] [PATCH] rtlwifi: Fix oops on unload Ben Hutchings
@ 2012-05-09  5:52 ` Ben Hutchings
  2012-05-09  5:52 ` [ 147/167] [PATCH] wl1251: fix crash on remove due to leftover work item Ben Hutchings
                   ` (20 subsequent siblings)
  166 siblings, 0 replies; 195+ messages in thread
From: Ben Hutchings @ 2012-05-09  5:52 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: torvalds, akpm, alan, Grazvydas Ignotas, John W. Linville

3.2-stable review patch.  If anyone has any objections, please let me know.

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

From: Grazvydas Ignotas <notasas@gmail.com>

commit 328c32f0f85467af5a6c4c3289e168d9ad2555af upstream.

Currently SDIO glue frees it's own structure before calling
wl1251_free_hw(), which in turn calls ieee80211_unregister_hw().
The later call may result in a need to communicate with the chip
to stop it (as it happens now if the interface is still up before
rmmod), which means calls are made back to the glue, resulting in
freed memory access.

Fix this by freeing glue data last.

Signed-off-by: Grazvydas Ignotas <notasas@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
---
 drivers/net/wireless/wl1251/sdio.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/wireless/wl1251/sdio.c b/drivers/net/wireless/wl1251/sdio.c
index f786942..1b851f6 100644
--- a/drivers/net/wireless/wl1251/sdio.c
+++ b/drivers/net/wireless/wl1251/sdio.c
@@ -315,8 +315,8 @@ static void __devexit wl1251_sdio_remove(struct sdio_func *func)
 
 	if (wl->irq)
 		free_irq(wl->irq, wl);
-	kfree(wl_sdio);
 	wl1251_free_hw(wl);
+	kfree(wl_sdio);
 
 	sdio_claim_host(func);
 	sdio_release_irq(func);
-- 
1.7.10




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

* [ 147/167] [PATCH] wl1251: fix crash on remove due to leftover work item
  2012-05-09  5:50 [ 000/167] 3.2.17-stable review Ben Hutchings
                   ` (145 preceding siblings ...)
  2012-05-09  5:52 ` [ 146/167] [PATCH] wl1251: fix crash on remove due to premature kfree Ben Hutchings
@ 2012-05-09  5:52 ` Ben Hutchings
  2012-05-09  5:52 ` [ 148/167] [PATCH] iwlwifi: do not nulify ctx->vif on reset Ben Hutchings
                   ` (19 subsequent siblings)
  166 siblings, 0 replies; 195+ messages in thread
From: Ben Hutchings @ 2012-05-09  5:52 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: torvalds, akpm, alan, Grazvydas Ignotas, John W. Linville

3.2-stable review patch.  If anyone has any objections, please let me know.

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

From: Grazvydas Ignotas <notasas@gmail.com>

commit 4c1bcdb5a3354b250b82a67549f57ac27a3bb85f upstream.

This driver currently leaves elp_work behind when stopping, which
occasionally results in data corruption because work function ends
up accessing freed memory, typical symptoms of this are various
worker_thread crashes. Fix it by cancelling elp_work.

Signed-off-by: Grazvydas Ignotas <notasas@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
---
 drivers/net/wireless/wl1251/main.c |    1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/net/wireless/wl1251/main.c b/drivers/net/wireless/wl1251/main.c
index 41302c7..d1afb8e 100644
--- a/drivers/net/wireless/wl1251/main.c
+++ b/drivers/net/wireless/wl1251/main.c
@@ -479,6 +479,7 @@ static void wl1251_op_stop(struct ieee80211_hw *hw)
 	cancel_work_sync(&wl->irq_work);
 	cancel_work_sync(&wl->tx_work);
 	cancel_work_sync(&wl->filter_work);
+	cancel_delayed_work_sync(&wl->elp_work);
 
 	mutex_lock(&wl->mutex);
 
-- 
1.7.10




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

* [ 148/167] [PATCH] iwlwifi: do not nulify ctx->vif on reset
  2012-05-09  5:50 [ 000/167] 3.2.17-stable review Ben Hutchings
                   ` (146 preceding siblings ...)
  2012-05-09  5:52 ` [ 147/167] [PATCH] wl1251: fix crash on remove due to leftover work item Ben Hutchings
@ 2012-05-09  5:52 ` Ben Hutchings
  2012-05-09  5:52 ` [ 149/167] [PATCH] iwlwifi: fix hardware queue programming Ben Hutchings
                   ` (18 subsequent siblings)
  166 siblings, 0 replies; 195+ messages in thread
From: Ben Hutchings @ 2012-05-09  5:52 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: torvalds, akpm, alan, Stanislaw Gruszka, Wey-Yi Guy, John W. Linville

3.2-stable review patch.  If anyone has any objections, please let me know.

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

From: Stanislaw Gruszka <sgruszka@redhat.com>

commit 8db4c7e25d153fb049e81715d72fa3be3a0c3b69 upstream.

ctx->vif is dereferenced in different part of iwlwifi code, so do not
nullify it.

This should address at least one of the possible reasons of WARNING at
iwlagn_mac_remove_interface, and perhaps some random crashes when
firmware reset is performed.

Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
[bwh: Backported to 3.2:
 - Change filename iwl-mac80211.c to iwl-core.c
 - Change context in iwlagn_prepare_restart()]
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
---
 drivers/net/wireless/iwlwifi/iwl-agn.c      |    3 ---
 drivers/net/wireless/iwlwifi/iwl-mac80211.c |   10 +++++++++-
 2 files changed, 9 insertions(+), 4 deletions(-)

--- linux.orig/drivers/net/wireless/iwlwifi/iwl-agn.c
+++ linux/drivers/net/wireless/iwlwifi/iwl-agn.c
@@ -1504,7 +1504,6 @@
 
 static void iwlagn_prepare_restart(struct iwl_priv *priv)
 {
-	struct iwl_rxon_context *ctx;
 	bool bt_full_concurrent;
 	u8 bt_ci_compliance;
 	u8 bt_load;
@@ -1513,8 +1512,6 @@
 
 	lockdep_assert_held(&priv->shrd->mutex);
 
-	for_each_context(priv, ctx)
-		ctx->vif = NULL;
 	priv->is_open = 0;
 
 	/*
--- linux.orig/drivers/net/wireless/iwlwifi/iwl-core.c
+++ linux/drivers/net/wireless/iwlwifi/iwl-core.c
@@ -1228,6 +1228,7 @@
 	struct iwl_rxon_context *tmp, *ctx = NULL;
 	int err;
 	enum nl80211_iftype viftype = ieee80211_vif_type_p2p(vif);
+	bool reset = false;
 
 	IWL_DEBUG_MAC80211(priv, "enter: type %d, addr %pM\n",
 			   viftype, vif->addr);
@@ -1249,6 +1250,13 @@
 			tmp->interface_modes | tmp->exclusive_interface_modes;
 
 		if (tmp->vif) {
+			/* On reset we need to add the same interface again */
+			if (tmp->vif == vif) {
+				reset = true;
+				ctx = tmp;
+				break;
+			}
+
 			/* check if this busy context is exclusive */
 			if (tmp->exclusive_interface_modes &
 						BIT(tmp->vif->type)) {
@@ -1275,7 +1283,7 @@
 	ctx->vif = vif;
 
 	err = iwl_setup_interface(priv, ctx);
-	if (!err)
+	if (!err || reset)
 		goto out;
 
 	ctx->vif = NULL;



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

* [ 149/167] [PATCH] iwlwifi: fix hardware queue programming
  2012-05-09  5:50 [ 000/167] 3.2.17-stable review Ben Hutchings
                   ` (147 preceding siblings ...)
  2012-05-09  5:52 ` [ 148/167] [PATCH] iwlwifi: do not nulify ctx->vif on reset Ben Hutchings
@ 2012-05-09  5:52 ` Ben Hutchings
  2012-05-09  5:52 ` [ 150/167] [PATCH] hfsplus: Fix potential buffer overflows Ben Hutchings
                   ` (17 subsequent siblings)
  166 siblings, 0 replies; 195+ messages in thread
From: Ben Hutchings @ 2012-05-09  5:52 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: torvalds, akpm, alan, Johannes Berg, Wey-Yi Guy, John W. Linville

3.2-stable review patch.  If anyone has any objections, please let me know.

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

From: Johannes Berg <johannes.berg@intel.com>

commit 5ef4acd58ab2abd0dd0c8e3cacd61a0dc5d73646 upstream.

Newer devices have 20 (5000 series) or 30 (6000 series)
hardware queues, rather than the 16 that 4965 had. This
was added to the driver a long time ago, but improperly:
the queue registers for the higher queues aren't just
continuations of the registers for the first 16 queues,
they are in other places. Therefore, the hardware would
lock up when trying to activate queue 16 or above and
the device would have to be restarted.

Thanks goes to Emmanuel who identified this and told me
how the queue programming should be done.

Note that we don't use queues 20 and higher today and
doing so needs more work than this.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
---
 drivers/net/wireless/iwlwifi/iwl-fh.h   |   24 +++++++++++++++++++-----
 drivers/net/wireless/iwlwifi/iwl-prph.h |   27 ++++++++++++++++++++++++---
 2 files changed, 43 insertions(+), 8 deletions(-)

diff --git a/drivers/net/wireless/iwlwifi/iwl-fh.h b/drivers/net/wireless/iwlwifi/iwl-fh.h
index 9020809..74bce97 100644
--- a/drivers/net/wireless/iwlwifi/iwl-fh.h
+++ b/drivers/net/wireless/iwlwifi/iwl-fh.h
@@ -104,15 +104,29 @@
  * (see struct iwl_tfd_frame).  These 16 pointer registers are offset by 0x04
  * bytes from one another.  Each TFD circular buffer in DRAM must be 256-byte
  * aligned (address bits 0-7 must be 0).
+ * Later devices have 20 (5000 series) or 30 (higher) queues, but the registers
+ * for them are in different places.
  *
  * Bit fields in each pointer register:
  *  27-0: TFD CB physical base address [35:8], must be 256-byte aligned
  */
-#define FH_MEM_CBBC_LOWER_BOUND          (FH_MEM_LOWER_BOUND + 0x9D0)
-#define FH_MEM_CBBC_UPPER_BOUND          (FH_MEM_LOWER_BOUND + 0xA10)
-
-/* Find TFD CB base pointer for given queue (range 0-15). */
-#define FH_MEM_CBBC_QUEUE(x)  (FH_MEM_CBBC_LOWER_BOUND + (x) * 0x4)
+#define FH_MEM_CBBC_0_15_LOWER_BOUND		(FH_MEM_LOWER_BOUND + 0x9D0)
+#define FH_MEM_CBBC_0_15_UPPER_BOUND		(FH_MEM_LOWER_BOUND + 0xA10)
+#define FH_MEM_CBBC_16_19_LOWER_BOUND		(FH_MEM_LOWER_BOUND + 0xBF0)
+#define FH_MEM_CBBC_16_19_UPPER_BOUND		(FH_MEM_LOWER_BOUND + 0xC00)
+#define FH_MEM_CBBC_20_31_LOWER_BOUND		(FH_MEM_LOWER_BOUND + 0xB20)
+#define FH_MEM_CBBC_20_31_UPPER_BOUND		(FH_MEM_LOWER_BOUND + 0xB80)
+
+/* Find TFD CB base pointer for given queue */
+static inline unsigned int FH_MEM_CBBC_QUEUE(unsigned int chnl)
+{
+	if (chnl < 16)
+		return FH_MEM_CBBC_0_15_LOWER_BOUND + 4 * chnl;
+	if (chnl < 20)
+		return FH_MEM_CBBC_16_19_LOWER_BOUND + 4 * (chnl - 16);
+	WARN_ON_ONCE(chnl >= 32);
+	return FH_MEM_CBBC_20_31_LOWER_BOUND + 4 * (chnl - 20);
+}
 
 
 /**
diff --git a/drivers/net/wireless/iwlwifi/iwl-prph.h b/drivers/net/wireless/iwlwifi/iwl-prph.h
index 75dc20b..3b10692 100644
--- a/drivers/net/wireless/iwlwifi/iwl-prph.h
+++ b/drivers/net/wireless/iwlwifi/iwl-prph.h
@@ -223,12 +223,33 @@
 #define SCD_AIT			(SCD_BASE + 0x0c)
 #define SCD_TXFACT		(SCD_BASE + 0x10)
 #define SCD_ACTIVE		(SCD_BASE + 0x14)
-#define SCD_QUEUE_WRPTR(x)	(SCD_BASE + 0x18 + (x) * 4)
-#define SCD_QUEUE_RDPTR(x)	(SCD_BASE + 0x68 + (x) * 4)
 #define SCD_QUEUECHAIN_SEL	(SCD_BASE + 0xe8)
 #define SCD_AGGR_SEL		(SCD_BASE + 0x248)
 #define SCD_INTERRUPT_MASK	(SCD_BASE + 0x108)
-#define SCD_QUEUE_STATUS_BITS(x)	(SCD_BASE + 0x10c + (x) * 4)
+
+static inline unsigned int SCD_QUEUE_WRPTR(unsigned int chnl)
+{
+	if (chnl < 20)
+		return SCD_BASE + 0x18 + chnl * 4;
+	WARN_ON_ONCE(chnl >= 32);
+	return SCD_BASE + 0x284 + (chnl - 20) * 4;
+}
+
+static inline unsigned int SCD_QUEUE_RDPTR(unsigned int chnl)
+{
+	if (chnl < 20)
+		return SCD_BASE + 0x68 + chnl * 4;
+	WARN_ON_ONCE(chnl >= 32);
+	return SCD_BASE + 0x2B4 + (chnl - 20) * 4;
+}
+
+static inline unsigned int SCD_QUEUE_STATUS_BITS(unsigned int chnl)
+{
+	if (chnl < 20)
+		return SCD_BASE + 0x10c + chnl * 4;
+	WARN_ON_ONCE(chnl >= 32);
+	return SCD_BASE + 0x384 + (chnl - 20) * 4;
+}
 
 /*********************** END TX SCHEDULER *************************************/
 
-- 
1.7.10




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

* [ 150/167] [PATCH] hfsplus: Fix potential buffer overflows
  2012-05-09  5:50 [ 000/167] 3.2.17-stable review Ben Hutchings
                   ` (148 preceding siblings ...)
  2012-05-09  5:52 ` [ 149/167] [PATCH] iwlwifi: fix hardware queue programming Ben Hutchings
@ 2012-05-09  5:52 ` Ben Hutchings
  2012-05-09  5:53 ` [ 151/167] [PATCH] ASoC: tlv312aic23: unbreak resume Ben Hutchings
                   ` (16 subsequent siblings)
  166 siblings, 0 replies; 195+ messages in thread
From: Ben Hutchings @ 2012-05-09  5:52 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: torvalds, akpm, alan, Greg Kroah-Hartman, Timo Warns, WANG Cong,
	Alexey Khoroshilov, Miklos Szeredi, Sage Weil, Eugene Teo,
	Roman Zippel, Al Viro, Christoph Hellwig, Alexey Dobriyan,
	Dave Anderson

3.2-stable review patch.  If anyone has any objections, please let me know.

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

From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit 6f24f892871acc47b40dd594c63606a17c714f77 upstream.

Commit ec81aecb2966 ("hfs: fix a potential buffer overflow") fixed a few
potential buffer overflows in the hfs filesystem.  But as Timo Warns
pointed out, these changes also need to be made on the hfsplus
filesystem as well.

Reported-by: Timo Warns <warns@pre-sense.de>
Acked-by: WANG Cong <amwang@redhat.com>
Cc: Alexey Khoroshilov <khoroshilov@ispras.ru>
Cc: Miklos Szeredi <mszeredi@suse.cz>
Cc: Sage Weil <sage@newdream.net>
Cc: Eugene Teo <eteo@redhat.com>
Cc: Roman Zippel <zippel@linux-m68k.org>
Cc: Al Viro <viro@zeniv.linux.org.uk>
Cc: Christoph Hellwig <hch@lst.de>
Cc: Alexey Dobriyan <adobriyan@gmail.com>
Cc: Dave Anderson <anderson@redhat.com>
Cc: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
---
 fs/hfsplus/catalog.c |    4 ++++
 fs/hfsplus/dir.c     |   11 +++++++++++
 2 files changed, 15 insertions(+)

diff --git a/fs/hfsplus/catalog.c b/fs/hfsplus/catalog.c
index 4dfbfec..ec2a9c2 100644
--- a/fs/hfsplus/catalog.c
+++ b/fs/hfsplus/catalog.c
@@ -366,6 +366,10 @@ int hfsplus_rename_cat(u32 cnid,
 	err = hfs_brec_find(&src_fd);
 	if (err)
 		goto out;
+	if (src_fd.entrylength > sizeof(entry) || src_fd.entrylength < 0) {
+		err = -EIO;
+		goto out;
+	}
 
 	hfs_bnode_read(src_fd.bnode, &entry, src_fd.entryoffset,
 				src_fd.entrylength);
diff --git a/fs/hfsplus/dir.c b/fs/hfsplus/dir.c
index 88e155f..26b53fb 100644
--- a/fs/hfsplus/dir.c
+++ b/fs/hfsplus/dir.c
@@ -150,6 +150,11 @@ static int hfsplus_readdir(struct file *filp, void *dirent, filldir_t filldir)
 		filp->f_pos++;
 		/* fall through */
 	case 1:
+		if (fd.entrylength > sizeof(entry) || fd.entrylength < 0) {
+			err = -EIO;
+			goto out;
+		}
+
 		hfs_bnode_read(fd.bnode, &entry, fd.entryoffset,
 			fd.entrylength);
 		if (be16_to_cpu(entry.type) != HFSPLUS_FOLDER_THREAD) {
@@ -181,6 +186,12 @@ static int hfsplus_readdir(struct file *filp, void *dirent, filldir_t filldir)
 			err = -EIO;
 			goto out;
 		}
+
+		if (fd.entrylength > sizeof(entry) || fd.entrylength < 0) {
+			err = -EIO;
+			goto out;
+		}
+
 		hfs_bnode_read(fd.bnode, &entry, fd.entryoffset,
 			fd.entrylength);
 		type = be16_to_cpu(entry.type);
-- 
1.7.10




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

* [ 151/167] [PATCH] ASoC: tlv312aic23: unbreak resume
  2012-05-09  5:50 [ 000/167] 3.2.17-stable review Ben Hutchings
                   ` (149 preceding siblings ...)
  2012-05-09  5:52 ` [ 150/167] [PATCH] hfsplus: Fix potential buffer overflows Ben Hutchings
@ 2012-05-09  5:53 ` Ben Hutchings
  2012-05-09  5:53 ` [ 152/167] [PATCH] asm-generic: Use __BITS_PER_LONG in statfs.h Ben Hutchings
                   ` (15 subsequent siblings)
  166 siblings, 0 replies; 195+ messages in thread
From: Ben Hutchings @ 2012-05-09  5:53 UTC (permalink / raw)
  To: linux-kernel, stable; +Cc: torvalds, akpm, alan, Eric Bénard, Mark Brown

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

3.2-stable review patch.  If anyone has any objections, please let me know.

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

From: =?UTF-8?q?Eric=20B=C3=A9nard?= <eric@eukrea.com>

commit e875c1e3e758447ba81ca450d89434b3b0496d37 upstream.

* commit f9dfbf9 "ASoC: tlv320aic23: convert to soc-cache" leads to
a bug preventing resumeof the codec as regmap expects a 9 bits data
register but 0xFFFF is passed in tlv320aic23_set_bias_level and this
values gets cached preventing any write to the TLV320AIC23_PWR
register as the final value produced by regmap is (register << 9) | value

* this patch solves the problem by only working on the 9 bits the
register contains.

Signed-off-by: Eric Bénard <eric@eukrea.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
---
 sound/soc/codecs/tlv320aic23.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/sound/soc/codecs/tlv320aic23.c b/sound/soc/codecs/tlv320aic23.c
index 16d55f9..df1e07f 100644
--- a/sound/soc/codecs/tlv320aic23.c
+++ b/sound/soc/codecs/tlv320aic23.c
@@ -472,7 +472,7 @@ static int tlv320aic23_set_dai_sysclk(struct snd_soc_dai *codec_dai,
 static int tlv320aic23_set_bias_level(struct snd_soc_codec *codec,
 				      enum snd_soc_bias_level level)
 {
-	u16 reg = snd_soc_read(codec, TLV320AIC23_PWR) & 0xff7f;
+	u16 reg = snd_soc_read(codec, TLV320AIC23_PWR) & 0x17f;
 
 	switch (level) {
 	case SND_SOC_BIAS_ON:
@@ -491,7 +491,7 @@ static int tlv320aic23_set_bias_level(struct snd_soc_codec *codec,
 	case SND_SOC_BIAS_OFF:
 		/* everything off, dac mute, inactive */
 		snd_soc_write(codec, TLV320AIC23_ACTIVE, 0x0);
-		snd_soc_write(codec, TLV320AIC23_PWR, 0xffff);
+		snd_soc_write(codec, TLV320AIC23_PWR, 0x1ff);
 		break;
 	}
 	codec->dapm.bias_level = level;
-- 
1.7.10




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

* [ 152/167] [PATCH] asm-generic: Use __BITS_PER_LONG in statfs.h
  2012-05-09  5:50 [ 000/167] 3.2.17-stable review Ben Hutchings
                   ` (150 preceding siblings ...)
  2012-05-09  5:53 ` [ 151/167] [PATCH] ASoC: tlv312aic23: unbreak resume Ben Hutchings
@ 2012-05-09  5:53 ` Ben Hutchings
  2012-05-09  5:53 ` [ 153/167] [PATCH] x86, relocs: Remove an unused variable Ben Hutchings
                   ` (14 subsequent siblings)
  166 siblings, 0 replies; 195+ messages in thread
From: Ben Hutchings @ 2012-05-09  5:53 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: torvalds, akpm, alan, H. Peter Anvin, H.J. Lu, Arnd Bergmann

3.2-stable review patch.  If anyone has any objections, please let me know.

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

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

commit f5c2347ee20a8d6964d6a6b1ad04f200f8d4dfa7 upstream.

<asm-generic/statfs.h> is exported to userspace, so using
BITS_PER_LONG is invalid.  We need to use __BITS_PER_LONG instead.

This is kernel bugzilla 43165.

Reported-by: H.J. Lu <hjl.tools@gmail.com>
Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
Link: http://lkml.kernel.org/r/1335465916-16965-1-git-send-email-hpa@linux.intel.com
Acked-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
---
 include/asm-generic/statfs.h |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/include/asm-generic/statfs.h b/include/asm-generic/statfs.h
index 0fd28e0..c749af9 100644
--- a/include/asm-generic/statfs.h
+++ b/include/asm-generic/statfs.h
@@ -15,7 +15,7 @@ typedef __kernel_fsid_t	fsid_t;
  * with a 10' pole.
  */
 #ifndef __statfs_word
-#if BITS_PER_LONG == 64
+#if __BITS_PER_LONG == 64
 #define __statfs_word long
 #else
 #define __statfs_word __u32
-- 
1.7.10




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

* [ 153/167] [PATCH] x86, relocs: Remove an unused variable
  2012-05-09  5:50 [ 000/167] 3.2.17-stable review Ben Hutchings
                   ` (151 preceding siblings ...)
  2012-05-09  5:53 ` [ 152/167] [PATCH] asm-generic: Use __BITS_PER_LONG in statfs.h Ben Hutchings
@ 2012-05-09  5:53 ` Ben Hutchings
  2012-05-09  6:16   ` Jonathan Nieder
  2012-05-09  5:53 ` [ 154/167] [PATCH] ARM: 7410/1: Add extra clobber registers for assembly in kernel_execve Ben Hutchings
                   ` (13 subsequent siblings)
  166 siblings, 1 reply; 195+ messages in thread
From: Ben Hutchings @ 2012-05-09  5:53 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: torvalds, akpm, alan, Kusanagi Kouichi, H. Peter Anvin

3.2-stable review patch.  If anyone has any objections, please let me know.

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

From: Kusanagi Kouichi <slash@ac.auone-net.jp>

commit 7c77cda0fe742ed07622827ce80963bbeebd1e3f upstream.

sh_symtab is set but not used.

[ hpa: putting this in urgent because of the sheer harmlessness of the patch:
  it quiets a build warning but does not change any generated code. ]

Signed-off-by: Kusanagi Kouichi <slash@ac.auone-net.jp>
Link: http://lkml.kernel.org/r/20120401082932.D5E066FC03D@msa105.auone-net.jp
Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
---
 arch/x86/boot/compressed/relocs.c |    2 --
 1 file changed, 2 deletions(-)

diff --git a/arch/x86/boot/compressed/relocs.c b/arch/x86/boot/compressed/relocs.c
index d3c0b02..fb7117a 100644
--- a/arch/x86/boot/compressed/relocs.c
+++ b/arch/x86/boot/compressed/relocs.c
@@ -403,13 +403,11 @@ static void print_absolute_symbols(void)
 	for (i = 0; i < ehdr.e_shnum; i++) {
 		struct section *sec = &secs[i];
 		char *sym_strtab;
-		Elf32_Sym *sh_symtab;
 		int j;
 
 		if (sec->shdr.sh_type != SHT_SYMTAB) {
 			continue;
 		}
-		sh_symtab = sec->symtab;
 		sym_strtab = sec->link->strtab;
 		for (j = 0; j < sec->shdr.sh_size/sizeof(Elf32_Sym); j++) {
 			Elf32_Sym *sym;
-- 
1.7.10




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

* [ 154/167] [PATCH] ARM: 7410/1: Add extra clobber registers for assembly in kernel_execve
  2012-05-09  5:50 [ 000/167] 3.2.17-stable review Ben Hutchings
                   ` (152 preceding siblings ...)
  2012-05-09  5:53 ` [ 153/167] [PATCH] x86, relocs: Remove an unused variable Ben Hutchings
@ 2012-05-09  5:53 ` Ben Hutchings
  2012-05-09  5:53 ` [ 155/167] [PATCH] ARM: 7414/1: SMP: prevent use of the console when using idmap_pgd Ben Hutchings
                   ` (12 subsequent siblings)
  166 siblings, 0 replies; 195+ messages in thread
From: Ben Hutchings @ 2012-05-09  5:53 UTC (permalink / raw)
  To: linux-kernel, stable; +Cc: torvalds, akpm, alan, Tim Bird, Russell King

3.2-stable review patch.  If anyone has any objections, please let me know.

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

From: Tim Bird <tim.bird@am.sony.com>

commit e787ec1376e862fcea1bfd523feb7c5fb43ecdb9 upstream.

The inline assembly in kernel_execve() uses r8 and r9.  Since this
code sequence does not return, it usually doesn't matter if the
register clobber list is accurate.  However, I saw a case where a
particular version of gcc used r8 as an intermediate for the value
eventually passed to r9.  Because r8 is used in the inline
assembly, and not mentioned in the clobber list, r9 was set
to an incorrect value.

This resulted in a kernel panic on execution of the first user-space
program in the system.  r9 is used in ret_to_user as the thread_info
pointer, and if it's wrong, bad things happen.

Signed-off-by: Tim Bird <tim.bird@am.sony.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
---
 arch/arm/kernel/sys_arm.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/arm/kernel/sys_arm.c b/arch/arm/kernel/sys_arm.c
index d2b1779..76cbb05 100644
--- a/arch/arm/kernel/sys_arm.c
+++ b/arch/arm/kernel/sys_arm.c
@@ -115,7 +115,7 @@ int kernel_execve(const char *filename,
 		  "Ir" (THREAD_START_SP - sizeof(regs)),
 		  "r" (&regs),
 		  "Ir" (sizeof(regs))
-		: "r0", "r1", "r2", "r3", "ip", "lr", "memory");
+		: "r0", "r1", "r2", "r3", "r8", "r9", "ip", "lr", "memory");
 
  out:
 	return ret;
-- 
1.7.10




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

* [ 155/167] [PATCH] ARM: 7414/1: SMP: prevent use of the console when using idmap_pgd
  2012-05-09  5:50 [ 000/167] 3.2.17-stable review Ben Hutchings
                   ` (153 preceding siblings ...)
  2012-05-09  5:53 ` [ 154/167] [PATCH] ARM: 7410/1: Add extra clobber registers for assembly in kernel_execve Ben Hutchings
@ 2012-05-09  5:53 ` Ben Hutchings
  2012-05-09  5:53 ` [ 156/167] [PATCH] drm/i915: disable sdvo hotplug on i945g/gm Ben Hutchings
                   ` (11 subsequent siblings)
  166 siblings, 0 replies; 195+ messages in thread
From: Ben Hutchings @ 2012-05-09  5:53 UTC (permalink / raw)
  To: linux-kernel, stable; +Cc: torvalds, akpm, alan, Colin Cross, Russell King

3.2-stable review patch.  If anyone has any objections, please let me know.

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

From: Colin Cross <ccross@android.com>

commit fde165b2a29673aabf18ceff14dea1f1cfb0daad upstream.

Commit 4e8ee7de227e3ab9a72040b448ad728c5428a042 (ARM: SMP: use
idmap_pgd for mapping MMU enable during secondary booting)
switched secondary boot to use idmap_pgd, which is initialized
during early_initcall, instead of a page table initialized during
__cpu_up.  This causes idmap_pgd to contain the static mappings
but be missing all dynamic mappings.

If a console is registered that creates a dynamic mapping, the
printk in secondary_start_kernel will trigger a data abort on
the missing mapping before the exception handlers have been
initialized, leading to a hang.  Initial boot is not affected
because no consoles have been registered, and resume is usually
not affected because the offending console is suspended.
Onlining a cpu with hotplug triggers the problem.

A workaround is to the printk in secondary_start_kernel until
after the page tables have been switched back to init_mm.

Signed-off-by: Colin Cross <ccross@android.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
---
 arch/arm/kernel/smp.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/arm/kernel/smp.c b/arch/arm/kernel/smp.c
index f6a4d32..8f46446 100644
--- a/arch/arm/kernel/smp.c
+++ b/arch/arm/kernel/smp.c
@@ -251,8 +251,6 @@ asmlinkage void __cpuinit secondary_start_kernel(void)
 	struct mm_struct *mm = &init_mm;
 	unsigned int cpu = smp_processor_id();
 
-	printk("CPU%u: Booted secondary processor\n", cpu);
-
 	/*
 	 * All kernel threads share the same mm context; grab a
 	 * reference and switch to it.
@@ -264,6 +262,8 @@ asmlinkage void __cpuinit secondary_start_kernel(void)
 	enter_lazy_tlb(mm, current);
 	local_flush_tlb_all();
 
+	printk("CPU%u: Booted secondary processor\n", cpu);
+
 	cpu_init();
 	preempt_disable();
 	trace_hardirqs_off();
-- 
1.7.10




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

* [ 156/167] [PATCH] drm/i915: disable sdvo hotplug on i945g/gm
  2012-05-09  5:50 [ 000/167] 3.2.17-stable review Ben Hutchings
                   ` (154 preceding siblings ...)
  2012-05-09  5:53 ` [ 155/167] [PATCH] ARM: 7414/1: SMP: prevent use of the console when using idmap_pgd Ben Hutchings
@ 2012-05-09  5:53 ` Ben Hutchings
  2012-05-09  5:53 ` [ 157/167] [PATCH] drm/i915: Do no set Stencil Cache eviction LRA w/a on gen7+ Ben Hutchings
                   ` (10 subsequent siblings)
  166 siblings, 0 replies; 195+ messages in thread
From: Ben Hutchings @ 2012-05-09  5:53 UTC (permalink / raw)
  To: linux-kernel, stable; +Cc: torvalds, akpm, alan, Daniel Vetter, Chris Wilson

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

3.2-stable review patch.  If anyone has any objections, please let me know.

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

From: Daniel Vetter <daniel.vetter@ffwll.ch>

commit 768b107e4b3be0acf6f58e914afe4f337c00932b upstream.

Chris Wilson dug out a hw erratum saying that there's noise on the
interrupt line on i945G chips. We also have a bug report from a i945GM
chip with an sdvo hotplug interrupt storm (and no apparent cause).

Play it safe and disable sdvo hotplug on all i945 variants.

Note that this is a regression that has been introduced in 3.1,
when we've enabled sdvo hotplug support with

commit cc68c81aed7d892deaf12d720d5455208e94cd0a
Author: Simon Farnsworth <simon.farnsworth@onelan.co.uk>
Date:   Wed Sep 21 17:13:30 2011 +0100

    drm/i915: Enable SDVO hotplug interrupts for HDMI and DVI

Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=38442
Reported-and-tested-by: Dominik Köppl <dominik@devwork.org>
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
Signed-Off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
---
 drivers/gpu/drm/i915/intel_sdvo.c |    6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/drivers/gpu/drm/i915/intel_sdvo.c b/drivers/gpu/drm/i915/intel_sdvo.c
index 232d77d..ae5e748 100644
--- a/drivers/gpu/drm/i915/intel_sdvo.c
+++ b/drivers/gpu/drm/i915/intel_sdvo.c
@@ -1220,8 +1220,14 @@ static bool intel_sdvo_get_capabilities(struct intel_sdvo *intel_sdvo, struct in
 
 static int intel_sdvo_supports_hotplug(struct intel_sdvo *intel_sdvo)
 {
+	struct drm_device *dev = intel_sdvo->base.base.dev;
 	u8 response[2];
 
+	/* HW Erratum: SDVO Hotplug is broken on all i945G chips, there's noise
+	 * on the line. */
+	if (IS_I945G(dev) || IS_I945GM(dev))
+		return false;
+
 	return intel_sdvo_get_value(intel_sdvo, SDVO_CMD_GET_HOT_PLUG_SUPPORT,
 				    &response, 2) && response[0];
 }
-- 
1.7.10




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

* [ 157/167] [PATCH] drm/i915: Do no set Stencil Cache eviction LRA w/a on gen7+
  2012-05-09  5:50 [ 000/167] 3.2.17-stable review Ben Hutchings
                   ` (155 preceding siblings ...)
  2012-05-09  5:53 ` [ 156/167] [PATCH] drm/i915: disable sdvo hotplug on i945g/gm Ben Hutchings
@ 2012-05-09  5:53 ` Ben Hutchings
  2012-05-09  5:53 ` [ 158/167] [PATCH] xen/pte: Fix crashes when trying to see non-existent PGD/PMD/PUD/PTEs Ben Hutchings
                   ` (9 subsequent siblings)
  166 siblings, 0 replies; 195+ messages in thread
From: Ben Hutchings @ 2012-05-09  5:53 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: torvalds, akpm, alan, Daniel Vetter, Dave Airlie, Kenneth Graunke

3.2-stable review patch.  If anyone has any objections, please let me know.

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

From: Daniel Vetter <daniel.vetter@ffwll.ch>

commit 2e7a44814d802c8ba479164b8924070cd908d6b5 upstream.

I've flagged this while reviewing the first version and Ken Graunke
fixed it up in v2, but unfortunately Dave Airlie picked up the wrong
version.

Cc: Dave Airlie <airlied@redhat.com>
Cc: Kenneth Graunke <kenneth@whitecape.org>
Signed-Off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
---
 drivers/gpu/drm/i915/intel_ringbuffer.c |    9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/drivers/gpu/drm/i915/intel_ringbuffer.c b/drivers/gpu/drm/i915/intel_ringbuffer.c
index 80fce51..62892a8 100644
--- a/drivers/gpu/drm/i915/intel_ringbuffer.c
+++ b/drivers/gpu/drm/i915/intel_ringbuffer.c
@@ -398,10 +398,8 @@ static int init_render_ring(struct intel_ring_buffer *ring)
 			return ret;
 	}
 
-	if (INTEL_INFO(dev)->gen >= 6) {
-		I915_WRITE(INSTPM,
-			   INSTPM_FORCE_ORDERING << 16 | INSTPM_FORCE_ORDERING);
 
+	if (IS_GEN6(dev)) {
 		/* From the Sandybridge PRM, volume 1 part 3, page 24:
 		 * "If this bit is set, STCunit will have LRA as replacement
 		 *  policy. [...] This bit must be reset.  LRA replacement
@@ -411,6 +409,11 @@ static int init_render_ring(struct intel_ring_buffer *ring)
 			   CM0_STC_EVICT_DISABLE_LRA_SNB << CM0_MASK_SHIFT);
 	}
 
+	if (INTEL_INFO(dev)->gen >= 6) {
+		I915_WRITE(INSTPM,
+			   INSTPM_FORCE_ORDERING << 16 | INSTPM_FORCE_ORDERING);
+	}
+
 	return ret;
 }
 
-- 
1.7.10




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

* [ 158/167] [PATCH] xen/pte: Fix crashes when trying to see non-existent PGD/PMD/PUD/PTEs
  2012-05-09  5:50 [ 000/167] 3.2.17-stable review Ben Hutchings
                   ` (156 preceding siblings ...)
  2012-05-09  5:53 ` [ 157/167] [PATCH] drm/i915: Do no set Stencil Cache eviction LRA w/a on gen7+ Ben Hutchings
@ 2012-05-09  5:53 ` Ben Hutchings
  2012-05-09  5:53 ` [ 159/167] [PATCH] xen/pci: dont use PCI BIOS service for configuration space accesses Ben Hutchings
                   ` (8 subsequent siblings)
  166 siblings, 0 replies; 195+ messages in thread
From: Ben Hutchings @ 2012-05-09  5:53 UTC (permalink / raw)
  To: linux-kernel, stable; +Cc: torvalds, akpm, alan, Konrad Rzeszutek Wilk

3.2-stable review patch.  If anyone has any objections, please let me know.

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

From: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>

commit b7e5ffe5d83fa40d702976d77452004abbe35791 upstream.

If I try to do "cat /sys/kernel/debug/kernel_page_tables"
I end up with:

BUG: unable to handle kernel paging request at ffffc7fffffff000
IP: [<ffffffff8106aa51>] ptdump_show+0x221/0x480
PGD 0
Oops: 0000 [#1] SMP
CPU 0
.. snip..
RAX: 0000000000000000 RBX: ffffc00000000fff RCX: 0000000000000000
RDX: 0000800000000000 RSI: 0000000000000000 RDI: ffffc7fffffff000

which is due to the fact we are trying to access a PFN that is not
accessible to us. The reason (at least in this case) was that
PGD[256] is set to __HYPERVISOR_VIRT_START which was setup (by the
hypervisor) to point to a read-only linear map of the MFN->PFN array.
During our parsing we would get the MFN (a valid one), try to look
it up in the MFN->PFN tree and find it invalid and return ~0 as PFN.
Then pte_mfn_to_pfn would happilly feed that in, attach the flags
and return it back to the caller. 'ptdump_show' bitshifts it and
gets and invalid value that it tries to dereference.

Instead of doing all of that, we detect the ~0 case and just
return !_PAGE_PRESENT.

This bug has been in existence .. at least until 2.6.37 (yikes!)

Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
---
 arch/x86/xen/mmu.c |    7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/arch/x86/xen/mmu.c b/arch/x86/xen/mmu.c
index b8e2794..69f5857 100644
--- a/arch/x86/xen/mmu.c
+++ b/arch/x86/xen/mmu.c
@@ -353,8 +353,13 @@ static pteval_t pte_mfn_to_pfn(pteval_t val)
 {
 	if (val & _PAGE_PRESENT) {
 		unsigned long mfn = (val & PTE_PFN_MASK) >> PAGE_SHIFT;
+		unsigned long pfn = mfn_to_pfn(mfn);
+
 		pteval_t flags = val & PTE_FLAGS_MASK;
-		val = ((pteval_t)mfn_to_pfn(mfn) << PAGE_SHIFT) | flags;
+		if (unlikely(pfn == ~0))
+			val = flags & ~_PAGE_PRESENT;
+		else
+			val = ((pteval_t)pfn << PAGE_SHIFT) | flags;
 	}
 
 	return val;
-- 
1.7.10




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

* [ 159/167] [PATCH] xen/pci: dont use PCI BIOS service for configuration space accesses
  2012-05-09  5:50 [ 000/167] 3.2.17-stable review Ben Hutchings
                   ` (157 preceding siblings ...)
  2012-05-09  5:53 ` [ 158/167] [PATCH] xen/pte: Fix crashes when trying to see non-existent PGD/PMD/PUD/PTEs Ben Hutchings
@ 2012-05-09  5:53 ` Ben Hutchings
  2012-05-09  5:53 ` [ 160/167] [PATCH] percpu, x86: dont use PMD_SIZE as embedded atom_size on 32bit Ben Hutchings
                   ` (7 subsequent siblings)
  166 siblings, 0 replies; 195+ messages in thread
From: Ben Hutchings @ 2012-05-09  5:53 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: torvalds, akpm, alan, David Vrabel, Jan Beulich, Konrad Rzeszutek Wilk

3.2-stable review patch.  If anyone has any objections, please let me know.

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

From: David Vrabel <david.vrabel@citrix.com>

commit 76a8df7b49168509df02461f83fab117a4a86e08 upstream.

The accessing PCI configuration space with the PCI BIOS32 service does
not work in PV guests.

On systems without MMCONFIG or where the BIOS hasn't marked the
MMCONFIG region as reserved in the e820 map, the BIOS service is
probed (even though direct access is preferred) and this hangs.

Acked-by: Jan Beulich <jbeulich@suse.com>
Signed-off-by: David Vrabel <david.vrabel@citrix.com>
[v1: Fixed compile error when CONFIG_PCI is not set]
Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
[bwh: Backported to 3.2: adjust context]
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
---
 arch/x86/xen/enlighten.c |    7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

--- linux.orig/arch/x86/xen/enlighten.c
+++ linux/arch/x86/xen/enlighten.c
@@ -62,6 +62,7 @@
 #include <asm/reboot.h>
 #include <asm/stackprotector.h>
 #include <asm/hypervisor.h>
+#include <asm/pci_x86.h>
 
 #include "xen-ops.h"
 #include "mmu.h"
@@ -1278,8 +1279,10 @@
 		/* Make sure ACS will be enabled */
 		pci_request_acs();
 	}
-		
-
+#ifdef CONFIG_PCI
+	/* PCI BIOS service won't work from a PV guest. */
+	pci_probe &= ~PCI_PROBE_BIOS;
+#endif
 	xen_raw_console_write("about to get started...\n");
 
 	xen_setup_runstate_info(0);



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

* [ 160/167] [PATCH] percpu, x86: dont use PMD_SIZE as embedded atom_size on 32bit
  2012-05-09  5:50 [ 000/167] 3.2.17-stable review Ben Hutchings
                   ` (158 preceding siblings ...)
  2012-05-09  5:53 ` [ 159/167] [PATCH] xen/pci: dont use PCI BIOS service for configuration space accesses Ben Hutchings
@ 2012-05-09  5:53 ` Ben Hutchings
  2012-05-09  5:53 ` [ 161/167] [PATCH] iwlagn: allow up to uCode API 6 for 6000 devices Ben Hutchings
                   ` (6 subsequent siblings)
  166 siblings, 0 replies; 195+ messages in thread
From: Ben Hutchings @ 2012-05-09  5:53 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: torvalds, akpm, alan, Tejun Heo, Yanmin Zhang, ShuoX Liu, H. Peter Anvin

3.2-stable review patch.  If anyone has any objections, please let me know.

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

From: Tejun Heo <tj@kernel.org>

commit d5e28005a1d2e67833852f4c9ea8ec206ea3ff85 upstream.

With the embed percpu first chunk allocator, x86 uses either PAGE_SIZE
or PMD_SIZE for atom_size.  PMD_SIZE is used when CPU supports PSE so
that percpu areas are aligned to PMD mappings and possibly allow using
PMD mappings in vmalloc areas in the future.  Using larger atom_size
doesn't waste actual memory; however, it does require larger vmalloc
space allocation later on for !first chunks.

With reasonably sized vmalloc area, PMD_SIZE shouldn't be a problem
but x86_32 at this point is anything but reasonable in terms of
address space and using larger atom_size reportedly leads to frequent
percpu allocation failures on certain setups.

As there is no reason to not use PMD_SIZE on x86_64 as vmalloc space
is aplenty and most x86_64 configurations support PSE, fix the issue
by always using PMD_SIZE on x86_64 and PAGE_SIZE on x86_32.

v2: drop cpu_has_pse test and make x86_64 always use PMD_SIZE and
    x86_32 PAGE_SIZE as suggested by hpa.

Signed-off-by: Tejun Heo <tj@kernel.org>
Reported-by: Yanmin Zhang <yanmin.zhang@intel.com>
Reported-by: ShuoX Liu <shuox.liu@intel.com>
Acked-by: H. Peter Anvin <hpa@zytor.com>
LKML-Reference: <4F97BA98.6010001@intel.com>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
---
 arch/x86/kernel/setup_percpu.c |   14 +++++++++++++-
 1 file changed, 13 insertions(+), 1 deletion(-)

diff --git a/arch/x86/kernel/setup_percpu.c b/arch/x86/kernel/setup_percpu.c
index 71f4727..5a98aa2 100644
--- a/arch/x86/kernel/setup_percpu.c
+++ b/arch/x86/kernel/setup_percpu.c
@@ -185,10 +185,22 @@ void __init setup_per_cpu_areas(void)
 #endif
 	rc = -EINVAL;
 	if (pcpu_chosen_fc != PCPU_FC_PAGE) {
-		const size_t atom_size = cpu_has_pse ? PMD_SIZE : PAGE_SIZE;
 		const size_t dyn_size = PERCPU_MODULE_RESERVE +
 			PERCPU_DYNAMIC_RESERVE - PERCPU_FIRST_CHUNK_RESERVE;
+		size_t atom_size;
 
+		/*
+		 * On 64bit, use PMD_SIZE for atom_size so that embedded
+		 * percpu areas are aligned to PMD.  This, in the future,
+		 * can also allow using PMD mappings in vmalloc area.  Use
+		 * PAGE_SIZE on 32bit as vmalloc space is highly contended
+		 * and large vmalloc area allocs can easily fail.
+		 */
+#ifdef CONFIG_X86_64
+		atom_size = PMD_SIZE;
+#else
+		atom_size = PAGE_SIZE;
+#endif
 		rc = pcpu_embed_first_chunk(PERCPU_FIRST_CHUNK_RESERVE,
 					    dyn_size, atom_size,
 					    pcpu_cpu_distance,
-- 
1.7.10




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

* [ 161/167] [PATCH] iwlagn: allow up to uCode API 6 for 6000 devices
  2012-05-09  5:50 [ 000/167] 3.2.17-stable review Ben Hutchings
                   ` (159 preceding siblings ...)
  2012-05-09  5:53 ` [ 160/167] [PATCH] percpu, x86: dont use PMD_SIZE as embedded atom_size on 32bit Ben Hutchings
@ 2012-05-09  5:53 ` Ben Hutchings
  2012-05-09  5:53 ` [ 162/167] [PATCH] iwlwifi: use correct released ucode version Ben Hutchings
                   ` (5 subsequent siblings)
  166 siblings, 0 replies; 195+ messages in thread
From: Ben Hutchings @ 2012-05-09  5:53 UTC (permalink / raw)
  To: linux-kernel, stable; +Cc: torvalds, akpm, alan, Johannes Berg, Wey-Yi Guy

3.2-stable review patch.  If anyone has any objections, please let me know.

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

From: Johannes Berg <johannes.berg@intel.com>

commit b914811524fbe9e91fe50845f5d7bd4316b8a6ee upstream.

Since the uCode hasn't been released (yet?),
warn only if using older than API 4, but load
anything up to API 6.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
---
 drivers/net/wireless/iwlwifi/iwl-6000.c |    7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/drivers/net/wireless/iwlwifi/iwl-6000.c b/drivers/net/wireless/iwlwifi/iwl-6000.c
index 09f0378..617ad1c 100644
--- a/drivers/net/wireless/iwlwifi/iwl-6000.c
+++ b/drivers/net/wireless/iwlwifi/iwl-6000.c
@@ -46,11 +46,12 @@
 #include "iwl-cfg.h"
 
 /* Highest firmware API version supported */
-#define IWL6000_UCODE_API_MAX 4
+#define IWL6000_UCODE_API_MAX 6
 #define IWL6050_UCODE_API_MAX 5
 #define IWL6000G2_UCODE_API_MAX 6
 
 /* Oldest version we won't warn about */
+#define IWL6000_UCODE_API_OK 4
 #define IWL6000G2_UCODE_API_OK 5
 
 /* Lowest firmware API version supported */
@@ -457,6 +458,7 @@ struct iwl_cfg iwl130_bg_cfg = {
 #define IWL_DEVICE_6000i					\
 	.fw_name_pre = IWL6000_FW_PRE,				\
 	.ucode_api_max = IWL6000_UCODE_API_MAX,			\
+	.ucode_api_ok = IWL6000_UCODE_API_OK,			\
 	.ucode_api_min = IWL6000_UCODE_API_MIN,			\
 	.valid_tx_ant = ANT_BC,		/* .cfg overwrite */	\
 	.valid_rx_ant = ANT_BC,		/* .cfg overwrite */	\
@@ -535,6 +537,7 @@ struct iwl_cfg iwl6000_3agn_cfg = {
 	.name = "Intel(R) Centrino(R) Ultimate-N 6300 AGN",
 	.fw_name_pre = IWL6000_FW_PRE,
 	.ucode_api_max = IWL6000_UCODE_API_MAX,
+	.ucode_api_ok = IWL6000_UCODE_API_OK,
 	.ucode_api_min = IWL6000_UCODE_API_MIN,
 	.eeprom_ver = EEPROM_6000_EEPROM_VERSION,
 	.eeprom_calib_ver = EEPROM_6000_TX_POWER_VERSION,
@@ -544,7 +547,7 @@ struct iwl_cfg iwl6000_3agn_cfg = {
 	.led_mode = IWL_LED_BLINK,
 };
 
-MODULE_FIRMWARE(IWL6000_MODULE_FIRMWARE(IWL6000_UCODE_API_MAX));
+MODULE_FIRMWARE(IWL6000_MODULE_FIRMWARE(IWL6000_UCODE_API_OK));
 MODULE_FIRMWARE(IWL6050_MODULE_FIRMWARE(IWL6050_UCODE_API_MAX));
 MODULE_FIRMWARE(IWL6005_MODULE_FIRMWARE(IWL6000G2_UCODE_API_MAX));
 MODULE_FIRMWARE(IWL6030_MODULE_FIRMWARE(IWL6000G2_UCODE_API_MAX));
-- 
1.7.10




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

* [ 162/167] [PATCH] iwlwifi: use correct released ucode version
  2012-05-09  5:50 [ 000/167] 3.2.17-stable review Ben Hutchings
                   ` (160 preceding siblings ...)
  2012-05-09  5:53 ` [ 161/167] [PATCH] iwlagn: allow up to uCode API 6 for 6000 devices Ben Hutchings
@ 2012-05-09  5:53 ` Ben Hutchings
  2012-05-09  5:53 ` [ 163/167] [PATCH] iwlwifi: use 6000G2B for 6030 device series Ben Hutchings
                   ` (4 subsequent siblings)
  166 siblings, 0 replies; 195+ messages in thread
From: Ben Hutchings @ 2012-05-09  5:53 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: torvalds, akpm, alan, Meenakshi Venkataraman, Wey-Yi Guy,
	John W. Linville

3.2-stable review patch.  If anyone has any objections, please let me know.

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

From: Meenakshi Venkataraman <meenakshi.venkataraman@intel.com>

commit 78cbcf2b9dbe0565820dc7721316f9c401000a68 upstream.

Report correctly the latest released version
of the iwlwifi firmware for all
iwlwifi-supported devices.

Signed-off-by: Meenakshi Venkataraman <meenakshi.venkataraman@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
[bwh: Backported to 3.2: adjust context]
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
---
 drivers/net/wireless/iwlwifi/iwl-1000.c |    8 ++++----
 drivers/net/wireless/iwlwifi/iwl-2000.c |   16 ++++++++--------
 drivers/net/wireless/iwlwifi/iwl-5000.c |   11 +++++++++--
 drivers/net/wireless/iwlwifi/iwl-6000.c |   10 ++++++----
 4 files changed, 27 insertions(+), 18 deletions(-)

--- linux.orig/drivers/net/wireless/iwlwifi/iwl-1000.c
+++ linux/drivers/net/wireless/iwlwifi/iwl-1000.c
@@ -45,8 +45,8 @@
 #include "iwl-cfg.h"
 
 /* Highest firmware API version supported */
-#define IWL1000_UCODE_API_MAX 6
-#define IWL100_UCODE_API_MAX 6
+#define IWL1000_UCODE_API_MAX 5
+#define IWL100_UCODE_API_MAX 5
 
 /* Oldest version we won't warn about */
 #define IWL1000_UCODE_API_OK 5
@@ -244,5 +244,5 @@
 	IWL_DEVICE_100,
 };
 
-MODULE_FIRMWARE(IWL1000_MODULE_FIRMWARE(IWL1000_UCODE_API_MAX));
-MODULE_FIRMWARE(IWL100_MODULE_FIRMWARE(IWL100_UCODE_API_MAX));
+MODULE_FIRMWARE(IWL1000_MODULE_FIRMWARE(IWL1000_UCODE_API_OK));
+MODULE_FIRMWARE(IWL100_MODULE_FIRMWARE(IWL100_UCODE_API_OK));
--- linux.orig/drivers/net/wireless/iwlwifi/iwl-2000.c
+++ linux/drivers/net/wireless/iwlwifi/iwl-2000.c
@@ -51,10 +51,10 @@
 #define IWL135_UCODE_API_MAX 6
 
 /* Oldest version we won't warn about */
-#define IWL2030_UCODE_API_OK 5
-#define IWL2000_UCODE_API_OK 5
-#define IWL105_UCODE_API_OK 5
-#define IWL135_UCODE_API_OK 5
+#define IWL2030_UCODE_API_OK 6
+#define IWL2000_UCODE_API_OK 6
+#define IWL105_UCODE_API_OK 6
+#define IWL135_UCODE_API_OK 6
 
 /* Lowest firmware API version supported */
 #define IWL2030_UCODE_API_MIN 5
@@ -372,7 +372,7 @@
 	.ht_params = &iwl2000_ht_params,
 };
 
-MODULE_FIRMWARE(IWL2000_MODULE_FIRMWARE(IWL2000_UCODE_API_MAX));
-MODULE_FIRMWARE(IWL2030_MODULE_FIRMWARE(IWL2030_UCODE_API_MAX));
-MODULE_FIRMWARE(IWL105_MODULE_FIRMWARE(IWL105_UCODE_API_MAX));
-MODULE_FIRMWARE(IWL135_MODULE_FIRMWARE(IWL135_UCODE_API_MAX));
+MODULE_FIRMWARE(IWL2000_MODULE_FIRMWARE(IWL2000_UCODE_API_OK));
+MODULE_FIRMWARE(IWL2030_MODULE_FIRMWARE(IWL2030_UCODE_API_OK));
+MODULE_FIRMWARE(IWL105_MODULE_FIRMWARE(IWL105_UCODE_API_OK));
+MODULE_FIRMWARE(IWL135_MODULE_FIRMWARE(IWL135_UCODE_API_OK));
--- linux.orig/drivers/net/wireless/iwlwifi/iwl-5000.c
+++ linux/drivers/net/wireless/iwlwifi/iwl-5000.c
@@ -50,6 +50,10 @@
 #define IWL5000_UCODE_API_MAX 5
 #define IWL5150_UCODE_API_MAX 2
 
+/* Oldest version we won't warn about */
+#define IWL5000_UCODE_API_OK 5
+#define IWL5150_UCODE_API_OK 2
+
 /* Lowest firmware API version supported */
 #define IWL5000_UCODE_API_MIN 1
 #define IWL5150_UCODE_API_MIN 1
@@ -373,6 +377,7 @@
 #define IWL_DEVICE_5000						\
 	.fw_name_pre = IWL5000_FW_PRE,				\
 	.ucode_api_max = IWL5000_UCODE_API_MAX,			\
+	.ucode_api_ok = IWL5000_UCODE_API_OK,			\
 	.ucode_api_min = IWL5000_UCODE_API_MIN,			\
 	.eeprom_ver = EEPROM_5000_EEPROM_VERSION,		\
 	.eeprom_calib_ver = EEPROM_5000_TX_POWER_VERSION,	\
@@ -416,6 +421,7 @@
 	.name = "Intel(R) WiMAX/WiFi Link 5350 AGN",
 	.fw_name_pre = IWL5000_FW_PRE,
 	.ucode_api_max = IWL5000_UCODE_API_MAX,
+	.ucode_api_ok = IWL5000_UCODE_API_OK,
 	.ucode_api_min = IWL5000_UCODE_API_MIN,
 	.eeprom_ver = EEPROM_5050_EEPROM_VERSION,
 	.eeprom_calib_ver = EEPROM_5050_TX_POWER_VERSION,
@@ -429,6 +435,7 @@
 #define IWL_DEVICE_5150						\
 	.fw_name_pre = IWL5150_FW_PRE,				\
 	.ucode_api_max = IWL5150_UCODE_API_MAX,			\
+	.ucode_api_ok = IWL5150_UCODE_API_OK,			\
 	.ucode_api_min = IWL5150_UCODE_API_MIN,			\
 	.eeprom_ver = EEPROM_5050_EEPROM_VERSION,		\
 	.eeprom_calib_ver = EEPROM_5050_TX_POWER_VERSION,	\
@@ -450,5 +457,5 @@
 	IWL_DEVICE_5150,
 };
 
-MODULE_FIRMWARE(IWL5000_MODULE_FIRMWARE(IWL5000_UCODE_API_MAX));
-MODULE_FIRMWARE(IWL5150_MODULE_FIRMWARE(IWL5150_UCODE_API_MAX));
+MODULE_FIRMWARE(IWL5000_MODULE_FIRMWARE(IWL5000_UCODE_API_OK));
+MODULE_FIRMWARE(IWL5150_MODULE_FIRMWARE(IWL5150_UCODE_API_OK));
--- linux.orig/drivers/net/wireless/iwlwifi/iwl-6000.c
+++ linux/drivers/net/wireless/iwlwifi/iwl-6000.c
@@ -53,6 +53,8 @@
 /* Oldest version we won't warn about */
 #define IWL6000_UCODE_API_OK 4
 #define IWL6000G2_UCODE_API_OK 5
+#define IWL6050_UCODE_API_OK 5
+#define IWL6000G2B_UCODE_API_OK 6
 
 /* Lowest firmware API version supported */
 #define IWL6000_UCODE_API_MIN 4
@@ -359,7 +361,7 @@
 #define IWL_DEVICE_6005						\
 	.fw_name_pre = IWL6005_FW_PRE,				\
 	.ucode_api_max = IWL6000G2_UCODE_API_MAX,		\
-	.ucode_api_ok = IWL6000G2_UCODE_API_OK,			\
+	.ucode_api_ok = IWL6000G2B_UCODE_API_OK,		\
 	.ucode_api_min = IWL6000G2_UCODE_API_MIN,		\
 	.eeprom_ver = EEPROM_6005_EEPROM_VERSION,		\
 	.eeprom_calib_ver = EEPROM_6005_TX_POWER_VERSION,	\
@@ -573,6 +575,6 @@
 };
 
 MODULE_FIRMWARE(IWL6000_MODULE_FIRMWARE(IWL6000_UCODE_API_OK));
-MODULE_FIRMWARE(IWL6050_MODULE_FIRMWARE(IWL6050_UCODE_API_MAX));
-MODULE_FIRMWARE(IWL6005_MODULE_FIRMWARE(IWL6000G2_UCODE_API_MAX));
-MODULE_FIRMWARE(IWL6030_MODULE_FIRMWARE(IWL6000G2_UCODE_API_MAX));
+MODULE_FIRMWARE(IWL6050_MODULE_FIRMWARE(IWL6050_UCODE_API_OK));
+MODULE_FIRMWARE(IWL6005_MODULE_FIRMWARE(IWL6000G2_UCODE_API_OK));
+MODULE_FIRMWARE(IWL6030_MODULE_FIRMWARE(IWL6000G2B_UCODE_API_OK));



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

* [ 163/167] [PATCH] iwlwifi: use 6000G2B for 6030 device series
  2012-05-09  5:50 [ 000/167] 3.2.17-stable review Ben Hutchings
                   ` (161 preceding siblings ...)
  2012-05-09  5:53 ` [ 162/167] [PATCH] iwlwifi: use correct released ucode version Ben Hutchings
@ 2012-05-09  5:53 ` Ben Hutchings
  2012-05-09  5:53 ` [ 164/167] [PATCH] exit_signal: simplify the "we have changed execution domain" logic Ben Hutchings
                   ` (3 subsequent siblings)
  166 siblings, 0 replies; 195+ messages in thread
From: Ben Hutchings @ 2012-05-09  5:53 UTC (permalink / raw)
  To: linux-kernel, stable; +Cc: torvalds, akpm, alan, Wey-Yi Guy, John W. Linville

3.2-stable review patch.  If anyone has any objections, please let me know.

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

From: Wey-Yi Guy <wey-yi.w.guy@intel.com>

commit 1ed2ec37b44e86eaa8e0a03b908a39c80f65ee45 upstream.

"iwlwifi: use correct released ucode version" change
the ucode api ok from 6000G2 to 6000G2B, but it shall belong
to 6030 device series, not the 6005 device series. Fix it

Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
[bwh: Backported to 3.2: adjust context]
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
---
 drivers/net/wireless/iwlwifi/iwl-6000.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

--- linux.orig/drivers/net/wireless/iwlwifi/iwl-6000.c
+++ linux/drivers/net/wireless/iwlwifi/iwl-6000.c
@@ -361,7 +361,7 @@
 #define IWL_DEVICE_6005						\
 	.fw_name_pre = IWL6005_FW_PRE,				\
 	.ucode_api_max = IWL6000G2_UCODE_API_MAX,		\
-	.ucode_api_ok = IWL6000G2B_UCODE_API_OK,		\
+	.ucode_api_ok = IWL6000G2_UCODE_API_OK,			\
 	.ucode_api_min = IWL6000G2_UCODE_API_MIN,		\
 	.eeprom_ver = EEPROM_6005_EEPROM_VERSION,		\
 	.eeprom_calib_ver = EEPROM_6005_TX_POWER_VERSION,	\
@@ -402,7 +402,7 @@
 #define IWL_DEVICE_6030						\
 	.fw_name_pre = IWL6030_FW_PRE,				\
 	.ucode_api_max = IWL6000G2_UCODE_API_MAX,		\
-	.ucode_api_ok = IWL6000G2_UCODE_API_OK,			\
+	.ucode_api_ok = IWL6000G2B_UCODE_API_OK,		\
 	.ucode_api_min = IWL6000G2_UCODE_API_MIN,		\
 	.eeprom_ver = EEPROM_6030_EEPROM_VERSION,		\
 	.eeprom_calib_ver = EEPROM_6030_TX_POWER_VERSION,	\



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

* [ 164/167] [PATCH] exit_signal: simplify the "we have changed execution domain" logic
  2012-05-09  5:50 [ 000/167] 3.2.17-stable review Ben Hutchings
                   ` (162 preceding siblings ...)
  2012-05-09  5:53 ` [ 163/167] [PATCH] iwlwifi: use 6000G2B for 6030 device series Ben Hutchings
@ 2012-05-09  5:53 ` Ben Hutchings
  2012-05-09  5:53 ` [ 165/167] [PATCH] exit_signal: fix the "parent has changed security " Ben Hutchings
                   ` (2 subsequent siblings)
  166 siblings, 0 replies; 195+ messages in thread
From: Ben Hutchings @ 2012-05-09  5:53 UTC (permalink / raw)
  To: linux-kernel, stable; +Cc: torvalds, akpm, alan, Oleg Nesterov

3.2-stable review patch.  If anyone has any objections, please let me know.

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

From: Oleg Nesterov <oleg@redhat.com>

commit e636825346b36a07ccfc8e30946d52855e21f681 upstream.

exit_notify() checks "tsk->self_exec_id != tsk->parent_exec_id"
to handle the "we have changed execution domain" case.

We can change do_thread() to always set ->exit_signal = SIGCHLD
and remove this check to simplify the code.

We could change setup_new_exec() instead, this looks more logical
because it increments ->self_exec_id. But note that de_thread()
already resets ->exit_signal if it changes the leader, let's keep
both changes close to each other.

Note that we change ->exit_signal lockless, this changes the rules.
Thereafter ->exit_signal is not stable under tasklist but this is
fine, the only possible change is OLDSIG -> SIGCHLD. This can race
with eligible_child() but the race is harmless. We can race with
reparent_leader() which changes our ->exit_signal in parallel, but
it does the same change to SIGCHLD.

The noticeable user-visible change is that the execing task is not
"visible" to do_wait()->eligible_child(__WCLONE) right after exec.
To me this looks more logical, and this is consistent with mt case.

Signed-off-by: Oleg Nesterov <oleg@redhat.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
---
 fs/exec.c     |    3 +++
 kernel/exit.c |    7 +------
 2 files changed, 4 insertions(+), 6 deletions(-)

diff --git a/fs/exec.c b/fs/exec.c
index b0695a9..1e94d22 100644
--- a/fs/exec.c
+++ b/fs/exec.c
@@ -977,6 +977,9 @@ static int de_thread(struct task_struct *tsk)
 	sig->notify_count = 0;
 
 no_thread_group:
+	/* we have changed execution domain */
+	tsk->exit_signal = SIGCHLD;
+
 	if (current->mm)
 		setmax_mm_hiwater_rss(&sig->maxrss, current->mm);
 
diff --git a/kernel/exit.c b/kernel/exit.c
index 752d2c0..51ac4ce 100644
--- a/kernel/exit.c
+++ b/kernel/exit.c
@@ -827,14 +827,9 @@ static void exit_notify(struct task_struct *tsk, int group_dead)
 	 * If the parent exec id doesn't match the exec id we saved
 	 * when we started then we know the parent has changed security
 	 * domain.
-	 *
-	 * If our self_exec id doesn't match our parent_exec_id then
-	 * we have changed execution domain as these two values started
-	 * the same after a fork.
 	 */
 	if (thread_group_leader(tsk) && tsk->exit_signal != SIGCHLD &&
-	    (tsk->parent_exec_id != tsk->real_parent->self_exec_id ||
-	     tsk->self_exec_id != tsk->parent_exec_id))
+	    tsk->parent_exec_id != tsk->real_parent->self_exec_id)
 		tsk->exit_signal = SIGCHLD;
 
 	if (unlikely(tsk->ptrace)) {
-- 
1.7.10




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

* [ 165/167] [PATCH] exit_signal: fix the "parent has changed security domain" logic
  2012-05-09  5:50 [ 000/167] 3.2.17-stable review Ben Hutchings
                   ` (163 preceding siblings ...)
  2012-05-09  5:53 ` [ 164/167] [PATCH] exit_signal: simplify the "we have changed execution domain" logic Ben Hutchings
@ 2012-05-09  5:53 ` Ben Hutchings
  2012-05-09  5:53 ` [ 166/167] [PATCH] staging: r8712u: Fix regression caused by commit 8c213fa Ben Hutchings
  2012-05-09  5:53 ` [ 167/167] [PATCH] smsc95xx: mark link down on startup and let PHY interrupt deal with carrier changes Ben Hutchings
  166 siblings, 0 replies; 195+ messages in thread
From: Ben Hutchings @ 2012-05-09  5:53 UTC (permalink / raw)
  To: linux-kernel, stable; +Cc: torvalds, akpm, alan, Oleg Nesterov

3.2-stable review patch.  If anyone has any objections, please let me know.

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

From: Oleg Nesterov <oleg@redhat.com>

commit b6e238dceed36891cc633167afe7151f1f3d83c5 upstream.

exit_notify() changes ->exit_signal if the parent already did exec.
This doesn't really work, we are not going to send the signal now
if there is another live thread or the exiting task is traced. The
parent can exec before the last dies or the tracer detaches.

Move this check into do_notify_parent() which actually sends the
signal.

The user-visible change is that we do not change ->exit_signal,
and thus the exiting task is still "clone children" for
do_wait()->eligible_child(__WCLONE). Hopefully this is fine, the
current logic is racy anyway.

Signed-off-by: Oleg Nesterov <oleg@redhat.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
---
 kernel/exit.c   |   14 --------------
 kernel/signal.c |    9 +++++++++
 2 files changed, 9 insertions(+), 14 deletions(-)

diff --git a/kernel/exit.c b/kernel/exit.c
index 51ac4ce..ce5f758 100644
--- a/kernel/exit.c
+++ b/kernel/exit.c
@@ -818,20 +818,6 @@ static void exit_notify(struct task_struct *tsk, int group_dead)
 	if (group_dead)
 		kill_orphaned_pgrp(tsk->group_leader, NULL);
 
-	/* Let father know we died
-	 *
-	 * Thread signals are configurable, but you aren't going to use
-	 * that to send signals to arbitrary processes.
-	 * That stops right now.
-	 *
-	 * If the parent exec id doesn't match the exec id we saved
-	 * when we started then we know the parent has changed security
-	 * domain.
-	 */
-	if (thread_group_leader(tsk) && tsk->exit_signal != SIGCHLD &&
-	    tsk->parent_exec_id != tsk->real_parent->self_exec_id)
-		tsk->exit_signal = SIGCHLD;
-
 	if (unlikely(tsk->ptrace)) {
 		int sig = thread_group_leader(tsk) &&
 				thread_group_empty(tsk) &&
diff --git a/kernel/signal.c b/kernel/signal.c
index 8511e39..e76001c 100644
--- a/kernel/signal.c
+++ b/kernel/signal.c
@@ -1652,6 +1652,15 @@ bool do_notify_parent(struct task_struct *tsk, int sig)
 	BUG_ON(!tsk->ptrace &&
 	       (tsk->group_leader != tsk || !thread_group_empty(tsk)));
 
+	if (sig != SIGCHLD) {
+		/*
+		 * This is only possible if parent == real_parent.
+		 * Check if it has changed security domain.
+		 */
+		if (tsk->parent_exec_id != tsk->parent->self_exec_id)
+			sig = SIGCHLD;
+	}
+
 	info.si_signo = sig;
 	info.si_errno = 0;
 	/*
-- 
1.7.10




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

* [ 166/167] [PATCH] staging: r8712u: Fix regression caused by commit 8c213fa
  2012-05-09  5:50 [ 000/167] 3.2.17-stable review Ben Hutchings
                   ` (164 preceding siblings ...)
  2012-05-09  5:53 ` [ 165/167] [PATCH] exit_signal: fix the "parent has changed security " Ben Hutchings
@ 2012-05-09  5:53 ` Ben Hutchings
  2012-05-09 19:49   ` Herton Ronaldo Krzesinski
  2012-05-09  5:53 ` [ 167/167] [PATCH] smsc95xx: mark link down on startup and let PHY interrupt deal with carrier changes Ben Hutchings
  166 siblings, 1 reply; 195+ messages in thread
From: Ben Hutchings @ 2012-05-09  5:53 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: torvalds, akpm, alan, Larry Finger, Alberto Lago Ballesteros,
	Adrian, Greg Kroah-Hartman

3.2-stable review patch.  If anyone has any objections, please let me know.

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

From: Larry Finger <Larry.Finger@lwfinger.net>

commit 2080913e017ab9f88379d93fd09546ad95faf87b upstream.

In commit 8c213fa "staging: r8712u: Use asynchronous firmware loading",
the command to release the firmware was placed in the wrong routine.

In combination with the bug introduced in commit a5ee652 "staging: r8712u:
Interface-state not fully tracked", the driver attempts to upload firmware
that had already been released. This bug is the source of one of the
problems in https://bugs.archlinux.org/task/27996#comment89833.

Tested-by: Alberto Lago Ballesteros <saniukeokusainaya@gmail.com>
Tested-by: Adrian <agib@gmx.de>
Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
---
 drivers/staging/rtl8712/os_intfs.c |    3 ---
 drivers/staging/rtl8712/usb_intf.c |    5 +++++
 2 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/drivers/staging/rtl8712/os_intfs.c b/drivers/staging/rtl8712/os_intfs.c
index 4cf175f..7bbd53a 100644
--- a/drivers/staging/rtl8712/os_intfs.c
+++ b/drivers/staging/rtl8712/os_intfs.c
@@ -475,9 +475,6 @@ static int netdev_close(struct net_device *pnetdev)
 	r8712_free_assoc_resources(padapter);
 	/*s2-4.*/
 	r8712_free_network_queue(padapter);
-	release_firmware(padapter->fw);
-	/* never exit with a firmware callback pending */
-	wait_for_completion(&padapter->rtl8712_fw_ready);
 	return 0;
 }
 
diff --git a/drivers/staging/rtl8712/usb_intf.c b/drivers/staging/rtl8712/usb_intf.c
index fe0e2ff..e01fe14 100644
--- a/drivers/staging/rtl8712/usb_intf.c
+++ b/drivers/staging/rtl8712/usb_intf.c
@@ -30,6 +30,7 @@
 
 #include <linux/usb.h>
 #include <linux/module.h>
+#include <linux/firmware.h>
 
 #include "osdep_service.h"
 #include "drv_types.h"
@@ -620,6 +621,10 @@ static void r871xu_dev_remove(struct usb_interface *pusb_intf)
 	struct _adapter *padapter = netdev_priv(pnetdev);
 	struct usb_device *udev = interface_to_usbdev(pusb_intf);
 
+	if (padapter->fw_found)
+		release_firmware(padapter->fw);
+	/* never exit with a firmware callback pending */
+	wait_for_completion(&padapter->rtl8712_fw_ready);
 	usb_set_intfdata(pusb_intf, NULL);
 	if (padapter) {
 		if (drvpriv.drv_registered == true)
-- 
1.7.10




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

* [ 167/167] [PATCH] smsc95xx: mark link down on startup and let PHY interrupt deal with carrier changes
  2012-05-09  5:50 [ 000/167] 3.2.17-stable review Ben Hutchings
                   ` (165 preceding siblings ...)
  2012-05-09  5:53 ` [ 166/167] [PATCH] staging: r8712u: Fix regression caused by commit 8c213fa Ben Hutchings
@ 2012-05-09  5:53 ` Ben Hutchings
  166 siblings, 0 replies; 195+ messages in thread
From: Ben Hutchings @ 2012-05-09  5:53 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: torvalds, akpm, alan, Paolo Pisati, Steve Glendinning, David S. Miller

3.2-stable review patch.  If anyone has any objections, please let me know.

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

From: Paolo Pisati <paolo.pisati@canonical.com>

commit 07d69d4238418746a7b85c5d05ec17c658a2a390 upstream.

Without this patch sysfs reports the cable as present

flag@flag-desktop:~$ cat /sys/class/net/eth0/carrier
1

while it's not:

flag@flag-desktop:~$ sudo mii-tool eth0
eth0: no link

Tested on my Beagle XM.

v2: added mantainer to the list of recipient

Signed-off-by: Paolo Pisati <paolo.pisati@canonical.com>
Acked-by: Steve Glendinning <steve.glendinning@shawell.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
---
 drivers/net/usb/smsc95xx.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/usb/smsc95xx.c b/drivers/net/usb/smsc95xx.c
index 53a1ba5..94ae669 100644
--- a/drivers/net/usb/smsc95xx.c
+++ b/drivers/net/usb/smsc95xx.c
@@ -1192,7 +1192,7 @@ static const struct driver_info smsc95xx_info = {
 	.rx_fixup	= smsc95xx_rx_fixup,
 	.tx_fixup	= smsc95xx_tx_fixup,
 	.status		= smsc95xx_status,
-	.flags		= FLAG_ETHER | FLAG_SEND_ZLP,
+	.flags		= FLAG_ETHER | FLAG_SEND_ZLP | FLAG_LINK_INTR,
 };
 
 static const struct usb_device_id products[] = {
-- 
1.7.10




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

* Re: [ 153/167] [PATCH] x86, relocs: Remove an unused variable
  2012-05-09  5:53 ` [ 153/167] [PATCH] x86, relocs: Remove an unused variable Ben Hutchings
@ 2012-05-09  6:16   ` Jonathan Nieder
  0 siblings, 0 replies; 195+ messages in thread
From: Jonathan Nieder @ 2012-05-09  6:16 UTC (permalink / raw)
  To: Ben Hutchings
  Cc: linux-kernel, stable, torvalds, akpm, alan, Kusanagi Kouichi,
	H. Peter Anvin

Hi,

Ben Hutchings wrote:

> 3.2-stable review patch.  If anyone has any objections, please let me know.
[...]
> commit 7c77cda0fe742ed07622827ce80963bbeebd1e3f upstream.
>
> sh_symtab is set but not used.
>
> [ hpa: putting this in urgent because of the sheer harmlessness of the patch:
>   it quiets a build warning but does not change any generated code. ]
[...]
> --- a/arch/x86/boot/compressed/relocs.c
> +++ b/arch/x86/boot/compressed/relocs.c
> @@ -403,13 +403,11 @@ static void print_absolute_symbols(void)
>  	for (i = 0; i < ehdr.e_shnum; i++) {
>  		struct section *sec = &secs[i];
>  		char *sym_strtab;
> -		Elf32_Sym *sh_symtab;
>  		int j;
>  
>  		if (sec->shdr.sh_type != SHT_SYMTAB) {
>  			continue;
>  		}
> -		sh_symtab = sec->symtab;

This patch is a no-op.

The explanation in brackets above makes perfect sense in the context
of mainline, but I don't think this belongs in stable.

Thanks,
Jonathan

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

* Re: [ 116/167] [PATCH] USB: EHCI: fix crash during suspend on ASUS computers
  2012-05-09  5:52 ` [ 116/167] [PATCH] USB: EHCI: fix crash during suspend on ASUS computers Ben Hutchings
@ 2012-05-09  6:25   ` Oleksij Rempel
  2012-05-09 14:20     ` Greg Kroah-Hartman
  0 siblings, 1 reply; 195+ messages in thread
From: Oleksij Rempel @ 2012-05-09  6:25 UTC (permalink / raw)
  To: Ben Hutchings
  Cc: linux-kernel, stable, torvalds, akpm, alan, Alan Stern,
	Steven Rostedt, Andrey Rahmatullin, Greg Kroah-Hartman

What is actually with acpi fix of this problem? Will be this patch
removed and acpi fix applied instead?

Am 09.05.2012 07:52, schrieb Ben Hutchings:
> 3.2-stable review patch.  If anyone has any objections, please let me know.
> 
> ------------------
> 
> From: Alan Stern <stern@rowland.harvard.edu>
> 
> commit 151b61284776be2d6f02d48c23c3625678960b97 upstream.
> 
> This patch (as1545) fixes a problem affecting several ASUS computers:
> The machine crashes or corrupts memory when going into suspend if the
> ehci-hcd driver is bound to any controllers.  Users have been forced
> to unbind or unload ehci-hcd before putting their systems to sleep.
> 
> After extensive testing, it was determined that the machines don't
> like going into suspend when any EHCI controllers are in the PCI D3
> power state.  Presumably this is a firmware bug, but there's nothing
> we can do about it except to avoid putting the controllers in D3
> during system sleep.
> 
> The patch adds a new flag to indicate whether the problem is present,
> and avoids changing the controller's power state if the flag is set.
> Runtime suspend is unaffected; this matters only for system suspend.
> However as a side effect, the controller will not respond to remote
> wakeup requests while the system is asleep.  Hence USB wakeup is not
> functional -- but of course, this is already true in the current state
> of affairs.
> 
> This fixes Bugzilla #42728.
> 
> Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
> Tested-by: Steven Rostedt <rostedt@goodmis.org>
> Tested-by: Andrey Rahmatullin <wrar@wrar.name>
> Tested-by: Oleksij Rempel (fishor) <bug-track@fisher-privat.net>
> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
> [bwh: Backported to 3.2: adjust context]
> Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
> ---
>  drivers/usb/core/hcd-pci.c  |    9 +++++++++
>  drivers/usb/host/ehci-pci.c |    8 ++++++++
>  include/linux/usb/hcd.h     |    2 ++
>  3 files changed, 19 insertions(+)
> 
> --- linux.orig/drivers/usb/core/hcd-pci.c
> +++ linux/drivers/usb/core/hcd-pci.c
> @@ -495,6 +495,15 @@
>  
>  	pci_save_state(pci_dev);
>  
> +	/*
> +	 * Some systems crash if an EHCI controller is in D3 during
> +	 * a sleep transition.  We have to leave such controllers in D0.
> +	 */
> +	if (hcd->broken_pci_sleep) {
> +		dev_dbg(dev, "Staying in PCI D0\n");
> +		return retval;
> +	}
> +
>  	/* If the root hub is dead rather than suspended, disallow remote
>  	 * wakeup.  usb_hc_died() should ensure that both hosts are marked as
>  	 * dying, so we only need to check the primary roothub.
> --- linux.orig/drivers/usb/host/ehci-pci.c
> +++ linux/drivers/usb/host/ehci-pci.c
> @@ -144,6 +144,14 @@
>  			hcd->has_tt = 1;
>  			tdi_reset(ehci);
>  		}
> +		if (pdev->subsystem_vendor == PCI_VENDOR_ID_ASUSTEK) {
> +			/* EHCI #1 or #2 on 6 Series/C200 Series chipset */
> +			if (pdev->device == 0x1c26 || pdev->device == 0x1c2d) {
> +				ehci_info(ehci, "broken D3 during system sleep on ASUS\n");
> +				hcd->broken_pci_sleep = 1;
> +				device_set_wakeup_capable(&pdev->dev, false);
> +			}
> +		}
>  		break;
>  	case PCI_VENDOR_ID_TDI:
>  		if (pdev->device == PCI_DEVICE_ID_TDI_EHCI) {
> --- linux.orig/include/linux/usb/hcd.h
> +++ linux/include/linux/usb/hcd.h
> @@ -128,6 +128,8 @@
>  	unsigned		wireless:1;	/* Wireless USB HCD */
>  	unsigned		authorized_default:1;
>  	unsigned		has_tt:1;	/* Integrated TT in root hub */
> +	unsigned		broken_pci_sleep:1;	/* Don't put the
> +			controller in PCI-D3 for system sleep */
>  
>  	int			irq;		/* irq allocated */
>  	void __iomem		*regs;		/* device memory/io */
> 
> 


-- 
Regards,
Oleksij

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

* Re: [ 024/167] [PATCH] md: dont call ->add_disk unless there is good reason.
  2012-05-09  5:50 ` [ 024/167] [PATCH] md: dont call ->add_disk unless there is good reason Ben Hutchings
@ 2012-05-09  6:57   ` Jonathan Nieder
  2012-05-09  7:20     ` NeilBrown
  0 siblings, 1 reply; 195+ messages in thread
From: Jonathan Nieder @ 2012-05-09  6:57 UTC (permalink / raw)
  To: Ben Hutchings
  Cc: linux-kernel, stable, torvalds, akpm, alan, NeilBrown, Jan Ceuleers

Hi,

Ben Hutchings wrote:

> 3.2-stable review patch.  If anyone has any objections, please let me know.
[...]
> commit ed209584c38fb74b7eecc03e5b1bfe674e591bd8 upstream.
>
> Commit 7bfec5f35c68121e7b18
>
>    md/raid5: If there is a spare and a want_replacement device, start replacement.
>
> cause md_check_recovery to call ->add_disk much more often.
> Instead of only when the array is degraded, it is now called whenever
> md_check_recovery finds anything useful to do, which includes
> updating the metadata for clean<->dirty transition.
> This causes unnecessary work, and causes info messages from ->add_disk
> to be reported much too often.

Does 3.2.y need this?  Commit 7bfec5f35c68121e7b18 (aka v3.3-rc3~3^2~22)
does not seem to be part of the 3.2-stable tree.

Jonathan

> So refine md_check_recovery to only do any actual recovery checking
> (including ->add_disk) if MD_RECOVERY_NEEDED is set.
> 
> This fix is suitable for 3.3.y:
> 
> Reported-by: Jan Ceuleers <jan.ceuleers@computer.org>
> Signed-off-by: NeilBrown <neilb@suse.de>
> Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
> ---
>  drivers/md/md.c |    4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/md/md.c b/drivers/md/md.c
> index b572e1e..8beb19c 100644
> --- a/drivers/md/md.c
> +++ b/drivers/md/md.c
> @@ -7560,14 +7560,14 @@ void md_check_recovery(struct mddev *mddev)
>  		 * any transients in the value of "sync_action".
>  		 */
>  		set_bit(MD_RECOVERY_RUNNING, &mddev->recovery);
> -		clear_bit(MD_RECOVERY_NEEDED, &mddev->recovery);
>  		/* Clear some bits that don't mean anything, but
>  		 * might be left set
>  		 */
>  		clear_bit(MD_RECOVERY_INTR, &mddev->recovery);
>  		clear_bit(MD_RECOVERY_DONE, &mddev->recovery);
>  
> -		if (test_bit(MD_RECOVERY_FROZEN, &mddev->recovery))
> +		if (!test_and_clear_bit(MD_RECOVERY_NEEDED, &mddev->recovery) ||
> +		    test_bit(MD_RECOVERY_FROZEN, &mddev->recovery))
>  			goto unlock;
>  		/* no recovery is running.
>  		 * remove any failed drives, then

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

* Re: [ 061/167] [PATCH] nfsd: dont fail unchecked creates of non-special files
  2012-05-09  5:51 ` [ 061/167] [PATCH] nfsd: dont fail unchecked creates of non-special files Ben Hutchings
@ 2012-05-09  7:07   ` Jonathan Nieder
  2012-05-09 12:36     ` Ben Hutchings
  0 siblings, 1 reply; 195+ messages in thread
From: Jonathan Nieder @ 2012-05-09  7:07 UTC (permalink / raw)
  To: Greg Kroah-Hartman
  Cc: Ben Hutchings, linux-kernel, stable, torvalds, akpm, alan,
	J. Bruce Fields, Orion Poplawski

Ben Hutchings wrote:

> 3.2-stable review patch.
[...]
> commit 9dc4e6c4d1182d34604ea40fef641775f5b15456 upstream.
[...]
> [bwh: Backported to 3.2: use &resfh, not resfh]
> Signed-off-by: Ben Hutchings <ben@decadent.org.uk>

Looks good.  Greg, I think this backport can be reused for 3.3.y,
where the upstream patch similarly does not apply for lack of
v3.4-rc1~40^2~19 ("nfsd4: reduce do_open_lookup() stack usage").

Thanks,
Jonathan

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

* Re: [ 024/167] [PATCH] md: dont call ->add_disk unless there is good reason.
  2012-05-09  6:57   ` Jonathan Nieder
@ 2012-05-09  7:20     ` NeilBrown
  2012-05-09 12:34       ` Ben Hutchings
  0 siblings, 1 reply; 195+ messages in thread
From: NeilBrown @ 2012-05-09  7:20 UTC (permalink / raw)
  To: Jonathan Nieder
  Cc: Ben Hutchings, linux-kernel, stable, torvalds, akpm, alan, Jan Ceuleers

[-- Attachment #1: Type: text/plain, Size: 2384 bytes --]

On Wed, 9 May 2012 01:57:17 -0500 Jonathan Nieder <jrnieder@gmail.com> wrote:

> Hi,
> 
> Ben Hutchings wrote:
> 
> > 3.2-stable review patch.  If anyone has any objections, please let me know.
> [...]
> > commit ed209584c38fb74b7eecc03e5b1bfe674e591bd8 upstream.
> >
> > Commit 7bfec5f35c68121e7b18
> >
> >    md/raid5: If there is a spare and a want_replacement device, start replacement.
> >
> > cause md_check_recovery to call ->add_disk much more often.
> > Instead of only when the array is degraded, it is now called whenever
> > md_check_recovery finds anything useful to do, which includes
> > updating the metadata for clean<->dirty transition.
> > This causes unnecessary work, and causes info messages from ->add_disk
> > to be reported much too often.
> 
> Does 3.2.y need this?  Commit 7bfec5f35c68121e7b18 (aka v3.3-rc3~3^2~22)
> does not seem to be part of the 3.2-stable tree.
> 
> Jonathan

Thanks for checking!

Probably not needed then, but it wouldn't be harmful.

NeilBrown


> 
> > So refine md_check_recovery to only do any actual recovery checking
> > (including ->add_disk) if MD_RECOVERY_NEEDED is set.
> > 
> > This fix is suitable for 3.3.y:
> > 
> > Reported-by: Jan Ceuleers <jan.ceuleers@computer.org>
> > Signed-off-by: NeilBrown <neilb@suse.de>
> > Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
> > ---
> >  drivers/md/md.c |    4 ++--
> >  1 file changed, 2 insertions(+), 2 deletions(-)
> > 
> > diff --git a/drivers/md/md.c b/drivers/md/md.c
> > index b572e1e..8beb19c 100644
> > --- a/drivers/md/md.c
> > +++ b/drivers/md/md.c
> > @@ -7560,14 +7560,14 @@ void md_check_recovery(struct mddev *mddev)
> >  		 * any transients in the value of "sync_action".
> >  		 */
> >  		set_bit(MD_RECOVERY_RUNNING, &mddev->recovery);
> > -		clear_bit(MD_RECOVERY_NEEDED, &mddev->recovery);
> >  		/* Clear some bits that don't mean anything, but
> >  		 * might be left set
> >  		 */
> >  		clear_bit(MD_RECOVERY_INTR, &mddev->recovery);
> >  		clear_bit(MD_RECOVERY_DONE, &mddev->recovery);
> >  
> > -		if (test_bit(MD_RECOVERY_FROZEN, &mddev->recovery))
> > +		if (!test_and_clear_bit(MD_RECOVERY_NEEDED, &mddev->recovery) ||
> > +		    test_bit(MD_RECOVERY_FROZEN, &mddev->recovery))
> >  			goto unlock;
> >  		/* no recovery is running.
> >  		 * remove any failed drives, then


[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 828 bytes --]

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

* Re: [ 074/167] [PATCH 14/26] tcp: fix tcp_trim_head()
  2012-05-09  5:51 ` [ 074/167] [PATCH 14/26] tcp: fix tcp_trim_head() Ben Hutchings
@ 2012-05-09  8:16   ` Jonathan Nieder
  2012-05-11  3:00     ` Ben Hutchings
  0 siblings, 1 reply; 195+ messages in thread
From: Jonathan Nieder @ 2012-05-09  8:16 UTC (permalink / raw)
  To: Ben Hutchings
  Cc: linux-kernel, stable, torvalds, akpm, alan, Eric Dumazet,
	Vijay Subramanian, David S. Miller

Ben Hutchings wrote:

> 3.2-stable review patch.  If anyone has any objections, please let me know.
[...]
> [ Upstream commit 4fa48bf3c75069d636fc8830743c929a062e80dc ]
>
> commit f07d960df3 (tcp: avoid frag allocation for small frames)
> breaked assumption in tcp stack that skb is either linear (skb->data_len
> == 0), or fully fragged (skb->data_len == skb->len)
>
> tcp_trim_head() made this assumption, we must fix it.

Is this needed in the context of 3.2.y (which does not include
f07d960df3)?

Curious,
Jonathan

> Thanks to Vijay for providing a very detailed explanation.
>
> Reported-by: Vijay Subramanian <subramanian.vijay@gmail.com>
> Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
> Signed-off-by: David S. Miller <davem@davemloft.net>
> Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
> ---
>  net/ipv4/tcp_output.c |   13 ++++++++-----
>  1 file changed, 8 insertions(+), 5 deletions(-)
>
> diff --git a/net/ipv4/tcp_output.c b/net/ipv4/tcp_output.c
> index 097e0c7..7413437 100644
> --- a/net/ipv4/tcp_output.c
> +++ b/net/ipv4/tcp_output.c
> @@ -1093,6 +1093,13 @@ static void __pskb_trim_head(struct sk_buff *skb, int len)
>  {
>  	int i, k, eat;
>  
> +	eat = min_t(int, len, skb_headlen(skb));
> +	if (eat) {
> +		__skb_pull(skb, eat);
> +		len -= eat;
> +		if (!len)
> +			return;
> +	}
>  	eat = len;
>  	k = 0;
>  	for (i = 0; i < skb_shinfo(skb)->nr_frags; i++) {
> @@ -1124,11 +1131,7 @@ int tcp_trim_head(struct sock *sk, struct sk_buff *skb, u32 len)
>  	if (skb_cloned(skb) && pskb_expand_head(skb, 0, 0, GFP_ATOMIC))
>  		return -ENOMEM;
>  
> -	/* If len == headlen, we avoid __skb_pull to preserve alignment. */
> -	if (unlikely(len < skb_headlen(skb)))
> -		__skb_pull(skb, len);
> -	else
> -		__pskb_trim_head(skb, len - skb_headlen(skb));
> +	__pskb_trim_head(skb, len);
>  
>  	TCP_SKB_CB(skb)->seq += len;
>  	skb->ip_summed = CHECKSUM_PARTIAL;
> -- 
> 1.7.10

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

* Re: [ 075/167] [PATCH 15/26] tcp: avoid order-1 allocations on wifi and tx path
  2012-05-09  5:51 ` [ 075/167] [PATCH 15/26] tcp: avoid order-1 allocations on wifi and tx path Ben Hutchings
@ 2012-05-09  8:19   ` Jonathan Nieder
  0 siblings, 0 replies; 195+ messages in thread
From: Jonathan Nieder @ 2012-05-09  8:19 UTC (permalink / raw)
  To: Ben Hutchings
  Cc: linux-kernel, stable, torvalds, akpm, alan, Eric Dumazet,
	Marc MERLIN, David S. Miller

Ben Hutchings wrote:

> 3.2-stable review patch.
[...]
> [ This combines upstream commit
>   a21d45726acacc963d8baddf74607d9b74e2b723 and the follow-on bug fix
>   commit 22b4a4f22da4b39c6f7f679fd35f3d35c91bf851 ]

If patch 074 ("tcp: fix tcp_trim_head()") were dropped, then the
follow-on bug fix 22b4a4f22da4 presumably would not be needed any
more.  (Commit a21d45726aca applies cleanly on top of 3.2.y, but I
haven't tested the result.)

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

* Re: [ 024/167] [PATCH] md: dont call ->add_disk unless there is good reason.
  2012-05-09  7:20     ` NeilBrown
@ 2012-05-09 12:34       ` Ben Hutchings
  0 siblings, 0 replies; 195+ messages in thread
From: Ben Hutchings @ 2012-05-09 12:34 UTC (permalink / raw)
  To: NeilBrown
  Cc: Jonathan Nieder, linux-kernel, stable, torvalds, akpm, alan,
	Jan Ceuleers

[-- Attachment #1: Type: text/plain, Size: 1468 bytes --]

On Wed, 2012-05-09 at 17:20 +1000, NeilBrown wrote:
> On Wed, 9 May 2012 01:57:17 -0500 Jonathan Nieder <jrnieder@gmail.com> wrote:
> 
> > Hi,
> > 
> > Ben Hutchings wrote:
> > 
> > > 3.2-stable review patch.  If anyone has any objections, please let me know.
> > [...]
> > > commit ed209584c38fb74b7eecc03e5b1bfe674e591bd8 upstream.
> > >
> > > Commit 7bfec5f35c68121e7b18
> > >
> > >    md/raid5: If there is a spare and a want_replacement device, start replacement.
> > >
> > > cause md_check_recovery to call ->add_disk much more often.
> > > Instead of only when the array is degraded, it is now called whenever
> > > md_check_recovery finds anything useful to do, which includes
> > > updating the metadata for clean<->dirty transition.
> > > This causes unnecessary work, and causes info messages from ->add_disk
> > > to be reported much too often.
> > 
> > Does 3.2.y need this?  Commit 7bfec5f35c68121e7b18 (aka v3.3-rc3~3^2~22)
> > does not seem to be part of the 3.2-stable tree.
> > 
> > Jonathan
> 
> Thanks for checking!
> 
> Probably not needed then, but it wouldn't be harmful.

But I don't think it meets the 'stable rules' for 3.2.y, so I'll drop
it.  If it turns out to be a important fix even without the earlier
change then let me know.

Ben.

-- 
Ben Hutchings
Life is what happens to you while you're busy making other plans.
                                                               - John Lennon

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 828 bytes --]

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

* Re: [ 061/167] [PATCH] nfsd: dont fail unchecked creates of non-special files
  2012-05-09  7:07   ` Jonathan Nieder
@ 2012-05-09 12:36     ` Ben Hutchings
  2012-05-10 16:37       ` Greg Kroah-Hartman
  0 siblings, 1 reply; 195+ messages in thread
From: Ben Hutchings @ 2012-05-09 12:36 UTC (permalink / raw)
  To: Jonathan Nieder
  Cc: Greg Kroah-Hartman, linux-kernel, stable, torvalds, akpm, alan,
	J. Bruce Fields, Orion Poplawski

[-- Attachment #1: Type: text/plain, Size: 763 bytes --]

On Wed, 2012-05-09 at 02:07 -0500, Jonathan Nieder wrote:
> Ben Hutchings wrote:
> 
> > 3.2-stable review patch.
> [...]
> > commit 9dc4e6c4d1182d34604ea40fef641775f5b15456 upstream.
> [...]
> > [bwh: Backported to 3.2: use &resfh, not resfh]
> > Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
> 
> Looks good.  Greg, I think this backport can be reused for 3.3.y,
> where the upstream patch similarly does not apply for lack of
> v3.4-rc1~40^2~19 ("nfsd4: reduce do_open_lookup() stack usage").

Thanks, I had made a note that this should be queued for 3.3.y as well.

Ben.

-- 
Ben Hutchings
Life is what happens to you while you're busy making other plans.
                                                               - John Lennon

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 828 bytes --]

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

* Re: [ 116/167] [PATCH] USB: EHCI: fix crash during suspend on ASUS computers
  2012-05-09  6:25   ` Oleksij Rempel
@ 2012-05-09 14:20     ` Greg Kroah-Hartman
  0 siblings, 0 replies; 195+ messages in thread
From: Greg Kroah-Hartman @ 2012-05-09 14:20 UTC (permalink / raw)
  To: Oleksij Rempel
  Cc: Ben Hutchings, linux-kernel, stable, torvalds, akpm, alan,
	Alan Stern, Steven Rostedt, Andrey Rahmatullin

On Wed, May 09, 2012 at 08:25:12AM +0200, Oleksij Rempel wrote:
> What is actually with acpi fix of this problem? Will be this patch
> removed and acpi fix applied instead?

When that acpi fix goes into the tree, yes, that will happen.  Until
then, this patch solves the problem for a number of users.

thanks,

greg k-h

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

* Re: [ 034/167] [PATCH] usb: gadget: udc-core: stop UDC on device-initiated disconnect
  2012-05-09  5:51 ` [ 034/167] [PATCH] usb: gadget: udc-core: stop UDC on device-initiated disconnect Ben Hutchings
@ 2012-05-09 19:19   ` Herton Ronaldo Krzesinski
  2012-05-11  3:04     ` Ben Hutchings
  0 siblings, 1 reply; 195+ messages in thread
From: Herton Ronaldo Krzesinski @ 2012-05-09 19:19 UTC (permalink / raw)
  To: Ben Hutchings; +Cc: linux-kernel, stable, torvalds, akpm, alan, Felipe Balbi

On Wed, May 09, 2012 at 06:51:03AM +0100, Ben Hutchings wrote:
> 3.2-stable review patch.  If anyone has any objections, please let me know.
> 
> ------------------
> 
> From: Felipe Balbi <balbi@ti.com>
> 
> commit 6d258a4c42089229b855fd706622029decf316d6 upstream.

We also need a follow up fix to this, commit
83a787a71e034244a9fd1d5988fe18f226341417 upstream.

> 
> When we want to do device-initiated disconnect,
> let's make sure we stop the UDC in order to
> e.g. allow lower power states to be achieved by
> turning off unnecessary clocks and/or stoping
> PHYs.
> 
> When reconnecting, call ->udc_start() again to
> make sure UDC is reinitialized.
> 
> Signed-off-by: Felipe Balbi <balbi@ti.com>
> Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
> ---
>  drivers/usb/gadget/udc-core.c |    4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/drivers/usb/gadget/udc-core.c b/drivers/usb/gadget/udc-core.c
> index 56da49f..c261887 100644
> --- a/drivers/usb/gadget/udc-core.c
> +++ b/drivers/usb/gadget/udc-core.c
> @@ -411,8 +411,12 @@ static ssize_t usb_udc_softconn_store(struct device *dev,
>  	struct usb_udc		*udc = container_of(dev, struct usb_udc, dev);
>  
>  	if (sysfs_streq(buf, "connect")) {
> +		if (udc_is_newstyle(udc))
> +			usb_gadget_udc_start(udc->gadget, udc->driver);
>  		usb_gadget_connect(udc->gadget);
>  	} else if (sysfs_streq(buf, "disconnect")) {
> +		if (udc_is_newstyle(udc))
> +			usb_gadget_udc_stop(udc->gadget, udc->driver);
>  		usb_gadget_disconnect(udc->gadget);
>  	} else {
>  		dev_err(dev, "unsupported command '%s'\n", buf);
> -- 
> 1.7.10
> 
> 
> 
> --
> To unsubscribe from this list: send the line "unsubscribe stable" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> 

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

* Re: [ 035/167] [PATCH] usb: gadget: udc-core: fix asymmetric calls in remove_driver
  2012-05-09  5:51 ` [ 035/167] [PATCH] usb: gadget: udc-core: fix asymmetric calls in remove_driver Ben Hutchings
@ 2012-05-09 19:25   ` Herton Ronaldo Krzesinski
  0 siblings, 0 replies; 195+ messages in thread
From: Herton Ronaldo Krzesinski @ 2012-05-09 19:25 UTC (permalink / raw)
  To: Ben Hutchings
  Cc: linux-kernel, stable, torvalds, akpm, alan,
	Kishon Vijay Abraham I, Partha Basak, Felipe Balbi

On Wed, May 09, 2012 at 06:51:04AM +0100, Ben Hutchings wrote:
> 3.2-stable review patch.  If anyone has any objections, please let me know.
> 
> ------------------
> 
> From: Kishon Vijay Abraham I <kishon@ti.com>
> 
> commit 8ae8090c82eb407267001f75b3d256b3bd4ae691 upstream.

After applying this it seems we need also this upstream commit applied
in addition:
320cd1e750f1bf3e47eb41209dcb2be07264cb76

> 
> During modprobe of gadget driver, pullup is called after
> udc_start. In order to make the exit path symmetric when
> removing a gadget driver, call pullup before ->udc_stop.
> 
> This is needed to avoid issues with PM where udc_stop
> disables the module completely (put IP in reset state,
> cut functional and interface clocks, and so on), which
> prevents us from accessing the IP's address space,
> thus creating the possibility of an abort exception
> when we try to access IP's address space after clocks
> are off.
> 
> Signed-off-by: Partha Basak <p-basak2@ti.com>
> Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>
> Signed-off-by: Felipe Balbi <balbi@ti.com>
> Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
> ---
>  drivers/usb/gadget/udc-core.c |    2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/usb/gadget/udc-core.c b/drivers/usb/gadget/udc-core.c
> index c261887..2fa9865 100644
> --- a/drivers/usb/gadget/udc-core.c
> +++ b/drivers/usb/gadget/udc-core.c
> @@ -264,8 +264,8 @@ static void usb_gadget_remove_driver(struct usb_udc *udc)
>  	if (udc_is_newstyle(udc)) {
>  		udc->driver->disconnect(udc->gadget);
>  		udc->driver->unbind(udc->gadget);
> -		usb_gadget_udc_stop(udc->gadget, udc->driver);
>  		usb_gadget_disconnect(udc->gadget);
> +		usb_gadget_udc_stop(udc->gadget, udc->driver);
>  	} else {
>  		usb_gadget_stop(udc->gadget, udc->driver);
>  	}
> -- 
> 1.7.10
> 
> 
> 
> --
> To unsubscribe from this list: send the line "unsubscribe stable" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> 

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

* Re: [ 046/167] [PATCH] spi: Fix device unregistration when unregistering the bus master
  2012-05-09  5:51 ` [ 046/167] [PATCH] spi: Fix device unregistration when unregistering the bus master Ben Hutchings
@ 2012-05-09 19:33   ` Herton Ronaldo Krzesinski
  2012-05-11  3:15     ` Ben Hutchings
  0 siblings, 1 reply; 195+ messages in thread
From: Herton Ronaldo Krzesinski @ 2012-05-09 19:33 UTC (permalink / raw)
  To: Ben Hutchings
  Cc: linux-kernel, stable, torvalds, akpm, alan, Laurent Pinchart,
	Grant Likely

On Wed, May 09, 2012 at 06:51:15AM +0100, Ben Hutchings wrote:
> 3.2-stable review patch.  If anyone has any objections, please let me know.
> 
> ------------------
> 
> From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> 
> commit 178db7d30f94707efca1a189753c105ef69942ed upstream.

After applying this change, this introduces a bug on spi-fsl-spi.c, we
need to apply in addition to this change commit
5039a86973cd35bdb2f64d28ee12f13fe2bb5a4c

> 
> Device are added as children of the bus master's parent device, but
> spi_unregister_master() looks for devices to unregister in the bus
> master's children. This results in the child devices not being
> unregistered.
> 
> Fix this by registering devices as direct children of the bus master.
> 
> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
> Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
> ---
>  drivers/spi/spi.c |    2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/spi/spi.c b/drivers/spi/spi.c
> index 77eae99..b2ccdea 100644
> --- a/drivers/spi/spi.c
> +++ b/drivers/spi/spi.c
> @@ -319,7 +319,7 @@ struct spi_device *spi_alloc_device(struct spi_master *master)
>  	}
>  
>  	spi->master = master;
> -	spi->dev.parent = dev;
> +	spi->dev.parent = &master->dev;
>  	spi->dev.bus = &spi_bus_type;
>  	spi->dev.release = spidev_release;
>  	device_initialize(&spi->dev);
> -- 
> 1.7.10
> 
> 
> 
> --
> To unsubscribe from this list: send the line "unsubscribe stable" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> 

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

* Re: [ 166/167] [PATCH] staging: r8712u: Fix regression caused by commit 8c213fa
  2012-05-09  5:53 ` [ 166/167] [PATCH] staging: r8712u: Fix regression caused by commit 8c213fa Ben Hutchings
@ 2012-05-09 19:49   ` Herton Ronaldo Krzesinski
  2012-05-11  3:21     ` Ben Hutchings
  0 siblings, 1 reply; 195+ messages in thread
From: Herton Ronaldo Krzesinski @ 2012-05-09 19:49 UTC (permalink / raw)
  To: Ben Hutchings
  Cc: linux-kernel, stable, torvalds, akpm, alan, Larry Finger,
	Alberto Lago Ballesteros, Adrian, Greg Kroah-Hartman

On Wed, May 09, 2012 at 06:53:15AM +0100, Ben Hutchings wrote:
> 3.2-stable review patch.  If anyone has any objections, please let me know.
> 
> ------------------
> 
> From: Larry Finger <Larry.Finger@lwfinger.net>
> 
> commit 2080913e017ab9f88379d93fd09546ad95faf87b upstream.
> 
> In commit 8c213fa "staging: r8712u: Use asynchronous firmware loading",
> the command to release the firmware was placed in the wrong routine.
> 
> In combination with the bug introduced in commit a5ee652 "staging: r8712u:
> Interface-state not fully tracked", the driver attempts to upload firmware
> that had already been released. This bug is the source of one of the
> problems in https://bugs.archlinux.org/task/27996#comment89833.
> 
> Tested-by: Alberto Lago Ballesteros <saniukeokusainaya@gmail.com>
> Tested-by: Adrian <agib@gmx.de>
> Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
> Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
> ---
>  drivers/staging/rtl8712/os_intfs.c |    3 ---
>  drivers/staging/rtl8712/usb_intf.c |    5 +++++
>  2 files changed, 5 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/staging/rtl8712/os_intfs.c b/drivers/staging/rtl8712/os_intfs.c
> index 4cf175f..7bbd53a 100644
> --- a/drivers/staging/rtl8712/os_intfs.c
> +++ b/drivers/staging/rtl8712/os_intfs.c
> @@ -475,9 +475,6 @@ static int netdev_close(struct net_device *pnetdev)
>  	r8712_free_assoc_resources(padapter);
>  	/*s2-4.*/
>  	r8712_free_network_queue(padapter);
> -	release_firmware(padapter->fw);
> -	/* never exit with a firmware callback pending */
> -	wait_for_completion(&padapter->rtl8712_fw_ready);
>  	return 0;
>  }
>  
> diff --git a/drivers/staging/rtl8712/usb_intf.c b/drivers/staging/rtl8712/usb_intf.c
> index fe0e2ff..e01fe14 100644
> --- a/drivers/staging/rtl8712/usb_intf.c
> +++ b/drivers/staging/rtl8712/usb_intf.c
> @@ -30,6 +30,7 @@
>  
>  #include <linux/usb.h>
>  #include <linux/module.h>
> +#include <linux/firmware.h>
>  
>  #include "osdep_service.h"
>  #include "drv_types.h"
> @@ -620,6 +621,10 @@ static void r871xu_dev_remove(struct usb_interface *pusb_intf)
>  	struct _adapter *padapter = netdev_priv(pnetdev);
>  	struct usb_device *udev = interface_to_usbdev(pusb_intf);
>  
> +	if (padapter->fw_found)
> +		release_firmware(padapter->fw);
> +	/* never exit with a firmware callback pending */
> +	wait_for_completion(&padapter->rtl8712_fw_ready);

We also need to apply commit ee6aeff71e2f16b9fe95ce908d098c169e0f4004
after this, due to the possible invalid padapter dereference.

>  	usb_set_intfdata(pusb_intf, NULL);
>  	if (padapter) {
>  		if (drvpriv.drv_registered == true)
> -- 
> 1.7.10
> 
> 
> 
> --
> To unsubscribe from this list: send the line "unsubscribe stable" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> 

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

* Re: [ 061/167] [PATCH] nfsd: dont fail unchecked creates of non-special files
  2012-05-09 12:36     ` Ben Hutchings
@ 2012-05-10 16:37       ` Greg Kroah-Hartman
  0 siblings, 0 replies; 195+ messages in thread
From: Greg Kroah-Hartman @ 2012-05-10 16:37 UTC (permalink / raw)
  To: Ben Hutchings
  Cc: Jonathan Nieder, linux-kernel, stable, torvalds, akpm, alan,
	J. Bruce Fields, Orion Poplawski

On Wed, May 09, 2012 at 01:36:31PM +0100, Ben Hutchings wrote:
> On Wed, 2012-05-09 at 02:07 -0500, Jonathan Nieder wrote:
> > Ben Hutchings wrote:
> > 
> > > 3.2-stable review patch.
> > [...]
> > > commit 9dc4e6c4d1182d34604ea40fef641775f5b15456 upstream.
> > [...]
> > > [bwh: Backported to 3.2: use &resfh, not resfh]
> > > Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
> > 
> > Looks good.  Greg, I think this backport can be reused for 3.3.y,
> > where the upstream patch similarly does not apply for lack of
> > v3.4-rc1~40^2~19 ("nfsd4: reduce do_open_lookup() stack usage").
> 
> Thanks, I had made a note that this should be queued for 3.3.y as well.

Thanks, now applied.

greg k-h

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

* Re: [ 074/167] [PATCH 14/26] tcp: fix tcp_trim_head()
  2012-05-09  8:16   ` Jonathan Nieder
@ 2012-05-11  3:00     ` Ben Hutchings
  2012-05-11  3:07       ` David Miller
  0 siblings, 1 reply; 195+ messages in thread
From: Ben Hutchings @ 2012-05-11  3:00 UTC (permalink / raw)
  To: David S. Miller, Jonathan Nieder
  Cc: linux-kernel, stable, torvalds, akpm, alan, Eric Dumazet,
	Vijay Subramanian

[-- Attachment #1: Type: text/plain, Size: 968 bytes --]

On Wed, 2012-05-09 at 03:16 -0500, Jonathan Nieder wrote:
> Ben Hutchings wrote:
> 
> > 3.2-stable review patch.  If anyone has any objections, please let me know.
> [...]
> > [ Upstream commit 4fa48bf3c75069d636fc8830743c929a062e80dc ]
> >
> > commit f07d960df3 (tcp: avoid frag allocation for small frames)
> > breaked assumption in tcp stack that skb is either linear (skb->data_len
> > == 0), or fully fragged (skb->data_len == skb->len)
> >
> > tcp_trim_head() made this assumption, we must fix it.
> 
> Is this needed in the context of 3.2.y (which does not include
> f07d960df3)?
[...]

The code being replaced really didn't make sense, but unless there is
some other case that breaks the assumption described then I don't think
this meets the stable rules.  David?

Ben.

-- 
Ben Hutchings
Life is what happens to you while you're busy making other plans.
                                                               - John Lennon

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 828 bytes --]

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

* Re: [ 034/167] [PATCH] usb: gadget: udc-core: stop UDC on device-initiated disconnect
  2012-05-09 19:19   ` Herton Ronaldo Krzesinski
@ 2012-05-11  3:04     ` Ben Hutchings
  0 siblings, 0 replies; 195+ messages in thread
From: Ben Hutchings @ 2012-05-11  3:04 UTC (permalink / raw)
  To: Herton Ronaldo Krzesinski
  Cc: linux-kernel, stable, torvalds, akpm, alan, Felipe Balbi

[-- Attachment #1: Type: text/plain, Size: 788 bytes --]

On Wed, 2012-05-09 at 12:19 -0700, Herton Ronaldo Krzesinski wrote:
> On Wed, May 09, 2012 at 06:51:03AM +0100, Ben Hutchings wrote:
> > 3.2-stable review patch.  If anyone has any objections, please let me know.
> > 
> > ------------------
> > 
> > From: Felipe Balbi <balbi@ti.com>
> > 
> > commit 6d258a4c42089229b855fd706622029decf316d6 upstream.
> 
> We also need a follow up fix to this, commit
> 83a787a71e034244a9fd1d5988fe18f226341417 upstream.
[...]

Right, Peter Korsgaard already pointed out this and commit
320cd1e750f1bf3e47eb41209dcb2be07264cb76, and I've added them to the
queue.

Ben.

-- 
Ben Hutchings
Life is what happens to you while you're busy making other plans.
                                                               - John Lennon

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 828 bytes --]

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

* Re: [ 074/167] [PATCH 14/26] tcp: fix tcp_trim_head()
  2012-05-11  3:00     ` Ben Hutchings
@ 2012-05-11  3:07       ` David Miller
  0 siblings, 0 replies; 195+ messages in thread
From: David Miller @ 2012-05-11  3:07 UTC (permalink / raw)
  To: ben
  Cc: jrnieder, linux-kernel, stable, torvalds, akpm, alan,
	eric.dumazet, subramanian.vijay

From: Ben Hutchings <ben@decadent.org.uk>
Date: Fri, 11 May 2012 04:00:15 +0100

> On Wed, 2012-05-09 at 03:16 -0500, Jonathan Nieder wrote:
>> Ben Hutchings wrote:
>> 
>> > 3.2-stable review patch.  If anyone has any objections, please let me know.
>> [...]
>> > [ Upstream commit 4fa48bf3c75069d636fc8830743c929a062e80dc ]
>> >
>> > commit f07d960df3 (tcp: avoid frag allocation for small frames)
>> > breaked assumption in tcp stack that skb is either linear (skb->data_len
>> > == 0), or fully fragged (skb->data_len == skb->len)
>> >
>> > tcp_trim_head() made this assumption, we must fix it.
>> 
>> Is this needed in the context of 3.2.y (which does not include
>> f07d960df3)?
> [...]
> 
> The code being replaced really didn't make sense, but unless there is
> some other case that breaks the assumption described then I don't think
> this meets the stable rules.  David?

It's a prerequisite for cleanly applying the patch that comes right
afterwards.

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

* Re: [ 046/167] [PATCH] spi: Fix device unregistration when unregistering the bus master
  2012-05-09 19:33   ` Herton Ronaldo Krzesinski
@ 2012-05-11  3:15     ` Ben Hutchings
  2012-05-11 22:23       ` Herton Ronaldo Krzesinski
  0 siblings, 1 reply; 195+ messages in thread
From: Ben Hutchings @ 2012-05-11  3:15 UTC (permalink / raw)
  To: Herton Ronaldo Krzesinski
  Cc: linux-kernel, stable, torvalds, akpm, alan, Laurent Pinchart,
	Grant Likely

[-- Attachment #1: Type: text/plain, Size: 837 bytes --]

On Wed, 2012-05-09 at 12:33 -0700, Herton Ronaldo Krzesinski wrote:
> On Wed, May 09, 2012 at 06:51:15AM +0100, Ben Hutchings wrote:
> > 3.2-stable review patch.  If anyone has any objections, please let me know.
> > 
> > ------------------
> > 
> > From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> > 
> > commit 178db7d30f94707efca1a189753c105ef69942ed upstream.
> 
> After applying this change, this introduces a bug on spi-fsl-spi.c, we
> need to apply in addition to this change commit
> 5039a86973cd35bdb2f64d28ee12f13fe2bb5a4c
[...]

OK, I've added that to the queue.  But doesn't fsl_spi_cs_control() also
need to be changed?

Ben.

-- 
Ben Hutchings
Life is what happens to you while you're busy making other plans.
                                                               - John Lennon

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 828 bytes --]

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

* Re: [ 166/167] [PATCH] staging: r8712u: Fix regression caused by commit 8c213fa
  2012-05-09 19:49   ` Herton Ronaldo Krzesinski
@ 2012-05-11  3:21     ` Ben Hutchings
  2012-05-11 16:28       ` Larry Finger
  0 siblings, 1 reply; 195+ messages in thread
From: Ben Hutchings @ 2012-05-11  3:21 UTC (permalink / raw)
  To: Herton Ronaldo Krzesinski, Larry Finger
  Cc: linux-kernel, stable, torvalds, akpm, alan,
	Alberto Lago Ballesteros, Adrian, Greg Kroah-Hartman

[-- Attachment #1: Type: text/plain, Size: 1577 bytes --]

On Wed, 2012-05-09 at 12:49 -0700, Herton Ronaldo Krzesinski wrote:
> On Wed, May 09, 2012 at 06:53:15AM +0100, Ben Hutchings wrote:
> > 3.2-stable review patch.  If anyone has any objections, please let me know.
> > 
> > ------------------
> > 
> > From: Larry Finger <Larry.Finger@lwfinger.net>
> > 
> > commit 2080913e017ab9f88379d93fd09546ad95faf87b upstream.
[...]
> > --- a/drivers/staging/rtl8712/usb_intf.c
> > +++ b/drivers/staging/rtl8712/usb_intf.c
> > @@ -30,6 +30,7 @@
> >  
> >  #include <linux/usb.h>
> >  #include <linux/module.h>
> > +#include <linux/firmware.h>
> >  
> >  #include "osdep_service.h"
> >  #include "drv_types.h"
> > @@ -620,6 +621,10 @@ static void r871xu_dev_remove(struct usb_interface *pusb_intf)
> >  	struct _adapter *padapter = netdev_priv(pnetdev);
> >  	struct usb_device *udev = interface_to_usbdev(pusb_intf);
> >  
> > +	if (padapter->fw_found)
> > +		release_firmware(padapter->fw);
> > +	/* never exit with a firmware callback pending */
> > +	wait_for_completion(&padapter->rtl8712_fw_ready);
> 
> We also need to apply commit ee6aeff71e2f16b9fe95ce908d098c169e0f4004
> after this, due to the possible invalid padapter dereference.
[...]

That 'fix' makes no sense since netdev_priv() never returns NULL.

Larry, you should remove the test for pAdapter completely, or if pnetdev
can somehow be NULL then test *that*.

Ben.

-- 
Ben Hutchings
Life is what happens to you while you're busy making other plans.
                                                               - John Lennon

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 828 bytes --]

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

* Re: [ 166/167] [PATCH] staging: r8712u: Fix regression caused by commit 8c213fa
  2012-05-11  3:21     ` Ben Hutchings
@ 2012-05-11 16:28       ` Larry Finger
  0 siblings, 0 replies; 195+ messages in thread
From: Larry Finger @ 2012-05-11 16:28 UTC (permalink / raw)
  To: Ben Hutchings
  Cc: Herton Ronaldo Krzesinski, linux-kernel, stable, torvalds, akpm,
	alan, Alberto Lago Ballesteros, Adrian, Greg Kroah-Hartman

On 05/10/2012 10:21 PM, Ben Hutchings wrote:
> On Wed, 2012-05-09 at 12:49 -0700, Herton Ronaldo Krzesinski wrote:
>> On Wed, May 09, 2012 at 06:53:15AM +0100, Ben Hutchings wrote:
>>> 3.2-stable review patch.  If anyone has any objections, please let me know.
>>>
>>> ------------------
>>>
>>> From: Larry Finger<Larry.Finger@lwfinger.net>
>>>
>>> commit 2080913e017ab9f88379d93fd09546ad95faf87b upstream.
> [...]
>>> --- a/drivers/staging/rtl8712/usb_intf.c
>>> +++ b/drivers/staging/rtl8712/usb_intf.c
>>> @@ -30,6 +30,7 @@
>>>
>>>   #include<linux/usb.h>
>>>   #include<linux/module.h>
>>> +#include<linux/firmware.h>
>>>
>>>   #include "osdep_service.h"
>>>   #include "drv_types.h"
>>> @@ -620,6 +621,10 @@ static void r871xu_dev_remove(struct usb_interface *pusb_intf)
>>>   	struct _adapter *padapter = netdev_priv(pnetdev);
>>>   	struct usb_device *udev = interface_to_usbdev(pusb_intf);
>>>
>>> +	if (padapter->fw_found)
>>> +		release_firmware(padapter->fw);
>>> +	/* never exit with a firmware callback pending */
>>> +	wait_for_completion(&padapter->rtl8712_fw_ready);
>>
>> We also need to apply commit ee6aeff71e2f16b9fe95ce908d098c169e0f4004
>> after this, due to the possible invalid padapter dereference.
> [...]
>
> That 'fix' makes no sense since netdev_priv() never returns NULL.
>
> Larry, you should remove the test for pAdapter completely, or if pnetdev
> can somehow be NULL then test *that*.

Thanks. I have a patch under testing.

Larry


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

* Re: [ 046/167] [PATCH] spi: Fix device unregistration when unregistering the bus master
  2012-05-11  3:15     ` Ben Hutchings
@ 2012-05-11 22:23       ` Herton Ronaldo Krzesinski
  0 siblings, 0 replies; 195+ messages in thread
From: Herton Ronaldo Krzesinski @ 2012-05-11 22:23 UTC (permalink / raw)
  To: Ben Hutchings
  Cc: linux-kernel, stable, torvalds, akpm, alan, Laurent Pinchart,
	Grant Likely

On Fri, May 11, 2012 at 04:15:49AM +0100, Ben Hutchings wrote:
> On Wed, 2012-05-09 at 12:33 -0700, Herton Ronaldo Krzesinski wrote:
> > On Wed, May 09, 2012 at 06:51:15AM +0100, Ben Hutchings wrote:
> > > 3.2-stable review patch.  If anyone has any objections, please let me know.
> > > 
> > > ------------------
> > > 
> > > From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> > > 
> > > commit 178db7d30f94707efca1a189753c105ef69942ed upstream.
> > 
> > After applying this change, this introduces a bug on spi-fsl-spi.c, we
> > need to apply in addition to this change commit
> > 5039a86973cd35bdb2f64d28ee12f13fe2bb5a4c
> [...]
> 
> OK, I've added that to the queue.  But doesn't fsl_spi_cs_control() also
> need to be changed?

I think so as well, I took a look and if no one beats me to it I'll send
a patch for that with Cc: stable.

> 
> Ben.
> 
> -- 
> Ben Hutchings
> Life is what happens to you while you're busy making other plans.
>                                                                - John Lennon

-- 
[]'s
Herton

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

* Re: [ 018/167] [PATCH] brcm80211: smac: resume transmit fifo upon receiving frames
  2012-05-09  5:50 ` [ 018/167] [PATCH] brcm80211: smac: resume transmit fifo upon receiving frames Ben Hutchings
@ 2012-05-11 23:42   ` Ben Hutchings
  2012-05-12  0:35     ` Jonathan Nieder
  0 siblings, 1 reply; 195+ messages in thread
From: Ben Hutchings @ 2012-05-11 23:42 UTC (permalink / raw)
  To: Arend van Spriel
  Cc: stable, torvalds, akpm, alan, Francesco Saverio Schiavarelli,
	Pieter-Paul Giesberts, Brett Rudley, John W. Linville, LKML

[-- Attachment #1: Type: text/plain, Size: 1383 bytes --]

On Wed, 2012-05-09 at 06:50 +0100, Ben Hutchings wrote:
> 3.2-stable review patch.  If anyone has any objections, please let me know.
> 
> ------------------
> 
> From: Arend van Spriel <arend@broadcom.com>
> 
> commit badc4f07622f0f7093a201638f45e85765f1b5e4 upstream.
> 
> There have been reports about not being able to use access-points
> on channel 12 and 13 or having connectivity issues when these channels
> were part of the selected regulatory domain. Upon switching to these
> channels the brcmsmac driver suspends the transmit dma fifos. This
> patch resumes them upon handing over the first received beacon to
> mac80211.
> 
> This patch is to be applied to the stable tree for kernel versions
> 3.2 and 3.3.

It looks like my earlier build test didn't include this driver, due to
'depends on BCMA=n'.  Unfortunately:

[...]
> +	/* unmute transmit */
> +	if (wlc->hw->suspended_fifos) {
> +		hdr = (struct ieee80211_hdr *)p->data;
> +		if (ieee80211_is_beacon(hdr->frame_control))
> +			brcms_b_mute(wlc->hw, false);
> +	}
[...]

brcms_b_mute() takes three arguments in 3.2.  Can you send me a patch to
fix this up in 3.2.y, or should I revert the change?

Ben.

-- 
Ben Hutchings
Experience is directly proportional to the value of equipment destroyed.
                                                         - Carolyn Scheppner

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 828 bytes --]

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

* Re: [ 018/167] [PATCH] brcm80211: smac: resume transmit fifo upon receiving frames
  2012-05-11 23:42   ` Ben Hutchings
@ 2012-05-12  0:35     ` Jonathan Nieder
  2012-05-12  0:46       ` Ben Hutchings
  0 siblings, 1 reply; 195+ messages in thread
From: Jonathan Nieder @ 2012-05-12  0:35 UTC (permalink / raw)
  To: Ben Hutchings
  Cc: Arend van Spriel, stable, torvalds, akpm, alan,
	Francesco Saverio Schiavarelli, Pieter-Paul Giesberts,
	Brett Rudley, John W. Linville, LKML

Ben Hutchings wrote:

> brcms_b_mute() takes three arguments in 3.2.  Can you send me a patch to
> fix this up in 3.2.y, or should I revert the change?

Sorry to have missed this.  Here's the fixup used when backporting to
3.0.y.

-- >8 --
Subject: brcm80211: smac: pass missing argument to 'brcms_b_mute'

[Not needed upstream --- this bug is specific to 3.2.y.]

Commit c6c44893c864, which removes the flag argument from brcms_b_mute,
is not part of 3.2.y, and we forgot to adjust a new call accordingly
when applying commit badc4f07622f ("brcm80211: smac: resume transmit
fifo upon receiving frames").

 drivers/net/wireless/brcm80211/brcmsmac/main.c: In function 'brcms_c_recvctl':
 drivers/net/wireless/brcm80211/brcmsmac/main.c:7882:4: error: too few arguments to function 'brcms_b_mute'
 drivers/net/wireless/brcm80211/brcmsmac/main.c:2538:13: note: declared here

Earlier build tests missed this because they didn't include this driver
due to 'depends on BCMA=n'.

Reported-by: Ben Hutchings <ben@decadent.org.uk>
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
---
 drivers/net/wireless/brcm80211/brcmsmac/main.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/wireless/brcm80211/brcmsmac/main.c b/drivers/net/wireless/brcm80211/brcmsmac/main.c
index f98becc9e169..833cbefcbfd2 100644
--- a/drivers/net/wireless/brcm80211/brcmsmac/main.c
+++ b/drivers/net/wireless/brcm80211/brcmsmac/main.c
@@ -7879,7 +7879,7 @@ brcms_c_recvctl(struct brcms_c_info *wlc, struct d11rxhdr *rxh,
 	if (wlc->hw->suspended_fifos) {
 		hdr = (struct ieee80211_hdr *)p->data;
 		if (ieee80211_is_beacon(hdr->frame_control))
-			brcms_b_mute(wlc->hw, false);
+			brcms_b_mute(wlc->hw, false, 0);
 	}
 
 	memcpy(IEEE80211_SKB_RXCB(p), &rx_status, sizeof(rx_status));
-- 
1.7.10.1


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

* Re: [ 018/167] [PATCH] brcm80211: smac: resume transmit fifo upon receiving frames
  2012-05-12  0:35     ` Jonathan Nieder
@ 2012-05-12  0:46       ` Ben Hutchings
  0 siblings, 0 replies; 195+ messages in thread
From: Ben Hutchings @ 2012-05-12  0:46 UTC (permalink / raw)
  To: Jonathan Nieder
  Cc: Arend van Spriel, stable, torvalds, akpm, alan,
	Francesco Saverio Schiavarelli, Pieter-Paul Giesberts,
	Brett Rudley, John W. Linville, LKML

[-- Attachment #1: Type: text/plain, Size: 531 bytes --]

On Fri, 2012-05-11 at 19:35 -0500, Jonathan Nieder wrote:
> Ben Hutchings wrote:
> 
> > brcms_b_mute() takes three arguments in 3.2.  Can you send me a patch to
> > fix this up in 3.2.y, or should I revert the change?
> 
> Sorry to have missed this.  Here's the fixup used when backporting to
> 3.0.y.
[...]

Thanks, I've queued this up.

Ben.

-- 
Ben Hutchings
Experience is directly proportional to the value of equipment destroyed.
                                                         - Carolyn Scheppner

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 828 bytes --]

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

end of thread, other threads:[~2012-05-12  0:46 UTC | newest]

Thread overview: 195+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-05-09  5:50 [ 000/167] 3.2.17-stable review Ben Hutchings
2012-05-09  5:50 ` [ 001/167] Perf: fix build breakage Ben Hutchings
2012-05-09  5:50 ` [ 002/167] [PATCH] crypto: sha512 - Fix byte counter overflow in SHA-512 Ben Hutchings
2012-05-09  5:50   ` Ben Hutchings
2012-05-09  5:50 ` [ 003/167] [PATCH] ALSA: hda/conexant - Dont set HP pin-control bit unconditionally Ben Hutchings
2012-05-09  5:50 ` [ 004/167] [PATCH] ALSA: hda/conexant - Set up the missing docking-station pins Ben Hutchings
2012-05-09  5:50 ` [ 005/167] [PATCH] ARM: clps711x: serial driver hungs are a result of call disable_irq within ISR Ben Hutchings
2012-05-09  5:50 ` [ 006/167] [PATCH] ARM: OMAP1: DMTIMER: fix broken timer clock source selection Ben Hutchings
2012-05-09  5:50 ` [ 007/167] [PATCH] mmc: fixes for eMMC v4.5 discard operation Ben Hutchings
2012-05-09  5:50 ` [ 008/167] [PATCH] mmc: fixes for eMMC v4.5 sanitize operation Ben Hutchings
2012-05-09  5:50 ` [ 009/167] [PATCH] mmc: unbreak sdhci-esdhc-imx on i.MX25 Ben Hutchings
2012-05-09  5:50 ` [ 010/167] [PATCH] xen/gntdev: do not set VM_PFNMAP Ben Hutchings
2012-05-09  5:50 ` [ 011/167] [PATCH] xen/xenbus: Add quirk to deal with misconfigured backends Ben Hutchings
2012-05-09  5:50 ` [ 012/167] [PATCH] USB: yurex: Remove allocation of coherent buffer for setup-packet buffer Ben Hutchings
2012-05-09  5:50 ` [ 013/167] [PATCH] USB: yurex: Fix missing URB_NO_TRANSFER_DMA_MAP flag in urb Ben Hutchings
2012-05-09  5:50 ` [ 014/167] [PATCH] uwb: fix use of del_timer_sync() in interrupt Ben Hutchings
2012-05-09  5:50 ` [ 015/167] [PATCH] uwb: fix error handling Ben Hutchings
2012-05-09  5:50 ` [ 016/167] [PATCH] davinci_mdio: Fix MDIO timeout check Ben Hutchings
2012-05-09  5:50 ` [ 017/167] [PATCH] mwifiex: update pcie8766 scratch register addresses Ben Hutchings
2012-05-09  5:50 ` [ 018/167] [PATCH] brcm80211: smac: resume transmit fifo upon receiving frames Ben Hutchings
2012-05-11 23:42   ` Ben Hutchings
2012-05-12  0:35     ` Jonathan Nieder
2012-05-12  0:46       ` Ben Hutchings
2012-05-09  5:50 ` [ 019/167] [PATCH] [media] rc-core: set mode for winbond-cir Ben Hutchings
2012-05-09  5:50 ` [ 020/167] [PATCH] [media] drxk: Does not unlock mutex if sanity check failed in scu_command() Ben Hutchings
2012-05-09  5:50 ` [ 021/167] [PATCH] cfg80211: fix interface combinations check Ben Hutchings
2012-05-09  5:50 ` [ 022/167] Fix modpost failures in fedora 17 Ben Hutchings
2012-05-09  5:50 ` [ 023/167] [PATCH] mm: fix s390 BUG by __set_page_dirty_no_writeback on swap Ben Hutchings
2012-05-09  5:50 ` [ 024/167] [PATCH] md: dont call ->add_disk unless there is good reason Ben Hutchings
2012-05-09  6:57   ` Jonathan Nieder
2012-05-09  7:20     ` NeilBrown
2012-05-09 12:34       ` Ben Hutchings
2012-05-09  5:50 ` [ 025/167] [PATCH] md: fix possible corruption of array metadata on shutdown Ben Hutchings
2012-05-09  5:50 ` [ 026/167] [PATCH] jbd2: use GFP_NOFS for blkdev_issue_flush Ben Hutchings
2012-05-09  5:50 ` [ 027/167] [PATCH] USB: serial: cp210x: Fixed usb_control_msg timeout values Ben Hutchings
2012-05-09  5:50 ` [ 028/167] [PATCH] pch_uart: Fix dma channel unallocated issue Ben Hutchings
2012-05-09  5:50 ` [ 029/167] [PATCH] drivers/tty/amiserial.c: add missing tty_unlock Ben Hutchings
2012-05-09  5:50 ` [ 030/167] [PATCH] USB: sierra: avoid QMI/wwan interface on MC77xx Ben Hutchings
2012-05-09  5:51 ` [ 031/167] [PATCH] EHCI: fix criterion for resuming the root hub Ben Hutchings
2012-05-09  5:51 ` [ 032/167] [PATCH] EHCI: always clear the STS_FLR status bit Ben Hutchings
2012-05-09  5:51 ` [ 033/167] [PATCH] USB: fix deadlock in bConfigurationValue attribute method Ben Hutchings
2012-05-09  5:51 ` [ 034/167] [PATCH] usb: gadget: udc-core: stop UDC on device-initiated disconnect Ben Hutchings
2012-05-09 19:19   ` Herton Ronaldo Krzesinski
2012-05-11  3:04     ` Ben Hutchings
2012-05-09  5:51 ` [ 035/167] [PATCH] usb: gadget: udc-core: fix asymmetric calls in remove_driver Ben Hutchings
2012-05-09 19:25   ` Herton Ronaldo Krzesinski
2012-05-09  5:51 ` [ 036/167] [PATCH] usb: gadget: eliminate NULL pointer dereference (bugfix) Ben Hutchings
2012-05-09  5:51 ` [ 037/167] [PATCH] usb: musb: omap: fix crash when musb glue (omap) gets initialized Ben Hutchings
2012-05-09  5:51 ` [ 038/167] [PATCH] usb: musb: omap: fix the error check for pm_runtime_get_sync Ben Hutchings
2012-05-09  5:51 ` [ 039/167] [PATCH] PCI: Add quirk for still enabled interrupts on Intel Sandy Bridge GPUs Ben Hutchings
2012-05-09  5:51 ` [ 040/167] [PATCH] ext4: fix endianness breakage in ext4_split_extent_at() Ben Hutchings
2012-05-09  5:51 ` [ 041/167] KVM: unmap pages from the iommu when slots are removed Ben Hutchings
2012-05-09  5:51 ` [ 042/167] [PATCH] dell-laptop: add 3 machines that has touchpad LED Ben Hutchings
2012-05-09  5:51 ` [ 043/167] [PATCH] dell-laptop: touchpad LED should persist its status after S3 Ben Hutchings
2012-05-09  5:51 ` [ 044/167] [PATCH] Bluetooth: Add support for Atheros [04ca:3005] Ben Hutchings
2012-05-09  5:51 ` [ 045/167] Dont limit non-nested epoll paths Ben Hutchings
2012-05-09  5:51 ` [ 046/167] [PATCH] spi: Fix device unregistration when unregistering the bus master Ben Hutchings
2012-05-09 19:33   ` Herton Ronaldo Krzesinski
2012-05-11  3:15     ` Ben Hutchings
2012-05-11 22:23       ` Herton Ronaldo Krzesinski
2012-05-09  5:51 ` [ 047/167] [PATCH] rt2800: Add support for the Fujitsu Stylistic Q550 Ben Hutchings
2012-05-09  5:51 ` [ 048/167] [PATCH] rt2x00: Identify rt2800usb chipsets Ben Hutchings
2012-05-09  5:51 ` [ 049/167] nfsd: fix b0rken error value for setattr on read-only mount Ben Hutchings
2012-05-09  5:51 ` [ 050/167] [PATCH] nfsd: fix error values returned by nfsd4_lockt() when nfsd_open() fails Ben Hutchings
2012-05-09  5:51 ` [ 051/167] nfsd: fix endianness breakage in TEST_STATEID handling Ben Hutchings
2012-05-09  5:51 ` [ 052/167] [PATCH] nfsd: fix compose_entry_fh() failure exits Ben Hutchings
2012-05-09  5:51 ` [ 053/167] [PATCH] btrfs: btrfs_root_readonly() broken on big-endian Ben Hutchings
2012-05-09  5:51 ` [ 054/167] [PATCH 1/4] ocfs2: ->l_next_free_req breakage " Ben Hutchings
2012-05-09  5:51 ` [ 055/167] [PATCH 2/4] ocfs: ->rl_used " Ben Hutchings
2012-05-09  5:51 ` [ 056/167] [PATCH 3/4] ocfs2: ->rl_count endianness breakage Ben Hutchings
2012-05-09  5:51 ` [ 057/167] [PATCH 4/4] ocfs2: ->e_leaf_clusters " Ben Hutchings
2012-05-09  5:51 ` [ 058/167] [PATCH] lockd: fix the endianness bug Ben Hutchings
2012-05-09  5:51 ` [ 059/167] [PATCH] usb: dwc3: ep0: increment "actual" on bounced ep0 case Ben Hutchings
2012-05-09  5:51 ` [ 060/167] [PATCH 01/26] net: fix /proc/net/dev regression Ben Hutchings
2012-05-09  5:51 ` [ 061/167] [PATCH] nfsd: dont fail unchecked creates of non-special files Ben Hutchings
2012-05-09  7:07   ` Jonathan Nieder
2012-05-09 12:36     ` Ben Hutchings
2012-05-10 16:37       ` Greg Kroah-Hartman
2012-05-09  5:51 ` [ 062/167] [PATCH 02/26] ppp: Dont stop and restart queue on every TX packet Ben Hutchings
2012-05-09  5:51 ` [ 063/167] [PATCH 03/26] tcp: allow splice() to build full TSO packets Ben Hutchings
2012-05-09  5:51 ` [ 064/167] [PATCH 04/26] sctp: Allow struct sctp_event_subscribe to grow without breaking binaries Ben Hutchings
2012-05-09  5:51 ` [ 065/167] [PATCH 05/26] bridge: Do not send queries on multicast group leaves Ben Hutchings
2012-05-09  5:51   ` Ben Hutchings
2012-05-09  5:51 ` [ 066/167] [PATCH 06/26] ipv6: fix array index in ip6_mc_add_src() Ben Hutchings
2012-05-09  5:51 ` [ 067/167] [PATCH 07/26] phonet: Check input from user before allocating Ben Hutchings
2012-05-09  5:51 ` [ 068/167] [PATCH 08/26] bonding: properly unset current_arp_slave on slave link up Ben Hutchings
2012-05-09  5:51 ` [ 069/167] [PATCH 09/26] wimax: i2400m - prevent a possible kernel bug due to missing fw_name string Ben Hutchings
2012-05-09  5:51 ` [ 070/167] [PATCH 10/26] netlink: fix races after skb queueing Ben Hutchings
2012-05-09  5:51 ` [ 071/167] [PATCH 11/26] net: fix a race in sock_queue_err_skb() Ben Hutchings
2012-05-09  5:51 ` [ 072/167] [PATCH 12/26] tcp: fix tcp_rcv_rtt_update() use of an unscaled RTT sample Ben Hutchings
2012-05-09  5:51 ` [ 073/167] [PATCH 13/26] net: allow pskb_expand_head() to get maximum tailroom Ben Hutchings
2012-05-09  5:51 ` [ 074/167] [PATCH 14/26] tcp: fix tcp_trim_head() Ben Hutchings
2012-05-09  8:16   ` Jonathan Nieder
2012-05-11  3:00     ` Ben Hutchings
2012-05-11  3:07       ` David Miller
2012-05-09  5:51 ` [ 075/167] [PATCH 15/26] tcp: avoid order-1 allocations on wifi and tx path Ben Hutchings
2012-05-09  8:19   ` Jonathan Nieder
2012-05-09  5:51 ` [ 076/167] [PATCH 16/26] atl1: fix kernel panic in case of DMA errors Ben Hutchings
2012-05-09  5:51 ` [ 077/167] [PATCH 17/26] 8139cp: set intr mask after its handler is registered Ben Hutchings
2012-05-09  5:51 ` [ 078/167] [PATCH 18/26] net: smsc911x: fix skb handling in receive path Ben Hutchings
2012-05-09  5:51 ` [ 079/167] [PATCH 19/26] net/ethernet: ks8851_mll fix rx frame buffer overflow Ben Hutchings
2012-05-09  5:51 ` [ 080/167] [PATCH 20/26] net_sched: gred: Fix oops in gred_dump() in WRED mode Ben Hutchings
2012-05-09  5:51 ` [ 081/167] [PATCH 21/26] net: usb: smsc75xx: fix mtu Ben Hutchings
2012-05-09  5:51 ` [ 082/167] [PATCH] dummy: Add ndo_uninit() Ben Hutchings
2012-05-09  5:51 ` [ 083/167] [PATCH 22/26] tcp: fix tcp_grow_window() for large incoming frames Ben Hutchings
2012-05-09  5:51 ` [ 084/167] [PATCH 23/26] netns: do not leak net_generic data on failed init Ben Hutchings
2012-05-09  5:51 ` [ 085/167] [PATCH 24/26] ksz884x: dont copy too much in netdev_set_mac_address() Ben Hutchings
2012-05-09  5:51 ` [ 086/167] [PATCH 25/26] net ax25: Reorder ax25_exit to remove races Ben Hutchings
2012-05-09  5:51 ` [ 087/167] [PATCH 26/26] tcp: fix TCP_MAXSEG for established IPv6 passive sockets Ben Hutchings
2012-05-09  5:51 ` [ 088/167] [PATCH] nfs: Enclose hostname in brackets when needed in nfs_do_root_mount Ben Hutchings
2012-05-09  5:51 ` [ 089/167] [PATCH] NFSv4: Ensure that the LOCK code sets exception->inode Ben Hutchings
2012-05-09  5:51 ` [ 090/167] [PATCH] NFSv4: Ensure that we check lock exclusive/shared type against open modes Ben Hutchings
2012-05-09  5:52 ` [ 091/167] [PATCH] NFS: put open context on error in nfs_pagein_multi Ben Hutchings
2012-05-09  5:52 ` [ 092/167] [PATCH] NFS: put open context on error in nfs_flush_multi Ben Hutchings
2012-05-09  5:52 ` [ 093/167] [PATCH] x86, microcode: Fix sysfs warning during module unload on unsupported CPUs Ben Hutchings
2012-05-09  5:52 ` [ 094/167] [PATCH] x86, apic: APIC code touches invalid MSR on P5 class machines Ben Hutchings
2012-05-09  5:52 ` [ 095/167] [PATCH] Revert "autofs: work around unhappy compat problem on x86-64" Ben Hutchings
2012-05-09  5:52 ` [ 096/167] [PATCH] xen: correctly check for pending events when restoring irq flags Ben Hutchings
2012-05-09  5:52 ` [ 097/167] [PATCH] xen/smp: Fix crash when booting with ACPI hotplug CPUs Ben Hutchings
2012-05-09  5:52 ` [ 098/167] [PATCH] ASoC: dapm: Ensure power gets managed for line widgets Ben Hutchings
2012-05-09  5:52 ` [ 099/167] [PATCH] ASoC: wm8994: Improve sequencing of AIF channel enables Ben Hutchings
2012-05-09  5:52 ` [ 100/167] [PATCH] dmaengine: at_hdmac: remove clear-on-read in atc_dostart() Ben Hutchings
2012-05-09  5:52 ` [ 101/167] [PATCH] sched: Fix OOPS when build_sched_domains() percpu allocation fails Ben Hutchings
2012-05-09  5:52 ` [ 102/167] [PATCH] tracing: Fix stacktrace of latency tracers (irqsoff and friends) Ben Hutchings
2012-05-09  5:52 ` [ 103/167] [PATCH] hwmon: fam15h_power: fix bogus values with current BIOSes Ben Hutchings
2012-05-09  5:52 ` [ 104/167] [PATCH] hwmon: (fam15h_power) Fix pci_device_id array Ben Hutchings
2012-05-09  5:52 ` [ 105/167] [PATCH] dell-laptop: Terminate quirks list properly Ben Hutchings
2012-05-09  5:52 ` [ 106/167] [PATCH] drm/radeon/kms: need to set up ss on DP bridges as well Ben Hutchings
2012-05-09  5:52 ` [ 107/167] [PATCH] drm/i915: handle input/output sdvo timings separately in mode_set Ben Hutchings
2012-05-09  5:52 ` [ 108/167] [PATCH] drm/i915: relative_constants_mode race fix Ben Hutchings
2012-05-09  5:52 ` [ 109/167] [PATCH] drm/i915: Force sync command ordering (Gen6+) Ben Hutchings
2012-05-09  5:52 ` [ 110/167] [PATCH] drm/i915: Set the Stencil Cache eviction policy to non-LRA mode Ben Hutchings
2012-05-09  5:52 ` [ 111/167] [PATCH] drm/i915: fix integer overflow in i915_gem_execbuffer2() Ben Hutchings
2012-05-09  5:52 ` [ 112/167] [PATCH] drm/i915: fix integer overflow in i915_gem_do_execbuffer() Ben Hutchings
2012-05-09  5:52 ` [ 113/167] nl80211: ensure interface is up in various APIs Ben Hutchings
2012-05-09  5:52 ` [ 114/167] [PATCH] ALSA: HDA: Add external mic quirk for Asus Zenbook UX31E Ben Hutchings
2012-05-09  5:52 ` [ 115/167] [PATCH] USB: cdc-wdm: fix race leading leading to memory corruption Ben Hutchings
2012-05-09  5:52 ` [ 116/167] [PATCH] USB: EHCI: fix crash during suspend on ASUS computers Ben Hutchings
2012-05-09  6:25   ` Oleksij Rempel
2012-05-09 14:20     ` Greg Kroah-Hartman
2012-05-09  5:52 ` [ 117/167] [PATCH] USB: gadget: storage gadgets send wrong error code for unknown commands Ben Hutchings
2012-05-09  5:52 ` [ 118/167] [PATCH] usb: gadget: dummy: do not call pullup() on udc_stop() Ben Hutchings
2012-05-09  5:52 ` [ 119/167] [PATCH] usb gadget: uvc: uvc_request_data::length field must be signed Ben Hutchings
2012-05-09  5:52 ` [ 120/167] [PATCH] pipes: add a "packetized pipe" mode for writing Ben Hutchings
2012-05-09  5:52 ` [ 121/167] [PATCH] autofs: make the autofsv5 packet file descriptor use a packetized pipe Ben Hutchings
2012-05-09  5:52 ` [ 122/167] [PATCH] ARM: 7396/1: errata: only handle ARM erratum #326103 on affected cores Ben Hutchings
2012-05-09  5:52 ` [ 123/167] [PATCH] ARM: 7397/1: l2x0: only apply workaround for erratum #753970 on PL310 Ben Hutchings
2012-05-09  5:52 ` [ 124/167] [PATCH] ARM: 7398/1: l2x0: only write to debug registers " Ben Hutchings
2012-05-09  5:52 ` [ 125/167] [PATCH] ARM: 7403/1: tls: remove covert channel via TPIDRURW Ben Hutchings
2012-05-09  5:52 ` [ 126/167] [PATCH] ARM: 7406/1: hotplug: copy the affinity mask when forcefully migrating IRQs Ben Hutchings
2012-05-09  5:52 ` [ 127/167] [PATCH] [SCSI] libsas: fix sas_find_bcast_phy() in the presence of vacant phys Ben Hutchings
2012-05-09  5:52 ` [ 128/167] [PATCH] [SCSI] libsas: fix false positive device attached conditions Ben Hutchings
2012-05-09  5:52 ` [ 129/167] [PATCH] efi: Add new variable attributes Ben Hutchings
2012-05-09  5:52 ` [ 130/167] [PATCH] efi: Validate UEFI boot variables Ben Hutchings
2012-05-09  5:52 ` [ 131/167] [PATCH] PM / Hibernate: fix the number of pages used for hibernate/thaw buffering Ben Hutchings
2012-05-09  5:52 ` [ 132/167] [PATCH] drm/i915: enable dip before writing data on gen4 Ben Hutchings
2012-05-09  5:52 ` [ 133/167] [PATCH] sched: Fix nohz load accounting -- again! Ben Hutchings
2012-05-09  5:52 ` [ 134/167] [PATCH] efivars: Improve variable validation Ben Hutchings
2012-05-09  5:52 ` [ 135/167] [PATCH] fs/cifs: fix parsing of dfs referrals Ben Hutchings
2012-05-09  5:52 ` [ 136/167] [PATCH] Fix __read_seqcount_begin() to use ACCESS_ONCE for sequence value read Ben Hutchings
2012-05-09  5:52 ` [ 137/167] [PATCH] hwmon: (coretemp) Increase CPU core limit Ben Hutchings
2012-05-09  5:52 ` [ 138/167] [PATCH] nouveau: initialise has_optimus variable Ben Hutchings
2012-05-09  5:52 ` [ 139/167] [PATCH] hwmon: (coretemp) fix oops on cpu unplug Ben Hutchings
2012-05-09  5:52 ` [ 140/167] [PATCH] libata: skip old error history when counting probe trials Ben Hutchings
2012-05-09  5:52 ` [ 141/167] [PATCH] b43: only reload config after successful initialization Ben Hutchings
2012-05-09  5:52 ` [ 142/167] [PATCH] i2c: pnx: Disable clk in suspend Ben Hutchings
2012-05-09  5:52 ` [ 143/167] [PATCH] ipw2200: Fix race condition in the command completion acknowledge Ben Hutchings
2012-05-09  5:52 ` [ 144/167] [PATCH] mac80211: fix AP mode EAP tx for VLAN stations Ben Hutchings
2012-05-09  5:52 ` [ 145/167] [PATCH] rtlwifi: Fix oops on unload Ben Hutchings
2012-05-09  5:52 ` [ 146/167] [PATCH] wl1251: fix crash on remove due to premature kfree Ben Hutchings
2012-05-09  5:52 ` [ 147/167] [PATCH] wl1251: fix crash on remove due to leftover work item Ben Hutchings
2012-05-09  5:52 ` [ 148/167] [PATCH] iwlwifi: do not nulify ctx->vif on reset Ben Hutchings
2012-05-09  5:52 ` [ 149/167] [PATCH] iwlwifi: fix hardware queue programming Ben Hutchings
2012-05-09  5:52 ` [ 150/167] [PATCH] hfsplus: Fix potential buffer overflows Ben Hutchings
2012-05-09  5:53 ` [ 151/167] [PATCH] ASoC: tlv312aic23: unbreak resume Ben Hutchings
2012-05-09  5:53 ` [ 152/167] [PATCH] asm-generic: Use __BITS_PER_LONG in statfs.h Ben Hutchings
2012-05-09  5:53 ` [ 153/167] [PATCH] x86, relocs: Remove an unused variable Ben Hutchings
2012-05-09  6:16   ` Jonathan Nieder
2012-05-09  5:53 ` [ 154/167] [PATCH] ARM: 7410/1: Add extra clobber registers for assembly in kernel_execve Ben Hutchings
2012-05-09  5:53 ` [ 155/167] [PATCH] ARM: 7414/1: SMP: prevent use of the console when using idmap_pgd Ben Hutchings
2012-05-09  5:53 ` [ 156/167] [PATCH] drm/i915: disable sdvo hotplug on i945g/gm Ben Hutchings
2012-05-09  5:53 ` [ 157/167] [PATCH] drm/i915: Do no set Stencil Cache eviction LRA w/a on gen7+ Ben Hutchings
2012-05-09  5:53 ` [ 158/167] [PATCH] xen/pte: Fix crashes when trying to see non-existent PGD/PMD/PUD/PTEs Ben Hutchings
2012-05-09  5:53 ` [ 159/167] [PATCH] xen/pci: dont use PCI BIOS service for configuration space accesses Ben Hutchings
2012-05-09  5:53 ` [ 160/167] [PATCH] percpu, x86: dont use PMD_SIZE as embedded atom_size on 32bit Ben Hutchings
2012-05-09  5:53 ` [ 161/167] [PATCH] iwlagn: allow up to uCode API 6 for 6000 devices Ben Hutchings
2012-05-09  5:53 ` [ 162/167] [PATCH] iwlwifi: use correct released ucode version Ben Hutchings
2012-05-09  5:53 ` [ 163/167] [PATCH] iwlwifi: use 6000G2B for 6030 device series Ben Hutchings
2012-05-09  5:53 ` [ 164/167] [PATCH] exit_signal: simplify the "we have changed execution domain" logic Ben Hutchings
2012-05-09  5:53 ` [ 165/167] [PATCH] exit_signal: fix the "parent has changed security " Ben Hutchings
2012-05-09  5:53 ` [ 166/167] [PATCH] staging: r8712u: Fix regression caused by commit 8c213fa Ben Hutchings
2012-05-09 19:49   ` Herton Ronaldo Krzesinski
2012-05-11  3:21     ` Ben Hutchings
2012-05-11 16:28       ` Larry Finger
2012-05-09  5:53 ` [ 167/167] [PATCH] smsc95xx: mark link down on startup and let PHY interrupt deal with carrier changes Ben Hutchings

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.