linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [01/80] eCryptfs: Flush file in vma close
  2011-12-07 16:12 [00/80] 3.0.13-stable review Greg KH
@ 2011-12-07 16:06 ` Greg KH
  2011-12-07 16:06 ` [02/80] i2c-algo-bit: Generate correct i2c address sequence for 10-bit target Greg KH
                   ` (78 subsequent siblings)
  79 siblings, 0 replies; 91+ messages in thread
From: Greg KH @ 2011-12-07 16:06 UTC (permalink / raw)
  To: linux-kernel, stable; +Cc: torvalds, akpm, alan, Tyler Hicks

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

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

From: Tyler Hicks <tyhicks@canonical.com>

commit 32001d6fe9ac6b0423e674a3093aa56740849f3b upstream.

Dirty pages weren't being written back when an mmap'ed eCryptfs file was
closed before the mapping was unmapped. Since f_ops->flush() is not
called by the munmap() path, the lower file was simply being released.
This patch flushes the eCryptfs file in the vm_ops->close() path.

https://launchpad.net/bugs/870326

Signed-off-by: Tyler Hicks <tyhicks@canonical.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

---
 fs/ecryptfs/file.c |   23 ++++++++++++++++++++++-
 1 file changed, 22 insertions(+), 1 deletion(-)

--- a/fs/ecryptfs/file.c
+++ b/fs/ecryptfs/file.c
@@ -139,6 +139,27 @@ out:
 	return rc;
 }
 
+static void ecryptfs_vma_close(struct vm_area_struct *vma)
+{
+	filemap_write_and_wait(vma->vm_file->f_mapping);
+}
+
+static const struct vm_operations_struct ecryptfs_file_vm_ops = {
+	.close		= ecryptfs_vma_close,
+	.fault		= filemap_fault,
+};
+
+static int ecryptfs_file_mmap(struct file *file, struct vm_area_struct *vma)
+{
+	int rc;
+
+	rc = generic_file_mmap(file, vma);
+	if (!rc)
+		vma->vm_ops = &ecryptfs_file_vm_ops;
+
+	return rc;
+}
+
 struct kmem_cache *ecryptfs_file_info_cache;
 
 /**
@@ -348,7 +369,7 @@ const struct file_operations ecryptfs_ma
 #ifdef CONFIG_COMPAT
 	.compat_ioctl = ecryptfs_compat_ioctl,
 #endif
-	.mmap = generic_file_mmap,
+	.mmap = ecryptfs_file_mmap,
 	.open = ecryptfs_open,
 	.flush = ecryptfs_flush,
 	.release = ecryptfs_release,



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

* [02/80] i2c-algo-bit: Generate correct i2c address sequence for 10-bit target
  2011-12-07 16:12 [00/80] 3.0.13-stable review Greg KH
  2011-12-07 16:06 ` [01/80] eCryptfs: Flush file in vma close Greg KH
@ 2011-12-07 16:06 ` Greg KH
  2011-12-07 16:06 ` [03/80] eCryptfs: Extend array bounds for all filename chars Greg KH
                   ` (77 subsequent siblings)
  79 siblings, 0 replies; 91+ messages in thread
From: Greg KH @ 2011-12-07 16:06 UTC (permalink / raw)
  To: linux-kernel, stable; +Cc: torvalds, akpm, alan, Sheng-Hui J. Chu, Jean Delvare

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

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

From: "Jeffrey (Sheng-Hui) Chu" <jeffchu@broadcom.com>

commit cc6bcf7d2ec2234e7b41770185e4dc826390185e upstream.

The wrong bits were put on the wire, fix that.

This fixes kernel bug #42562.

Signed-off-by: Sheng-Hui J. Chu <jeffchu@broadcom.com>
Signed-off-by: Jean Delvare <khali@linux-fr.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

---
 drivers/i2c/algos/i2c-algo-bit.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

--- a/drivers/i2c/algos/i2c-algo-bit.c
+++ b/drivers/i2c/algos/i2c-algo-bit.c
@@ -486,7 +486,7 @@ static int bit_doAddress(struct i2c_adap
 
 	if (flags & I2C_M_TEN) {
 		/* a ten bit address */
-		addr = 0xf0 | ((msg->addr >> 7) & 0x03);
+		addr = 0xf0 | ((msg->addr >> 7) & 0x06);
 		bit_dbg(2, &i2c_adap->dev, "addr0: %d\n", addr);
 		/* try extended address code...*/
 		ret = try_address(i2c_adap, addr, retries);
@@ -496,7 +496,7 @@ static int bit_doAddress(struct i2c_adap
 			return -EREMOTEIO;
 		}
 		/* the remaining 8 bit address */
-		ret = i2c_outb(i2c_adap, msg->addr & 0x7f);
+		ret = i2c_outb(i2c_adap, msg->addr & 0xff);
 		if ((ret != 1) && !nak_ok) {
 			/* the chip did not ack / xmission error occurred */
 			dev_err(&i2c_adap->dev, "died at 2nd address code\n");



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

* [03/80] eCryptfs: Extend array bounds for all filename chars
  2011-12-07 16:12 [00/80] 3.0.13-stable review Greg KH
  2011-12-07 16:06 ` [01/80] eCryptfs: Flush file in vma close Greg KH
  2011-12-07 16:06 ` [02/80] i2c-algo-bit: Generate correct i2c address sequence for 10-bit target Greg KH
@ 2011-12-07 16:06 ` Greg KH
  2011-12-07 16:06 ` [04/80] crypto: mv_cesa - fix hashing of chunks > 1920 bytes Greg KH
                   ` (76 subsequent siblings)
  79 siblings, 0 replies; 91+ messages in thread
From: Greg KH @ 2011-12-07 16:06 UTC (permalink / raw)
  To: linux-kernel, stable; +Cc: torvalds, akpm, alan, Tyler Hicks

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

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

From: Tyler Hicks <tyhicks@canonical.com>

commit 0f751e641a71157aa584c2a2e22fda52b52b8a56 upstream.

>From mhalcrow's original commit message:

    Characters with ASCII values greater than the size of
    filename_rev_map[] are valid filename characters.
    ecryptfs_decode_from_filename() will access kernel memory beyond
    that array, and ecryptfs_parse_tag_70_packet() will then decrypt
    those characters. The attacker, using the FNEK of the crafted file,
    can then re-encrypt the characters to reveal the kernel memory past
    the end of the filename_rev_map[] array. I expect low security
    impact since this array is statically allocated in the text area,
    and the amount of memory past the array that is accessible is
    limited by the largest possible ASCII filename character.

This patch solves the issue reported by mhalcrow but with an
implementation suggested by Linus to simply extend the length of
filename_rev_map[] to 256. Characters greater than 0x7A are mapped to
0x00, which is how invalid characters less than 0x7A were previously
being handled.

Signed-off-by: Tyler Hicks <tyhicks@canonical.com>
Reported-by: Michael Halcrow <mhalcrow@google.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

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

--- a/fs/ecryptfs/crypto.c
+++ b/fs/ecryptfs/crypto.c
@@ -1943,7 +1943,7 @@ static unsigned char *portable_filename_
 
 /* We could either offset on every reverse map or just pad some 0x00's
  * at the front here */
-static const unsigned char filename_rev_map[] = {
+static const unsigned char filename_rev_map[256] = {
 	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 7 */
 	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 15 */
 	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 23 */
@@ -1959,7 +1959,7 @@ static const unsigned char filename_rev_
 	0x00, 0x26, 0x27, 0x28, 0x29, 0x2A, 0x2B, 0x2C, /* 103 */
 	0x2D, 0x2E, 0x2F, 0x30, 0x31, 0x32, 0x33, 0x34, /* 111 */
 	0x35, 0x36, 0x37, 0x38, 0x39, 0x3A, 0x3B, 0x3C, /* 119 */
-	0x3D, 0x3E, 0x3F
+	0x3D, 0x3E, 0x3F /* 123 - 255 initialized to 0x00 */
 };
 
 /**



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

* [04/80] crypto: mv_cesa - fix hashing of chunks > 1920 bytes
  2011-12-07 16:12 [00/80] 3.0.13-stable review Greg KH
                   ` (2 preceding siblings ...)
  2011-12-07 16:06 ` [03/80] eCryptfs: Extend array bounds for all filename chars Greg KH
@ 2011-12-07 16:06 ` Greg KH
  2011-12-07 16:06 ` [05/80] drm: integer overflow in drm_mode_dirtyfb_ioctl() Greg KH
                   ` (75 subsequent siblings)
  79 siblings, 0 replies; 91+ messages in thread
From: Greg KH @ 2011-12-07 16:06 UTC (permalink / raw)
  To: linux-kernel, stable; +Cc: torvalds, akpm, alan, Phil Sutter, Herbert Xu

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

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

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

commit 274252862f386b7868f35bf5ceaa5391a8ccfdf3 upstream.

This was broken by commit 7759995c75ae0cbd4c861582908449f6b6208e7a (yes,
myself). The basic problem here is since the digest state is only saved
after the last chunk, the state array is only valid when handling the
first chunk of the next buffer. Broken since linux-3.0.

Signed-off-by: Phil Sutter <phil.sutter@viprinet.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

---
 drivers/crypto/mv_cesa.c |   12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)

--- a/drivers/crypto/mv_cesa.c
+++ b/drivers/crypto/mv_cesa.c
@@ -342,11 +342,13 @@ static void mv_process_hash_current(int
 		else
 			op.config |= CFG_MID_FRAG;
 
-		writel(req_ctx->state[0], cpg->reg + DIGEST_INITIAL_VAL_A);
-		writel(req_ctx->state[1], cpg->reg + DIGEST_INITIAL_VAL_B);
-		writel(req_ctx->state[2], cpg->reg + DIGEST_INITIAL_VAL_C);
-		writel(req_ctx->state[3], cpg->reg + DIGEST_INITIAL_VAL_D);
-		writel(req_ctx->state[4], cpg->reg + DIGEST_INITIAL_VAL_E);
+		if (first_block) {
+			writel(req_ctx->state[0], cpg->reg + DIGEST_INITIAL_VAL_A);
+			writel(req_ctx->state[1], cpg->reg + DIGEST_INITIAL_VAL_B);
+			writel(req_ctx->state[2], cpg->reg + DIGEST_INITIAL_VAL_C);
+			writel(req_ctx->state[3], cpg->reg + DIGEST_INITIAL_VAL_D);
+			writel(req_ctx->state[4], cpg->reg + DIGEST_INITIAL_VAL_E);
+		}
 	}
 
 	memcpy(cpg->sram + SRAM_CONFIG, &op, sizeof(struct sec_accel_config));



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

* [05/80] drm: integer overflow in drm_mode_dirtyfb_ioctl()
  2011-12-07 16:12 [00/80] 3.0.13-stable review Greg KH
                   ` (3 preceding siblings ...)
  2011-12-07 16:06 ` [04/80] crypto: mv_cesa - fix hashing of chunks > 1920 bytes Greg KH
@ 2011-12-07 16:06 ` Greg KH
  2011-12-07 16:06 ` [06/80] drm/radeon/kms: fix up gpio i2c mask bits for r4xx for real Greg KH
                   ` (74 subsequent siblings)
  79 siblings, 0 replies; 91+ messages in thread
From: Greg KH @ 2011-12-07 16:06 UTC (permalink / raw)
  To: linux-kernel, stable; +Cc: torvalds, akpm, alan, Xi Wang, Dave Airlie

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

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

From: Xi Wang <xi.wang@gmail.com>

commit a5cd335165e31db9dbab636fd29895d41da55dd2 upstream.

There is a potential integer overflow in drm_mode_dirtyfb_ioctl()
if userspace passes in a large num_clips.  The call to kmalloc would
allocate a small buffer, and the call to fb->funcs->dirty may result
in a memory corruption.

Reported-by: Haogang Chen <haogangchen@gmail.com>
Signed-off-by: Xi Wang <xi.wang@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

---
 drivers/gpu/drm/drm_crtc.c |    4 ++++
 include/drm/drm_mode.h     |    2 ++
 2 files changed, 6 insertions(+)

--- a/drivers/gpu/drm/drm_crtc.c
+++ b/drivers/gpu/drm/drm_crtc.c
@@ -1866,6 +1866,10 @@ int drm_mode_dirtyfb_ioctl(struct drm_de
 	}
 
 	if (num_clips && clips_ptr) {
+		if (num_clips < 0 || num_clips > DRM_MODE_FB_DIRTY_MAX_CLIPS) {
+			ret = -EINVAL;
+			goto out_err1;
+		}
 		clips = kzalloc(num_clips * sizeof(*clips), GFP_KERNEL);
 		if (!clips) {
 			ret = -ENOMEM;
--- a/include/drm/drm_mode.h
+++ b/include/drm/drm_mode.h
@@ -233,6 +233,8 @@ struct drm_mode_fb_cmd {
 #define DRM_MODE_FB_DIRTY_ANNOTATE_FILL 0x02
 #define DRM_MODE_FB_DIRTY_FLAGS         0x03
 
+#define DRM_MODE_FB_DIRTY_MAX_CLIPS     256
+
 /*
  * Mark a region of a framebuffer as dirty.
  *



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

* [06/80] drm/radeon/kms: fix up gpio i2c mask bits for r4xx for real
  2011-12-07 16:12 [00/80] 3.0.13-stable review Greg KH
                   ` (4 preceding siblings ...)
  2011-12-07 16:06 ` [05/80] drm: integer overflow in drm_mode_dirtyfb_ioctl() Greg KH
@ 2011-12-07 16:06 ` Greg KH
  2011-12-07 16:06 ` [07/80] drm/i915: Ivybridge still has fences! Greg KH
                   ` (73 subsequent siblings)
  79 siblings, 0 replies; 91+ messages in thread
From: Greg KH @ 2011-12-07 16:06 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: torvalds, akpm, alan, Alex Deucher, Jean Delvare, Dave Airlie

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

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

From: Alex Deucher <alexander.deucher@amd.com>

commit d724502a9d7a46f4a56a1663b1f50d2dc9d1ef40 upstream.

Fixes i2c test failures when i2c_algo_bit.bit_test=1.

The hw doesn't actually require a mask, so just set it
to the default mask bits for r1xx-r4xx radeon ddc.

I missed this part the first time through.

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Cc: Jean Delvare <khali@linux-fr.org>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

---
 drivers/gpu/drm/radeon/radeon_atombios.c |   12 ++++++++++++
 1 file changed, 12 insertions(+)

--- a/drivers/gpu/drm/radeon/radeon_atombios.c
+++ b/drivers/gpu/drm/radeon/radeon_atombios.c
@@ -169,6 +169,18 @@ void radeon_atombios_i2c_init(struct rad
 			gpio = &i2c_info->asGPIO_Info[i];
 			i2c.valid = false;
 
+			/* r4xx mask is technically not used by the hw, so patch in the legacy mask bits */
+			if ((rdev->family == CHIP_R420) ||
+			    (rdev->family == CHIP_R423) ||
+			    (rdev->family == CHIP_RV410)) {
+				if ((le16_to_cpu(gpio->usClkMaskRegisterIndex) == 0x0018) ||
+				    (le16_to_cpu(gpio->usClkMaskRegisterIndex) == 0x0019) ||
+				    (le16_to_cpu(gpio->usClkMaskRegisterIndex) == 0x001a)) {
+					gpio->ucClkMaskShift = 0x19;
+					gpio->ucDataMaskShift = 0x18;
+				}
+			}
+
 			/* some evergreen boards have bad data for this entry */
 			if (ASIC_IS_DCE4(rdev)) {
 				if ((i == 7) &&



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

* [07/80] drm/i915: Ivybridge still has fences!
  2011-12-07 16:12 [00/80] 3.0.13-stable review Greg KH
                   ` (5 preceding siblings ...)
  2011-12-07 16:06 ` [06/80] drm/radeon/kms: fix up gpio i2c mask bits for r4xx for real Greg KH
@ 2011-12-07 16:06 ` Greg KH
  2011-12-07 16:06 ` [08/80] drm/i915: Turn on a required 3D clock gating bit on Sandybridge Greg KH
                   ` (72 subsequent siblings)
  79 siblings, 0 replies; 91+ messages in thread
From: Greg KH @ 2011-12-07 16:06 UTC (permalink / raw)
  To: linux-kernel, stable; +Cc: torvalds, akpm, alan, Daniel Vetter, Keith Packard

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

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

From: Daniel Vetter <daniel.vetter@ffwll.ch>

commit 775d17b6ca4357048f36c22151335addfe15db4b upstream.

So don't forget to restore them on resume and dump them into
the error state.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

---
 drivers/gpu/drm/i915/i915_irq.c     |    1 +
 drivers/gpu/drm/i915/i915_suspend.c |    2 ++
 2 files changed, 3 insertions(+)

--- a/drivers/gpu/drm/i915/i915_irq.c
+++ b/drivers/gpu/drm/i915/i915_irq.c
@@ -820,6 +820,7 @@ static void i915_gem_record_fences(struc
 
 	/* Fences */
 	switch (INTEL_INFO(dev)->gen) {
+	case 7:
 	case 6:
 		for (i = 0; i < 16; i++)
 			error->fence[i] = I915_READ64(FENCE_REG_SANDYBRIDGE_0 + (i * 8));
--- a/drivers/gpu/drm/i915/i915_suspend.c
+++ b/drivers/gpu/drm/i915/i915_suspend.c
@@ -370,6 +370,7 @@ static void i915_save_modeset_reg(struct
 
 	/* Fences */
 	switch (INTEL_INFO(dev)->gen) {
+	case 7:
 	case 6:
 		for (i = 0; i < 16; i++)
 			dev_priv->saveFENCE[i] = I915_READ64(FENCE_REG_SANDYBRIDGE_0 + (i * 8));
@@ -404,6 +405,7 @@ static void i915_restore_modeset_reg(str
 
 	/* Fences */
 	switch (INTEL_INFO(dev)->gen) {
+	case 7:
 	case 6:
 		for (i = 0; i < 16; i++)
 			I915_WRITE64(FENCE_REG_SANDYBRIDGE_0 + (i * 8), dev_priv->saveFENCE[i]);



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

* [08/80] drm/i915: Turn on a required 3D clock gating bit on Sandybridge.
  2011-12-07 16:12 [00/80] 3.0.13-stable review Greg KH
                   ` (6 preceding siblings ...)
  2011-12-07 16:06 ` [07/80] drm/i915: Ivybridge still has fences! Greg KH
@ 2011-12-07 16:06 ` Greg KH
  2011-12-07 16:06 ` [09/80] drm/i915: Turn on another required clock gating bit on gen6 Greg KH
                   ` (71 subsequent siblings)
  79 siblings, 0 replies; 91+ messages in thread
From: Greg KH @ 2011-12-07 16:06 UTC (permalink / raw)
  To: linux-kernel, stable; +Cc: torvalds, akpm, alan, Eric Anholt, Keith Packard

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

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

From: Eric Anholt <eric@anholt.net>

commit 406478dc911e16677fbd9c84d1d50cdffbc031ab upstream.

Fixes rendering failures in Unigine Tropics and Sanctuary and the mesa
"fire" demo.

Signed-off-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

---
 drivers/gpu/drm/i915/i915_reg.h      |    3 +++
 drivers/gpu/drm/i915/intel_display.c |    9 +++++++++
 2 files changed, 12 insertions(+)

--- a/drivers/gpu/drm/i915/i915_reg.h
+++ b/drivers/gpu/drm/i915/i915_reg.h
@@ -3370,6 +3370,9 @@
 
 #define  GT_FIFO_FREE_ENTRIES			0x120008
 
+#define GEN6_UCGCTL2				0x9404
+# define GEN6_RCPBUNIT_CLOCK_GATE_DISABLE		(1 << 12)
+
 #define GEN6_RPNSWREQ				0xA008
 #define   GEN6_TURBO_DISABLE			(1<<31)
 #define   GEN6_FREQUENCY(x)			((x)<<25)
--- a/drivers/gpu/drm/i915/intel_display.c
+++ b/drivers/gpu/drm/i915/intel_display.c
@@ -7405,6 +7405,15 @@ static void gen6_init_clock_gating(struc
 	I915_WRITE(WM2_LP_ILK, 0);
 	I915_WRITE(WM1_LP_ILK, 0);
 
+	/* According to the BSpec vol1g, bit 12 (RCPBUNIT) clock
+	 * gating disable must be set.  Failure to set it results in
+	 * flickering pixels due to Z write ordering failures after
+	 * some amount of runtime in the Mesa "fire" demo, and Unigine
+	 * Sanctuary and Tropics, and apparently anything else with
+	 * alpha test or pixel discard.
+	 */
+	I915_WRITE(GEN6_UCGCTL2, GEN6_RCPBUNIT_CLOCK_GATE_DISABLE);
+
 	/*
 	 * According to the spec the following bits should be
 	 * set in order to enable memory self-refresh and fbc:



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

* [09/80] drm/i915: Turn on another required clock gating bit on gen6.
  2011-12-07 16:12 [00/80] 3.0.13-stable review Greg KH
                   ` (7 preceding siblings ...)
  2011-12-07 16:06 ` [08/80] drm/i915: Turn on a required 3D clock gating bit on Sandybridge Greg KH
@ 2011-12-07 16:06 ` Greg KH
  2011-12-07 16:06 ` [10/80] drm/ttm: request zeroed system memory pages for new TT buffer objects Greg KH
                   ` (70 subsequent siblings)
  79 siblings, 0 replies; 91+ messages in thread
From: Greg KH @ 2011-12-07 16:06 UTC (permalink / raw)
  To: linux-kernel, stable; +Cc: torvalds, akpm, alan, Eric Anholt, Keith Packard

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

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

From: Eric Anholt <eric@anholt.net>

commit 9ca1d10d748e56964de95e3ed80211b192f56cf4 upstream.

Unlike the previous one, I don't have known testcases it fixes.  I'd
rather not go through the same debug cycle on whatever testcases those
might be.

Signed-off-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

---
 drivers/gpu/drm/i915/i915_reg.h      |    1 +
 drivers/gpu/drm/i915/intel_display.c |    7 ++++++-
 2 files changed, 7 insertions(+), 1 deletion(-)

--- a/drivers/gpu/drm/i915/i915_reg.h
+++ b/drivers/gpu/drm/i915/i915_reg.h
@@ -3372,6 +3372,7 @@
 
 #define GEN6_UCGCTL2				0x9404
 # define GEN6_RCPBUNIT_CLOCK_GATE_DISABLE		(1 << 12)
+# define GEN6_RCCUNIT_CLOCK_GATE_DISABLE		(1 << 11)
 
 #define GEN6_RPNSWREQ				0xA008
 #define   GEN6_TURBO_DISABLE			(1<<31)
--- a/drivers/gpu/drm/i915/intel_display.c
+++ b/drivers/gpu/drm/i915/intel_display.c
@@ -7411,8 +7411,13 @@ static void gen6_init_clock_gating(struc
 	 * some amount of runtime in the Mesa "fire" demo, and Unigine
 	 * Sanctuary and Tropics, and apparently anything else with
 	 * alpha test or pixel discard.
+	 *
+	 * According to the spec, bit 11 (RCCUNIT) must also be set,
+	 * but we didn't debug actual testcases to find it out.
 	 */
-	I915_WRITE(GEN6_UCGCTL2, GEN6_RCPBUNIT_CLOCK_GATE_DISABLE);
+	I915_WRITE(GEN6_UCGCTL2,
+		   GEN6_RCPBUNIT_CLOCK_GATE_DISABLE |
+		   GEN6_RCCUNIT_CLOCK_GATE_DISABLE);
 
 	/*
 	 * According to the spec the following bits should be



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

* [10/80] drm/ttm: request zeroed system memory pages for new TT buffer objects
  2011-12-07 16:12 [00/80] 3.0.13-stable review Greg KH
                   ` (8 preceding siblings ...)
  2011-12-07 16:06 ` [09/80] drm/i915: Turn on another required clock gating bit on gen6 Greg KH
@ 2011-12-07 16:06 ` Greg KH
  2011-12-07 16:06 ` [11/80] drm/i915: fix CB tuning check for ILK+ Greg KH
                   ` (69 subsequent siblings)
  79 siblings, 0 replies; 91+ messages in thread
From: Greg KH @ 2011-12-07 16:06 UTC (permalink / raw)
  To: linux-kernel, stable; +Cc: torvalds, akpm, alan, Ben Skeggs, Dave Airlie

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

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

From: Ben Skeggs <bskeggs@redhat.com>

commit ff02b13f6867af72682d7a9bb9bd705f9af2bab0 upstream.

Fixes an information leak to userspace, we were handing out un-zeroed pages
for any newly created TTM_PL_TT buffer.

Reported-by: Marcin Slusarz <marcin.slusarz@gmail.com>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Tested-by: Marcin Slusarz <marcin.slusarz@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

---
 drivers/gpu/drm/ttm/ttm_bo.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

--- a/drivers/gpu/drm/ttm/ttm_bo.c
+++ b/drivers/gpu/drm/ttm/ttm_bo.c
@@ -394,7 +394,8 @@ static int ttm_bo_handle_move_mem(struct
 
 	if (!(new_man->flags & TTM_MEMTYPE_FLAG_FIXED)) {
 		if (bo->ttm == NULL) {
-			ret = ttm_bo_add_ttm(bo, false);
+			bool zero = !(old_man->flags & TTM_MEMTYPE_FLAG_FIXED);
+			ret = ttm_bo_add_ttm(bo, zero);
 			if (ret)
 				goto out_err;
 		}



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

* [11/80] drm/i915: fix CB tuning check for ILK+
  2011-12-07 16:12 [00/80] 3.0.13-stable review Greg KH
                   ` (9 preceding siblings ...)
  2011-12-07 16:06 ` [10/80] drm/ttm: request zeroed system memory pages for new TT buffer objects Greg KH
@ 2011-12-07 16:06 ` Greg KH
  2011-12-07 16:06 ` [12/80] PCI hotplug: shpchp: dont blindly claim non-AMD 0x7450 device IDs Greg KH
                   ` (68 subsequent siblings)
  79 siblings, 0 replies; 91+ messages in thread
From: Greg KH @ 2011-12-07 16:06 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: torvalds, akpm, alan, Jesse Barnes, Keith Packard, Timo Aaltonen

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

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

From: Jesse Barnes <jbarnes@virtuousgeek.org>

commit cb0e093162d7b6589c2217a00e2abfef686b32d6 upstream.

CB tuning is needed to handle potential process variations that might
cause clock jitter for certain PLL settings.  However, we were setting
it incorrectly since we were using the wrong M value as a check (M1 when
we needed to use the whole M value).  Fix it up, making my HDMI
attached display a little prettier (used to have occasional dots crawl
across the display).

Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
Signed-off-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Timo Aaltonen <timo@canonical.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

---
 drivers/gpu/drm/i915/intel_display.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- a/drivers/gpu/drm/i915/intel_display.c
+++ b/drivers/gpu/drm/i915/intel_display.c
@@ -4972,7 +4972,7 @@ static int ironlake_crtc_mode_set(struct
 	} else if (is_sdvo && is_tv)
 		factor = 20;
 
-	if (clock.m1 < factor * clock.n)
+	if (clock.m < factor * clock.n)
 		fp |= FP_CB_TUNE;
 
 	dpll = 0;



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

* [12/80] PCI hotplug: shpchp: dont blindly claim non-AMD 0x7450 device IDs
  2011-12-07 16:12 [00/80] 3.0.13-stable review Greg KH
                   ` (10 preceding siblings ...)
  2011-12-07 16:06 ` [11/80] drm/i915: fix CB tuning check for ILK+ Greg KH
@ 2011-12-07 16:06 ` Greg KH
  2011-12-07 16:06 ` [13/80] drm/radeon/kms: fix up gpio i2c mask bits for r4xx Greg KH
                   ` (67 subsequent siblings)
  79 siblings, 0 replies; 91+ messages in thread
From: Greg KH @ 2011-12-07 16:06 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: torvalds, akpm, alan, Joerg Roedel, Bjorn Helgaas, Jesse Barnes

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

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

From: Bjorn Helgaas <bhelgaas@google.com>

commit 4cac2eb158c6da0c761689345c6cc5df788a6292 upstream.

Previously we claimed device ID 0x7450, regardless of the vendor, which is
clearly wrong.  Now we'll claim that device ID only for AMD.

I suspect this was just a typo in the original code, but it's possible this
change will break shpchp on non-7450 AMD bridges.  If so, we'll have to fix
them as we find them.

Reference: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=638863
Reported-by: Ralf Jung <ralfjung-e@gmx.de>
Cc: Joerg Roedel <joerg.roedel@amd.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

---
 drivers/pci/hotplug/shpchp_core.c |    4 ++--
 drivers/pci/hotplug/shpchp_hpc.c  |    4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)

--- a/drivers/pci/hotplug/shpchp_core.c
+++ b/drivers/pci/hotplug/shpchp_core.c
@@ -278,8 +278,8 @@ static int get_adapter_status (struct ho
 
 static int is_shpc_capable(struct pci_dev *dev)
 {
-	if ((dev->vendor == PCI_VENDOR_ID_AMD) || (dev->device ==
-						PCI_DEVICE_ID_AMD_GOLAM_7450))
+	if (dev->vendor == PCI_VENDOR_ID_AMD &&
+	    dev->device == PCI_DEVICE_ID_AMD_GOLAM_7450)
 		return 1;
 	if (!pci_find_capability(dev, PCI_CAP_ID_SHPC))
 		return 0;
--- a/drivers/pci/hotplug/shpchp_hpc.c
+++ b/drivers/pci/hotplug/shpchp_hpc.c
@@ -944,8 +944,8 @@ int shpc_init(struct controller *ctrl, s
 	ctrl->pci_dev = pdev;  /* pci_dev of the P2P bridge */
 	ctrl_dbg(ctrl, "Hotplug Controller:\n");
 
-	if ((pdev->vendor == PCI_VENDOR_ID_AMD) || (pdev->device ==
-				PCI_DEVICE_ID_AMD_GOLAM_7450)) {
+	if (pdev->vendor == PCI_VENDOR_ID_AMD &&
+	    pdev->device == PCI_DEVICE_ID_AMD_GOLAM_7450) {
 		/* amd shpc driver doesn't use Base Offset; assume 0 */
 		ctrl->mmio_base = pci_resource_start(pdev, 0);
 		ctrl->mmio_size = pci_resource_len(pdev, 0);



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

* [13/80] drm/radeon/kms: fix up gpio i2c mask bits for r4xx
  2011-12-07 16:12 [00/80] 3.0.13-stable review Greg KH
                   ` (11 preceding siblings ...)
  2011-12-07 16:06 ` [12/80] PCI hotplug: shpchp: dont blindly claim non-AMD 0x7450 device IDs Greg KH
@ 2011-12-07 16:06 ` Greg KH
  2011-12-07 16:06 ` [14/80] viafb: correct sync polarity for OLPC DCON Greg KH
                   ` (66 subsequent siblings)
  79 siblings, 0 replies; 91+ messages in thread
From: Greg KH @ 2011-12-07 16:06 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: torvalds, akpm, alan, Alex Deucher, Jean Delvare, Dave Airlie

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

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

From: Alex Deucher <alexander.deucher@amd.com>

commit 6c47e5c23aa2a7c54ad7ac13af4bd56cd9e703bf upstream.

Fixes i2c test failures when i2c_algo_bit.bit_test=1.

The hw doesn't actually require a mask, so just set it
to the default mask bits for r1xx-r4xx radeon ddc.

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Cc: Jean Delvare <khali@linux-fr.org>
Signed-off-by: Dave Airlie <airlied@redhat.com>

---
 drivers/gpu/drm/radeon/radeon_atombios.c |   12 ++++++++++++
 1 file changed, 12 insertions(+)

--- a/drivers/gpu/drm/radeon/radeon_atombios.c
+++ b/drivers/gpu/drm/radeon/radeon_atombios.c
@@ -85,6 +85,18 @@ static inline struct radeon_i2c_bus_rec
 		for (i = 0; i < num_indices; i++) {
 			gpio = &i2c_info->asGPIO_Info[i];
 
+			/* r4xx mask is technically not used by the hw, so patch in the legacy mask bits */
+			if ((rdev->family == CHIP_R420) ||
+			    (rdev->family == CHIP_R423) ||
+			    (rdev->family == CHIP_RV410)) {
+				if ((le16_to_cpu(gpio->usClkMaskRegisterIndex) == 0x0018) ||
+				    (le16_to_cpu(gpio->usClkMaskRegisterIndex) == 0x0019) ||
+				    (le16_to_cpu(gpio->usClkMaskRegisterIndex) == 0x001a)) {
+					gpio->ucClkMaskShift = 0x19;
+					gpio->ucDataMaskShift = 0x18;
+				}
+			}
+
 			/* some evergreen boards have bad data for this entry */
 			if (ASIC_IS_DCE4(rdev)) {
 				if ((i == 7) &&



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

* [14/80] viafb: correct sync polarity for OLPC DCON
  2011-12-07 16:12 [00/80] 3.0.13-stable review Greg KH
                   ` (12 preceding siblings ...)
  2011-12-07 16:06 ` [13/80] drm/radeon/kms: fix up gpio i2c mask bits for r4xx Greg KH
@ 2011-12-07 16:06 ` Greg KH
  2011-12-07 16:06 ` [15/80] ARM: pxa: fix inconsistent CONFIG_USB_PXA27X Greg KH
                   ` (65 subsequent siblings)
  79 siblings, 0 replies; 91+ messages in thread
From: Greg KH @ 2011-12-07 16:06 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: torvalds, akpm, alan, Daniel Drake, Florian Tobias Schandinat

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

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

From: Daniel Drake <dsd@laptop.org>

commit a32839696a8eef813a1aff604fbad9a32dff6c95 upstream.

While the OLPC display appears to be able to handle either positive
or negative sync, the Display Controller only recognises positive sync.

This brings viafb (for XO-1.5) in line with lxfb (for XO-1) and
fixes a recent regression where the XO-1.5 DCON could no longer be
frozen. Thanks to Florian Tobias Schandinat for helping identify
the fix.

Test case: from a vt,
	echo 1 > /sys/devices/platform/dcon/freeze
should cause the current screen contents to freeze, rather than garbage being
displayed.

Signed-off-by: Daniel Drake <dsd@laptop.org>
Signed-off-by: Florian Tobias Schandinat <FlorianSchandinat@gmx.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

---
 drivers/video/via/share.h |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

--- a/drivers/video/via/share.h
+++ b/drivers/video/via/share.h
@@ -557,8 +557,8 @@
 #define M1200X720_R60_VSP       POSITIVE
 
 /* 1200x900@60 Sync Polarity (DCON) */
-#define M1200X900_R60_HSP       NEGATIVE
-#define M1200X900_R60_VSP       NEGATIVE
+#define M1200X900_R60_HSP       POSITIVE
+#define M1200X900_R60_VSP       POSITIVE
 
 /* 1280x600@60 Sync Polarity (GTF Mode) */
 #define M1280x600_R60_HSP       NEGATIVE



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

* [15/80] ARM: pxa: fix inconsistent CONFIG_USB_PXA27X
  2011-12-07 16:12 [00/80] 3.0.13-stable review Greg KH
                   ` (13 preceding siblings ...)
  2011-12-07 16:06 ` [14/80] viafb: correct sync polarity for OLPC DCON Greg KH
@ 2011-12-07 16:06 ` Greg KH
  2011-12-07 16:06 ` [16/80] arm: mx28: fix bit operation in clock setting Greg KH
                   ` (64 subsequent siblings)
  79 siblings, 0 replies; 91+ messages in thread
From: Greg KH @ 2011-12-07 16:06 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: torvalds, akpm, alan, Haojian Zhuang, Felipe Balbi, Eric Miao

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

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

From: Haojian Zhuang <haojian.zhuang@marvell.com>

commit c0a39151a4055332897cba615623d3de2f3896df upstream.

Since CONFIG_USB_GADGET_PXA27X and other macros are renamed to
CONFIG_USB_PXA27X. Update them in arch/arm/mach-pxa and arch/arm/configs
to keep consistent.

Signed-off-by: Haojian Zhuang <haojian.zhuang@marvell.com>
Acked-by: Felipe Balbi <balbi@ti.com>
Signed-off-by: Eric Miao <eric.y.miao@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

---
 arch/arm/configs/ezx_defconfig           |    2 +-
 arch/arm/configs/imote2_defconfig        |    2 +-
 arch/arm/configs/magician_defconfig      |    2 +-
 arch/arm/configs/zeus_defconfig          |    2 +-
 arch/arm/mach-pxa/balloon3.c             |    2 +-
 arch/arm/mach-pxa/colibri-pxa320.c       |    2 +-
 arch/arm/mach-pxa/gumstix.c              |    2 +-
 arch/arm/mach-pxa/include/mach/palm27x.h |    4 ++--
 arch/arm/mach-pxa/palm27x.c              |    4 ++--
 arch/arm/mach-pxa/palmtc.c               |    2 +-
 arch/arm/mach-pxa/vpac270.c              |    2 +-
 11 files changed, 13 insertions(+), 13 deletions(-)

--- a/arch/arm/configs/ezx_defconfig
+++ b/arch/arm/configs/ezx_defconfig
@@ -287,7 +287,7 @@ CONFIG_USB=y
 # CONFIG_USB_DEVICE_CLASS is not set
 CONFIG_USB_OHCI_HCD=y
 CONFIG_USB_GADGET=y
-CONFIG_USB_GADGET_PXA27X=y
+CONFIG_USB_PXA27X=y
 CONFIG_USB_ETH=m
 # CONFIG_USB_ETH_RNDIS is not set
 CONFIG_MMC=y
--- a/arch/arm/configs/imote2_defconfig
+++ b/arch/arm/configs/imote2_defconfig
@@ -263,7 +263,7 @@ CONFIG_USB=y
 # CONFIG_USB_DEVICE_CLASS is not set
 CONFIG_USB_OHCI_HCD=y
 CONFIG_USB_GADGET=y
-CONFIG_USB_GADGET_PXA27X=y
+CONFIG_USB_PXA27X=y
 CONFIG_USB_ETH=m
 # CONFIG_USB_ETH_RNDIS is not set
 CONFIG_MMC=y
--- a/arch/arm/configs/magician_defconfig
+++ b/arch/arm/configs/magician_defconfig
@@ -132,7 +132,7 @@ CONFIG_USB_MON=m
 CONFIG_USB_OHCI_HCD=y
 CONFIG_USB_GADGET=y
 CONFIG_USB_GADGET_VBUS_DRAW=500
-CONFIG_USB_GADGET_PXA27X=y
+CONFIG_USB_PXA27X=y
 CONFIG_USB_ETH=m
 # CONFIG_USB_ETH_RNDIS is not set
 CONFIG_USB_GADGETFS=m
--- a/arch/arm/configs/zeus_defconfig
+++ b/arch/arm/configs/zeus_defconfig
@@ -140,7 +140,7 @@ CONFIG_USB_SERIAL=m
 CONFIG_USB_SERIAL_GENERIC=y
 CONFIG_USB_SERIAL_MCT_U232=m
 CONFIG_USB_GADGET=m
-CONFIG_USB_GADGET_PXA27X=y
+CONFIG_USB_PXA27X=y
 CONFIG_USB_ETH=m
 CONFIG_USB_GADGETFS=m
 CONFIG_USB_FILE_STORAGE=m
--- a/arch/arm/mach-pxa/balloon3.c
+++ b/arch/arm/mach-pxa/balloon3.c
@@ -307,7 +307,7 @@ static inline void balloon3_mmc_init(voi
 /******************************************************************************
  * USB Gadget
  ******************************************************************************/
-#if defined(CONFIG_USB_GADGET_PXA27X)||defined(CONFIG_USB_GADGET_PXA27X_MODULE)
+#if defined(CONFIG_USB_PXA27X)||defined(CONFIG_USB_PXA27X_MODULE)
 static void balloon3_udc_command(int cmd)
 {
 	if (cmd == PXA2XX_UDC_CMD_CONNECT)
--- a/arch/arm/mach-pxa/colibri-pxa320.c
+++ b/arch/arm/mach-pxa/colibri-pxa320.c
@@ -147,7 +147,7 @@ static void __init colibri_pxa320_init_e
 static inline void __init colibri_pxa320_init_eth(void) {}
 #endif /* CONFIG_AX88796 */
 
-#if defined(CONFIG_USB_GADGET_PXA27X)||defined(CONFIG_USB_GADGET_PXA27X_MODULE)
+#if defined(CONFIG_USB_PXA27X)||defined(CONFIG_USB_PXA27X_MODULE)
 static struct gpio_vbus_mach_info colibri_pxa320_gpio_vbus_info = {
 	.gpio_vbus		= mfp_to_gpio(MFP_PIN_GPIO96),
 	.gpio_pullup		= -1,
--- a/arch/arm/mach-pxa/gumstix.c
+++ b/arch/arm/mach-pxa/gumstix.c
@@ -106,7 +106,7 @@ static void __init gumstix_mmc_init(void
 }
 #endif
 
-#ifdef CONFIG_USB_GADGET_PXA25X
+#ifdef CONFIG_USB_PXA25X
 static struct gpio_vbus_mach_info gumstix_udc_info = {
 	.gpio_vbus		= GPIO_GUMSTIX_USB_GPIOn,
 	.gpio_pullup		= GPIO_GUMSTIX_USB_GPIOx,
--- a/arch/arm/mach-pxa/include/mach/palm27x.h
+++ b/arch/arm/mach-pxa/include/mach/palm27x.h
@@ -37,8 +37,8 @@ extern void __init palm27x_lcd_init(int
 static inline void palm27x_lcd_init(int power, struct pxafb_mode_info *mode) {}
 #endif
 
-#if	defined(CONFIG_USB_GADGET_PXA27X) || \
-	defined(CONFIG_USB_GADGET_PXA27X_MODULE)
+#if	defined(CONFIG_USB_PXA27X) || \
+	defined(CONFIG_USB_PXA27X_MODULE)
 extern void __init palm27x_udc_init(int vbus, int pullup,
 					int vbus_inverted);
 #else
--- a/arch/arm/mach-pxa/palm27x.c
+++ b/arch/arm/mach-pxa/palm27x.c
@@ -164,8 +164,8 @@ void __init palm27x_lcd_init(int power,
 /******************************************************************************
  * USB Gadget
  ******************************************************************************/
-#if	defined(CONFIG_USB_GADGET_PXA27X) || \
-	defined(CONFIG_USB_GADGET_PXA27X_MODULE)
+#if	defined(CONFIG_USB_PXA27X) || \
+	defined(CONFIG_USB_PXA27X_MODULE)
 static struct gpio_vbus_mach_info palm27x_udc_info = {
 	.gpio_vbus_inverted	= 1,
 };
--- a/arch/arm/mach-pxa/palmtc.c
+++ b/arch/arm/mach-pxa/palmtc.c
@@ -339,7 +339,7 @@ static inline void palmtc_mkp_init(void)
 /******************************************************************************
  * UDC
  ******************************************************************************/
-#if defined(CONFIG_USB_GADGET_PXA25X)||defined(CONFIG_USB_GADGET_PXA25X_MODULE)
+#if defined(CONFIG_USB_PXA25X)||defined(CONFIG_USB_PXA25X_MODULE)
 static struct gpio_vbus_mach_info palmtc_udc_info = {
 	.gpio_vbus		= GPIO_NR_PALMTC_USB_DETECT_N,
 	.gpio_vbus_inverted	= 1,
--- a/arch/arm/mach-pxa/vpac270.c
+++ b/arch/arm/mach-pxa/vpac270.c
@@ -343,7 +343,7 @@ static inline void vpac270_uhc_init(void
 /******************************************************************************
  * USB Gadget
  ******************************************************************************/
-#if defined(CONFIG_USB_GADGET_PXA27X)||defined(CONFIG_USB_GADGET_PXA27X_MODULE)
+#if defined(CONFIG_USB_PXA27X)||defined(CONFIG_USB_PXA27X_MODULE)
 static struct gpio_vbus_mach_info vpac270_gpio_vbus_info = {
 	.gpio_vbus		= GPIO41_VPAC270_UDC_DETECT,
 	.gpio_pullup		= -1,



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

* [16/80] arm: mx28: fix bit operation in clock setting
  2011-12-07 16:12 [00/80] 3.0.13-stable review Greg KH
                   ` (14 preceding siblings ...)
  2011-12-07 16:06 ` [15/80] ARM: pxa: fix inconsistent CONFIG_USB_PXA27X Greg KH
@ 2011-12-07 16:06 ` Greg KH
  2011-12-07 16:06 ` [17/80] ARM: OMAP: smartreflex: fix IRQ handling bug Greg KH
                   ` (63 subsequent siblings)
  79 siblings, 0 replies; 91+ messages in thread
From: Greg KH @ 2011-12-07 16:06 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: torvalds, akpm, alan, Wolfram Sang, Sascha Hauer, Shawn Guo,
	Shawn Guo, Arnd Bergmann

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

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

From: Wolfram Sang <w.sang@pengutronix.de>

commit c2735391fbc68feae10d6d14e60956c8106e725f upstream.

reg | (1 << clk->enable_shift) always evaluates to true. Switch it
to & which makes much more sense. Same fix as 13be9f00 (ARM i.MX28: fix
bit operation) at a different location.

Signed-off-by: Wolfram Sang <w.sang@pengutronix.de>
Cc: Sascha Hauer <s.hauer@pengutronix.de>
Cc: Shawn Guo <shawn.guo@freescale.com>
Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

---
 arch/arm/mach-mxs/clock-mx28.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- a/arch/arm/mach-mxs/clock-mx28.c
+++ b/arch/arm/mach-mxs/clock-mx28.c
@@ -404,7 +404,7 @@ static int name##_set_rate(struct clk *c
 	reg = __raw_readl(CLKCTRL_BASE_ADDR + HW_CLKCTRL_##dr);		\
 	reg &= ~BM_CLKCTRL_##dr##_DIV;					\
 	reg |= div << BP_CLKCTRL_##dr##_DIV;				\
-	if (reg | (1 << clk->enable_shift)) {				\
+	if (reg & (1 << clk->enable_shift)) {				\
 		pr_err("%s: clock is gated\n", __func__);		\
 		return -EINVAL;						\
 	}								\



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

* [17/80] ARM: OMAP: smartreflex: fix IRQ handling bug
  2011-12-07 16:12 [00/80] 3.0.13-stable review Greg KH
                   ` (15 preceding siblings ...)
  2011-12-07 16:06 ` [16/80] arm: mx28: fix bit operation in clock setting Greg KH
@ 2011-12-07 16:06 ` Greg KH
  2011-12-07 16:06 ` [18/80] ARM: OMAP2: select ARM_AMBA if OMAP3_EMU is defined Greg KH
                   ` (62 subsequent siblings)
  79 siblings, 0 replies; 91+ messages in thread
From: Greg KH @ 2011-12-07 16:06 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: torvalds, akpm, alan, Felipe Balbi, Kevin Hilman, Tony Lindgren

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

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

From: Felipe Balbi <balbi@ti.com>

commit 5a4f1844c2ba21f804d7729306d9b16eaeb724a8 upstream.

Fix a bug which has been on this driver since
it was added by the original commit 984aa6db
which would never clear IRQSTATUS bits.

Signed-off-by: Felipe Balbi <balbi@ti.com>
Signed-off-by: Kevin Hilman <khilman@ti.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

---
 arch/arm/mach-omap2/smartreflex.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- a/arch/arm/mach-omap2/smartreflex.c
+++ b/arch/arm/mach-omap2/smartreflex.c
@@ -137,7 +137,7 @@ static irqreturn_t sr_interrupt(int irq,
 		sr_write_reg(sr_info, ERRCONFIG_V1, status);
 	} else if (sr_info->ip_type == SR_TYPE_V2) {
 		/* Read the status bits */
-		sr_read_reg(sr_info, IRQSTATUS);
+		status = sr_read_reg(sr_info, IRQSTATUS);
 
 		/* Clear them by writing back */
 		sr_write_reg(sr_info, IRQSTATUS, status);



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

* [18/80] ARM: OMAP2: select ARM_AMBA if OMAP3_EMU is defined
  2011-12-07 16:12 [00/80] 3.0.13-stable review Greg KH
                   ` (16 preceding siblings ...)
  2011-12-07 16:06 ` [17/80] ARM: OMAP: smartreflex: fix IRQ handling bug Greg KH
@ 2011-12-07 16:06 ` Greg KH
  2011-12-07 16:06 ` [19/80] ARM: 7161/1: errata: no automatic store buffer drain Greg KH
                   ` (61 subsequent siblings)
  79 siblings, 0 replies; 91+ messages in thread
From: Greg KH @ 2011-12-07 16:06 UTC (permalink / raw)
  To: linux-kernel, stable; +Cc: torvalds, akpm, alan, Ming Lei, Tony Lindgren

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

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

From: Ming Lei <tom.leiming@gmail.com>

commit a8a6565c7615cab3608d75af95b5c8a3522cd7c4 upstream.

This patch selects ARM_AMBA if OMAP3_EMU is defined because
OC_ETM depends on ARM_AMBA, so fix the link failure[1].

[1],
arch/arm/kernel/built-in.o: In function `etm_remove':
/home/tom/git/omap/linux-2.6-omap/arch/arm/kernel/etm.c:609: undefined
reference to `amba_release_regions'
arch/arm/kernel/built-in.o: In function `etb_remove':
/home/tom/git/omap/linux-2.6-omap/arch/arm/kernel/etm.c:409: undefined
reference to `amba_release_regions'
arch/arm/kernel/built-in.o: In function `etm_init':
/home/tom/git/omap/linux-2.6-omap/arch/arm/kernel/etm.c:640: undefined
reference to `amba_driver_register'
/home/tom/git/omap/linux-2.6-omap/arch/arm/kernel/etm.c:646: undefined
reference to `amba_driver_register'
/home/tom/git/omap/linux-2.6-omap/arch/arm/kernel/etm.c:648: undefined
reference to `amba_driver_unregister'
arch/arm/kernel/built-in.o: In function `etm_probe':
/home/tom/git/omap/linux-2.6-omap/arch/arm/kernel/etm.c:545: undefined
reference to `amba_request_regions'
/home/tom/git/omap/linux-2.6-omap/arch/arm/kernel/etm.c:595: undefined
reference to `amba_release_regions'
arch/arm/kernel/built-in.o: In function `etb_probe':
/home/tom/git/omap/linux-2.6-omap/arch/arm/kernel/etm.c:347: undefined
reference to `amba_request_regions'
/home/tom/git/omap/linux-2.6-omap/arch/arm/kernel/etm.c:392: undefined
reference to `amba_release_regions'
arch/arm/mach-omap2/built-in.o: In function `emu_init':
/home/tom/git/omap/linux-2.6-omap/arch/arm/mach-omap2/emu.c:62:
undefined reference to `amba_device_register'
/home/tom/git/omap/linux-2.6-omap/arch/arm/mach-omap2/emu.c:63:
undefined reference to `amba_device_register'
make: *** [.tmp_vmlinux1] Error 1
making modules

Signed-off-by: Ming Lei <tom.leiming@gmail.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

---
 arch/arm/mach-omap2/Kconfig |    1 +
 1 file changed, 1 insertion(+)

--- a/arch/arm/mach-omap2/Kconfig
+++ b/arch/arm/mach-omap2/Kconfig
@@ -326,6 +326,7 @@ config MACH_OMAP4_PANDA
 config OMAP3_EMU
 	bool "OMAP3 debugging peripherals"
 	depends on ARCH_OMAP3
+	select ARM_AMBA
 	select OC_ETM
 	help
 	  Say Y here to enable debugging hardware of omap3



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

* [19/80] ARM: 7161/1: errata: no automatic store buffer drain
  2011-12-07 16:12 [00/80] 3.0.13-stable review Greg KH
                   ` (17 preceding siblings ...)
  2011-12-07 16:06 ` [18/80] ARM: OMAP2: select ARM_AMBA if OMAP3_EMU is defined Greg KH
@ 2011-12-07 16:06 ` Greg KH
  2011-12-07 16:06 ` [20/80] ALSA: lx6464es - fix device communication via command bus Greg KH
                   ` (60 subsequent siblings)
  79 siblings, 0 replies; 91+ messages in thread
From: Greg KH @ 2011-12-07 16:06 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: torvalds, akpm, alan, Catalin Marinas, Will Deacon, Russell King

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

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

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

commit 11ed0ba1754841316d4095478944300acf19acc3 upstream.

This patch implements a workaround for PL310 erratum 769419. On
revisions of the PL310 prior to r3p2, the Store Buffer does not
automatically drain. This can cause normal, non-cacheable writes to be
retained when the memory system is idle, leading to suboptimal I/O
performance for drivers using coherent DMA.

This patch adds an optional wmb() call to the cpu_idle loop. On systems
with an outer cache, this causes an explicit flush of the store buffer.

Acked-by: Catalin Marinas <catalin.marinas@arm.com>
Tested-by: Marc Zyngier <marc.zyngier@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: Greg Kroah-Hartman <gregkh@suse.de>

---
 arch/arm/Kconfig          |   12 ++++++++++++
 arch/arm/kernel/process.c |    3 +++
 2 files changed, 15 insertions(+)

--- a/arch/arm/Kconfig
+++ b/arch/arm/Kconfig
@@ -1312,6 +1312,18 @@ config ARM_ERRATA_764369
 	  relevant cache maintenance functions and sets a specific bit
 	  in the diagnostic control register of the SCU.
 
+config PL310_ERRATA_769419
+	bool "PL310 errata: no automatic Store Buffer drain"
+	depends on CACHE_L2X0
+	help
+	  On revisions of the PL310 prior to r3p2, the Store Buffer does
+	  not automatically drain. This can cause normal, non-cacheable
+	  writes to be retained when the memory system is idle, leading
+	  to suboptimal I/O performance for drivers using coherent DMA.
+	  This option adds a write barrier to the cpu_idle loop so that,
+	  on systems with an outer cache, the store buffer is drained
+	  explicitly.
+
 endmenu
 
 menu "Kernel Features"
--- a/arch/arm/kernel/process.c
+++ b/arch/arm/kernel/process.c
@@ -191,6 +191,9 @@ void cpu_idle(void)
 #endif
 
 			local_irq_disable();
+#ifdef CONFIG_PL310_ERRATA_769419
+			wmb();
+#endif
 			if (hlt_counter) {
 				local_irq_enable();
 				cpu_relax();



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

* [20/80] ALSA: lx6464es - fix device communication via command bus
  2011-12-07 16:12 [00/80] 3.0.13-stable review Greg KH
                   ` (18 preceding siblings ...)
  2011-12-07 16:06 ` [19/80] ARM: 7161/1: errata: no automatic store buffer drain Greg KH
@ 2011-12-07 16:06 ` Greg KH
  2011-12-07 17:47   ` Linus Torvalds
  2011-12-07 16:06 ` [21/80] ASoC: fsl_ssi: properly initialize the sysfs attribute object Greg KH
                   ` (59 subsequent siblings)
  79 siblings, 1 reply; 91+ messages in thread
From: Greg KH @ 2011-12-07 16:06 UTC (permalink / raw)
  To: linux-kernel, stable; +Cc: torvalds, akpm, alan, Tim Blechmann, Takashi Iwai

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

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

From: Tim Blechmann <tim@klingt.org>

commit a29878553a9a7b4c06f93c7e383527cf014d4ceb upstream.

commit 6175ddf06b6172046a329e3abfd9c901a43efd2e optimized the mem*io
functions that have been used to send commands to the device. these
optimizations somehow corrupted the communication with the lx6464es,
that resulted the device to be unusable with kernels after 2.6.33.

this patch emulates the memcpy_*_io functions via a loop to avoid these
problems.

Signed-off-by: Tim Blechmann <tim@klingt.org>
LKML-Reference: <4ECB5257.4040600@ladisch.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

---
 sound/pci/lx6464es/lx_core.c |   16 ++++++++++++----
 1 file changed, 12 insertions(+), 4 deletions(-)

--- a/sound/pci/lx6464es/lx_core.c
+++ b/sound/pci/lx6464es/lx_core.c
@@ -80,8 +80,12 @@ unsigned long lx_dsp_reg_read(struct lx6
 
 void lx_dsp_reg_readbuf(struct lx6464es *chip, int port, u32 *data, u32 len)
 {
-	void __iomem *address = lx_dsp_register(chip, port);
-	memcpy_fromio(data, address, len*sizeof(u32));
+	u32 __iomem *address = lx_dsp_register(chip, port);
+	int i;
+
+	/* we cannot use memcpy_fromio */
+	for (i = 0; i != len; ++i)
+		data[i] = ioread32(address + i);
 }
 
 
@@ -94,8 +98,12 @@ void lx_dsp_reg_write(struct lx6464es *c
 void lx_dsp_reg_writebuf(struct lx6464es *chip, int port, const u32 *data,
 			 u32 len)
 {
-	void __iomem *address = lx_dsp_register(chip, port);
-	memcpy_toio(address, data, len*sizeof(u32));
+	u32 __iomem *address = lx_dsp_register(chip, port);
+	int i;
+
+	/* we cannot use memcpy_to */
+	for (i = 0; i != len; ++i)
+		iowrite32(data[i], address + i);
 }
 
 



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

* [21/80] ASoC: fsl_ssi: properly initialize the sysfs attribute object
  2011-12-07 16:12 [00/80] 3.0.13-stable review Greg KH
                   ` (19 preceding siblings ...)
  2011-12-07 16:06 ` [20/80] ALSA: lx6464es - fix device communication via command bus Greg KH
@ 2011-12-07 16:06 ` Greg KH
  2011-12-07 16:06 ` [22/80] ASoC: wm8753: Skip noop reconfiguration of DAI mode Greg KH
                   ` (58 subsequent siblings)
  79 siblings, 0 replies; 91+ messages in thread
From: Greg KH @ 2011-12-07 16:06 UTC (permalink / raw)
  To: linux-kernel, stable; +Cc: torvalds, akpm, alan, Timur Tabi, Mark Brown

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

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

From: Timur Tabi <timur@freescale.com>

commit 0f768a7235d3dfb6f4833030a95a06419df089cb upstream.

Commit 6992f533 ("sysfs: Use one lockdep class per sysfs attribute")
requires 'struct attribute' objects to be initialized with sysfs_attr_init().

Signed-off-by: Timur Tabi <timur@freescale.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

---
 sound/soc/fsl/fsl_ssi.c |    1 +
 1 file changed, 1 insertion(+)

--- a/sound/soc/fsl/fsl_ssi.c
+++ b/sound/soc/fsl/fsl_ssi.c
@@ -698,6 +698,7 @@ static int __devinit fsl_ssi_probe(struc
 
 	/* Initialize the the device_attribute structure */
 	dev_attr = &ssi_private->dev_attr;
+	sysfs_attr_init(&dev_attr->attr);
 	dev_attr->attr.name = "statistics";
 	dev_attr->attr.mode = S_IRUGO;
 	dev_attr->show = fsl_sysfs_ssi_show;



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

* [22/80] ASoC: wm8753: Skip noop reconfiguration of DAI mode
  2011-12-07 16:12 [00/80] 3.0.13-stable review Greg KH
                   ` (20 preceding siblings ...)
  2011-12-07 16:06 ` [21/80] ASoC: fsl_ssi: properly initialize the sysfs attribute object Greg KH
@ 2011-12-07 16:06 ` Greg KH
  2011-12-07 16:06 ` [23/80] ASoC: Ensure WM8731 register cache is synced when resuming from disabled Greg KH
                   ` (57 subsequent siblings)
  79 siblings, 0 replies; 91+ messages in thread
From: Greg KH @ 2011-12-07 16:06 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: torvalds, akpm, alan, Timo Juhani Lindfors, Mark Brown

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

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

From: Timo Juhani Lindfors <timo.lindfors@iki.fi>

commit 2391a0e06789a3f1718dee30b282562f7ed28c87 upstream.

This patch makes it possible to set DAI mode to its currently applied
value even if codec is active. This is necessary to allow

aplay -t raw -r 44100 -f S16_LE -c 2 < /dev/urandom &
alsactl store -f backup.state
alsactl restore -f backup.state

to work without returning errors. This patch is based on a patch sent
by Klaus Kurzmann <mok@fluxnetz.de>.

Signed-off-by: Timo Juhani Lindfors <timo.lindfors@iki.fi>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

---
 sound/soc/codecs/wm8753.c |    3 +++
 1 file changed, 3 insertions(+)

--- a/sound/soc/codecs/wm8753.c
+++ b/sound/soc/codecs/wm8753.c
@@ -189,6 +189,9 @@ static int wm8753_set_dai(struct snd_kco
 	struct wm8753_priv *wm8753 = snd_soc_codec_get_drvdata(codec);
 	u16 ioctl;
 
+	if (wm8753->dai_func == ucontrol->value.integer.value[0])
+		return 0;
+
 	if (codec->active)
 		return -EBUSY;
 



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

* [23/80] ASoC: Ensure WM8731 register cache is synced when resuming from disabled
  2011-12-07 16:12 [00/80] 3.0.13-stable review Greg KH
                   ` (21 preceding siblings ...)
  2011-12-07 16:06 ` [22/80] ASoC: wm8753: Skip noop reconfiguration of DAI mode Greg KH
@ 2011-12-07 16:06 ` Greg KH
  2011-12-07 16:06 ` [24/80] SUNRPC: Ensure we return EAGAIN in xs_nospace if congestion is cleared Greg KH
                   ` (56 subsequent siblings)
  79 siblings, 0 replies; 91+ messages in thread
From: Greg KH @ 2011-12-07 16:06 UTC (permalink / raw)
  To: linux-kernel, stable; +Cc: torvalds, akpm, alan, Mark Brown

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

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

From: Mark Brown <broonie@opensource.wolfsonmicro.com>

commit ed3e80c4c991a52f9fce3421536a78e331ae0949 upstream.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

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

--- a/sound/soc/codecs/wm8731.c
+++ b/sound/soc/codecs/wm8731.c
@@ -463,6 +463,7 @@ static int wm8731_set_bias_level(struct
 		snd_soc_write(codec, WM8731_PWR, 0xffff);
 		regulator_bulk_disable(ARRAY_SIZE(wm8731->supplies),
 				       wm8731->supplies);
+		codec->cache_sync = 1;
 		break;
 	}
 	codec->dapm.bias_level = level;



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

* [24/80] SUNRPC: Ensure we return EAGAIN in xs_nospace if congestion is cleared
  2011-12-07 16:12 [00/80] 3.0.13-stable review Greg KH
                   ` (22 preceding siblings ...)
  2011-12-07 16:06 ` [23/80] ASoC: Ensure WM8731 register cache is synced when resuming from disabled Greg KH
@ 2011-12-07 16:06 ` Greg KH
  2011-12-07 16:06 ` [25/80] genirq: fix regression in irqfixup, irqpoll Greg KH
                   ` (55 subsequent siblings)
  79 siblings, 0 replies; 91+ messages in thread
From: Greg KH @ 2011-12-07 16:06 UTC (permalink / raw)
  To: linux-kernel, stable; +Cc: torvalds, akpm, alan, Trond Myklebust

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

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

From: Trond Myklebust <Trond.Myklebust@netapp.com>

commit 24ca9a847791fd53d9b217330b15f3c285827a18 upstream.

By returning '0' instead of 'EAGAIN' when the tests in xs_nospace() fail
to find evidence of socket congestion, we are making the RPC engine believe
that the message was incorrectly sent and so it disconnects the socket
instead of just retrying.

The bug appears to have been introduced by commit
5e3771ce2d6a69e10fcc870cdf226d121d868491 (SUNRPC: Ensure that xs_nospace
return values are propagated).

Reported-by: Andrew Cooper <andrew.cooper3@citrix.com>
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Tested-by: Andrew Cooper <andrew.cooper3@citrix.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

---
 net/sunrpc/xprtsock.c |    3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

--- a/net/sunrpc/xprtsock.c
+++ b/net/sunrpc/xprtsock.c
@@ -485,7 +485,7 @@ static int xs_nospace(struct rpc_task *t
 	struct rpc_rqst *req = task->tk_rqstp;
 	struct rpc_xprt *xprt = req->rq_xprt;
 	struct sock_xprt *transport = container_of(xprt, struct sock_xprt, xprt);
-	int ret = 0;
+	int ret = -EAGAIN;
 
 	dprintk("RPC: %5u xmit incomplete (%u left of %u)\n",
 			task->tk_pid, req->rq_slen - req->rq_bytes_sent,
@@ -497,7 +497,6 @@ static int xs_nospace(struct rpc_task *t
 	/* Don't race with disconnect */
 	if (xprt_connected(xprt)) {
 		if (test_bit(SOCK_ASYNC_NOSPACE, &transport->sock->flags)) {
-			ret = -EAGAIN;
 			/*
 			 * Notify TCP that we're limited by the application
 			 * window size



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

* [25/80] genirq: fix regression in irqfixup, irqpoll
  2011-12-07 16:12 [00/80] 3.0.13-stable review Greg KH
                   ` (23 preceding siblings ...)
  2011-12-07 16:06 ` [24/80] SUNRPC: Ensure we return EAGAIN in xs_nospace if congestion is cleared Greg KH
@ 2011-12-07 16:06 ` Greg KH
  2011-12-07 16:06 ` [26/80] cgroup_freezer: fix freezing groups with stopped tasks Greg KH
                   ` (54 subsequent siblings)
  79 siblings, 0 replies; 91+ messages in thread
From: Greg KH @ 2011-12-07 16:06 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: torvalds, akpm, alan, Edward Donovan, Thomas Gleixner

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

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

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

From: Edward Donovan <edward.donovan@numble.net>

commit 52553ddffad76ccf192d4dd9ce88d5818f57f62a upstream.

Commit fa27271bc8d2("genirq: Fixup poll handling") introduced a
regression that broke irqfixup/irqpoll for some hardware configurations.

Amidst reorganizing 'try_one_irq', that patch removed a test that
checked for 'action->handler' returning IRQ_HANDLED, before acting on
the interrupt.  Restoring this test back returns the functionality lost
since 2.6.39.  In the current set of tests, after 'action' is set, it
must precede '!action->next' to take effect.

With this and my previous patch to irq/spurious.c, c75d720fca8a, all
IRQ regressions that I have encountered are fixed.

Signed-off-by: Edward Donovan <edward.donovan@numble.net>
Reported-and-tested-by: Rogério Brito <rbrito@ime.usp.br>
Cc: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

---
 kernel/irq/spurious.c |    4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

--- a/kernel/irq/spurious.c
+++ b/kernel/irq/spurious.c
@@ -84,7 +84,9 @@ static int try_one_irq(int irq, struct i
 	 */
 	action = desc->action;
 	if (!action || !(action->flags & IRQF_SHARED) ||
-	    (action->flags & __IRQF_TIMER) || !action->next)
+	    (action->flags & __IRQF_TIMER) ||
+	    (action->handler(irq, action->dev_id) == IRQ_HANDLED) ||
+	    !action->next)
 		goto out;
 
 	/* Already running on another processor */



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

* [26/80] cgroup_freezer: fix freezing groups with stopped tasks
  2011-12-07 16:12 [00/80] 3.0.13-stable review Greg KH
                   ` (24 preceding siblings ...)
  2011-12-07 16:06 ` [25/80] genirq: fix regression in irqfixup, irqpoll Greg KH
@ 2011-12-07 16:06 ` Greg KH
  2011-12-07 16:06 ` [27/80] timekeeping: add arch_offset hook to ktime_get functions Greg KH
                   ` (53 subsequent siblings)
  79 siblings, 0 replies; 91+ messages in thread
From: Greg KH @ 2011-12-07 16:06 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: torvalds, akpm, alan, Michal Hocko, Li Zefan, Tomasz Buchert,
	Paul Menage, Tejun Heo

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

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

From: Michal Hocko <mhocko@suse.cz>

commit 884a45d964dd395eda945842afff5e16bcaedf56 upstream.

2d3cbf8b (cgroup_freezer: update_freezer_state() does incorrect state
transitions) removed is_task_frozen_enough and replaced it with a simple
frozen call. This, however, breaks freezing for a group with stopped tasks
because those cannot be frozen and so the group remains in CGROUP_FREEZING
state (update_if_frozen doesn't count stopped tasks) and never reaches
CGROUP_FROZEN.

Let's add is_task_frozen_enough back and use it at the original locations
(update_if_frozen and try_to_freeze_cgroup). Semantically we consider
stopped tasks as frozen enough so we should consider both cases when
testing frozen tasks.

Testcase:
mkdir /dev/freezer
mount -t cgroup -o freezer none /dev/freezer
mkdir /dev/freezer/foo
sleep 1h &
pid=$!
kill -STOP $pid
echo $pid > /dev/freezer/foo/tasks
echo FROZEN > /dev/freezer/foo/freezer.state
while true
do
	cat /dev/freezer/foo/freezer.state
	[ "`cat /dev/freezer/foo/freezer.state`" = "FROZEN" ] && break
	sleep 1
done
echo OK

Signed-off-by: Michal Hocko <mhocko@suse.cz>
Acked-by: Li Zefan <lizf@cn.fujitsu.com>
Cc: Tomasz Buchert <tomasz.buchert@inria.fr>
Cc: Paul Menage <paul@paulmenage.org>
Cc: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Tejun Heo <htejun@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

---
 kernel/cgroup_freezer.c |   11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)

--- a/kernel/cgroup_freezer.c
+++ b/kernel/cgroup_freezer.c
@@ -153,6 +153,13 @@ static void freezer_destroy(struct cgrou
 	kfree(cgroup_freezer(cgroup));
 }
 
+/* task is frozen or will freeze immediately when next it gets woken */
+static bool is_task_frozen_enough(struct task_struct *task)
+{
+	return frozen(task) ||
+		(task_is_stopped_or_traced(task) && freezing(task));
+}
+
 /*
  * The call to cgroup_lock() in the freezer.state write method prevents
  * a write to that file racing against an attach, and hence the
@@ -231,7 +238,7 @@ static void update_if_frozen(struct cgro
 	cgroup_iter_start(cgroup, &it);
 	while ((task = cgroup_iter_next(cgroup, &it))) {
 		ntotal++;
-		if (frozen(task))
+		if (is_task_frozen_enough(task))
 			nfrozen++;
 	}
 
@@ -284,7 +291,7 @@ static int try_to_freeze_cgroup(struct c
 	while ((task = cgroup_iter_next(cgroup, &it))) {
 		if (!freeze_task(task, true))
 			continue;
-		if (frozen(task))
+		if (is_task_frozen_enough(task))
 			continue;
 		if (!freezing(task) && !freezer_should_skip(task))
 			num_cant_freeze_now++;



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

* [27/80] timekeeping: add arch_offset hook to ktime_get functions
  2011-12-07 16:12 [00/80] 3.0.13-stable review Greg KH
                   ` (25 preceding siblings ...)
  2011-12-07 16:06 ` [26/80] cgroup_freezer: fix freezing groups with stopped tasks Greg KH
@ 2011-12-07 16:06 ` Greg KH
  2011-12-07 16:06 ` [28/80] hrtimer: Fix extra wakeups from __remove_hrtimer() Greg KH
                   ` (52 subsequent siblings)
  79 siblings, 0 replies; 91+ messages in thread
From: Greg KH @ 2011-12-07 16:06 UTC (permalink / raw)
  To: linux-kernel, stable; +Cc: torvalds, akpm, alan, Hector Palacios, John Stultz

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

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

From: Hector Palacios <hector.palacios@digi.com>

commit d004e024058a0eaca097513ce62cbcf978913e0a upstream.

ktime_get and ktime_get_ts were calling timekeeping_get_ns()
but later they were not calling arch_gettimeoffset() so architectures
using this mechanism returned 0 ns when calling these functions.

This happened for example when running Busybox's ping which calls
syscall(__NR_clock_gettime, CLOCK_MONOTONIC, ts) which eventually
calls ktime_get. As a result the returned ping travel time was zero.

Signed-off-by: Hector Palacios <hector.palacios@digi.com>
Signed-off-by: John Stultz <john.stultz@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

---
 kernel/time/timekeeping.c |    4 ++++
 1 file changed, 4 insertions(+)

--- a/kernel/time/timekeeping.c
+++ b/kernel/time/timekeeping.c
@@ -249,6 +249,8 @@ ktime_t ktime_get(void)
 		secs = xtime.tv_sec + wall_to_monotonic.tv_sec;
 		nsecs = xtime.tv_nsec + wall_to_monotonic.tv_nsec;
 		nsecs += timekeeping_get_ns();
+		/* If arch requires, add in gettimeoffset() */
+		nsecs += arch_gettimeoffset();
 
 	} while (read_seqretry(&xtime_lock, seq));
 	/*
@@ -280,6 +282,8 @@ void ktime_get_ts(struct timespec *ts)
 		*ts = xtime;
 		tomono = wall_to_monotonic;
 		nsecs = timekeeping_get_ns();
+		/* If arch requires, add in gettimeoffset() */
+		nsecs += arch_gettimeoffset();
 
 	} while (read_seqretry(&xtime_lock, seq));
 



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

* [28/80] hrtimer: Fix extra wakeups from __remove_hrtimer()
  2011-12-07 16:12 [00/80] 3.0.13-stable review Greg KH
                   ` (26 preceding siblings ...)
  2011-12-07 16:06 ` [27/80] timekeeping: add arch_offset hook to ktime_get functions Greg KH
@ 2011-12-07 16:06 ` Greg KH
  2011-12-07 16:06 ` [29/80] p54spi: Add missing spin_lock_init Greg KH
                   ` (51 subsequent siblings)
  79 siblings, 0 replies; 91+ messages in thread
From: Greg KH @ 2011-12-07 16:06 UTC (permalink / raw)
  To: linux-kernel, stable; +Cc: torvalds, akpm, alan, Jeff Ohlstein, Thomas Gleixner

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

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

From: Jeff Ohlstein <johlstei@codeaurora.org>

commit 27c9cd7e601632b3794e1c3344d37b86917ffb43 upstream.

__remove_hrtimer() attempts to reprogram the clockevent device when
the timer being removed is the next to expire. However,
__remove_hrtimer() reprograms the clockevent *before* removing the
timer from the timerqueue and thus when hrtimer_force_reprogram()
finds the next timer to expire it finds the timer we're trying to
remove.

This is especially noticeable when the system switches to NOHz mode
and the system tick is removed. The timer tick is removed from the
system but the clockevent is programmed to wakeup in another HZ
anyway.

Silence the extra wakeup by removing the timer from the timerqueue
before calling hrtimer_force_reprogram() so that we actually program
the clockevent for the next timer to expire.

This was broken by 998adc3 "hrtimers: Convert hrtimers to use
timerlist infrastructure".

Signed-off-by: Jeff Ohlstein <johlstei@codeaurora.org>
Link: http://lkml.kernel.org/r/1321660030-8520-1-git-send-email-johlstei@codeaurora.org
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

---
 kernel/hrtimer.c |    6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

--- a/kernel/hrtimer.c
+++ b/kernel/hrtimer.c
@@ -885,10 +885,13 @@ static void __remove_hrtimer(struct hrti
 			     struct hrtimer_clock_base *base,
 			     unsigned long newstate, int reprogram)
 {
+	struct timerqueue_node *next_timer;
 	if (!(timer->state & HRTIMER_STATE_ENQUEUED))
 		goto out;
 
-	if (&timer->node == timerqueue_getnext(&base->active)) {
+	next_timer = timerqueue_getnext(&base->active);
+	timerqueue_del(&base->active, &timer->node);
+	if (&timer->node == next_timer) {
 #ifdef CONFIG_HIGH_RES_TIMERS
 		/* Reprogram the clock event device. if enabled */
 		if (reprogram && hrtimer_hres_active()) {
@@ -901,7 +904,6 @@ static void __remove_hrtimer(struct hrti
 		}
 #endif
 	}
-	timerqueue_del(&base->active, &timer->node);
 	if (!timerqueue_getnext(&base->active))
 		base->cpu_base->active_bases &= ~(1 << base->index);
 out:



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

* [29/80] p54spi: Add missing spin_lock_init
  2011-12-07 16:12 [00/80] 3.0.13-stable review Greg KH
                   ` (27 preceding siblings ...)
  2011-12-07 16:06 ` [28/80] hrtimer: Fix extra wakeups from __remove_hrtimer() Greg KH
@ 2011-12-07 16:06 ` Greg KH
  2011-12-07 16:06 ` [30/80] p54spi: Fix workqueue deadlock Greg KH
                   ` (50 subsequent siblings)
  79 siblings, 0 replies; 91+ messages in thread
From: Greg KH @ 2011-12-07 16:06 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: torvalds, akpm, alan, Michael Buesch, Christian Lamparter,
	John W. Linville

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

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

From: =?UTF-8?q?Michael=20B=C3=BCsch?= <m@bues.ch>

commit 32d3a3922d617a5a685a5e2d24b20d0e88f192a9 upstream.

The tx_lock is not initialized properly. Add spin_lock_init().

Signed-off-by: Michael Buesch <m@bues.ch>
Acked-by: Christian Lamparter <chunkeey@googlemail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

---
 drivers/net/wireless/p54/p54spi.c |    1 +
 1 file changed, 1 insertion(+)

--- a/drivers/net/wireless/p54/p54spi.c
+++ b/drivers/net/wireless/p54/p54spi.c
@@ -657,6 +657,7 @@ static int __devinit p54spi_probe(struct
 	init_completion(&priv->fw_comp);
 	INIT_LIST_HEAD(&priv->tx_pending);
 	mutex_init(&priv->mutex);
+	spin_lock_init(&priv->tx_lock);
 	SET_IEEE80211_DEV(hw, &spi->dev);
 	priv->common.open = p54spi_op_start;
 	priv->common.stop = p54spi_op_stop;



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

* [30/80] p54spi: Fix workqueue deadlock
  2011-12-07 16:12 [00/80] 3.0.13-stable review Greg KH
                   ` (28 preceding siblings ...)
  2011-12-07 16:06 ` [29/80] p54spi: Add missing spin_lock_init Greg KH
@ 2011-12-07 16:06 ` Greg KH
  2011-12-07 16:06 ` [31/80] rt2x00: Fix efuse EEPROM reading on PPC32 Greg KH
                   ` (49 subsequent siblings)
  79 siblings, 0 replies; 91+ messages in thread
From: Greg KH @ 2011-12-07 16:06 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: torvalds, akpm, alan, Michael Buesch, Christian Lamparter,
	John W. Linville

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

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

From: =?UTF-8?q?Michael=20B=C3=BCsch?= <m@bues.ch>

commit 2d1618170eb493d18f66f2ac03775409a6fb97c6 upstream.

priv->work must not be synced while priv->mutex is locked, because
the mutex is taken in the work handler.
Move cancel_work_sync down to after the device shutdown code.
This is safe, because the work handler checks fw_state and bails out
early in case of a race.

Signed-off-by: Michael Buesch <m@bues.ch>
Acked-by: Christian Lamparter <chunkeey@googlemail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

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

--- a/drivers/net/wireless/p54/p54spi.c
+++ b/drivers/net/wireless/p54/p54spi.c
@@ -589,8 +589,6 @@ static void p54spi_op_stop(struct ieee80
 
 	WARN_ON(priv->fw_state != FW_STATE_READY);
 
-	cancel_work_sync(&priv->work);
-
 	p54spi_power_off(priv);
 	spin_lock_irqsave(&priv->tx_lock, flags);
 	INIT_LIST_HEAD(&priv->tx_pending);
@@ -598,6 +596,8 @@ static void p54spi_op_stop(struct ieee80
 
 	priv->fw_state = FW_STATE_OFF;
 	mutex_unlock(&priv->mutex);
+
+	cancel_work_sync(&priv->work);
 }
 
 static int __devinit p54spi_probe(struct spi_device *spi)



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

* [31/80] rt2x00: Fix efuse EEPROM reading on PPC32.
  2011-12-07 16:12 [00/80] 3.0.13-stable review Greg KH
                   ` (29 preceding siblings ...)
  2011-12-07 16:06 ` [30/80] p54spi: Fix workqueue deadlock Greg KH
@ 2011-12-07 16:06 ` Greg KH
  2011-12-07 16:06 ` [32/80] nl80211: fix MAC address validation Greg KH
                   ` (48 subsequent siblings)
  79 siblings, 0 replies; 91+ messages in thread
From: Greg KH @ 2011-12-07 16:06 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: torvalds, akpm, alan, Gertjan van Wingerde, Helmut Schaa,
	Ivo van Doorn, John W. Linville

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

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

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

commit 68fa64ef606bcee688fce46d07aa68f175070156 upstream.

Fix __le32 to __le16 conversion of the first word of an 8-word block
of EEPROM read via the efuse method.

Reported-and-tested-by: Ingvar Hagelund <ingvar@redpill-linpro.com>
Signed-off-by: Gertjan van Wingerde <gwingerde@gmail.com>
Acked-by: Helmut Schaa <helmut.schaa@googlemail.com>
Acked-by: Ivo van Doorn <IvDoorn@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

---
 drivers/net/wireless/rt2x00/rt2800lib.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- a/drivers/net/wireless/rt2x00/rt2800lib.c
+++ b/drivers/net/wireless/rt2x00/rt2800lib.c
@@ -3514,7 +3514,7 @@ static void rt2800_efuse_read(struct rt2
 	/* Apparently the data is read from end to start */
 	rt2800_register_read_lock(rt2x00dev, EFUSE_DATA3, &reg);
 	/* The returned value is in CPU order, but eeprom is le */
-	rt2x00dev->eeprom[i] = cpu_to_le32(reg);
+	*(u32 *)&rt2x00dev->eeprom[i] = cpu_to_le32(reg);
 	rt2800_register_read_lock(rt2x00dev, EFUSE_DATA2, &reg);
 	*(u32 *)&rt2x00dev->eeprom[i + 2] = cpu_to_le32(reg);
 	rt2800_register_read_lock(rt2x00dev, EFUSE_DATA1, &reg);



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

* [32/80] nl80211: fix MAC address validation
  2011-12-07 16:12 [00/80] 3.0.13-stable review Greg KH
                   ` (30 preceding siblings ...)
  2011-12-07 16:06 ` [31/80] rt2x00: Fix efuse EEPROM reading on PPC32 Greg KH
@ 2011-12-07 16:06 ` Greg KH
  2011-12-07 16:06 ` [33/80] cfg80211: fix regulatory NULL dereference Greg KH
                   ` (47 subsequent siblings)
  79 siblings, 0 replies; 91+ messages in thread
From: Greg KH @ 2011-12-07 16:06 UTC (permalink / raw)
  To: linux-kernel, stable; +Cc: torvalds, akpm, alan, Eliad Peller, John W. Linville

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

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

From: Eliad Peller <eliad@wizery.com>

commit e007b857e88097c96c45620bf3b04a4e309053d1 upstream.

MAC addresses have a fixed length. The current
policy allows passing < ETH_ALEN bytes, which
might result in reading beyond the buffer.

Signed-off-by: Eliad Peller <eliad@wizery.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

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

--- a/net/wireless/nl80211.c
+++ b/net/wireless/nl80211.c
@@ -83,8 +83,8 @@ static const struct nla_policy nl80211_p
 	[NL80211_ATTR_IFINDEX] = { .type = NLA_U32 },
 	[NL80211_ATTR_IFNAME] = { .type = NLA_NUL_STRING, .len = IFNAMSIZ-1 },
 
-	[NL80211_ATTR_MAC] = { .type = NLA_BINARY, .len = ETH_ALEN },
-	[NL80211_ATTR_PREV_BSSID] = { .type = NLA_BINARY, .len = ETH_ALEN },
+	[NL80211_ATTR_MAC] = { .len = ETH_ALEN },
+	[NL80211_ATTR_PREV_BSSID] = { .len = ETH_ALEN },
 
 	[NL80211_ATTR_KEY] = { .type = NLA_NESTED, },
 	[NL80211_ATTR_KEY_DATA] = { .type = NLA_BINARY,



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

* [33/80] cfg80211: fix regulatory NULL dereference
  2011-12-07 16:12 [00/80] 3.0.13-stable review Greg KH
                   ` (31 preceding siblings ...)
  2011-12-07 16:06 ` [32/80] nl80211: fix MAC address validation Greg KH
@ 2011-12-07 16:06 ` Greg KH
  2011-12-07 16:06 ` [34/80] mac80211: dont stop a single aggregation session twice Greg KH
                   ` (46 subsequent siblings)
  79 siblings, 0 replies; 91+ messages in thread
From: Greg KH @ 2011-12-07 16:06 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: torvalds, akpm, alan, Luis R. Rodriguez, Johannes Berg,
	John W. Linville

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

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

From: Johannes Berg <johannes.berg@intel.com>

commit de3584bd62d87b4c250129fbc46ca52c80330add upstream.

By the time userspace returns with a response to
the regulatory domain request, the wiphy causing
the request might have gone away. If this is so,
reject the update but mark the request as having
been processed anyway.

Cc: Luis R. Rodriguez <lrodriguez@qca.qualcomm.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

---
 net/wireless/reg.c |    4 ++++
 1 file changed, 4 insertions(+)

--- a/net/wireless/reg.c
+++ b/net/wireless/reg.c
@@ -2026,6 +2026,10 @@ static int __set_regdom(const struct iee
 	}
 
 	request_wiphy = wiphy_idx_to_wiphy(last_request->wiphy_idx);
+	if (!request_wiphy) {
+		reg_set_request_processed();
+		return -ENODEV;
+	}
 
 	if (!last_request->intersect) {
 		int r;



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

* [34/80] mac80211: dont stop a single aggregation session twice
  2011-12-07 16:12 [00/80] 3.0.13-stable review Greg KH
                   ` (32 preceding siblings ...)
  2011-12-07 16:06 ` [33/80] cfg80211: fix regulatory NULL dereference Greg KH
@ 2011-12-07 16:06 ` Greg KH
  2011-12-07 16:06 ` [35/80] mac80211: fix race between the AGG SM and the Tx data path Greg KH
                   ` (45 subsequent siblings)
  79 siblings, 0 replies; 91+ messages in thread
From: Greg KH @ 2011-12-07 16:06 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: torvalds, akpm, alan, Johannes Berg, John W. Linville

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

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

From: Johannes Berg <johannes.berg@intel.com>

commit 24f50a9d165745fd0701c6e089d35f58a229ea69 upstream.

Nikolay noticed (by code review) that mac80211 can
attempt to stop an aggregation session while it is
already being stopped. So to fix it, check whether
stop is already being done and bail out if so.

Also move setting the STOPPING state into the lock
so things are properly atomic.

Reported-by: Nikolay Martynov <mar.kolya@gmail.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

---
 net/mac80211/agg-tx.c |   10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

--- a/net/mac80211/agg-tx.c
+++ b/net/mac80211/agg-tx.c
@@ -162,6 +162,12 @@ int ___ieee80211_stop_tx_ba_session(stru
 		return -ENOENT;
 	}
 
+	/* if we're already stopping ignore any new requests to stop */
+	if (test_bit(HT_AGG_STATE_STOPPING, &tid_tx->state)) {
+		spin_unlock_bh(&sta->lock);
+		return -EALREADY;
+	}
+
 	if (test_bit(HT_AGG_STATE_WANT_START, &tid_tx->state)) {
 		/* not even started yet! */
 		ieee80211_assign_tid_tx(sta, tid, NULL);
@@ -170,6 +176,8 @@ int ___ieee80211_stop_tx_ba_session(stru
 		return 0;
 	}
 
+	set_bit(HT_AGG_STATE_STOPPING, &tid_tx->state);
+
 	spin_unlock_bh(&sta->lock);
 
 #ifdef CONFIG_MAC80211_HT_DEBUG
@@ -177,8 +185,6 @@ int ___ieee80211_stop_tx_ba_session(stru
 	       sta->sta.addr, tid);
 #endif /* CONFIG_MAC80211_HT_DEBUG */
 
-	set_bit(HT_AGG_STATE_STOPPING, &tid_tx->state);
-
 	del_timer_sync(&tid_tx->addba_resp_timer);
 
 	/*



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

* [35/80] mac80211: fix race between the AGG SM and the Tx data path
  2011-12-07 16:12 [00/80] 3.0.13-stable review Greg KH
                   ` (33 preceding siblings ...)
  2011-12-07 16:06 ` [34/80] mac80211: dont stop a single aggregation session twice Greg KH
@ 2011-12-07 16:06 ` Greg KH
  2011-12-07 16:06 ` [36/80] hwmon: (coretemp) Fix oops on driver load Greg KH
                   ` (44 subsequent siblings)
  79 siblings, 0 replies; 91+ messages in thread
From: Greg KH @ 2011-12-07 16:06 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: torvalds, akpm, alan, Emmanuel Grumbach, John W. Linville

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

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

From: Emmanuel Grumbach <emmanuel.grumbach@intel.com>

commit 2a1e0fd175dcfd72096ba9291d31e3b1b5342e60 upstream.

When a packet is supposed to sent be as an a-MPDU, mac80211 sets
IEEE80211_TX_CTL_AMPDU to let the driver know. On the other
hand, mac80211 configures the driver for aggregration with the
ampdu_action callback.
There is race between these two mechanisms since the following
scenario can occur when the BA agreement is torn down:

Tx softIRQ	 			drv configuration
==========				=================

check OPERATIONAL bit
Set the TX_CTL_AMPDU bit in the packet

					clear OPERATIONAL bit
					stop Tx AGG
Pass Tx packet to the driver.

In that case the driver would get a packet with TX_CTL_AMPDU set
although it has already been notified that the BA session has been
torn down.

To fix this, we need to synchronize all the Qdisc activity after we
cleared the OPERATIONAL bit. After that step, all the following
packets will be buffered until the driver reports it is ready to get
new packets for this RA / TID. This buffering allows not to run into
another race that would send packets with TX_CTL_AMPDU unset while
the driver hasn't been requested to tear down the BA session yet.

This race occurs in practice and iwlwifi complains with a WARN_ON
when it happens.

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Reviewed-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

---
 net/mac80211/agg-tx.c |   14 ++++++++++++++
 1 file changed, 14 insertions(+)

--- a/net/mac80211/agg-tx.c
+++ b/net/mac80211/agg-tx.c
@@ -194,6 +194,20 @@ int ___ieee80211_stop_tx_ba_session(stru
 	 */
 	clear_bit(HT_AGG_STATE_OPERATIONAL, &tid_tx->state);
 
+	/*
+	 * There might be a few packets being processed right now (on
+	 * another CPU) that have already gotten past the aggregation
+	 * check when it was still OPERATIONAL and consequently have
+	 * IEEE80211_TX_CTL_AMPDU set. In that case, this code might
+	 * call into the driver at the same time or even before the
+	 * TX paths calls into it, which could confuse the driver.
+	 *
+	 * Wait for all currently running TX paths to finish before
+	 * telling the driver. New packets will not go through since
+	 * the aggregation session is no longer OPERATIONAL.
+	 */
+	synchronize_net();
+
 	tid_tx->stop_initiator = initiator;
 	tid_tx->tx_stop = tx;
 



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

* [36/80] hwmon: (coretemp) Fix oops on driver load
  2011-12-07 16:12 [00/80] 3.0.13-stable review Greg KH
                   ` (34 preceding siblings ...)
  2011-12-07 16:06 ` [35/80] mac80211: fix race between the AGG SM and the Tx data path Greg KH
@ 2011-12-07 16:06 ` Greg KH
  2011-12-07 16:06 ` [37/80] revert "mfd: Fix twl4030 dependencies for audio codec" Greg KH
                   ` (43 subsequent siblings)
  79 siblings, 0 replies; 91+ messages in thread
From: Greg KH @ 2011-12-07 16:06 UTC (permalink / raw)
  To: linux-kernel, stable, stable
  Cc: torvalds, akpm, alan, Guenter Roeck, Greg KH, Jean Delvare,
	Durgadoss R, Fenghua Yu

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

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

From: Jean Delvare <khali@linux-fr.org>

This is for stable kernel branch 3.0 only. Previous and later versions
have different code paths and are not affected by this bug.

If the CPU microcode is too old, the coretemp driver won't work. But
instead of failing gracefully, it currently oops. Check for NULL
platform device data to avoid this.

Signed-off-by: Jean Delvare <khali@linux-fr.org>
Acked-by: Durgadoss R <durgadoss.r@intel.com>
Acked-by: Guenter Roeck <guenter.roeck@ericsson.com>
Cc: Fenghua Yu <fenghua.yu@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

---
 drivers/hwmon/coretemp.c |    2 ++
 1 file changed, 2 insertions(+)

--- a/drivers/hwmon/coretemp.c
+++ b/drivers/hwmon/coretemp.c
@@ -539,6 +539,8 @@ static void coretemp_add_core(unsigned i
 		return;
 
 	pdata = platform_get_drvdata(pdev);
+	if (!pdata)
+		return;
 
 	err = create_core_data(pdata, pdev, cpu, pkg_flag);
 	if (err)



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

* [37/80] revert "mfd: Fix twl4030 dependencies for audio codec"
  2011-12-07 16:12 [00/80] 3.0.13-stable review Greg KH
                   ` (35 preceding siblings ...)
  2011-12-07 16:06 ` [36/80] hwmon: (coretemp) Fix oops on driver load Greg KH
@ 2011-12-07 16:06 ` Greg KH
  2011-12-07 16:06 ` [38/80] SCSI: Silencing killing requests for dead queue Greg KH
                   ` (42 subsequent siblings)
  79 siblings, 0 replies; 91+ messages in thread
From: Greg KH @ 2011-12-07 16:06 UTC (permalink / raw)
  To: linux-kernel, stable, Greg KH
  Cc: torvalds, akpm, alan, Thomas Weber, Peter Ujfalusi, Samuel Ortiz,
	Jarkko Nikula

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

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

This reverts commit 11b8fc6ae54bf18a48c94e181c37ca135b858b42, which was commit f09ee0451a44a4e913a7c3cec3805508f7de6c54 upstream.

Koen Kooi <koen@dominion.thruhere.net> reports that this shouldn't have been applied to the 3.0 kernel as it isn't relevant there, only 3.1.

Reported-by: Koen Kooi <koen@dominion.thruhere.net>
Cc: Thomas Weber <weber@corscience.de>
Cc: Peter Ujfalusi <peter.ujfalusi@ti.com>
Cc: Samuel Ortiz <sameo@linux.intel.com>
Cc: Jarkko Nikula <jarkko.nikula@bitmer.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

---
 drivers/mfd/twl-core.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- a/drivers/mfd/twl-core.c
+++ b/drivers/mfd/twl-core.c
@@ -109,7 +109,7 @@
 #define twl_has_watchdog()        false
 #endif
 
-#if defined(CONFIG_MFD_TWL4030_AUDIO) || defined(CONFIG_MFD_TWL4030_AUDIO_MODULE) ||\
+#if defined(CONFIG_TWL4030_CODEC) || defined(CONFIG_TWL4030_CODEC_MODULE) ||\
 	defined(CONFIG_SND_SOC_TWL6040) || defined(CONFIG_SND_SOC_TWL6040_MODULE)
 #define twl_has_codec()	true
 #else



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

* [38/80] SCSI: Silencing killing requests for dead queue
  2011-12-07 16:12 [00/80] 3.0.13-stable review Greg KH
                   ` (36 preceding siblings ...)
  2011-12-07 16:06 ` [37/80] revert "mfd: Fix twl4030 dependencies for audio codec" Greg KH
@ 2011-12-07 16:06 ` Greg KH
  2011-12-07 16:06 ` [39/80] hugetlb: release pages in the error path of hugetlb_cow() Greg KH
                   ` (41 subsequent siblings)
  79 siblings, 0 replies; 91+ messages in thread
From: Greg KH @ 2011-12-07 16:06 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: torvalds, akpm, alan, Hannes Reinecke, James Bottomley,
	Christoph Biedl

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

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

From: Hannes Reinecke <hare@suse.de>

commit 745718132c3c7cac98a622b610e239dcd5217f71 upstream.

When we tear down a device we try to flush all outstanding
commands in scsi_free_queue(). However the check in
scsi_request_fn() is imperfect as it only signals that
we _might start_ aborting commands, not that we've actually
aborted some.
So move the printk inside the scsi_kill_request function,
this will also give us a hint about which commands are aborted.

Signed-off-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
Cc: Christoph Biedl <linux-kernel.bfrz@manchmal.in-ulm.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

---
 drivers/scsi/scsi_lib.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

--- a/drivers/scsi/scsi_lib.c
+++ b/drivers/scsi/scsi_lib.c
@@ -1407,6 +1407,8 @@ static void scsi_kill_request(struct req
 
 	blk_start_request(req);
 
+	scmd_printk(KERN_INFO, cmd, "killing request\n");
+
 	sdev = cmd->device;
 	starget = scsi_target(sdev);
 	shost = sdev->host;
@@ -1488,7 +1490,6 @@ static void scsi_request_fn(struct reque
 	struct request *req;
 
 	if (!sdev) {
-		printk("scsi: killing requests for dead queue\n");
 		while ((req = blk_peek_request(q)) != NULL)
 			scsi_kill_request(req, q);
 		return;



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

* [39/80] hugetlb: release pages in the error path of hugetlb_cow()
  2011-12-07 16:12 [00/80] 3.0.13-stable review Greg KH
                   ` (37 preceding siblings ...)
  2011-12-07 16:06 ` [38/80] SCSI: Silencing killing requests for dead queue Greg KH
@ 2011-12-07 16:06 ` Greg KH
  2011-12-07 16:07 ` [40/80] drm/radeon/kms: add some new pci ids Greg KH
                   ` (40 subsequent siblings)
  79 siblings, 0 replies; 91+ messages in thread
From: Greg KH @ 2011-12-07 16:06 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: torvalds, akpm, alan, Hillf Danton, Hugh Dickins, Johannes Weiner,
	Michal Hocko

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

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

From: Hillf Danton <dhillf@gmail.com>

commit ea4039a34c4c206d015d34a49d0b00868e37db1d upstream.

If we fail to prepare an anon_vma, the {new, old}_page should be released,
or they will leak.

Signed-off-by: Hillf Danton <dhillf@gmail.com>
Reviewed-by: Andrea Arcangeli <aarcange@redhat.com>
Cc: Hugh Dickins <hughd@google.com>
Cc: Johannes Weiner <jweiner@redhat.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Michal Hocko <mhocko@suse.cz>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

---
 mm/hugetlb.c |    2 ++
 1 file changed, 2 insertions(+)

--- a/mm/hugetlb.c
+++ b/mm/hugetlb.c
@@ -2415,6 +2415,8 @@ retry_avoidcopy:
 	 * anon_vma prepared.
 	 */
 	if (unlikely(anon_vma_prepare(vma))) {
+		page_cache_release(new_page);
+		page_cache_release(old_page);
 		/* Caller expects lock to be held */
 		spin_lock(&mm->page_table_lock);
 		return VM_FAULT_OOM;



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

* [40/80] drm/radeon/kms: add some new pci ids
  2011-12-07 16:12 [00/80] 3.0.13-stable review Greg KH
                   ` (38 preceding siblings ...)
  2011-12-07 16:06 ` [39/80] hugetlb: release pages in the error path of hugetlb_cow() Greg KH
@ 2011-12-07 16:07 ` Greg KH
  2011-12-07 16:07 ` [41/80] drm/radeon/kms: add some loop timeouts in pageflip code Greg KH
                   ` (39 subsequent siblings)
  79 siblings, 0 replies; 91+ messages in thread
From: Greg KH @ 2011-12-07 16:07 UTC (permalink / raw)
  To: linux-kernel, stable; +Cc: torvalds, akpm, alan, Alex Deucher, Dave Airlie

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

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

From: Alex Deucher <alexander.deucher@amd.com>

commit 2ed4d9d648cbd4fb1c232a646dbdbdfdd373ca94 upstream.

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

---
 include/drm/drm_pciids.h |    8 ++++++++
 1 file changed, 8 insertions(+)

--- a/include/drm/drm_pciids.h
+++ b/include/drm/drm_pciids.h
@@ -197,6 +197,14 @@
 	{0x1002, 0x6770, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_CAICOS|RADEON_NEW_MEMMAP}, \
 	{0x1002, 0x6778, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_CAICOS|RADEON_NEW_MEMMAP}, \
 	{0x1002, 0x6779, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_CAICOS|RADEON_NEW_MEMMAP}, \
+	{0x1002, 0x6840, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_TURKS|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP}, \
+	{0x1002, 0x6841, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_TURKS|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP}, \
+	{0x1002, 0x6842, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_TURKS|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP}, \
+	{0x1002, 0x6843, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_TURKS|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP}, \
+	{0x1002, 0x6849, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_TURKS|RADEON_NEW_MEMMAP}, \
+	{0x1002, 0x6850, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_TURKS|RADEON_NEW_MEMMAP}, \
+	{0x1002, 0x6858, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_TURKS|RADEON_NEW_MEMMAP}, \
+	{0x1002, 0x6859, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_TURKS|RADEON_NEW_MEMMAP}, \
 	{0x1002, 0x6880, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_CYPRESS|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP}, \
 	{0x1002, 0x6888, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_CYPRESS|RADEON_NEW_MEMMAP}, \
 	{0x1002, 0x6889, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_CYPRESS|RADEON_NEW_MEMMAP}, \



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

* [41/80] drm/radeon/kms: add some loop timeouts in pageflip code
  2011-12-07 16:12 [00/80] 3.0.13-stable review Greg KH
                   ` (39 preceding siblings ...)
  2011-12-07 16:07 ` [40/80] drm/radeon/kms: add some new pci ids Greg KH
@ 2011-12-07 16:07 ` Greg KH
  2011-12-07 16:07 ` [42/80] firmware: Sigma: Prevent out of bounds memory access Greg KH
                   ` (38 subsequent siblings)
  79 siblings, 0 replies; 91+ messages in thread
From: Greg KH @ 2011-12-07 16:07 UTC (permalink / raw)
  To: linux-kernel, stable; +Cc: torvalds, akpm, alan, Alex Deucher, Dave Airlie

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

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

From: Alex Deucher <alexander.deucher@amd.com>

commit f64964796dedca340608fb1075ab6baad5625851 upstream.

Avoid infinite loops waiting for surface updates if a GPU
reset happens while waiting for a page flip.

See:
https://bugs.freedesktop.org/show_bug.cgi?id=43191

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Mario Kleiner <mario.kleiner@tuebingen.mpg.de>
Tested-by: Simon Farnsworth <simon.farnsworth@onelan.co.uk>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

---
 drivers/gpu/drm/radeon/evergreen.c |    7 ++++++-
 drivers/gpu/drm/radeon/r100.c      |    7 ++++++-
 drivers/gpu/drm/radeon/rs600.c     |    7 ++++++-
 drivers/gpu/drm/radeon/rv770.c     |    7 ++++++-
 4 files changed, 24 insertions(+), 4 deletions(-)

--- a/drivers/gpu/drm/radeon/evergreen.c
+++ b/drivers/gpu/drm/radeon/evergreen.c
@@ -82,6 +82,7 @@ u32 evergreen_page_flip(struct radeon_de
 {
 	struct radeon_crtc *radeon_crtc = rdev->mode_info.crtcs[crtc_id];
 	u32 tmp = RREG32(EVERGREEN_GRPH_UPDATE + radeon_crtc->crtc_offset);
+	int i;
 
 	/* Lock the graphics update lock */
 	tmp |= EVERGREEN_GRPH_UPDATE_LOCK;
@@ -99,7 +100,11 @@ u32 evergreen_page_flip(struct radeon_de
 	       (u32)crtc_base);
 
 	/* Wait for update_pending to go high. */
-	while (!(RREG32(EVERGREEN_GRPH_UPDATE + radeon_crtc->crtc_offset) & EVERGREEN_GRPH_SURFACE_UPDATE_PENDING));
+	for (i = 0; i < rdev->usec_timeout; i++) {
+		if (RREG32(EVERGREEN_GRPH_UPDATE + radeon_crtc->crtc_offset) & EVERGREEN_GRPH_SURFACE_UPDATE_PENDING)
+			break;
+		udelay(1);
+	}
 	DRM_DEBUG("Update pending now high. Unlocking vupdate_lock.\n");
 
 	/* Unlock the lock, so double-buffering can take place inside vblank */
--- a/drivers/gpu/drm/radeon/r100.c
+++ b/drivers/gpu/drm/radeon/r100.c
@@ -84,13 +84,18 @@ u32 r100_page_flip(struct radeon_device
 {
 	struct radeon_crtc *radeon_crtc = rdev->mode_info.crtcs[crtc_id];
 	u32 tmp = ((u32)crtc_base) | RADEON_CRTC_OFFSET__OFFSET_LOCK;
+	int i;
 
 	/* Lock the graphics update lock */
 	/* update the scanout addresses */
 	WREG32(RADEON_CRTC_OFFSET + radeon_crtc->crtc_offset, tmp);
 
 	/* Wait for update_pending to go high. */
-	while (!(RREG32(RADEON_CRTC_OFFSET + radeon_crtc->crtc_offset) & RADEON_CRTC_OFFSET__GUI_TRIG_OFFSET));
+	for (i = 0; i < rdev->usec_timeout; i++) {
+		if (RREG32(RADEON_CRTC_OFFSET + radeon_crtc->crtc_offset) & RADEON_CRTC_OFFSET__GUI_TRIG_OFFSET)
+			break;
+		udelay(1);
+	}
 	DRM_DEBUG("Update pending now high. Unlocking vupdate_lock.\n");
 
 	/* Unlock the lock, so double-buffering can take place inside vblank */
--- a/drivers/gpu/drm/radeon/rs600.c
+++ b/drivers/gpu/drm/radeon/rs600.c
@@ -62,6 +62,7 @@ u32 rs600_page_flip(struct radeon_device
 {
 	struct radeon_crtc *radeon_crtc = rdev->mode_info.crtcs[crtc_id];
 	u32 tmp = RREG32(AVIVO_D1GRPH_UPDATE + radeon_crtc->crtc_offset);
+	int i;
 
 	/* Lock the graphics update lock */
 	tmp |= AVIVO_D1GRPH_UPDATE_LOCK;
@@ -74,7 +75,11 @@ u32 rs600_page_flip(struct radeon_device
 	       (u32)crtc_base);
 
 	/* Wait for update_pending to go high. */
-	while (!(RREG32(AVIVO_D1GRPH_UPDATE + radeon_crtc->crtc_offset) & AVIVO_D1GRPH_SURFACE_UPDATE_PENDING));
+	for (i = 0; i < rdev->usec_timeout; i++) {
+		if (RREG32(AVIVO_D1GRPH_UPDATE + radeon_crtc->crtc_offset) & AVIVO_D1GRPH_SURFACE_UPDATE_PENDING)
+			break;
+		udelay(1);
+	}
 	DRM_DEBUG("Update pending now high. Unlocking vupdate_lock.\n");
 
 	/* Unlock the lock, so double-buffering can take place inside vblank */
--- a/drivers/gpu/drm/radeon/rv770.c
+++ b/drivers/gpu/drm/radeon/rv770.c
@@ -47,6 +47,7 @@ u32 rv770_page_flip(struct radeon_device
 {
 	struct radeon_crtc *radeon_crtc = rdev->mode_info.crtcs[crtc_id];
 	u32 tmp = RREG32(AVIVO_D1GRPH_UPDATE + radeon_crtc->crtc_offset);
+	int i;
 
 	/* Lock the graphics update lock */
 	tmp |= AVIVO_D1GRPH_UPDATE_LOCK;
@@ -66,7 +67,11 @@ u32 rv770_page_flip(struct radeon_device
 	       (u32)crtc_base);
 
 	/* Wait for update_pending to go high. */
-	while (!(RREG32(AVIVO_D1GRPH_UPDATE + radeon_crtc->crtc_offset) & AVIVO_D1GRPH_SURFACE_UPDATE_PENDING));
+	for (i = 0; i < rdev->usec_timeout; i++) {
+		if (RREG32(AVIVO_D1GRPH_UPDATE + radeon_crtc->crtc_offset) & AVIVO_D1GRPH_SURFACE_UPDATE_PENDING)
+			break;
+		udelay(1);
+	}
 	DRM_DEBUG("Update pending now high. Unlocking vupdate_lock.\n");
 
 	/* Unlock the lock, so double-buffering can take place inside vblank */



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

* [42/80] firmware: Sigma: Prevent out of bounds memory access
  2011-12-07 16:12 [00/80] 3.0.13-stable review Greg KH
                   ` (40 preceding siblings ...)
  2011-12-07 16:07 ` [41/80] drm/radeon/kms: add some loop timeouts in pageflip code Greg KH
@ 2011-12-07 16:07 ` Greg KH
  2011-12-07 16:07 ` [43/80] firmware: Sigma: Skip header during CRC generation Greg KH
                   ` (37 subsequent siblings)
  79 siblings, 0 replies; 91+ messages in thread
From: Greg KH @ 2011-12-07 16:07 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: torvalds, akpm, alan, Lars-Peter Clausen, Mike Frysinger,
	Mark Brown

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

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

From: Lars-Peter Clausen <lars@metafoo.de>

commit 4f718a29fe4908c2cea782f751e9805319684e2b upstream.

The SigmaDSP firmware loader currently does not perform enough boundary size
checks when processing the firmware. As a result it is possible that a
malformed firmware can cause an out of bounds memory access.

This patch adds checks which ensure that both the action header and the payload
are completely inside the firmware data boundaries before processing them.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Acked-by: Mike Frysinger <vapier@gentoo.org>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

---
 drivers/firmware/sigma.c |   76 ++++++++++++++++++++++++++++++++++-------------
 include/linux/sigma.h    |    5 ---
 2 files changed, 55 insertions(+), 26 deletions(-)

--- a/drivers/firmware/sigma.c
+++ b/drivers/firmware/sigma.c
@@ -14,13 +14,34 @@
 #include <linux/module.h>
 #include <linux/sigma.h>
 
-/* Return: 0==OK, <0==error, =1 ==no more actions */
+static size_t sigma_action_size(struct sigma_action *sa)
+{
+	size_t payload = 0;
+
+	switch (sa->instr) {
+	case SIGMA_ACTION_WRITEXBYTES:
+	case SIGMA_ACTION_WRITESINGLE:
+	case SIGMA_ACTION_WRITESAFELOAD:
+		payload = sigma_action_len(sa);
+		break;
+	default:
+		break;
+	}
+
+	payload = ALIGN(payload, 2);
+
+	return payload + sizeof(struct sigma_action);
+}
+
+/*
+ * Returns a negative error value in case of an error, 0 if processing of
+ * the firmware should be stopped after this action, 1 otherwise.
+ */
 static int
-process_sigma_action(struct i2c_client *client, struct sigma_firmware *ssfw)
+process_sigma_action(struct i2c_client *client, struct sigma_action *sa)
 {
-	struct sigma_action *sa = (void *)(ssfw->fw->data + ssfw->pos);
 	size_t len = sigma_action_len(sa);
-	int ret = 0;
+	int ret;
 
 	pr_debug("%s: instr:%i addr:%#x len:%zu\n", __func__,
 		sa->instr, sa->addr, len);
@@ -29,44 +50,50 @@ process_sigma_action(struct i2c_client *
 	case SIGMA_ACTION_WRITEXBYTES:
 	case SIGMA_ACTION_WRITESINGLE:
 	case SIGMA_ACTION_WRITESAFELOAD:
-		if (ssfw->fw->size < ssfw->pos + len)
-			return -EINVAL;
 		ret = i2c_master_send(client, (void *)&sa->addr, len);
 		if (ret < 0)
 			return -EINVAL;
 		break;
-
 	case SIGMA_ACTION_DELAY:
-		ret = 0;
 		udelay(len);
 		len = 0;
 		break;
-
 	case SIGMA_ACTION_END:
-		return 1;
-
+		return 0;
 	default:
 		return -EINVAL;
 	}
 
-	/* when arrive here ret=0 or sent data */
-	ssfw->pos += sigma_action_size(sa, len);
-	return ssfw->pos == ssfw->fw->size;
+	return 1;
 }
 
 static int
 process_sigma_actions(struct i2c_client *client, struct sigma_firmware *ssfw)
 {
-	pr_debug("%s: processing %p\n", __func__, ssfw);
+	struct sigma_action *sa;
+	size_t size;
+	int ret;
+
+	while (ssfw->pos + sizeof(*sa) <= ssfw->fw->size) {
+		sa = (struct sigma_action *)(ssfw->fw->data + ssfw->pos);
+
+		size = sigma_action_size(sa);
+		ssfw->pos += size;
+		if (ssfw->pos > ssfw->fw->size || size == 0)
+			break;
+
+		ret = process_sigma_action(client, sa);
 
-	while (1) {
-		int ret = process_sigma_action(client, ssfw);
 		pr_debug("%s: action returned %i\n", __func__, ret);
-		if (ret == 1)
-			return 0;
-		else if (ret)
+
+		if (ret <= 0)
 			return ret;
 	}
+
+	if (ssfw->pos != ssfw->fw->size)
+		return -EINVAL;
+
+	return 0;
 }
 
 int process_sigma_firmware(struct i2c_client *client, const char *name)
@@ -89,7 +116,14 @@ int process_sigma_firmware(struct i2c_cl
 
 	/* then verify the header */
 	ret = -EINVAL;
-	if (fw->size < sizeof(*ssfw_head))
+
+	/*
+	 * Reject too small or unreasonable large files. The upper limit has been
+	 * chosen a bit arbitrarily, but it should be enough for all practical
+	 * purposes and having the limit makes it easier to avoid integer
+	 * overflows later in the loading process.
+	 */
+	if (fw->size < sizeof(*ssfw_head) || fw->size >= 0x4000000)
 		goto done;
 
 	ssfw_head = (void *)fw->data;
--- a/include/linux/sigma.h
+++ b/include/linux/sigma.h
@@ -50,11 +50,6 @@ static inline u32 sigma_action_len(struc
 	return (sa->len_hi << 16) | sa->len;
 }
 
-static inline size_t sigma_action_size(struct sigma_action *sa, u32 payload_len)
-{
-	return sizeof(*sa) + payload_len + (payload_len % 2);
-}
-
 extern int process_sigma_firmware(struct i2c_client *client, const char *name);
 
 #endif



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

* [43/80] firmware: Sigma: Skip header during CRC generation
  2011-12-07 16:12 [00/80] 3.0.13-stable review Greg KH
                   ` (41 preceding siblings ...)
  2011-12-07 16:07 ` [42/80] firmware: Sigma: Prevent out of bounds memory access Greg KH
@ 2011-12-07 16:07 ` Greg KH
  2011-12-07 16:07 ` [44/80] firmware: Sigma: Fix endianess issues Greg KH
                   ` (36 subsequent siblings)
  79 siblings, 0 replies; 91+ messages in thread
From: Greg KH @ 2011-12-07 16:07 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: torvalds, akpm, alan, Lars-Peter Clausen, Mike Frysinger,
	Mark Brown

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

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

From: Lars-Peter Clausen <lars@metafoo.de>

commit c56935bdc0a8edf50237d3b0205133a5b0adc604 upstream.

The firmware header is not part of the CRC, so skip it. Otherwise the firmware
will be rejected due to non-matching CRCs.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Acked-by: Mike Frysinger <vapier@gentoo.org>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

---
 drivers/firmware/sigma.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

--- a/drivers/firmware/sigma.c
+++ b/drivers/firmware/sigma.c
@@ -130,7 +130,8 @@ int process_sigma_firmware(struct i2c_cl
 	if (memcmp(ssfw_head->magic, SIGMA_MAGIC, ARRAY_SIZE(ssfw_head->magic)))
 		goto done;
 
-	crc = crc32(0, fw->data, fw->size);
+	crc = crc32(0, fw->data + sizeof(*ssfw_head),
+			fw->size - sizeof(*ssfw_head));
 	pr_debug("%s: crc=%x\n", __func__, crc);
 	if (crc != ssfw_head->crc)
 		goto done;



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

* [44/80] firmware: Sigma: Fix endianess issues
  2011-12-07 16:12 [00/80] 3.0.13-stable review Greg KH
                   ` (42 preceding siblings ...)
  2011-12-07 16:07 ` [43/80] firmware: Sigma: Skip header during CRC generation Greg KH
@ 2011-12-07 16:07 ` Greg KH
  2011-12-07 16:07 ` [45/80] staging: usbip: bugfix for deadlock Greg KH
                   ` (35 subsequent siblings)
  79 siblings, 0 replies; 91+ messages in thread
From: Greg KH @ 2011-12-07 16:07 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: torvalds, akpm, alan, Lars-Peter Clausen, Mike Frysinger,
	Mark Brown

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

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

From: Lars-Peter Clausen <lars@metafoo.de>

commit bda63586bc5929e97288cdb371bb6456504867ed upstream.

Currently the SigmaDSP firmware loader only works correctly on little-endian
systems. Fix this by using the proper endianess conversion functions.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Acked-by: Mike Frysinger <vapier@gentoo.org>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

---
 drivers/firmware/sigma.c |    2 +-
 include/linux/sigma.h    |    8 ++++----
 2 files changed, 5 insertions(+), 5 deletions(-)

--- a/drivers/firmware/sigma.c
+++ b/drivers/firmware/sigma.c
@@ -133,7 +133,7 @@ int process_sigma_firmware(struct i2c_cl
 	crc = crc32(0, fw->data + sizeof(*ssfw_head),
 			fw->size - sizeof(*ssfw_head));
 	pr_debug("%s: crc=%x\n", __func__, crc);
-	if (crc != ssfw_head->crc)
+	if (crc != le32_to_cpu(ssfw_head->crc))
 		goto done;
 
 	ssfw.pos = sizeof(*ssfw_head);
--- a/include/linux/sigma.h
+++ b/include/linux/sigma.h
@@ -24,7 +24,7 @@ struct sigma_firmware {
 struct sigma_firmware_header {
 	unsigned char magic[7];
 	u8 version;
-	u32 crc;
+	__le32 crc;
 };
 
 enum {
@@ -40,14 +40,14 @@ enum {
 struct sigma_action {
 	u8 instr;
 	u8 len_hi;
-	u16 len;
-	u16 addr;
+	__le16 len;
+	__be16 addr;
 	unsigned char payload[];
 };
 
 static inline u32 sigma_action_len(struct sigma_action *sa)
 {
-	return (sa->len_hi << 16) | sa->len;
+	return (sa->len_hi << 16) | le16_to_cpu(sa->len);
 }
 
 extern int process_sigma_firmware(struct i2c_client *client, const char *name);



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

* [45/80] staging: usbip: bugfix for deadlock
  2011-12-07 16:12 [00/80] 3.0.13-stable review Greg KH
                   ` (43 preceding siblings ...)
  2011-12-07 16:07 ` [44/80] firmware: Sigma: Fix endianess issues Greg KH
@ 2011-12-07 16:07 ` Greg KH
  2011-12-07 16:07 ` [46/80] staging: comedi: fix oops for USB DAQ devices Greg KH
                   ` (34 subsequent siblings)
  79 siblings, 0 replies; 91+ messages in thread
From: Greg KH @ 2011-12-07 16:07 UTC (permalink / raw)
  To: linux-kernel, stable; +Cc: torvalds, akpm, alan, Bart Westgeest

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

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

From: Bart Westgeest <bart@elbrys.com>

commit 438957f8d4a84daa7fa5be6978ad5897a2e9e5e5 upstream.

Interrupts must be disabled prior to calling usb_hcd_unlink_urb_from_ep.
If interrupts are not disabled, it can potentially lead to a deadlock.
The deadlock is readily reproduceable on a slower (ARM based) device
such as the TI Pandaboard.

Signed-off-by: Bart Westgeest <bart@elbrys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

---
 drivers/staging/usbip/vhci_rx.c |   10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

--- a/drivers/staging/usbip/vhci_rx.c
+++ b/drivers/staging/usbip/vhci_rx.c
@@ -68,6 +68,7 @@ static void vhci_recv_ret_submit(struct
 {
 	struct usbip_device *ud = &vdev->ud;
 	struct urb *urb;
+	unsigned long flags;
 
 	spin_lock(&vdev->priv_lock);
 	urb = pickup_urb_and_free_priv(vdev, pdu->base.seqnum);
@@ -101,9 +102,9 @@ static void vhci_recv_ret_submit(struct
 
 	usbip_dbg_vhci_rx("now giveback urb %p\n", urb);
 
-	spin_lock(&the_controller->lock);
+	spin_lock_irqsave(&the_controller->lock, flags);
 	usb_hcd_unlink_urb_from_ep(vhci_to_hcd(the_controller), urb);
-	spin_unlock(&the_controller->lock);
+	spin_unlock_irqrestore(&the_controller->lock, flags);
 
 	usb_hcd_giveback_urb(vhci_to_hcd(the_controller), urb, urb->status);
 
@@ -141,6 +142,7 @@ static void vhci_recv_ret_unlink(struct
 {
 	struct vhci_unlink *unlink;
 	struct urb *urb;
+	unsigned long flags;
 
 	usbip_dump_header(pdu);
 
@@ -170,9 +172,9 @@ static void vhci_recv_ret_unlink(struct
 		urb->status = pdu->u.ret_unlink.status;
 		pr_info("urb->status %d\n", urb->status);
 
-		spin_lock(&the_controller->lock);
+		spin_lock_irqsave(&the_controller->lock, flags);
 		usb_hcd_unlink_urb_from_ep(vhci_to_hcd(the_controller), urb);
-		spin_unlock(&the_controller->lock);
+		spin_unlock_irqrestore(&the_controller->lock, flags);
 
 		usb_hcd_giveback_urb(vhci_to_hcd(the_controller), urb,
 				     urb->status);



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

* [46/80] staging: comedi: fix oops for USB DAQ devices.
  2011-12-07 16:12 [00/80] 3.0.13-stable review Greg KH
                   ` (44 preceding siblings ...)
  2011-12-07 16:07 ` [45/80] staging: usbip: bugfix for deadlock Greg KH
@ 2011-12-07 16:07 ` Greg KH
  2011-12-07 16:07 ` [47/80] Staging: comedi: fix mmap_count Greg KH
                   ` (33 subsequent siblings)
  79 siblings, 0 replies; 91+ messages in thread
From: Greg KH @ 2011-12-07 16:07 UTC (permalink / raw)
  To: linux-kernel, stable; +Cc: torvalds, akpm, alan, Bernd Porr

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

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

From: Bernd Porr <berndporr@f2s.com>

commit 3ffab428f40849ed5f21bcfd7285bdef7902f9ca upstream.

This fixes kernel oops when an USB DAQ device is plugged out while it's
communicating with the userspace software.

Signed-off-by: Bernd Porr <berndporr@f2s.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

---
 drivers/staging/comedi/comedi_fops.c |   73 +++++++++++++++++++++++++----------
 1 file changed, 54 insertions(+), 19 deletions(-)

--- a/drivers/staging/comedi/comedi_fops.c
+++ b/drivers/staging/comedi/comedi_fops.c
@@ -1452,9 +1452,6 @@ static struct vm_operations_struct comed
 static int comedi_mmap(struct file *file, struct vm_area_struct *vma)
 {
 	const unsigned minor = iminor(file->f_dentry->d_inode);
-	struct comedi_device_file_info *dev_file_info =
-	    comedi_get_device_file_info(minor);
-	struct comedi_device *dev = dev_file_info->device;
 	struct comedi_async *async = NULL;
 	unsigned long start = vma->vm_start;
 	unsigned long size;
@@ -1462,6 +1459,15 @@ static int comedi_mmap(struct file *file
 	int i;
 	int retval;
 	struct comedi_subdevice *s;
+	struct comedi_device_file_info *dev_file_info;
+	struct comedi_device *dev;
+
+	dev_file_info = comedi_get_device_file_info(minor);
+	if (dev_file_info == NULL)
+	        return -ENODEV;
+	dev = dev_file_info->device;
+	if (dev == NULL)
+	        return -ENODEV;
 
 	mutex_lock(&dev->mutex);
 	if (!dev->attached) {
@@ -1528,11 +1534,17 @@ static unsigned int comedi_poll(struct f
 {
 	unsigned int mask = 0;
 	const unsigned minor = iminor(file->f_dentry->d_inode);
-	struct comedi_device_file_info *dev_file_info =
-	    comedi_get_device_file_info(minor);
-	struct comedi_device *dev = dev_file_info->device;
 	struct comedi_subdevice *read_subdev;
 	struct comedi_subdevice *write_subdev;
+	struct comedi_device_file_info *dev_file_info;
+	struct comedi_device *dev;
+	dev_file_info = comedi_get_device_file_info(minor);
+
+	if (dev_file_info == NULL)
+	        return -ENODEV;
+	dev = dev_file_info->device;
+	if (dev == NULL)
+	        return -ENODEV;
 
 	mutex_lock(&dev->mutex);
 	if (!dev->attached) {
@@ -1578,9 +1590,15 @@ static ssize_t comedi_write(struct file
 	int n, m, count = 0, retval = 0;
 	DECLARE_WAITQUEUE(wait, current);
 	const unsigned minor = iminor(file->f_dentry->d_inode);
-	struct comedi_device_file_info *dev_file_info =
-	    comedi_get_device_file_info(minor);
-	struct comedi_device *dev = dev_file_info->device;
+	struct comedi_device_file_info *dev_file_info;
+	struct comedi_device *dev;
+	dev_file_info = comedi_get_device_file_info(minor);
+
+	if (dev_file_info == NULL)
+	        return -ENODEV;
+	dev = dev_file_info->device;
+	if (dev == NULL)
+	        return -ENODEV;
 
 	if (!dev->attached) {
 		DPRINTK("no driver configured on comedi%i\n", dev->minor);
@@ -1683,9 +1701,15 @@ static ssize_t comedi_read(struct file *
 	int n, m, count = 0, retval = 0;
 	DECLARE_WAITQUEUE(wait, current);
 	const unsigned minor = iminor(file->f_dentry->d_inode);
-	struct comedi_device_file_info *dev_file_info =
-	    comedi_get_device_file_info(minor);
-	struct comedi_device *dev = dev_file_info->device;
+	struct comedi_device_file_info *dev_file_info;
+	struct comedi_device *dev;
+	dev_file_info = comedi_get_device_file_info(minor);
+
+	if (dev_file_info == NULL)
+	        return -ENODEV;
+	dev = dev_file_info->device;
+	if (dev == NULL)
+	        return -ENODEV;
 
 	if (!dev->attached) {
 		DPRINTK("no driver configured on comedi%i\n", dev->minor);
@@ -1885,11 +1909,17 @@ ok:
 static int comedi_close(struct inode *inode, struct file *file)
 {
 	const unsigned minor = iminor(inode);
-	struct comedi_device_file_info *dev_file_info =
-	    comedi_get_device_file_info(minor);
-	struct comedi_device *dev = dev_file_info->device;
 	struct comedi_subdevice *s = NULL;
 	int i;
+	struct comedi_device_file_info *dev_file_info;
+	struct comedi_device *dev;
+	dev_file_info = comedi_get_device_file_info(minor);
+
+	if (dev_file_info == NULL)
+	        return -ENODEV;
+	dev = dev_file_info->device;
+	if (dev == NULL)
+	        return -ENODEV;
 
 	mutex_lock(&dev->mutex);
 
@@ -1923,10 +1953,15 @@ static int comedi_close(struct inode *in
 static int comedi_fasync(int fd, struct file *file, int on)
 {
 	const unsigned minor = iminor(file->f_dentry->d_inode);
-	struct comedi_device_file_info *dev_file_info =
-	    comedi_get_device_file_info(minor);
-
-	struct comedi_device *dev = dev_file_info->device;
+	struct comedi_device_file_info *dev_file_info;
+	struct comedi_device *dev;
+	dev_file_info = comedi_get_device_file_info(minor);
+
+	if (dev_file_info == NULL)
+	        return -ENODEV;
+	dev = dev_file_info->device;
+	if (dev == NULL)
+	        return -ENODEV;
 
 	return fasync_helper(fd, file, on, &dev->async_queue);
 }



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

* [47/80] Staging: comedi: fix mmap_count
  2011-12-07 16:12 [00/80] 3.0.13-stable review Greg KH
                   ` (45 preceding siblings ...)
  2011-12-07 16:07 ` [46/80] staging: comedi: fix oops for USB DAQ devices Greg KH
@ 2011-12-07 16:07 ` Greg KH
  2011-12-07 16:07 ` [48/80] Staging: comedi: fix signal handling in read and write Greg KH
                   ` (32 subsequent siblings)
  79 siblings, 0 replies; 91+ messages in thread
From: Greg KH @ 2011-12-07 16:07 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: torvalds, akpm, alan, Alessandro Rubini, Federico Vaga

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

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

From: Federico Vaga <federico.vaga@gmail.com>

commit df30b21cb0eed5ba8a8e0cdfeebc66ba8cde821d upstream.

In comedi_fops, mmap_count is decremented at comedi_vm_ops->close but
it is not incremented at comedi_vm_ops->open. This may result in a negative
counter.  The patch introduces the open method to keep the counter
consistent.

The bug was triggerd by this sample code:

        mmap(0, ...., comedi_fd);
        fork();
        exit(0);

Acked-by: Alessandro Rubini <rubini@gnudd.com>
Signed-off-by: Federico Vaga <federico.vaga@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

---
 drivers/staging/comedi/comedi_fops.c |   19 +++++++++++++++++--
 1 file changed, 17 insertions(+), 2 deletions(-)

--- a/drivers/staging/comedi/comedi_fops.c
+++ b/drivers/staging/comedi/comedi_fops.c
@@ -1432,7 +1432,21 @@ static int do_cancel(struct comedi_devic
 	return ret;
 }
 
-static void comedi_unmap(struct vm_area_struct *area)
+
+static void comedi_vm_open(struct vm_area_struct *area)
+{
+	struct comedi_async *async;
+	struct comedi_device *dev;
+
+	async = area->vm_private_data;
+	dev = async->subdevice->device;
+
+	mutex_lock(&dev->mutex);
+	async->mmap_count++;
+	mutex_unlock(&dev->mutex);
+}
+
+static void comedi_vm_close(struct vm_area_struct *area)
 {
 	struct comedi_async *async;
 	struct comedi_device *dev;
@@ -1446,7 +1460,8 @@ static void comedi_unmap(struct vm_area_
 }
 
 static struct vm_operations_struct comedi_vm_ops = {
-	.close = comedi_unmap,
+	.open = comedi_vm_open,
+	.close = comedi_vm_close,
 };
 
 static int comedi_mmap(struct file *file, struct vm_area_struct *vma)



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

* [48/80] Staging: comedi: fix signal handling in read and write
  2011-12-07 16:12 [00/80] 3.0.13-stable review Greg KH
                   ` (46 preceding siblings ...)
  2011-12-07 16:07 ` [47/80] Staging: comedi: fix mmap_count Greg KH
@ 2011-12-07 16:07 ` Greg KH
  2011-12-07 16:07 ` [49/80] USB: whci-hcd: fix endian conversion in qset_clear() Greg KH
                   ` (31 subsequent siblings)
  79 siblings, 0 replies; 91+ messages in thread
From: Greg KH @ 2011-12-07 16:07 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: torvalds, akpm, alan, Alessandro Rubini, Federico Vaga

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

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

From: Federico Vaga <federico.vaga@gmail.com>

commit 6a9ce6b654e491981f6ef7e214cbd4f63e033848 upstream.

After sleeping on a wait queue, signal_pending(current) should be
checked (not before sleeping).

Acked-by: Alessandro Rubini <rubini@gnudd.com>
Signed-off-by: Federico Vaga <federico.vaga@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

---
 drivers/staging/comedi/comedi_fops.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

--- a/drivers/staging/comedi/comedi_fops.c
+++ b/drivers/staging/comedi/comedi_fops.c
@@ -1673,11 +1673,11 @@ static ssize_t comedi_write(struct file
 				retval = -EAGAIN;
 				break;
 			}
+			schedule();
 			if (signal_pending(current)) {
 				retval = -ERESTARTSYS;
 				break;
 			}
-			schedule();
 			if (!s->busy)
 				break;
 			if (s->busy != file) {
@@ -1780,11 +1780,11 @@ static ssize_t comedi_read(struct file *
 				retval = -EAGAIN;
 				break;
 			}
+			schedule();
 			if (signal_pending(current)) {
 				retval = -ERESTARTSYS;
 				break;
 			}
-			schedule();
 			if (!s->busy) {
 				retval = 0;
 				break;



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

* [49/80] USB: whci-hcd: fix endian conversion in qset_clear()
  2011-12-07 16:12 [00/80] 3.0.13-stable review Greg KH
                   ` (47 preceding siblings ...)
  2011-12-07 16:07 ` [48/80] Staging: comedi: fix signal handling in read and write Greg KH
@ 2011-12-07 16:07 ` Greg KH
  2011-12-07 16:07 ` [50/80] HID: Correct General touch PID Greg KH
                   ` (30 subsequent siblings)
  79 siblings, 0 replies; 91+ messages in thread
From: Greg KH @ 2011-12-07 16:07 UTC (permalink / raw)
  To: linux-kernel, stable; +Cc: torvalds, akpm, alan, Dan Carpenter

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

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

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

commit 8746c83d538cab273d335acb2be226d096f4a5af upstream.

qset->qh.link is an __le64 field and we should be using cpu_to_le64()
to fill it.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

---
 drivers/usb/host/whci/qset.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- a/drivers/usb/host/whci/qset.c
+++ b/drivers/usb/host/whci/qset.c
@@ -124,7 +124,7 @@ void qset_clear(struct whc *whc, struct
 {
 	qset->td_start = qset->td_end = qset->ntds = 0;
 
-	qset->qh.link = cpu_to_le32(QH_LINK_NTDS(8) | QH_LINK_T);
+	qset->qh.link = cpu_to_le64(QH_LINK_NTDS(8) | QH_LINK_T);
 	qset->qh.status = qset->qh.status & QH_STATUS_SEQ_MASK;
 	qset->qh.err_count = 0;
 	qset->qh.scratch[0] = 0;



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

* [50/80] HID: Correct General touch PID
  2011-12-07 16:12 [00/80] 3.0.13-stable review Greg KH
                   ` (48 preceding siblings ...)
  2011-12-07 16:07 ` [49/80] USB: whci-hcd: fix endian conversion in qset_clear() Greg KH
@ 2011-12-07 16:07 ` Greg KH
  2011-12-07 16:07 ` [51/80] usb: ftdi_sio: add PID for Propox ISPcable III Greg KH
                   ` (29 subsequent siblings)
  79 siblings, 0 replies; 91+ messages in thread
From: Greg KH @ 2011-12-07 16:07 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: torvalds, akpm, alan, Benjamin Tissoires, Jiri Kosina

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

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

From: Benjamin Tissoires <benjamin.tissoires@gmail.com>

commit b1807719f6acdf18cc4bde3b5400d05d77801494 upstream.

Genera Touch told us that 0001 is their single point device
and 0003 is the multitouch one. Apparently, we made the tests
someone having a prototype, and not the final product.
They said it should be safe to do the switch.

This partially reverts 5572da0 ("HID: hid-mulitouch: add support
for the 'Sensing Win7-TwoFinger'").

Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

---
 drivers/hid/hid-core.c |    2 +-
 drivers/hid/hid-ids.h  |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

--- a/drivers/hid/hid-core.c
+++ b/drivers/hid/hid-core.c
@@ -1721,8 +1721,8 @@ static const struct hid_device_id hid_ig
 	{ HID_USB_DEVICE(USB_VENDOR_ID_ESSENTIAL_REALITY, USB_DEVICE_ID_ESSENTIAL_REALITY_P5) },
 	{ HID_USB_DEVICE(USB_VENDOR_ID_ETT, USB_DEVICE_ID_TC5UH) },
 	{ HID_USB_DEVICE(USB_VENDOR_ID_ETT, USB_DEVICE_ID_TC4UM) },
+	{ HID_USB_DEVICE(USB_VENDOR_ID_GENERAL_TOUCH, 0x0001) },
 	{ HID_USB_DEVICE(USB_VENDOR_ID_GENERAL_TOUCH, 0x0002) },
-	{ HID_USB_DEVICE(USB_VENDOR_ID_GENERAL_TOUCH, 0x0003) },
 	{ HID_USB_DEVICE(USB_VENDOR_ID_GENERAL_TOUCH, 0x0004) },
 	{ HID_USB_DEVICE(USB_VENDOR_ID_GLAB, USB_DEVICE_ID_4_PHIDGETSERVO_30) },
 	{ HID_USB_DEVICE(USB_VENDOR_ID_GLAB, USB_DEVICE_ID_1_PHIDGETSERVO_30) },
--- a/drivers/hid/hid-ids.h
+++ b/drivers/hid/hid-ids.h
@@ -266,7 +266,7 @@
 #define USB_DEVICE_ID_GAMERON_DUAL_PCS_ADAPTOR	0x0002
 
 #define USB_VENDOR_ID_GENERAL_TOUCH	0x0dfc
-#define USB_DEVICE_ID_GENERAL_TOUCH_WIN7_TWOFINGERS 0x0001
+#define USB_DEVICE_ID_GENERAL_TOUCH_WIN7_TWOFINGERS 0x0003
 
 #define USB_VENDOR_ID_GLAB		0x06c2
 #define USB_DEVICE_ID_4_PHIDGETSERVO_30	0x0038



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

* [51/80] usb: ftdi_sio: add PID for Propox ISPcable III
  2011-12-07 16:12 [00/80] 3.0.13-stable review Greg KH
                   ` (49 preceding siblings ...)
  2011-12-07 16:07 ` [50/80] HID: Correct General touch PID Greg KH
@ 2011-12-07 16:07 ` Greg KH
  2011-12-07 16:07 ` [52/80] usb: option: add Huawei E353 controlling interfaces Greg KH
                   ` (28 subsequent siblings)
  79 siblings, 0 replies; 91+ messages in thread
From: Greg KH @ 2011-12-07 16:07 UTC (permalink / raw)
  To: linux-kernel, stable; +Cc: torvalds, akpm, alan, Marcin Kościelnicki

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

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

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

From: Marcin Kościelnicki <koriakin@0x04.net>

commit 307369b0ca06b27b511b61714e335ddfccf19c4f upstream.

Signed-off-by: Marcin Kościelnicki <koriakin@0x04.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

---
 drivers/usb/serial/ftdi_sio.c     |    1 +
 drivers/usb/serial/ftdi_sio_ids.h |    1 +
 2 files changed, 2 insertions(+)

--- a/drivers/usb/serial/ftdi_sio.c
+++ b/drivers/usb/serial/ftdi_sio.c
@@ -735,6 +735,7 @@ static struct usb_device_id id_table_com
 	{ USB_DEVICE(TML_VID, TML_USB_SERIAL_PID) },
 	{ USB_DEVICE(FTDI_VID, FTDI_ELSTER_UNICOM_PID) },
 	{ USB_DEVICE(FTDI_VID, FTDI_PROPOX_JTAGCABLEII_PID) },
+	{ USB_DEVICE(FTDI_VID, FTDI_PROPOX_ISPCABLEIII_PID) },
 	{ USB_DEVICE(OLIMEX_VID, OLIMEX_ARM_USB_OCD_PID),
 		.driver_info = (kernel_ulong_t)&ftdi_jtag_quirk },
 	{ USB_DEVICE(OLIMEX_VID, OLIMEX_ARM_USB_OCD_H_PID),
--- a/drivers/usb/serial/ftdi_sio_ids.h
+++ b/drivers/usb/serial/ftdi_sio_ids.h
@@ -112,6 +112,7 @@
 
 /* Propox devices */
 #define FTDI_PROPOX_JTAGCABLEII_PID	0xD738
+#define FTDI_PROPOX_ISPCABLEIII_PID	0xD739
 
 /* Lenz LI-USB Computer Interface. */
 #define FTDI_LENZ_LIUSB_PID	0xD780



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

* [52/80] usb: option: add Huawei E353 controlling interfaces
  2011-12-07 16:12 [00/80] 3.0.13-stable review Greg KH
                   ` (50 preceding siblings ...)
  2011-12-07 16:07 ` [51/80] usb: ftdi_sio: add PID for Propox ISPcable III Greg KH
@ 2011-12-07 16:07 ` Greg KH
  2011-12-07 16:07 ` [53/80] usb: option: add SIMCom SIM5218 Greg KH
                   ` (27 subsequent siblings)
  79 siblings, 0 replies; 91+ messages in thread
From: Greg KH @ 2011-12-07 16:07 UTC (permalink / raw)
  To: linux-kernel, stable; +Cc: torvalds, akpm, alan, Dirk Nehring

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

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

From: Dirk Nehring <dnehring@gmx.net>

commit 46b1848360c8e634e0b063932a1261062fa0f7d6 upstream.

This patch creates the missing controlling devices for the Huawei E353
HSPA+ stick.

Signed-off-by: Dirk Nehring <dnehring@gmx.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

---
 drivers/usb/serial/option.c |    3 +++
 1 file changed, 3 insertions(+)

--- a/drivers/usb/serial/option.c
+++ b/drivers/usb/serial/option.c
@@ -657,6 +657,9 @@ static const struct usb_device_id option
 	{ USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_K4511, 0xff, 0x01, 0x31) },
 	{ USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_K4511, 0xff, 0x01, 0x32) },
 	{ USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_E353, 0xff, 0x01, 0x01) },
+	{ USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_E353, 0xff, 0x01, 0x02) },
+	{ USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_E353, 0xff, 0x01, 0x03) },
+	{ USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_E353, 0xff, 0x01, 0x08) },
 	{ USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, NOVATELWIRELESS_PRODUCT_V640) },
 	{ USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, NOVATELWIRELESS_PRODUCT_V620) },
 	{ USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, NOVATELWIRELESS_PRODUCT_V740) },



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

* [53/80] usb: option: add SIMCom SIM5218
  2011-12-07 16:12 [00/80] 3.0.13-stable review Greg KH
                   ` (51 preceding siblings ...)
  2011-12-07 16:07 ` [52/80] usb: option: add Huawei E353 controlling interfaces Greg KH
@ 2011-12-07 16:07 ` Greg KH
  2011-12-07 16:07 ` [54/80] USB: usb-storage: unusual_devs entry for Kingston DT 101 G2 Greg KH
                   ` (26 subsequent siblings)
  79 siblings, 0 replies; 91+ messages in thread
From: Greg KH @ 2011-12-07 16:07 UTC (permalink / raw)
  To: linux-kernel, stable; +Cc: torvalds, akpm, alan, Veli-Pekka Peltola

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

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

From: Veli-Pekka Peltola <veli-pekka.peltola@bluegiga.com>

commit ec0cd94d881ca89cc9fb61d00d0f4b2b52e605b3 upstream.

Tested with SIM5218EVB-KIT evaluation kit.

Signed-off-by: Veli-Pekka Peltola <veli-pekka.peltola@bluegiga.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

---
 drivers/usb/serial/option.c |    1 +
 1 file changed, 1 insertion(+)

--- a/drivers/usb/serial/option.c
+++ b/drivers/usb/serial/option.c
@@ -746,6 +746,7 @@ static const struct usb_device_id option
 	{ USB_DEVICE(KYOCERA_VENDOR_ID, KYOCERA_PRODUCT_KPC680) },
 	{ USB_DEVICE(QUALCOMM_VENDOR_ID, 0x6000)}, /* ZTE AC8700 */
 	{ USB_DEVICE(QUALCOMM_VENDOR_ID, 0x6613)}, /* Onda H600/ZTE MF330 */
+	{ USB_DEVICE(QUALCOMM_VENDOR_ID, 0x9000)}, /* SIMCom SIM5218 */
 	{ USB_DEVICE(CMOTECH_VENDOR_ID, CMOTECH_PRODUCT_6280) }, /* BP3-USB & BP3-EXT HSDPA */
 	{ USB_DEVICE(CMOTECH_VENDOR_ID, CMOTECH_PRODUCT_6008) },
 	{ USB_DEVICE(TELIT_VENDOR_ID, TELIT_PRODUCT_UC864E) },



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

* [54/80] USB: usb-storage: unusual_devs entry for Kingston DT 101 G2
  2011-12-07 16:12 [00/80] 3.0.13-stable review Greg KH
                   ` (52 preceding siblings ...)
  2011-12-07 16:07 ` [53/80] usb: option: add SIMCom SIM5218 Greg KH
@ 2011-12-07 16:07 ` Greg KH
  2011-12-07 16:07 ` [55/80] USB: EHCI: fix HUB TT scheduling issue with iso transfer Greg KH
                   ` (25 subsequent siblings)
  79 siblings, 0 replies; 91+ messages in thread
From: Greg KH @ 2011-12-07 16:07 UTC (permalink / raw)
  To: linux-kernel, stable; +Cc: torvalds, akpm, alan, Qinglin Ye

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

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

From: Qinglin Ye <yestyle@gmail.com>

commit cec28a5428793b6bc64e56687fb239759d6da74e upstream.

Kingston DT 101 G2 replies a wrong tag while transporting, add an
unusal_devs entry to ignore the tag validation.

Signed-off-by: Qinglin Ye <yestyle@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

---
 drivers/usb/storage/unusual_devs.h |    7 +++++++
 1 file changed, 7 insertions(+)

--- a/drivers/usb/storage/unusual_devs.h
+++ b/drivers/usb/storage/unusual_devs.h
@@ -1854,6 +1854,13 @@ UNUSUAL_DEV(  0x1370, 0x6828, 0x0110, 0x
 		USB_SC_DEVICE, USB_PR_DEVICE, NULL,
 		US_FL_IGNORE_RESIDUE ),
 
+/* Reported by Qinglin Ye <yestyle@gmail.com> */
+UNUSUAL_DEV(  0x13fe, 0x3600, 0x0100, 0x0100,
+		"Kingston",
+		"DT 101 G2",
+		USB_SC_DEVICE, USB_PR_DEVICE, NULL,
+		US_FL_BULK_IGNORE_TAG ),
+
 /* Reported by Francesco Foresti <frafore@tiscali.it> */
 UNUSUAL_DEV(  0x14cd, 0x6600, 0x0201, 0x0201,
 		"Super Top",



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

* [55/80] USB: EHCI: fix HUB TT scheduling issue with iso transfer
  2011-12-07 16:12 [00/80] 3.0.13-stable review Greg KH
                   ` (53 preceding siblings ...)
  2011-12-07 16:07 ` [54/80] USB: usb-storage: unusual_devs entry for Kingston DT 101 G2 Greg KH
@ 2011-12-07 16:07 ` Greg KH
  2011-12-07 16:07 ` [56/80] EHCI : Fix a regression in the ISO scheduler Greg KH
                   ` (24 subsequent siblings)
  79 siblings, 0 replies; 91+ messages in thread
From: Greg KH @ 2011-12-07 16:07 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: torvalds, akpm, alan, Matthieu Castet, Thomas Poussevin,
	Alan Stern

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

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

From: Thomas Poussevin <thomas.poussevin@parrot.com>

commit 811c926c538f7e8d3c08b630dd5844efd7e000f6 upstream.

The current TT scheduling doesn't allow to play and then record on a
full-speed device connected to a high speed hub.

The IN iso stream can only start on the first uframe (0-2 for a 165 us)
because of CSPLIT transactions.
For the OUT iso stream there no such restriction. uframe 0-5 are possible.

The idea of this patch is that the first uframe are precious (for IN TT iso
stream) and we should allocate the last uframes first if possible.

For that we reverse the order of uframe allocation (last uframe first).

Here an example :

hid interrupt stream
----------------------------------------------------------------------
uframe                |  0  |  1  |  2  |  3  |  4  |  5  |  6  |  7  |
----------------------------------------------------------------------
max_tt_usecs          | 125 | 125 | 125 | 125 | 125 | 125 | 30  |  0  |
----------------------------------------------------------------------
used usecs on a frame | 13  |  0  |  0  |  0  |  0  |  0  |  0  |  0  |
----------------------------------------------------------------------

iso OUT stream
----------------------------------------------------------------------
uframe                |  0  |  1  |  2  |  3  |  4  |  5  |  6  |  7  |
----------------------------------------------------------------------
max_tt_usecs          | 125 | 125 | 125 | 125 | 125 | 125 | 30  |  0  |
----------------------------------------------------------------------
used usecs on a frame | 13  | 125 |  39 |  0  |  0  |  0  |  0  |  0  |
----------------------------------------------------------------------

There no place for iso IN stream  (uframe 0-2 are used) and we got "cannot
submit datapipe for urb 0, error -28: not enough bandwidth" error.

With the patch this become.

iso OUT stream
----------------------------------------------------------------------
uframe                |  0  |  1  |  2  |  3  |  4  |  5  |  6  |  7  |
----------------------------------------------------------------------
max_tt_usecs          | 125 | 125 | 125 | 125 | 125 | 125 | 30  |  0  |
----------------------------------------------------------------------
used usecs on a frame |  13 |  0  |  0  |  0  | 125 |  39 |  0  |  0  |
----------------------------------------------------------------------

iso IN stream
----------------------------------------------------------------------
uframe                |  0  |  1  |  2  |  3  |  4  |  5  |  6  |  7  |
----------------------------------------------------------------------
max_tt_usecs          | 125 | 125 | 125 | 125 | 125 | 125 | 30  |  0  |
----------------------------------------------------------------------
used usecs on a frame |  13 |  0  | 125 | 40  | 125 |  39 |  0  |  0  |
----------------------------------------------------------------------

Signed-off-by: Matthieu Castet <matthieu.castet@parrot.com>
Signed-off-by: Thomas Poussevin <thomas.poussevin@parrot.com>
Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

---
 drivers/usb/host/ehci-sched.c |   15 ++++++++++-----
 1 file changed, 10 insertions(+), 5 deletions(-)

--- a/drivers/usb/host/ehci-sched.c
+++ b/drivers/usb/host/ehci-sched.c
@@ -1483,10 +1483,15 @@ iso_stream_schedule (
 
 		/* NOTE:  assumes URB_ISO_ASAP, to limit complexity/bugs */
 
-		/* find a uframe slot with enough bandwidth */
-		next = start + period;
-		for (; start < next; start++) {
-
+		/* find a uframe slot with enough bandwidth.
+		 * Early uframes are more precious because full-speed
+		 * iso IN transfers can't use late uframes,
+		 * and therefore they should be allocated last.
+		 */
+		next = start;
+		start += period;
+		do {
+			start--;
 			/* check schedule: enough space? */
 			if (stream->highspeed) {
 				if (itd_slot_ok(ehci, mod, start,
@@ -1499,7 +1504,7 @@ iso_stream_schedule (
 						start, sched, period))
 					break;
 			}
-		}
+		} while (start > next);
 
 		/* no room in the schedule */
 		if (start == next) {



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

* [56/80] EHCI : Fix a regression in the ISO scheduler
  2011-12-07 16:12 [00/80] 3.0.13-stable review Greg KH
                   ` (54 preceding siblings ...)
  2011-12-07 16:07 ` [55/80] USB: EHCI: fix HUB TT scheduling issue with iso transfer Greg KH
@ 2011-12-07 16:07 ` Greg KH
  2011-12-07 16:07 ` [57/80] xHCI: fix bug in xhci_clear_command_ring() Greg KH
                   ` (23 subsequent siblings)
  79 siblings, 0 replies; 91+ messages in thread
From: Greg KH @ 2011-12-07 16:07 UTC (permalink / raw)
  To: linux-kernel, stable; +Cc: torvalds, akpm, alan, Matthieu CASTET, Alan Stern

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

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

From: Matthieu CASTET <castet.matthieu@free.fr>

commit e3420901eba65b1c46bed86d360e3a8685d20734 upstream.

Fix a regression that was introduced by commit
811c926c538f7e8d3c08b630dd5844efd7e000f6 (USB: EHCI: fix HUB TT scheduling
issue with iso transfer).

We detect an error if next == start, but this means uframe 0 can't be allocated
anymore for iso transfer...

Reported-by: Sander Eikelenboom <linux@eikelenboom.it>
Signed-off-by: Matthieu CASTET <castet.matthieu@free.fr>
Acked-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

---
 drivers/usb/host/ehci-sched.c |    9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

--- a/drivers/usb/host/ehci-sched.c
+++ b/drivers/usb/host/ehci-sched.c
@@ -1479,6 +1479,7 @@ iso_stream_schedule (
 	 * jump until after the queue is primed.
 	 */
 	else {
+		int done = 0;
 		start = SCHEDULE_SLOP + (now & ~0x07);
 
 		/* NOTE:  assumes URB_ISO_ASAP, to limit complexity/bugs */
@@ -1496,18 +1497,18 @@ iso_stream_schedule (
 			if (stream->highspeed) {
 				if (itd_slot_ok(ehci, mod, start,
 						stream->usecs, period))
-					break;
+					done = 1;
 			} else {
 				if ((start % 8) >= 6)
 					continue;
 				if (sitd_slot_ok(ehci, mod, stream,
 						start, sched, period))
-					break;
+					done = 1;
 			}
-		} while (start > next);
+		} while (start > next && !done);
 
 		/* no room in the schedule */
-		if (start == next) {
+		if (!done) {
 			ehci_dbg(ehci, "iso resched full %p (now %d max %d)\n",
 				urb, now, now + mod);
 			status = -ENOSPC;



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

* [57/80] xHCI: fix bug in xhci_clear_command_ring()
  2011-12-07 16:12 [00/80] 3.0.13-stable review Greg KH
                   ` (55 preceding siblings ...)
  2011-12-07 16:07 ` [56/80] EHCI : Fix a regression in the ISO scheduler Greg KH
@ 2011-12-07 16:07 ` Greg KH
  2011-12-07 16:07 ` [58/80] sched, x86: Avoid unnecessary overflow in sched_clock Greg KH
                   ` (22 subsequent siblings)
  79 siblings, 0 replies; 91+ messages in thread
From: Greg KH @ 2011-12-07 16:07 UTC (permalink / raw)
  To: linux-kernel, stable; +Cc: torvalds, akpm, alan, Andiry Xu, Sarah Sharp

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

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

From: Andiry Xu <andiry.xu@amd.com>

commit 158886cd2cf4599e04f9b7e10cb767f5f39b14f1 upstream.

When system enters suspend, xHCI driver clears command ring by writing zero
to all the TRBs. However, this also writes zero to the Link TRB, and the ring
is mangled. This may cause driver accesses wrong memory address and the
result is unpredicted.

When clear the command ring, keep the last Link TRB intact, only clear its
cycle bit. This should fix the "command ring full" issue reported by Oliver
Neukum.

This should be backported to stable kernels as old as 2.6.37, since the
commit 89821320 "xhci: Fix command ring replay after resume" is merged.

Signed-off-by: Andiry Xu <andiry.xu@amd.com>
Signed-off-by: Sarah Sharp <sarah.a.sharp@linux.intel.com>
Reported-by: Oliver Neukum <oneukum@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

---
 drivers/usb/host/xhci.c |    5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

--- a/drivers/usb/host/xhci.c
+++ b/drivers/usb/host/xhci.c
@@ -657,7 +657,10 @@ static void xhci_clear_command_ring(stru
 	ring = xhci->cmd_ring;
 	seg = ring->deq_seg;
 	do {
-		memset(seg->trbs, 0, SEGMENT_SIZE);
+		memset(seg->trbs, 0,
+			sizeof(union xhci_trb) * (TRBS_PER_SEGMENT - 1));
+		seg->trbs[TRBS_PER_SEGMENT - 1].link.control &=
+			cpu_to_le32(~TRB_CYCLE);
 		seg = seg->next;
 	} while (seg != ring->deq_seg);
 



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

* [58/80] sched, x86: Avoid unnecessary overflow in sched_clock
  2011-12-07 16:12 [00/80] 3.0.13-stable review Greg KH
                   ` (56 preceding siblings ...)
  2011-12-07 16:07 ` [57/80] xHCI: fix bug in xhci_clear_command_ring() Greg KH
@ 2011-12-07 16:07 ` Greg KH
  2011-12-07 16:07 ` [59/80] x86/mpparse: Account for bus types other than ISA and PCI Greg KH
                   ` (21 subsequent siblings)
  79 siblings, 0 replies; 91+ messages in thread
From: Greg KH @ 2011-12-07 16:07 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: torvalds, akpm, alan, Salman Qazi, John Stultz, Peter Zijlstra,
	Ingo Molnar

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

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

From: Salman Qazi <sqazi@google.com>

commit 4cecf6d401a01d054afc1e5f605bcbfe553cb9b9 upstream.

(Added the missing signed-off-by line)

In hundreds of days, the __cycles_2_ns calculation in sched_clock
has an overflow.  cyc * per_cpu(cyc2ns, cpu) exceeds 64 bits, causing
the final value to become zero.  We can solve this without losing
any precision.

We can decompose TSC into quotient and remainder of division by the
scale factor, and then use this to convert TSC into nanoseconds.

Signed-off-by: Salman Qazi <sqazi@google.com>
Acked-by: John Stultz <johnstul@us.ibm.com>
Reviewed-by: Paul Turner <pjt@google.com>
Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
Link: http://lkml.kernel.org/r/20111115221121.7262.88871.stgit@dungbeetle.mtv.corp.google.com
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

---
 arch/x86/include/asm/timer.h |   23 ++++++++++++++++++++++-
 1 file changed, 22 insertions(+), 1 deletion(-)

--- a/arch/x86/include/asm/timer.h
+++ b/arch/x86/include/asm/timer.h
@@ -32,6 +32,22 @@ extern int no_timer_check;
  *  (mathieu.desnoyers@polymtl.ca)
  *
  *			-johnstul@us.ibm.com "math is hard, lets go shopping!"
+ *
+ * In:
+ *
+ * ns = cycles * cyc2ns_scale / SC
+ *
+ * Although we may still have enough bits to store the value of ns,
+ * in some cases, we may not have enough bits to store cycles * cyc2ns_scale,
+ * leading to an incorrect result.
+ *
+ * To avoid this, we can decompose 'cycles' into quotient and remainder
+ * of division by SC.  Then,
+ *
+ * ns = (quot * SC + rem) * cyc2ns_scale / SC
+ *    = quot * cyc2ns_scale + (rem * cyc2ns_scale) / SC
+ *
+ *			- sqazi@google.com
  */
 
 DECLARE_PER_CPU(unsigned long, cyc2ns);
@@ -41,9 +57,14 @@ DECLARE_PER_CPU(unsigned long long, cyc2
 
 static inline unsigned long long __cycles_2_ns(unsigned long long cyc)
 {
+	unsigned long long quot;
+	unsigned long long rem;
 	int cpu = smp_processor_id();
 	unsigned long long ns = per_cpu(cyc2ns_offset, cpu);
-	ns += cyc * per_cpu(cyc2ns, cpu) >> CYC2NS_SCALE_FACTOR;
+	quot = (cyc >> CYC2NS_SCALE_FACTOR);
+	rem = cyc & ((1ULL << CYC2NS_SCALE_FACTOR) - 1);
+	ns += quot * per_cpu(cyc2ns, cpu) +
+		((rem * per_cpu(cyc2ns, cpu)) >> CYC2NS_SCALE_FACTOR);
 	return ns;
 }
 



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

* [59/80] x86/mpparse: Account for bus types other than ISA and PCI
  2011-12-07 16:12 [00/80] 3.0.13-stable review Greg KH
                   ` (57 preceding siblings ...)
  2011-12-07 16:07 ` [58/80] sched, x86: Avoid unnecessary overflow in sched_clock Greg KH
@ 2011-12-07 16:07 ` Greg KH
  2011-12-07 16:07 ` [60/80] x86: Fix "Acer Aspire 1" reboot hang Greg KH
                   ` (20 subsequent siblings)
  79 siblings, 0 replies; 91+ messages in thread
From: Greg KH @ 2011-12-07 16:07 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: torvalds, akpm, alan, Bjorn Helgaas, Dan McGrath,
	Alexey Starikovskiy, Jonathan Nieder, Ingo Molnar

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

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

From: Bjorn Helgaas <bhelgaas@google.com>

commit 9e6866686bdf2dcf3aeb0838076237ede532dcc8 upstream.

In commit f8924e770e04 ("x86: unify mp_bus_info"), the 32-bit
and 64-bit versions of MP_bus_info were rearranged to match each
other better.  Unfortunately it introduced a regression: prior
to that change we used to always set the mp_bus_not_pci bit,
then clear it if we found a PCI bus.  After it, we set
mp_bus_not_pci for ISA buses, clear it for PCI buses, and leave
it alone otherwise.

In the cases of ISA and PCI, there's not much difference.  But
ISA is not the only non-PCI bus, so it's better to always set
mp_bus_not_pci and clear it only for PCI.

Without this change, Dan's Dell PowerEdge 4200 panics on boot
with a log indicating interrupt routing trouble unless the
"noapic" option is supplied.  With this change, the machine
boots reliably without "noapic".

Fixes http://bugs.debian.org/586494

Reported-bisected-and-tested-by: Dan McGrath <troubledaemon@gmail.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Cc: Dan McGrath <troubledaemon@gmail.com>
Cc: Alexey Starikovskiy <aystarik@gmail.com>
[jrnieder@gmail.com: clarified commit message]
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Link: http://lkml.kernel.org/r/20111122215000.GA9151@elie.hsd1.il.comcast.net
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

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

--- a/arch/x86/kernel/mpparse.c
+++ b/arch/x86/kernel/mpparse.c
@@ -95,8 +95,8 @@ static void __init MP_bus_info(struct mp
 	}
 #endif
 
+	set_bit(m->busid, mp_bus_not_pci);
 	if (strncmp(str, BUSTYPE_ISA, sizeof(BUSTYPE_ISA) - 1) == 0) {
-		set_bit(m->busid, mp_bus_not_pci);
 #if defined(CONFIG_EISA) || defined(CONFIG_MCA)
 		mp_bus_id_to_type[m->busid] = MP_BUS_ISA;
 #endif



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

* [60/80] x86: Fix "Acer Aspire 1" reboot hang
  2011-12-07 16:12 [00/80] 3.0.13-stable review Greg KH
                   ` (58 preceding siblings ...)
  2011-12-07 16:07 ` [59/80] x86/mpparse: Account for bus types other than ISA and PCI Greg KH
@ 2011-12-07 16:07 ` Greg KH
  2011-12-07 16:07 ` [61/80] x86/paravirt: PTE updates in k(un)map_atomic need to be synchronous, regardless of lazy_mmu mode Greg KH
                   ` (19 subsequent siblings)
  79 siblings, 0 replies; 91+ messages in thread
From: Greg KH @ 2011-12-07 16:07 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: torvalds, akpm, alan, Peter Chubb, Don Zickus, Peter Zijlstra,
	Ingo Molnar

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

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

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

From: Peter Chubb <peter.chubb@nicta.com.au>

commit 1ef03890969932e9359b9a4c658f7f87771910ac upstream.

Looks like on some Acer Aspire 1s with older bioses, reboot via bios
fails.  It works on my machine, (with BIOS version 0.3310) but
not on some others (BIOS version 0.3309).

There's a log of problems at:

  https://bbs.archlinux.org/viewtopic.php?id=124136

This patch adds a different callback to the reboot quirk table,
to allow rebooting via keybaord controller.

Reported-by: Uroš Vampl <mobile.leecher@gmail.com>
Tested-by: Vasily Khoruzhick <anarsoul@gmail.com>
Signed-off-by: Peter Chubb <peter.chubb@nicta.com.au>
Cc: Don Zickus <dzickus@redhat.com>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Link: http://lkml.kernel.org/r/1323093233-9481-1-git-send-email-anarsoul@gmail.com
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

---
 arch/x86/kernel/reboot.c |   13 +++++++++++--
 1 file changed, 11 insertions(+), 2 deletions(-)

--- a/arch/x86/kernel/reboot.c
+++ b/arch/x86/kernel/reboot.c
@@ -124,7 +124,7 @@ __setup("reboot=", reboot_setup);
  */
 
 /*
- * Some machines require the "reboot=b"  commandline option,
+ * Some machines require the "reboot=b" or "reboot=k"  commandline options,
  * this quirk makes that automatic.
  */
 static int __init set_bios_reboot(const struct dmi_system_id *d)
@@ -136,6 +136,15 @@ static int __init set_bios_reboot(const
 	return 0;
 }
 
+static int __init set_kbd_reboot(const struct dmi_system_id *d)
+{
+	if (reboot_type != BOOT_KBD) {
+		reboot_type = BOOT_KBD;
+		printk(KERN_INFO "%s series board detected. Selecting KBD-method for reboot.\n", d->ident);
+	}
+	return 0;
+}
+
 static struct dmi_system_id __initdata reboot_dmi_table[] = {
 	{	/* Handle problems with rebooting on Dell E520's */
 		.callback = set_bios_reboot,
@@ -295,7 +304,7 @@ static struct dmi_system_id __initdata r
 		},
 	},
 	{ /* Handle reboot issue on Acer Aspire one */
-		.callback = set_bios_reboot,
+		.callback = set_kbd_reboot,
 		.ident = "Acer Aspire One A110",
 		.matches = {
 			DMI_MATCH(DMI_SYS_VENDOR, "Acer"),



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

* [61/80] x86/paravirt: PTE updates in k(un)map_atomic need to be synchronous, regardless of lazy_mmu mode
  2011-12-07 16:12 [00/80] 3.0.13-stable review Greg KH
                   ` (59 preceding siblings ...)
  2011-12-07 16:07 ` [60/80] x86: Fix "Acer Aspire 1" reboot hang Greg KH
@ 2011-12-07 16:07 ` Greg KH
  2011-12-07 16:07 ` [62/80] perf/x86: Fix PEBS instruction unwind Greg KH
                   ` (18 subsequent siblings)
  79 siblings, 0 replies; 91+ messages in thread
From: Greg KH @ 2011-12-07 16:07 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: torvalds, akpm, alan, Konrad Rzeszutek Wilk, Peter Zijlstra,
	Jeremy Fitzhardinge, Ingo Molnar

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

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

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

commit 2cd1c8d4dc7ecca9e9431e2dabe41ae9c7d89e51 upstream.

Fix an outstanding issue that has been reported since 2.6.37.
Under a heavy loaded machine processing "fork()" calls could
crash with:

BUG: unable to handle kernel paging request at f573fc8c
IP: [<c01abc54>] swap_count_continued+0x104/0x180
*pdpt = 000000002a3b9027 *pde = 0000000001bed067 *pte = 0000000000000000 Oops: 0000 [#1] SMP
Modules linked in:
Pid: 1638, comm: apache2 Not tainted 3.0.4-linode37 #1
EIP: 0061:[<c01abc54>] EFLAGS: 00210246 CPU: 3
EIP is at swap_count_continued+0x104/0x180
.. snip..
Call Trace:
 [<c01ac222>] ? __swap_duplicate+0xc2/0x160
 [<c01040f7>] ? pte_mfn_to_pfn+0x87/0xe0
 [<c01ac2e4>] ? swap_duplicate+0x14/0x40
 [<c01a0a6b>] ? copy_pte_range+0x45b/0x500
 [<c01a0ca5>] ? copy_page_range+0x195/0x200
 [<c01328c6>] ? dup_mmap+0x1c6/0x2c0
 [<c0132cf8>] ? dup_mm+0xa8/0x130
 [<c013376a>] ? copy_process+0x98a/0xb30
 [<c013395f>] ? do_fork+0x4f/0x280
 [<c01573b3>] ? getnstimeofday+0x43/0x100
 [<c010f770>] ? sys_clone+0x30/0x40
 [<c06c048d>] ? ptregs_clone+0x15/0x48
 [<c06bfb71>] ? syscall_call+0x7/0xb

The problem is that in copy_page_range() we turn lazy mode on,
and then in swap_entry_free() we call swap_count_continued()
which ends up in:

         map = kmap_atomic(page, KM_USER0) + offset;

and then later we touch *map.

Since we are running in batched mode (lazy) we don't actually
set up the PTE mappings and the kmap_atomic is not done
synchronously and ends up trying to dereference a page that has
not been set.

Looking at kmap_atomic_prot_pfn(), it uses
'arch_flush_lazy_mmu_mode' and doing the same in
kmap_atomic_prot() and __kunmap_atomic() makes the problem go
away.

Interestingly, commit b8bcfe997e4615 ("x86/paravirt: remove lazy
mode in interrupts") removed part of this to fix an interrupt
issue - but it went to far and did not consider this scenario.

Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Jeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

---
 arch/x86/mm/highmem_32.c |    2 ++
 1 file changed, 2 insertions(+)

--- a/arch/x86/mm/highmem_32.c
+++ b/arch/x86/mm/highmem_32.c
@@ -45,6 +45,7 @@ void *kmap_atomic_prot(struct page *page
 	vaddr = __fix_to_virt(FIX_KMAP_BEGIN + idx);
 	BUG_ON(!pte_none(*(kmap_pte-idx)));
 	set_pte(kmap_pte-idx, mk_pte(page, prot));
+	arch_flush_lazy_mmu_mode();
 
 	return (void *)vaddr;
 }
@@ -88,6 +89,7 @@ void __kunmap_atomic(void *kvaddr)
 		 */
 		kpte_clear_flush(kmap_pte-idx, vaddr);
 		kmap_atomic_idx_pop();
+		arch_flush_lazy_mmu_mode();
 	}
 #ifdef CONFIG_DEBUG_HIGHMEM
 	else {



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

* [62/80] perf/x86: Fix PEBS instruction unwind
  2011-12-07 16:12 [00/80] 3.0.13-stable review Greg KH
                   ` (60 preceding siblings ...)
  2011-12-07 16:07 ` [61/80] x86/paravirt: PTE updates in k(un)map_atomic need to be synchronous, regardless of lazy_mmu mode Greg KH
@ 2011-12-07 16:07 ` Greg KH
  2011-12-07 16:07 ` [63/80] oprofile, x86: Fix crash when unloading module (nmi timer mode) Greg KH
                   ` (17 subsequent siblings)
  79 siblings, 0 replies; 91+ messages in thread
From: Greg KH @ 2011-12-07 16:07 UTC (permalink / raw)
  To: linux-kernel, stable; +Cc: torvalds, akpm, alan, Peter Zijlstra, Ingo Molnar

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

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

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

commit 57d1c0c03c6b48b2b96870d831b9ce6b917f53ac upstream.

Masami spotted that we always try to decode the instruction stream as
64bit instructions when running a 64bit kernel, this doesn't work for
ia32-compat proglets.

Use TIF_IA32 to detect if we need to use the 32bit instruction
decoder.

Reported-by: Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com>
Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

---
 arch/x86/kernel/cpu/perf_event_intel_ds.c |    6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

--- a/arch/x86/kernel/cpu/perf_event_intel_ds.c
+++ b/arch/x86/kernel/cpu/perf_event_intel_ds.c
@@ -508,6 +508,7 @@ static int intel_pmu_pebs_fixup_ip(struc
 	unsigned long from = cpuc->lbr_entries[0].from;
 	unsigned long old_to, to = cpuc->lbr_entries[0].to;
 	unsigned long ip = regs->ip;
+	int is_64bit = 0;
 
 	/*
 	 * We don't need to fixup if the PEBS assist is fault like
@@ -559,7 +560,10 @@ static int intel_pmu_pebs_fixup_ip(struc
 		} else
 			kaddr = (void *)to;
 
-		kernel_insn_init(&insn, kaddr);
+#ifdef CONFIG_X86_64
+		is_64bit = kernel_ip(to) || !test_thread_flag(TIF_IA32);
+#endif
+		insn_init(&insn, kaddr, is_64bit);
 		insn_get_length(&insn);
 		to += insn.length;
 	} while (to < ip);



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

* [63/80] oprofile, x86: Fix crash when unloading module (nmi timer mode)
  2011-12-07 16:12 [00/80] 3.0.13-stable review Greg KH
                   ` (61 preceding siblings ...)
  2011-12-07 16:07 ` [62/80] perf/x86: Fix PEBS instruction unwind Greg KH
@ 2011-12-07 16:07 ` Greg KH
  2011-12-07 16:07 ` [64/80] [S390] add missing .set function for NT_S390_LAST_BREAK regset Greg KH
                   ` (16 subsequent siblings)
  79 siblings, 0 replies; 91+ messages in thread
From: Greg KH @ 2011-12-07 16:07 UTC (permalink / raw)
  To: linux-kernel, stable; +Cc: torvalds, akpm, alan, Robert Richter

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

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

From: Robert Richter <robert.richter@amd.com>

commit 97f7f8189fe54e3cfe324ef9ad35064f3d2d3bff upstream.

If oprofile uses the nmi timer interrupt there is a crash while
unloading the module. The bug can be triggered with oprofile build as
module and kernel parameter nolapic set. This patch fixes this.

oprofile: using NMI timer interrupt.
BUG: unable to handle kernel NULL pointer dereference at 0000000000000008
IP: [<ffffffff8123c226>] unregister_syscore_ops+0x41/0x58
PGD 42dbca067 PUD 41da6a067 PMD 0
Oops: 0002 [#1] PREEMPT SMP
CPU 5
Modules linked in: oprofile(-) [last unloaded: oprofile]

Pid: 2518, comm: modprobe Not tainted 3.1.0-rc7-00019-gb2fb49d #19 Advanced Micro Device Anaheim/Anaheim
RIP: 0010:[<ffffffff8123c226>]  [<ffffffff8123c226>] unregister_syscore_ops+0x41/0x58
RSP: 0018:ffff88041ef71e98  EFLAGS: 00010296
RAX: 0000000000000000 RBX: ffffffffa0017100 RCX: dead000000200200
RDX: 0000000000000000 RSI: dead000000100100 RDI: ffffffff8178c620
RBP: ffff88041ef71ea8 R08: 0000000000000001 R09: 0000000000000082
R10: 0000000000000000 R11: ffff88041ef71de8 R12: 0000000000000080
R13: fffffffffffffff5 R14: 0000000000000001 R15: 0000000000610210
FS:  00007fc902f20700(0000) GS:ffff88042fd40000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 000000008005003b
CR2: 0000000000000008 CR3: 000000041cdb6000 CR4: 00000000000006e0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000ffff0ff0 DR7: 0000000000000400
Process modprobe (pid: 2518, threadinfo ffff88041ef70000, task ffff88041d348040)
Stack:
 ffff88041ef71eb8 ffffffffa0017790 ffff88041ef71eb8 ffffffffa0013532
 ffff88041ef71ec8 ffffffffa00132d6 ffff88041ef71ed8 ffffffffa00159b2
 ffff88041ef71f78 ffffffff81073115 656c69666f72706f 0000000000610200
Call Trace:
 [<ffffffffa0013532>] op_nmi_exit+0x15/0x17 [oprofile]
 [<ffffffffa00132d6>] oprofile_arch_exit+0xe/0x10 [oprofile]
 [<ffffffffa00159b2>] oprofile_exit+0x1e/0x20 [oprofile]
 [<ffffffff81073115>] sys_delete_module+0x1c3/0x22f
 [<ffffffff811bf09e>] ? trace_hardirqs_on_thunk+0x3a/0x3f
 [<ffffffff8148070b>] system_call_fastpath+0x16/0x1b
Code: 20 c6 78 81 e8 c5 cc 23 00 48 8b 13 48 8b 43 08 48 be 00 01 10 00 00 00 ad de 48 b9 00 02 20 00 00 00 ad de 48 c7 c7 20 c6 78 81
 89 42 08 48 89 10 48 89 33 48 89 4b 08 e8 a6 c0 23 00 5a 5b
RIP  [<ffffffff8123c226>] unregister_syscore_ops+0x41/0x58
 RSP <ffff88041ef71e98>
CR2: 0000000000000008
---[ end trace 43a541a52956b7b0 ]---

Signed-off-by: Robert Richter <robert.richter@amd.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

---
 arch/x86/oprofile/init.c |    7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

--- a/arch/x86/oprofile/init.c
+++ b/arch/x86/oprofile/init.c
@@ -21,6 +21,7 @@ extern int op_nmi_timer_init(struct opro
 extern void op_nmi_exit(void);
 extern void x86_backtrace(struct pt_regs * const regs, unsigned int depth);
 
+static int nmi_timer;
 
 int __init oprofile_arch_init(struct oprofile_operations *ops)
 {
@@ -31,8 +32,9 @@ int __init oprofile_arch_init(struct opr
 #ifdef CONFIG_X86_LOCAL_APIC
 	ret = op_nmi_init(ops);
 #endif
+	nmi_timer = (ret != 0);
 #ifdef CONFIG_X86_IO_APIC
-	if (ret < 0)
+	if (nmi_timer)
 		ret = op_nmi_timer_init(ops);
 #endif
 	ops->backtrace = x86_backtrace;
@@ -44,6 +46,7 @@ int __init oprofile_arch_init(struct opr
 void oprofile_arch_exit(void)
 {
 #ifdef CONFIG_X86_LOCAL_APIC
-	op_nmi_exit();
+	if (!nmi_timer)
+		op_nmi_exit();
 #endif
 }



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

* [64/80] [S390] add missing .set function for NT_S390_LAST_BREAK regset
  2011-12-07 16:12 [00/80] 3.0.13-stable review Greg KH
                   ` (62 preceding siblings ...)
  2011-12-07 16:07 ` [63/80] oprofile, x86: Fix crash when unloading module (nmi timer mode) Greg KH
@ 2011-12-07 16:07 ` Greg KH
  2011-12-07 16:07 ` [65/80] cfg80211: fix race on init and driver registration Greg KH
                   ` (15 subsequent siblings)
  79 siblings, 0 replies; 91+ messages in thread
From: Greg KH @ 2011-12-07 16:07 UTC (permalink / raw)
  To: linux-kernel, stable; +Cc: torvalds, akpm, alan, Martin Schwidefsky

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

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

From: Martin Schwidefsky <schwidefsky@de.ibm.com>

commit b934069c991355d27a053a932591c77960f4e414 upstream.

The last breaking event address is a read-only value, the regset misses the
.set function. If a PTRACE_SETREGSET is done for NT_S390_LAST_BREAK we
get an oops due to a branch to zero:

Kernel BUG at 0000000000000002 verbose debug info unavailable
illegal operation: 0001 #1 SMP
...
Call Trace:
(<0000000000158294> ptrace_regset+0x184/0x188)
 <00000000001595b6> ptrace_request+0x37a/0x4fc
 <0000000000109a78> arch_ptrace+0x108/0x1fc
 <00000000001590d6> SyS_ptrace+0xaa/0x12c
 <00000000005c7a42> sysc_noemu+0x16/0x1c
 <000003fffd5ec10c> 0x3fffd5ec10c
Last Breaking-Event-Address:
 <0000000000158242> ptrace_regset+0x132/0x188

Add a nop .set function to prevent the branch to zero.

Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

---
 arch/s390/kernel/ptrace.c |   18 ++++++++++++++++++
 1 file changed, 18 insertions(+)

--- a/arch/s390/kernel/ptrace.c
+++ b/arch/s390/kernel/ptrace.c
@@ -897,6 +897,14 @@ static int s390_last_break_get(struct ta
 	return 0;
 }
 
+static int s390_last_break_set(struct task_struct *target,
+			       const struct user_regset *regset,
+			       unsigned int pos, unsigned int count,
+			       const void *kbuf, const void __user *ubuf)
+{
+	return 0;
+}
+
 #endif
 
 static const struct user_regset s390_regsets[] = {
@@ -923,6 +931,7 @@ static const struct user_regset s390_reg
 		.size = sizeof(long),
 		.align = sizeof(long),
 		.get = s390_last_break_get,
+		.set = s390_last_break_set,
 	},
 #endif
 };
@@ -1080,6 +1089,14 @@ static int s390_compat_last_break_get(st
 	return 0;
 }
 
+static int s390_compat_last_break_set(struct task_struct *target,
+				      const struct user_regset *regset,
+				      unsigned int pos, unsigned int count,
+				      const void *kbuf, const void __user *ubuf)
+{
+	return 0;
+}
+
 static const struct user_regset s390_compat_regsets[] = {
 	[REGSET_GENERAL] = {
 		.core_note_type = NT_PRSTATUS,
@@ -1103,6 +1120,7 @@ static const struct user_regset s390_com
 		.size = sizeof(long),
 		.align = sizeof(long),
 		.get = s390_compat_last_break_get,
+		.set = s390_compat_last_break_set,
 	},
 	[REGSET_GENERAL_EXTENDED] = {
 		.core_note_type = NT_S390_HIGH_GPRS,



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

* [65/80] cfg80211: fix race on init and driver registration
  2011-12-07 16:12 [00/80] 3.0.13-stable review Greg KH
                   ` (63 preceding siblings ...)
  2011-12-07 16:07 ` [64/80] [S390] add missing .set function for NT_S390_LAST_BREAK regset Greg KH
@ 2011-12-07 16:07 ` Greg KH
  2011-12-07 16:07 ` [66/80] cfg80211: amend regulatory NULL dereference fix Greg KH
                   ` (14 subsequent siblings)
  79 siblings, 0 replies; 91+ messages in thread
From: Greg KH @ 2011-12-07 16:07 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: torvalds, akpm, alan, Johannes Berg, Luis R. Rodriguez,
	John W. Linville

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

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

From: "Luis R. Rodriguez" <mcgrof@qca.qualcomm.com>

commit a042994dd377d86bff9446ee76151ceb6267c9ba upstream.

There is a theoretical race that if hit will trigger
a crash. The race is between when we issue the first
regulatory hint, regulatory_hint_core(), gets processed
by the workqueue and between when the first device
gets registered to the wireless core. This is not easy
to reproduce but it was easy to do so through the
regulatory simulator I have been working on. This
is a port of the fix I implemented there [1].

[1] https://github.com/mcgrof/regsim/commit/a246ccf81f059cb662eee288aa13100f631e4cc8

Cc: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Luis R. Rodriguez <mcgrof@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

---
 net/wireless/reg.c |   43 +++++++++++++++++++++++++++----------------
 1 file changed, 27 insertions(+), 16 deletions(-)

--- a/net/wireless/reg.c
+++ b/net/wireless/reg.c
@@ -57,8 +57,17 @@
 #define REG_DBG_PRINT(args...)
 #endif
 
+static struct regulatory_request core_request_world = {
+	.initiator = NL80211_REGDOM_SET_BY_CORE,
+	.alpha2[0] = '0',
+	.alpha2[1] = '0',
+	.intersect = false,
+	.processed = true,
+	.country_ie_env = ENVIRON_ANY,
+};
+
 /* Receipt of information from last regulatory request */
-static struct regulatory_request *last_request;
+static struct regulatory_request *last_request = &core_request_world;
 
 /* To trigger userspace events */
 static struct platform_device *reg_pdev;
@@ -150,7 +159,7 @@ static char user_alpha2[2];
 module_param(ieee80211_regdom, charp, 0444);
 MODULE_PARM_DESC(ieee80211_regdom, "IEEE 802.11 regulatory domain code");
 
-static void reset_regdomains(void)
+static void reset_regdomains(bool full_reset)
 {
 	/* avoid freeing static information or freeing something twice */
 	if (cfg80211_regdomain == cfg80211_world_regdom)
@@ -165,6 +174,13 @@ static void reset_regdomains(void)
 
 	cfg80211_world_regdom = &world_regdom;
 	cfg80211_regdomain = NULL;
+
+	if (!full_reset)
+		return;
+
+	if (last_request != &core_request_world)
+		kfree(last_request);
+	last_request = &core_request_world;
 }
 
 /*
@@ -175,7 +191,7 @@ static void update_world_regdomain(const
 {
 	BUG_ON(!last_request);
 
-	reset_regdomains();
+	reset_regdomains(false);
 
 	cfg80211_world_regdom = rd;
 	cfg80211_regdomain = rd;
@@ -1396,7 +1412,8 @@ static int __regulatory_hint(struct wiph
 	}
 
 new_request:
-	kfree(last_request);
+	if (last_request != &core_request_world)
+		kfree(last_request);
 
 	last_request = pending_request;
 	last_request->intersect = intersect;
@@ -1566,9 +1583,6 @@ static int regulatory_hint_core(const ch
 {
 	struct regulatory_request *request;
 
-	kfree(last_request);
-	last_request = NULL;
-
 	request = kzalloc(sizeof(struct regulatory_request),
 			  GFP_KERNEL);
 	if (!request)
@@ -1766,7 +1780,7 @@ static void restore_regulatory_settings(
 	mutex_lock(&cfg80211_mutex);
 	mutex_lock(&reg_mutex);
 
-	reset_regdomains();
+	reset_regdomains(true);
 	restore_alpha2(alpha2, reset_user);
 
 	/*
@@ -2035,7 +2049,7 @@ static int __set_regdom(const struct iee
 		int r;
 
 		if (last_request->initiator != NL80211_REGDOM_SET_BY_DRIVER) {
-			reset_regdomains();
+			reset_regdomains(false);
 			cfg80211_regdomain = rd;
 			return 0;
 		}
@@ -2056,7 +2070,7 @@ static int __set_regdom(const struct iee
 		if (r)
 			return r;
 
-		reset_regdomains();
+		reset_regdomains(false);
 		cfg80211_regdomain = rd;
 		return 0;
 	}
@@ -2081,7 +2095,7 @@ static int __set_regdom(const struct iee
 
 		rd = NULL;
 
-		reset_regdomains();
+		reset_regdomains(false);
 		cfg80211_regdomain = intersected_rd;
 
 		return 0;
@@ -2101,7 +2115,7 @@ static int __set_regdom(const struct iee
 	kfree(rd);
 	rd = NULL;
 
-	reset_regdomains();
+	reset_regdomains(false);
 	cfg80211_regdomain = intersected_rd;
 
 	return 0;
@@ -2254,11 +2268,8 @@ void /* __init_or_exit */ regulatory_exi
 	mutex_lock(&cfg80211_mutex);
 	mutex_lock(&reg_mutex);
 
-	reset_regdomains();
-
-	kfree(last_request);
+	reset_regdomains(true);
 
-	last_request = NULL;
 	dev_set_uevent_suppress(&reg_pdev->dev, true);
 
 	platform_device_unregister(reg_pdev);



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

* [66/80] cfg80211: amend regulatory NULL dereference fix
  2011-12-07 16:12 [00/80] 3.0.13-stable review Greg KH
                   ` (64 preceding siblings ...)
  2011-12-07 16:07 ` [65/80] cfg80211: fix race on init and driver registration Greg KH
@ 2011-12-07 16:07 ` Greg KH
  2011-12-07 16:07 ` [67/80] genirq: Fix race condition when stopping the irq thread Greg KH
                   ` (13 subsequent siblings)
  79 siblings, 0 replies; 91+ messages in thread
From: Greg KH @ 2011-12-07 16:07 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: torvalds, akpm, alan, Johannes Berg, Luis R. Rodriguez,
	John W. Linville

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

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

From: "Luis R. Rodriguez" <mcgrof@qca.qualcomm.com>

commit 0bac71af6e66dc798bf07d0c0dd14ee5503362f9 upstream.

Johannes' patch for "cfg80211: fix regulatory NULL dereference"
broke user regulaotry hints and it did not address the fact that
last_request was left populated even if the previous regulatory
hint was stale due to the wiphy disappearing.

Fix user reguluatory hints by only bailing out if for those
regulatory hints where a request_wiphy is expected. The stale last_request
considerations are addressed through the previous fixes on last_request
where we reset the last_request to a static world regdom request upon
reset_regdomains(). In this case though we further enhance the effect
by simply restoring reguluatory settings completely.

Cc: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Luis R. Rodriguez <mcgrof@qca.qualcomm.com>
Reviewed-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

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

--- a/net/wireless/reg.c
+++ b/net/wireless/reg.c
@@ -2040,8 +2040,10 @@ static int __set_regdom(const struct iee
 	}
 
 	request_wiphy = wiphy_idx_to_wiphy(last_request->wiphy_idx);
-	if (!request_wiphy) {
-		reg_set_request_processed();
+	if (!request_wiphy &&
+	    (last_request->initiator == NL80211_REGDOM_SET_BY_DRIVER ||
+	     last_request->initiator == NL80211_REGDOM_SET_BY_COUNTRY_IE)) {
+		schedule_delayed_work(&reg_timeout, 0);
 		return -ENODEV;
 	}
 



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

* [67/80] genirq: Fix race condition when stopping the irq thread
  2011-12-07 16:12 [00/80] 3.0.13-stable review Greg KH
                   ` (65 preceding siblings ...)
  2011-12-07 16:07 ` [66/80] cfg80211: amend regulatory NULL dereference fix Greg KH
@ 2011-12-07 16:07 ` Greg KH
  2011-12-07 16:07 ` [68/80] NFS: Prevent 3.0 from crashing if it receives a partial layout Greg KH
                   ` (12 subsequent siblings)
  79 siblings, 0 replies; 91+ messages in thread
From: Greg KH @ 2011-12-07 16:07 UTC (permalink / raw)
  To: linux-kernel, stable; +Cc: torvalds, akpm, alan, Ido Yariv, Thomas Gleixner

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

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

From: Ido Yariv <ido@wizery.com>

commit 550acb19269d65f32e9ac4ddb26c2b2070e37f1c upstream.

In irq_wait_for_interrupt(), the should_stop member is verified before
setting the task's state to TASK_INTERRUPTIBLE and calling schedule().
In case kthread_stop sets should_stop and wakes up the process after
should_stop is checked by the irq thread but before the task's state
is changed, the irq thread might never exit:

kthread_stop                    irq_wait_for_interrupt
------------                    ----------------------

                                 ...
...                              while (!kthread_should_stop()) {
kthread->should_stop = 1;
wake_up_process(k);
wait_for_completion(&kthread->exited);
...
                                     set_current_state(TASK_INTERRUPTIBLE);

                                     ...

                                     schedule();
                                 }

Fix this by checking if the thread should stop after modifying the
task's state.

[ tglx: Simplified it a bit ]

Signed-off-by: Ido Yariv <ido@wizery.com>
Link: http://lkml.kernel.org/r/1322740508-22640-1-git-send-email-ido@wizery.com
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

---
 kernel/irq/manage.c |    5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

--- a/kernel/irq/manage.c
+++ b/kernel/irq/manage.c
@@ -620,8 +620,9 @@ static irqreturn_t irq_nested_primary_ha
 
 static int irq_wait_for_interrupt(struct irqaction *action)
 {
+	set_current_state(TASK_INTERRUPTIBLE);
+
 	while (!kthread_should_stop()) {
-		set_current_state(TASK_INTERRUPTIBLE);
 
 		if (test_and_clear_bit(IRQTF_RUNTHREAD,
 				       &action->thread_flags)) {
@@ -629,7 +630,9 @@ static int irq_wait_for_interrupt(struct
 			return 0;
 		}
 		schedule();
+		set_current_state(TASK_INTERRUPTIBLE);
 	}
+	__set_current_state(TASK_RUNNING);
 	return -1;
 }
 



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

* [68/80] NFS: Prevent 3.0 from crashing if it receives a partial layout
  2011-12-07 16:12 [00/80] 3.0.13-stable review Greg KH
                   ` (66 preceding siblings ...)
  2011-12-07 16:07 ` [67/80] genirq: Fix race condition when stopping the irq thread Greg KH
@ 2011-12-07 16:07 ` Greg KH
  2011-12-07 16:07 ` [69/80] xfs: validate acl count Greg KH
                   ` (11 subsequent siblings)
  79 siblings, 0 replies; 91+ messages in thread
From: Greg KH @ 2011-12-07 16:07 UTC (permalink / raw)
  To: linux-kernel, stable, stable
  Cc: torvalds, akpm, alan, Fred Isaman , Trond Myklebust,
	Trond Myklebust

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

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

From: Trond Myklebust <Trond.Myklebust@netapp.com>

This is a backport of critical parts of
commit 7c24d9489f "NFSv4.1: File layout only supports whole file layouts"

It prevents the file layout driver from (incorrectly) using
partial layouts, but ignores the part of the referenced commmit that
relies on additional machinery to change the LAYOUTGET request
based on layout driver.

Signed-off-by: Fred Isaman <iisaman@netapp.com>
Acked-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

---
 fs/nfs/nfs4filelayout.c |    8 ++++++++
 fs/nfs/pnfs.c           |    3 ++-
 2 files changed, 10 insertions(+), 1 deletion(-)

--- a/fs/nfs/nfs4filelayout.c
+++ b/fs/nfs/nfs4filelayout.c
@@ -428,6 +428,14 @@ filelayout_check_layout(struct pnfs_layo
 
 	dprintk("--> %s\n", __func__);
 
+	/* FIXME: remove this check when layout segment support is added */
+	if (lgr->range.offset != 0 ||
+	    lgr->range.length != NFS4_MAX_UINT64) {
+		dprintk("%s Only whole file layouts supported. Use MDS i/o\n",
+			__func__);
+		goto out;
+	}
+
 	if (fl->pattern_offset > lgr->range.offset) {
 		dprintk("%s pattern_offset %lld too large\n",
 				__func__, fl->pattern_offset);
--- a/fs/nfs/pnfs.c
+++ b/fs/nfs/pnfs.c
@@ -980,7 +980,8 @@ pnfs_update_layout(struct inode *ino,
 		arg.offset -= pg_offset;
 		arg.length += pg_offset;
 	}
-	arg.length = PAGE_CACHE_ALIGN(arg.length);
+	if (arg.length != NFS4_MAX_UINT64)
+		arg.length = PAGE_CACHE_ALIGN(arg.length);
 
 	lseg = send_layoutget(lo, ctx, &arg, gfp_flags);
 	if (!lseg && first) {



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

* [69/80] xfs: validate acl count
  2011-12-07 16:12 [00/80] 3.0.13-stable review Greg KH
                   ` (67 preceding siblings ...)
  2011-12-07 16:07 ` [68/80] NFS: Prevent 3.0 from crashing if it receives a partial layout Greg KH
@ 2011-12-07 16:07 ` Greg KH
  2011-12-07 16:07 ` [70/80] xfs: force buffer writeback before blocking on the ilock in inode reclaim Greg KH
                   ` (10 subsequent siblings)
  79 siblings, 0 replies; 91+ messages in thread
From: Greg KH @ 2011-12-07 16:07 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: torvalds, akpm, alan, xfs, Christoph Hellwig, Ben Myers,
	Dave Chinner

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

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

From: Christoph Hellwig <hch@infradead.org>

commit fa8b18edd752a8b4e9d1ee2cd615b82c93cf8bba upstream.

This prevents in-memory corruption and possible panics if the on-disk
ACL is badly corrupted.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Ben Myers <bpm@sgi.com>
Acked-by: Dave Chinner <dchinner@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

---
 fs/xfs/linux-2.6/xfs_acl.c |    2 ++
 1 file changed, 2 insertions(+)

--- a/fs/xfs/linux-2.6/xfs_acl.c
+++ b/fs/xfs/linux-2.6/xfs_acl.c
@@ -42,6 +42,8 @@ xfs_acl_from_disk(struct xfs_acl *aclp)
 	int count, i;
 
 	count = be32_to_cpu(aclp->acl_cnt);
+	if (count > XFS_ACL_MAX_ENTRIES)
+		return ERR_PTR(-EFSCORRUPTED);
 
 	acl = posix_acl_alloc(count, GFP_KERNEL);
 	if (!acl)



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

* [70/80] xfs: force buffer writeback before blocking on the ilock in inode reclaim
  2011-12-07 16:12 [00/80] 3.0.13-stable review Greg KH
                   ` (68 preceding siblings ...)
  2011-12-07 16:07 ` [69/80] xfs: validate acl count Greg KH
@ 2011-12-07 16:07 ` Greg KH
  2011-12-07 16:07 ` [71/80] xfs: fix attr2 vs large data fork assert Greg KH
                   ` (9 subsequent siblings)
  79 siblings, 0 replies; 91+ messages in thread
From: Greg KH @ 2011-12-07 16:07 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: torvalds, akpm, alan, xfs, Christoph Hellwig, Ben Myers,
	Dave Chinner

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

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

From: Christoph Hellwig <hch@infradead.org>

commit 4dd2cb4a28b7ab1f37163a4eba280926a13a8749 upstream.

If we are doing synchronous inode reclaim we block the VM from making
progress in memory reclaim.  So if we encouter a flush locked inode
promote it in the delwri list and wake up xfsbufd to write it out now.
Without this we can get hangs of up to 30 seconds during workloads hitting
synchronous inode reclaim.

The scheme is copied from what we do for dquot reclaims.

Reported-by: Simon Kirby <sim@hostway.ca>
Signed-off-by: Christoph Hellwig <hch@lst.de>
Tested-by: Simon Kirby <sim@hostway.ca>
Signed-off-by: Ben Myers <bpm@sgi.com>
Acked-by: Dave Chinner <dchinner@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

---
 fs/xfs/linux-2.6/xfs_sync.c |   11 +++++++++++
 fs/xfs/xfs_inode.c          |   21 +++++++++++++++++++++
 fs/xfs/xfs_inode.h          |    1 +
 3 files changed, 33 insertions(+)

--- a/fs/xfs/linux-2.6/xfs_sync.c
+++ b/fs/xfs/linux-2.6/xfs_sync.c
@@ -772,6 +772,17 @@ restart:
 	if (!xfs_iflock_nowait(ip)) {
 		if (!(sync_mode & SYNC_WAIT))
 			goto out;
+
+		/*
+		 * If we only have a single dirty inode in a cluster there is
+		 * a fair chance that the AIL push may have pushed it into
+		 * the buffer, but xfsbufd won't touch it until 30 seconds
+		 * from now, and thus we will lock up here.
+		 *
+		 * Promote the inode buffer to the front of the delwri list
+		 * and wake up xfsbufd now.
+		 */
+		xfs_promote_inode(ip);
 		xfs_iflock(ip);
 	}
 
--- a/fs/xfs/xfs_inode.c
+++ b/fs/xfs/xfs_inode.c
@@ -3099,6 +3099,27 @@ corrupt_out:
 	return XFS_ERROR(EFSCORRUPTED);
 }
 
+void
+xfs_promote_inode(
+	struct xfs_inode	*ip)
+{
+	struct xfs_buf		*bp;
+
+	ASSERT(xfs_isilocked(ip, XFS_ILOCK_EXCL|XFS_ILOCK_SHARED));
+
+	bp = xfs_incore(ip->i_mount->m_ddev_targp, ip->i_imap.im_blkno,
+			ip->i_imap.im_len, XBF_TRYLOCK);
+	if (!bp)
+		return;
+
+	if (XFS_BUF_ISDELAYWRITE(bp)) {
+		xfs_buf_delwri_promote(bp);
+		wake_up_process(ip->i_mount->m_ddev_targp->bt_task);
+	}
+
+	xfs_buf_relse(bp);
+}
+
 /*
  * Return a pointer to the extent record at file index idx.
  */
--- a/fs/xfs/xfs_inode.h
+++ b/fs/xfs/xfs_inode.h
@@ -509,6 +509,7 @@ int		xfs_iunlink(struct xfs_trans *, xfs
 void		xfs_iext_realloc(xfs_inode_t *, int, int);
 void		xfs_iunpin_wait(xfs_inode_t *);
 int		xfs_iflush(xfs_inode_t *, uint);
+void		xfs_promote_inode(struct xfs_inode *);
 void		xfs_lock_inodes(xfs_inode_t **, int, uint);
 void		xfs_lock_two_inodes(xfs_inode_t *, xfs_inode_t *, uint);
 



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

* [71/80] xfs: fix attr2 vs large data fork assert
  2011-12-07 16:12 [00/80] 3.0.13-stable review Greg KH
                   ` (69 preceding siblings ...)
  2011-12-07 16:07 ` [70/80] xfs: force buffer writeback before blocking on the ilock in inode reclaim Greg KH
@ 2011-12-07 16:07 ` Greg KH
  2011-12-07 16:07 ` [72/80] trace_events_filter: Use rcu_assign_pointer() when setting ftrace_event_call->filter Greg KH
                   ` (8 subsequent siblings)
  79 siblings, 0 replies; 91+ messages in thread
From: Greg KH @ 2011-12-07 16:07 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: torvalds, akpm, alan, xfs, Christoph Hellwig, Ben Myers,
	Dave Chinner

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

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

From: Christoph Hellwig <hch@infradead.org>

commit 4c393a6059f8442a70512a48ce4639b882b6f6ad upstream.

With Dmitry fsstress updates I've seen very reproducible crashes in
xfs_attr_shortform_remove because xfs_attr_shortform_bytesfit claims that
the attributes would not fit inline into the inode after removing an
attribute.  It turns out that we were operating on an inode with lots
of delalloc extents, and thus an if_bytes values for the data fork that
is larger than biggest possible on-disk storage for it which utterly
confuses the code near the end of xfs_attr_shortform_bytesfit.

Fix this by always allowing the current attribute fork, like we already
do for the attr1 format, given that delalloc conversion will take care
for moving either the data or attribute area out of line if it doesn't
fit at that point - or making the point moot by merging extents at this
point.

Also document the function better, and clean up some loose bits.

Reviewed-by: Dave Chinner <dchinner@redhat.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Ben Myers <bpm@sgi.com>
Acked-by: Dave Chinner <dchinner@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

---
 fs/xfs/xfs_attr_leaf.c |   64 +++++++++++++++++++++++++++++--------------------
 1 file changed, 39 insertions(+), 25 deletions(-)

--- a/fs/xfs/xfs_attr_leaf.c
+++ b/fs/xfs/xfs_attr_leaf.c
@@ -110,6 +110,7 @@ xfs_attr_namesp_match(int arg_flags, int
 /*
  * Query whether the requested number of additional bytes of extended
  * attribute space will be able to fit inline.
+ *
  * Returns zero if not, else the di_forkoff fork offset to be used in the
  * literal area for attribute data once the new bytes have been added.
  *
@@ -122,7 +123,7 @@ xfs_attr_shortform_bytesfit(xfs_inode_t
 	int offset;
 	int minforkoff;	/* lower limit on valid forkoff locations */
 	int maxforkoff;	/* upper limit on valid forkoff locations */
-	int dsize;	
+	int dsize;
 	xfs_mount_t *mp = dp->i_mount;
 
 	offset = (XFS_LITINO(mp) - bytes) >> 3; /* rounded down */
@@ -136,47 +137,60 @@ xfs_attr_shortform_bytesfit(xfs_inode_t
 		return (offset >= minforkoff) ? minforkoff : 0;
 	}
 
-	if (!(mp->m_flags & XFS_MOUNT_ATTR2)) {
-		if (bytes <= XFS_IFORK_ASIZE(dp))
-			return dp->i_d.di_forkoff;
+	/*
+	 * If the requested numbers of bytes is smaller or equal to the
+	 * current attribute fork size we can always proceed.
+	 *
+	 * Note that if_bytes in the data fork might actually be larger than
+	 * the current data fork size is due to delalloc extents. In that
+	 * case either the extent count will go down when they are converted
+	 * to real extents, or the delalloc conversion will take care of the
+	 * literal area rebalancing.
+	 */
+	if (bytes <= XFS_IFORK_ASIZE(dp))
+		return dp->i_d.di_forkoff;
+
+	/*
+	 * For attr2 we can try to move the forkoff if there is space in the
+	 * literal area, but for the old format we are done if there is no
+	 * space in the fixed attribute fork.
+	 */
+	if (!(mp->m_flags & XFS_MOUNT_ATTR2))
 		return 0;
-	}
 
 	dsize = dp->i_df.if_bytes;
-	
+
 	switch (dp->i_d.di_format) {
 	case XFS_DINODE_FMT_EXTENTS:
-		/* 
+		/*
 		 * If there is no attr fork and the data fork is extents, 
-		 * determine if creating the default attr fork will result 
-		 * in the extents form migrating to btree. If so, the 
-		 * minimum offset only needs to be the space required for 
+		 * determine if creating the default attr fork will result
+		 * in the extents form migrating to btree. If so, the
+		 * minimum offset only needs to be the space required for
 		 * the btree root.
-		 */ 
+		 */
 		if (!dp->i_d.di_forkoff && dp->i_df.if_bytes >
 		    xfs_default_attroffset(dp))
 			dsize = XFS_BMDR_SPACE_CALC(MINDBTPTRS);
 		break;
-		
 	case XFS_DINODE_FMT_BTREE:
 		/*
-		 * If have data btree then keep forkoff if we have one,
-		 * otherwise we are adding a new attr, so then we set 
-		 * minforkoff to where the btree root can finish so we have 
+		 * If we have a data btree then keep forkoff if we have one,
+		 * otherwise we are adding a new attr, so then we set
+		 * minforkoff to where the btree root can finish so we have
 		 * plenty of room for attrs
 		 */
 		if (dp->i_d.di_forkoff) {
-			if (offset < dp->i_d.di_forkoff) 
+			if (offset < dp->i_d.di_forkoff)
 				return 0;
-			else 
-				return dp->i_d.di_forkoff;
-		} else
-			dsize = XFS_BMAP_BROOT_SPACE(dp->i_df.if_broot);
+			return dp->i_d.di_forkoff;
+		}
+		dsize = XFS_BMAP_BROOT_SPACE(dp->i_df.if_broot);
 		break;
 	}
-	
-	/* 
-	 * A data fork btree root must have space for at least 
+
+	/*
+	 * A data fork btree root must have space for at least
 	 * MINDBTPTRS key/ptr pairs if the data fork is small or empty.
 	 */
 	minforkoff = MAX(dsize, XFS_BMDR_SPACE_CALC(MINDBTPTRS));
@@ -186,10 +200,10 @@ xfs_attr_shortform_bytesfit(xfs_inode_t
 	maxforkoff = XFS_LITINO(mp) - XFS_BMDR_SPACE_CALC(MINABTPTRS);
 	maxforkoff = maxforkoff >> 3;	/* rounded down */
 
-	if (offset >= minforkoff && offset < maxforkoff)
-		return offset;
 	if (offset >= maxforkoff)
 		return maxforkoff;
+	if (offset >= minforkoff)
+		return offset;
 	return 0;
 }
 



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

* [72/80] trace_events_filter: Use rcu_assign_pointer() when setting ftrace_event_call->filter
  2011-12-07 16:12 [00/80] 3.0.13-stable review Greg KH
                   ` (70 preceding siblings ...)
  2011-12-07 16:07 ` [71/80] xfs: fix attr2 vs large data fork assert Greg KH
@ 2011-12-07 16:07 ` Greg KH
  2011-12-07 16:07 ` [73/80] rtc: Disable the alarm in the hardware Greg KH
                   ` (7 subsequent siblings)
  79 siblings, 0 replies; 91+ messages in thread
From: Greg KH @ 2011-12-07 16:07 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: torvalds, akpm, alan, Eric Dumazet, Frederic Weisbecker,
	Jiri Olsa, Tejun Heo, Steven Rostedt

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

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

From: Tejun Heo <tj@kernel.org>

commit d3d9acf646679c1981032b0985b386d12fccc60c upstream.

ftrace_event_call->filter is sched RCU protected but didn't use
rcu_assign_pointer().  Use it.

TODO: Add proper __rcu annotation to call->filter and all its users.

-v2: Use RCU_INIT_POINTER() for %NULL clearing as suggested by Eric.

Link: http://lkml.kernel.org/r/20111123164949.GA29639@google.com

Cc: Eric Dumazet <eric.dumazet@gmail.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Signed-off-by: Tejun Heo <tj@kernel.org>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

---
 kernel/trace/trace_events_filter.c |    6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

--- a/kernel/trace/trace_events_filter.c
+++ b/kernel/trace/trace_events_filter.c
@@ -1766,7 +1766,7 @@ static int replace_system_preds(struct e
 		 * replace the filter for the call.
 		 */
 		filter = call->filter;
-		call->filter = filter_item->filter;
+		rcu_assign_pointer(call->filter, filter_item->filter);
 		filter_item->filter = filter;
 
 		fail = false;
@@ -1821,7 +1821,7 @@ int apply_event_filter(struct ftrace_eve
 		filter = call->filter;
 		if (!filter)
 			goto out_unlock;
-		call->filter = NULL;
+		RCU_INIT_POINTER(call->filter, NULL);
 		/* Make sure the filter is not being used */
 		synchronize_sched();
 		__free_filter(filter);
@@ -1862,7 +1862,7 @@ out:
 	 * string
 	 */
 	tmp = call->filter;
-	call->filter = filter;
+	rcu_assign_pointer(call->filter, filter);
 	if (tmp) {
 		/* Make sure the call is done with the filter */
 		synchronize_sched();



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

* [73/80] rtc: Disable the alarm in the hardware
  2011-12-07 16:12 [00/80] 3.0.13-stable review Greg KH
                   ` (71 preceding siblings ...)
  2011-12-07 16:07 ` [72/80] trace_events_filter: Use rcu_assign_pointer() when setting ftrace_event_call->filter Greg KH
@ 2011-12-07 16:07 ` Greg KH
  2011-12-07 16:07 ` [74/80] tracing: fix event_subsystem ref counting Greg KH
                   ` (6 subsequent siblings)
  79 siblings, 0 replies; 91+ messages in thread
From: Greg KH @ 2011-12-07 16:07 UTC (permalink / raw)
  To: linux-kernel, stable; +Cc: torvalds, akpm, alan, John Stultz, Rabin Vincent

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

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

From: Rabin Vincent <rabin.vincent@stericsson.com>

commit c0afabd3d553c521e003779c127143ffde55a16f upstream.

Currently, the RTC code does not disable the alarm in the hardware.

This means that after a sequence such as the one below (the files are in the
RTC sysfs), the box will boot up after 2 minutes even though we've
asked for the alarm to be turned off.

	# echo $((`cat since_epoch`)+120) > wakealarm
	# echo 0 > wakealarm
	# poweroff

Fix this by disabling the alarm when there are no timers to run.

Cc: John Stultz <john.stultz@linaro.org>
Signed-off-by: Rabin Vincent <rabin.vincent@stericsson.com>
Signed-off-by: John Stultz <john.stultz@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

---
 drivers/rtc/interface.c |   44 ++++++++++++++++++++++++++++++++++----------
 1 file changed, 34 insertions(+), 10 deletions(-)

--- a/drivers/rtc/interface.c
+++ b/drivers/rtc/interface.c
@@ -318,6 +318,20 @@ int rtc_read_alarm(struct rtc_device *rt
 }
 EXPORT_SYMBOL_GPL(rtc_read_alarm);
 
+static int ___rtc_set_alarm(struct rtc_device *rtc, struct rtc_wkalrm *alarm)
+{
+	int err;
+
+	if (!rtc->ops)
+		err = -ENODEV;
+	else if (!rtc->ops->set_alarm)
+		err = -EINVAL;
+	else
+		err = rtc->ops->set_alarm(rtc->dev.parent, alarm);
+
+	return err;
+}
+
 static int __rtc_set_alarm(struct rtc_device *rtc, struct rtc_wkalrm *alarm)
 {
 	struct rtc_time tm;
@@ -341,14 +355,7 @@ static int __rtc_set_alarm(struct rtc_de
 	 * over right here, before we set the alarm.
 	 */
 
-	if (!rtc->ops)
-		err = -ENODEV;
-	else if (!rtc->ops->set_alarm)
-		err = -EINVAL;
-	else
-		err = rtc->ops->set_alarm(rtc->dev.parent, alarm);
-
-	return err;
+	return ___rtc_set_alarm(rtc, alarm);
 }
 
 int rtc_set_alarm(struct rtc_device *rtc, struct rtc_wkalrm *alarm)
@@ -762,6 +769,20 @@ static int rtc_timer_enqueue(struct rtc_
 	return 0;
 }
 
+static void rtc_alarm_disable(struct rtc_device *rtc)
+{
+	struct rtc_wkalrm alarm;
+	struct rtc_time tm;
+
+	__rtc_read_time(rtc, &tm);
+
+	alarm.time = rtc_ktime_to_tm(ktime_add(rtc_tm_to_ktime(tm),
+				     ktime_set(300, 0)));
+	alarm.enabled = 0;
+
+	___rtc_set_alarm(rtc, &alarm);
+}
+
 /**
  * rtc_timer_remove - Removes a rtc_timer from the rtc_device timerqueue
  * @rtc rtc device
@@ -783,8 +804,10 @@ static void rtc_timer_remove(struct rtc_
 		struct rtc_wkalrm alarm;
 		int err;
 		next = timerqueue_getnext(&rtc->timerqueue);
-		if (!next)
+		if (!next) {
+			rtc_alarm_disable(rtc);
 			return;
+		}
 		alarm.time = rtc_ktime_to_tm(next->expires);
 		alarm.enabled = 1;
 		err = __rtc_set_alarm(rtc, &alarm);
@@ -846,7 +869,8 @@ again:
 		err = __rtc_set_alarm(rtc, &alarm);
 		if (err == -ETIME)
 			goto again;
-	}
+	} else
+		rtc_alarm_disable(rtc);
 
 	mutex_unlock(&rtc->ops_lock);
 }



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

* [74/80] tracing: fix event_subsystem ref counting
  2011-12-07 16:12 [00/80] 3.0.13-stable review Greg KH
                   ` (72 preceding siblings ...)
  2011-12-07 16:07 ` [73/80] rtc: Disable the alarm in the hardware Greg KH
@ 2011-12-07 16:07 ` Greg KH
  2011-12-07 16:07 ` [75/80] tick-broadcast: Stop active broadcast device when replacing it Greg KH
                   ` (5 subsequent siblings)
  79 siblings, 0 replies; 91+ messages in thread
From: Greg KH @ 2011-12-07 16:07 UTC (permalink / raw)
  To: linux-kernel, stable; +Cc: torvalds, akpm, alan, Ilya Dryomov, Steven Rostedt

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

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

From: Ilya Dryomov <idryomov@gmail.com>

commit cb59974742aea24adf6637eb0c4b8e7b48bca6fb upstream.

Fix a bug introduced by e9dbfae5, which prevents event_subsystem from
ever being released.

Ref_count was added to keep track of subsystem users, not for counting
events.  Subsystem is created with ref_count = 1, so there is no need to
increment it for every event, we have nr_events for that.  Fix this by
touching ref_count only when we actually have a new user -
subsystem_open().

Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
Link: http://lkml.kernel.org/r/1320052062-7846-1-git-send-email-idryomov@gmail.com
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

---
 kernel/trace/trace_events.c |    1 -
 1 file changed, 1 deletion(-)

--- a/kernel/trace/trace_events.c
+++ b/kernel/trace/trace_events.c
@@ -1096,7 +1096,6 @@ event_subsystem_dir(const char *name, st
 	/* First see if we did not already create this dir */
 	list_for_each_entry(system, &event_subsystems, list) {
 		if (strcmp(system->name, name) == 0) {
-			__get_system(system);
 			system->nr_events++;
 			return system->entry;
 		}



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

* [75/80] tick-broadcast: Stop active broadcast device when replacing it
  2011-12-07 16:12 [00/80] 3.0.13-stable review Greg KH
                   ` (73 preceding siblings ...)
  2011-12-07 16:07 ` [74/80] tracing: fix event_subsystem ref counting Greg KH
@ 2011-12-07 16:07 ` Greg KH
  2011-12-07 16:07 ` [76/80] perf: Fix parsing of __print_flags() in TP_printk() Greg KH
                   ` (4 subsequent siblings)
  79 siblings, 0 replies; 91+ messages in thread
From: Greg KH @ 2011-12-07 16:07 UTC (permalink / raw)
  To: linux-kernel, stable; +Cc: torvalds, akpm, alan, Thomas Gleixner

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

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

From: Thomas Gleixner <tglx@linutronix.de>

commit c1be84309c58b1e7c6d626e28fba41a22b364c3d upstream.

When a better rated broadcast device is installed, then the current
active device is not disabled, which results in two running broadcast
devices.

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

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

--- a/kernel/time/tick-broadcast.c
+++ b/kernel/time/tick-broadcast.c
@@ -71,7 +71,7 @@ int tick_check_broadcast_device(struct c
 	     (dev->features & CLOCK_EVT_FEAT_C3STOP))
 		return 0;
 
-	clockevents_exchange_device(NULL, dev);
+	clockevents_exchange_device(tick_broadcast_device.evtdev, dev);
 	tick_broadcast_device.evtdev = dev;
 	if (!cpumask_empty(tick_get_broadcast_mask()))
 		tick_broadcast_start_periodic(dev);



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

* [76/80] perf: Fix parsing of __print_flags() in TP_printk()
  2011-12-07 16:12 [00/80] 3.0.13-stable review Greg KH
                   ` (74 preceding siblings ...)
  2011-12-07 16:07 ` [75/80] tick-broadcast: Stop active broadcast device when replacing it Greg KH
@ 2011-12-07 16:07 ` Greg KH
  2011-12-07 16:07 ` [77/80] jump_label: jump_label_inc may return before the code is patched Greg KH
                   ` (3 subsequent siblings)
  79 siblings, 0 replies; 91+ messages in thread
From: Greg KH @ 2011-12-07 16:07 UTC (permalink / raw)
  To: linux-kernel, stable; +Cc: torvalds, akpm, alan, Steven Rostedt

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

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

From: Steven Rostedt <srostedt@redhat.com>

commit d06c27b22aa66e48e32f03f9387328a9af9b0625 upstream.

A update is made to the sched:sched_switch event that adds some
logic to the first parameter of the __print_flags() that shows the
state of tasks. This change cause perf to fail parsing the flags.

A simple fix is needed to have the parser be able to process ops
within the argument.

Reported-by: Andrew Vagin <avagin@openvz.org>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

---
 tools/perf/util/trace-event-parse.c |    2 ++
 1 file changed, 2 insertions(+)

--- a/tools/perf/util/trace-event-parse.c
+++ b/tools/perf/util/trace-event-parse.c
@@ -1537,6 +1537,8 @@ process_flags(struct event *event, struc
 	field = malloc_or_die(sizeof(*field));
 
 	type = process_arg(event, field, &token);
+	while (type == EVENT_OP)
+		type = process_op(event, field, &token);
 	if (test_type_token(type, token, EVENT_DELIM, ","))
 		goto out_free;
 



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

* [77/80] jump_label: jump_label_inc may return before the code is patched
  2011-12-07 16:12 [00/80] 3.0.13-stable review Greg KH
                   ` (75 preceding siblings ...)
  2011-12-07 16:07 ` [76/80] perf: Fix parsing of __print_flags() in TP_printk() Greg KH
@ 2011-12-07 16:07 ` Greg KH
  2011-12-07 16:07 ` [78/80] oprofile: Fix crash when unloading module (hr timer mode) Greg KH
                   ` (2 subsequent siblings)
  79 siblings, 0 replies; 91+ messages in thread
From: Greg KH @ 2011-12-07 16:07 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: torvalds, akpm, alan, Peter Zijlstra, Jason Baron, Gleb Natapov,
	Steven Rostedt

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

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

From: Gleb Natapov <gleb@redhat.com>

commit bbbf7af4bf8fc69bc751818cf30521080fa47dcb upstream.

If cpu A calls jump_label_inc() just after atomic_add_return() is
called by cpu B, atomic_inc_not_zero() will return value greater then
zero and jump_label_inc() will return to a caller before jump_label_update()
finishes its job on cpu B.

Link: http://lkml.kernel.org/r/20111018175551.GH17571@redhat.com

Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Acked-by: Jason Baron <jbaron@redhat.com>
Signed-off-by: Gleb Natapov <gleb@redhat.com>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

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

--- a/kernel/jump_label.c
+++ b/kernel/jump_label.c
@@ -66,8 +66,9 @@ void jump_label_inc(struct jump_label_ke
 		return;
 
 	jump_label_lock();
-	if (atomic_add_return(1, &key->enabled) == 1)
+	if (atomic_read(&key->enabled) == 0)
 		jump_label_update(key, JUMP_LABEL_ENABLE);
+	atomic_inc(&key->enabled);
 	jump_label_unlock();
 }
 



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

* [78/80] oprofile: Fix crash when unloading module (hr timer mode)
  2011-12-07 16:12 [00/80] 3.0.13-stable review Greg KH
                   ` (76 preceding siblings ...)
  2011-12-07 16:07 ` [77/80] jump_label: jump_label_inc may return before the code is patched Greg KH
@ 2011-12-07 16:07 ` Greg KH
  2011-12-07 16:07 ` [79/80] clocksource: Fix bug with max_deferment margin calculation Greg KH
  2011-12-07 16:07 ` [80/80] clockevents: Set noop handler in clockevents_exchange_device() Greg KH
  79 siblings, 0 replies; 91+ messages in thread
From: Greg KH @ 2011-12-07 16:07 UTC (permalink / raw)
  To: linux-kernel, stable; +Cc: torvalds, akpm, alan, Robert Richter

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

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

From: Robert Richter <robert.richter@amd.com>

commit 87121ca504fd1d963a66b3fb0c72054b0fd9a177 upstream.

Oprofile may crash in a KVM guest while unlaoding modules. This
happens if oprofile_arch_init() fails and oprofile switches to the hr
timer mode as a fallback. In this case oprofile_arch_exit() is called,
but it never was initialized properly which causes the crash. This
patch fixes this.

oprofile: using timer interrupt.
BUG: unable to handle kernel NULL pointer dereference at 0000000000000008
IP: [<ffffffff8123c226>] unregister_syscore_ops+0x41/0x58
PGD 41da3f067 PUD 41d80e067 PMD 0
Oops: 0002 [#1] PREEMPT SMP
CPU 5
Modules linked in: oprofile(-)

Pid: 2382, comm: modprobe Not tainted 3.1.0-rc7-00018-g709a39d #18 Advanced Micro Device Anaheim/Anaheim
RIP: 0010:[<ffffffff8123c226>]  [<ffffffff8123c226>] unregister_syscore_ops+0x41/0x58
RSP: 0018:ffff88041de1de98  EFLAGS: 00010296
RAX: 0000000000000000 RBX: ffffffffa00060e0 RCX: dead000000200200
RDX: 0000000000000000 RSI: dead000000100100 RDI: ffffffff8178c620
RBP: ffff88041de1dea8 R08: 0000000000000001 R09: 0000000000000082
R10: 0000000000000000 R11: ffff88041de1dde8 R12: 0000000000000080
R13: fffffffffffffff5 R14: 0000000000000001 R15: 0000000000610210
FS:  00007f9ae5bef700(0000) GS:ffff88042fd40000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 000000008005003b
CR2: 0000000000000008 CR3: 000000041ca44000 CR4: 00000000000006e0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000ffff0ff0 DR7: 0000000000000400
Process modprobe (pid: 2382, threadinfo ffff88041de1c000, task ffff88042db6d040)
Stack:
 ffff88041de1deb8 ffffffffa0006770 ffff88041de1deb8 ffffffffa000251e
 ffff88041de1dec8 ffffffffa00022c2 ffff88041de1ded8 ffffffffa0004993
 ffff88041de1df78 ffffffff81073115 656c69666f72706f 0000000000610200
Call Trace:
 [<ffffffffa000251e>] op_nmi_exit+0x15/0x17 [oprofile]
 [<ffffffffa00022c2>] oprofile_arch_exit+0xe/0x10 [oprofile]
 [<ffffffffa0004993>] oprofile_exit+0x13/0x15 [oprofile]
 [<ffffffff81073115>] sys_delete_module+0x1c3/0x22f
 [<ffffffff811bf09e>] ? trace_hardirqs_on_thunk+0x3a/0x3f
 [<ffffffff8148070b>] system_call_fastpath+0x16/0x1b
Code: 20 c6 78 81 e8 c5 cc 23 00 48 8b 13 48 8b 43 08 48 be 00 01 10 00 00 00 ad de 48 b9 00 02 20 00 00 00 ad de 48 c7 c7 20 c6 78 81
 89 42 08 48 89 10 48 89 33 48 89 4b 08 e8 a6 c0 23 00 5a 5b
RIP  [<ffffffff8123c226>] unregister_syscore_ops+0x41/0x58
 RSP <ffff88041de1de98>
CR2: 0000000000000008
---[ end trace 06d4e95b6aa3b437 ]---

Signed-off-by: Robert Richter <robert.richter@amd.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

---
 drivers/oprofile/oprof.c     |   29 ++++++++++++++++++++++++-----
 drivers/oprofile/timer_int.c |    1 +
 2 files changed, 25 insertions(+), 5 deletions(-)

--- a/drivers/oprofile/oprof.c
+++ b/drivers/oprofile/oprof.c
@@ -239,26 +239,45 @@ int oprofile_set_ulong(unsigned long *ad
 	return err;
 }
 
+static int timer_mode;
+
 static int __init oprofile_init(void)
 {
 	int err;
 
+	/* always init architecture to setup backtrace support */
 	err = oprofile_arch_init(&oprofile_ops);
-	if (err < 0 || timer) {
-		printk(KERN_INFO "oprofile: using timer interrupt.\n");
+
+	timer_mode = err || timer;	/* fall back to timer mode on errors */
+	if (timer_mode) {
+		if (!err)
+			oprofile_arch_exit();
 		err = oprofile_timer_init(&oprofile_ops);
 		if (err)
 			return err;
 	}
-	return oprofilefs_register();
+
+	err = oprofilefs_register();
+	if (!err)
+		return 0;
+
+	/* failed */
+	if (timer_mode)
+		oprofile_timer_exit();
+	else
+		oprofile_arch_exit();
+
+	return err;
 }
 
 
 static void __exit oprofile_exit(void)
 {
-	oprofile_timer_exit();
 	oprofilefs_unregister();
-	oprofile_arch_exit();
+	if (timer_mode)
+		oprofile_timer_exit();
+	else
+		oprofile_arch_exit();
 }
 
 
--- a/drivers/oprofile/timer_int.c
+++ b/drivers/oprofile/timer_int.c
@@ -110,6 +110,7 @@ int oprofile_timer_init(struct oprofile_
 	ops->start = oprofile_hrtimer_start;
 	ops->stop = oprofile_hrtimer_stop;
 	ops->cpu_type = "timer";
+	printk(KERN_INFO "oprofile: using timer interrupt.\n");
 	return 0;
 }
 



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

* [79/80] clocksource: Fix bug with max_deferment margin calculation
  2011-12-07 16:12 [00/80] 3.0.13-stable review Greg KH
                   ` (77 preceding siblings ...)
  2011-12-07 16:07 ` [78/80] oprofile: Fix crash when unloading module (hr timer mode) Greg KH
@ 2011-12-07 16:07 ` Greg KH
  2011-12-07 16:07 ` [80/80] clockevents: Set noop handler in clockevents_exchange_device() Greg KH
  79 siblings, 0 replies; 91+ messages in thread
From: Greg KH @ 2011-12-07 16:07 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: torvalds, akpm, alan, Yang Honggang (Joseph), John Stultz

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

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

From: "Yang Honggang (Joseph)" <eagle.rtlinux@gmail.com>

commit b1f919664d04a8d0ba29cb76673c7ca3325a2006 upstream.

In order to leave a margin of 12.5% we should >> 3 not >> 5.

Signed-off-by: Yang Honggang (Joseph) <eagle.rtlinux@gmail.com>
[jstultz: Modified commit subject]
Signed-off-by: John Stultz <john.stultz@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

---
 kernel/time/clocksource.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

--- a/kernel/time/clocksource.c
+++ b/kernel/time/clocksource.c
@@ -531,7 +531,7 @@ static u64 clocksource_max_deferment(str
 	 * note a margin of 12.5% is used because this can be computed with
 	 * a shift, versus say 10% which would require division.
 	 */
-	return max_nsecs - (max_nsecs >> 5);
+	return max_nsecs - (max_nsecs >> 3);
 }
 
 #ifndef CONFIG_ARCH_USES_GETTIMEOFFSET
@@ -653,7 +653,7 @@ void __clocksource_updatefreq_scale(stru
 	 * ~ 0.06ppm granularity for NTP. We apply the same 12.5%
 	 * margin as we do in clocksource_max_deferment()
 	 */
-	sec = (cs->mask - (cs->mask >> 5));
+	sec = (cs->mask - (cs->mask >> 3));
 	do_div(sec, freq);
 	do_div(sec, scale);
 	if (!sec)



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

* [80/80] clockevents: Set noop handler in clockevents_exchange_device()
  2011-12-07 16:12 [00/80] 3.0.13-stable review Greg KH
                   ` (78 preceding siblings ...)
  2011-12-07 16:07 ` [79/80] clocksource: Fix bug with max_deferment margin calculation Greg KH
@ 2011-12-07 16:07 ` Greg KH
  79 siblings, 0 replies; 91+ messages in thread
From: Greg KH @ 2011-12-07 16:07 UTC (permalink / raw)
  To: linux-kernel, stable; +Cc: torvalds, akpm, alan, Thomas Gleixner

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

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

From: Thomas Gleixner <tglx@linutronix.de>

commit de28f25e8244c7353abed8de0c7792f5f883588c upstream.

If a device is shutdown, then there might be a pending interrupt,
which will be processed after we reenable interrupts, which causes the
original handler to be run. If the old handler is the (broadcast)
periodic handler the shutdown state might hang the kernel completely.

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

---
 kernel/time/clockevents.c |    1 +
 1 file changed, 1 insertion(+)

--- a/kernel/time/clockevents.c
+++ b/kernel/time/clockevents.c
@@ -286,6 +286,7 @@ void clockevents_exchange_device(struct
 	 * released list and do a notify add later.
 	 */
 	if (old) {
+		old->event_handler = clockevents_handle_noop;
 		clockevents_set_mode(old, CLOCK_EVT_MODE_UNUSED);
 		list_del(&old->list);
 		list_add(&old->list, &clockevents_released);



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

* [00/80] 3.0.13-stable review
@ 2011-12-07 16:12 Greg KH
  2011-12-07 16:06 ` [01/80] eCryptfs: Flush file in vma close Greg KH
                   ` (79 more replies)
  0 siblings, 80 replies; 91+ messages in thread
From: Greg KH @ 2011-12-07 16:12 UTC (permalink / raw)
  To: linux-kernel, stable; +Cc: torvalds, akpm, alan

This is the start of the stable review cycle for the 3.0.13 release.
There are 80 patches in this series, all will be posted as a response
to this one.  If anyone has any issues with these being applied, please
let us know.  If anyone is a maintainer of the proper subsystem, and
wants to add a Signed-off-by: line to the patch, please respond with it.

Responses should be made by Friday, December 9, 2011, 17:00:00 UTC.
Anything received after that time might be too late.

The whole patch series can be found in one patch at:
	kernel.org/pub/linux/kernel/v3.0/stable-review/patch-3.0.13-rc1.gz
and the diffstat can be found below.

thanks,

greg k-h

 Makefile                                  |    4 +-
 arch/arm/Kconfig                          |   12 ++++
 arch/arm/configs/ezx_defconfig            |    2 +-
 arch/arm/configs/imote2_defconfig         |    2 +-
 arch/arm/configs/magician_defconfig       |    2 +-
 arch/arm/configs/zeus_defconfig           |    2 +-
 arch/arm/kernel/process.c                 |    3 +
 arch/arm/mach-mxs/clock-mx28.c            |    2 +-
 arch/arm/mach-omap2/Kconfig               |    1 +
 arch/arm/mach-omap2/smartreflex.c         |    2 +-
 arch/arm/mach-pxa/balloon3.c              |    2 +-
 arch/arm/mach-pxa/colibri-pxa320.c        |    2 +-
 arch/arm/mach-pxa/gumstix.c               |    2 +-
 arch/arm/mach-pxa/include/mach/palm27x.h  |    4 +-
 arch/arm/mach-pxa/palm27x.c               |    4 +-
 arch/arm/mach-pxa/palmtc.c                |    2 +-
 arch/arm/mach-pxa/vpac270.c               |    2 +-
 arch/s390/kernel/ptrace.c                 |   18 ++++++
 arch/x86/include/asm/timer.h              |   23 +++++++-
 arch/x86/kernel/cpu/perf_event_intel_ds.c |    6 ++-
 arch/x86/kernel/mpparse.c                 |    2 +-
 arch/x86/kernel/reboot.c                  |   13 ++++-
 arch/x86/mm/highmem_32.c                  |    2 +
 arch/x86/oprofile/init.c                  |    7 ++-
 drivers/crypto/mv_cesa.c                  |   12 ++--
 drivers/firmware/sigma.c                  |   81 ++++++++++++++++++-------
 drivers/gpu/drm/drm_crtc.c                |    4 +
 drivers/gpu/drm/i915/i915_irq.c           |    1 +
 drivers/gpu/drm/i915/i915_reg.h           |    4 +
 drivers/gpu/drm/i915/i915_suspend.c       |    2 +
 drivers/gpu/drm/i915/intel_display.c      |   16 +++++-
 drivers/gpu/drm/radeon/evergreen.c        |    7 ++-
 drivers/gpu/drm/radeon/r100.c             |    7 ++-
 drivers/gpu/drm/radeon/radeon_atombios.c  |   24 +++++++
 drivers/gpu/drm/radeon/rs600.c            |    7 ++-
 drivers/gpu/drm/radeon/rv770.c            |    7 ++-
 drivers/gpu/drm/ttm/ttm_bo.c              |    3 +-
 drivers/hid/hid-core.c                    |    2 +-
 drivers/hid/hid-ids.h                     |    2 +-
 drivers/hwmon/coretemp.c                  |    2 +
 drivers/i2c/algos/i2c-algo-bit.c          |    4 +-
 drivers/mfd/twl-core.c                    |    2 +-
 drivers/net/wireless/p54/p54spi.c         |    5 +-
 drivers/net/wireless/rt2x00/rt2800lib.c   |    2 +-
 drivers/oprofile/oprof.c                  |   29 +++++++--
 drivers/oprofile/timer_int.c              |    1 +
 drivers/pci/hotplug/shpchp_core.c         |    4 +-
 drivers/pci/hotplug/shpchp_hpc.c          |    4 +-
 drivers/rtc/interface.c                   |   44 ++++++++++---
 drivers/scsi/scsi_lib.c                   |    3 +-
 drivers/staging/comedi/comedi_fops.c      |   94 ++++++++++++++++++++++-------
 drivers/staging/usbip/vhci_rx.c           |   10 ++-
 drivers/usb/host/ehci-sched.c             |   22 ++++---
 drivers/usb/host/whci/qset.c              |    2 +-
 drivers/usb/host/xhci.c                   |    5 +-
 drivers/usb/serial/ftdi_sio.c             |    1 +
 drivers/usb/serial/ftdi_sio_ids.h         |    1 +
 drivers/usb/serial/option.c               |    4 +
 drivers/usb/storage/unusual_devs.h        |    7 ++
 drivers/video/via/share.h                 |    4 +-
 fs/ecryptfs/crypto.c                      |    4 +-
 fs/ecryptfs/file.c                        |   23 +++++++-
 fs/nfs/nfs4filelayout.c                   |    8 +++
 fs/nfs/pnfs.c                             |    3 +-
 fs/xfs/linux-2.6/xfs_acl.c                |    2 +
 fs/xfs/linux-2.6/xfs_sync.c               |   11 ++++
 fs/xfs/xfs_attr_leaf.c                    |   64 ++++++++++++--------
 fs/xfs/xfs_inode.c                        |   21 +++++++
 fs/xfs/xfs_inode.h                        |    1 +
 include/drm/drm_mode.h                    |    2 +
 include/drm/drm_pciids.h                  |    8 +++
 include/linux/sigma.h                     |   13 +---
 kernel/cgroup_freezer.c                   |   11 +++-
 kernel/hrtimer.c                          |    6 +-
 kernel/irq/manage.c                       |    5 +-
 kernel/irq/spurious.c                     |    4 +-
 kernel/jump_label.c                       |    3 +-
 kernel/time/clockevents.c                 |    1 +
 kernel/time/clocksource.c                 |    4 +-
 kernel/time/tick-broadcast.c              |    2 +-
 kernel/time/timekeeping.c                 |    4 +
 kernel/trace/trace_events.c               |    1 -
 kernel/trace/trace_events_filter.c        |    6 +-
 mm/hugetlb.c                              |    2 +
 net/mac80211/agg-tx.c                     |   24 +++++++-
 net/sunrpc/xprtsock.c                     |    3 +-
 net/wireless/nl80211.c                    |    4 +-
 net/wireless/reg.c                        |   49 ++++++++++-----
 sound/pci/lx6464es/lx_core.c              |   16 ++++-
 sound/soc/codecs/wm8731.c                 |    1 +
 sound/soc/codecs/wm8753.c                 |    3 +
 sound/soc/fsl/fsl_ssi.c                   |    1 +
 tools/perf/util/trace-event-parse.c       |    2 +
 93 files changed, 660 insertions(+), 202 deletions(-)

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

* Re: [20/80] ALSA: lx6464es - fix device communication via command bus
  2011-12-07 16:06 ` [20/80] ALSA: lx6464es - fix device communication via command bus Greg KH
@ 2011-12-07 17:47   ` Linus Torvalds
  2011-12-07 18:00     ` H. Peter Anvin
  2011-12-08  7:55     ` Brian Gerst
  0 siblings, 2 replies; 91+ messages in thread
From: Linus Torvalds @ 2011-12-07 17:47 UTC (permalink / raw)
  To: Greg KH, H. Peter Anvin, Ingo Molnar, Brian Gerst,
	Thomas Gleixner, x86
  Cc: linux-kernel, stable, akpm, alan, Tim Blechmann, Takashi Iwai

On Wed, Dec 7, 2011 at 8:06 AM, Greg KH <gregkh@suse.de> wrote:
>
> From: Tim Blechmann <tim@klingt.org>
>
> commit a29878553a9a7b4c06f93c7e383527cf014d4ceb upstream.
>
> commit 6175ddf06b6172046a329e3abfd9c901a43efd2e optimized the mem*io
> functions that have been used to send commands to the device. these
> optimizations somehow corrupted the communication with the lx6464es,
> that resulted the device to be unusable with kernels after 2.6.33.

Uhhuh. Looking at this, I understand why the driver can't really use
memcpy_toio/fromio any more, and I never noticed this problem because
it was worked around in drivers instead (or being discussed elsewhere
and I just overlooked it)

That commit (6175ddf06b61) is really bad and buggy. It probably wasn't
horribly bad back when it was done, but it's getting increasingly bad
as we change how "memcpy()" works.

For example, memcpy some day will be just "rep movsb" on newer CPU's
("enhanced fast string memcpy"), which can be optimal for memory. But
it is completely unacceptable for IO devices, so saying that "Iomem
has no special significance on x86" is just total crap.

iomem can work with regular accessors, yes, but it still has
significance even on x86: iomem is *not* RAM.

And using memcpy() is wrong, wrong, wrong. It's wrong even aside from
any future "rep movsb" issues - it's already wrong due to the crazy
"optimized x86 memcpy" that works around Atom crap. Copying stuff
backwards is not what memcpy_toio/fromio is supposed to do, partly
because it can confuse devices, but partly simply because it can
easily destroy things like PCI bursting etc. I also would not be
totally shocked to hear that some devices dislike 8-byte writes.

So I understand why the driver works around the issue, but I think the
real fix is to undo much of that broken commit in the first place.

So we should probably make memcpy_fromio/toio do the
"__inline_memcpy()" loop that we used to use: "rep movsl" followed by
conditional movsw/movsb. No, it's not necessarily optimal, but it's
*safe*, and it's quite likely *more* optimal than memcpy that may well
end up doing it a byte at a time!

So I think we should just re-instate "arch/x86/lib/io.c, copy the
"inline_memcpy" thing in there, and add a similar "rep stosl" version
for the "memset_io()". IOW, undo most of 6175ddf06b61, just make it
use the same code for 32-bit and 64-bit.

Ingo, Peter, Thomas? Comments?

                                 Linus

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

* Re: [20/80] ALSA: lx6464es - fix device communication via command bus
  2011-12-07 17:47   ` Linus Torvalds
@ 2011-12-07 18:00     ` H. Peter Anvin
  2011-12-07 18:09       ` Linus Torvalds
  2011-12-08  7:55     ` Brian Gerst
  1 sibling, 1 reply; 91+ messages in thread
From: H. Peter Anvin @ 2011-12-07 18:00 UTC (permalink / raw)
  To: Linus Torvalds
  Cc: Greg KH, Ingo Molnar, Brian Gerst, Thomas Gleixner, x86,
	linux-kernel, stable, akpm, alan, Tim Blechmann, Takashi Iwai

On 12/07/2011 09:47 AM, Linus Torvalds wrote:
> 
> Ingo, Peter, Thomas? Comments?
> 

I agree in principle, although I am really not happy about the idea of
disallowing 64-bit writes from device drivers that haven't explicitly
indicated they won't support it.

However, I would *also* like if more drivers would explicitly specify
the transfer size they expect.  Right now, that is done though a set of
functions whose name are a bit of a mismatch to the others:
__iowrite{32,64}_copy(), which probably should be renamed
memcpy_toio{32,64}() and augmented with matching memcpy_fromio{32,64}()
functions.

What do you think?

	-hpa


-- 
H. Peter Anvin, Intel Open Source Technology Center
I work for Intel.  I don't speak on their behalf.


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

* Re: [20/80] ALSA: lx6464es - fix device communication via command bus
  2011-12-07 18:00     ` H. Peter Anvin
@ 2011-12-07 18:09       ` Linus Torvalds
  2011-12-09 23:17         ` H. Peter Anvin
  0 siblings, 1 reply; 91+ messages in thread
From: Linus Torvalds @ 2011-12-07 18:09 UTC (permalink / raw)
  To: H. Peter Anvin
  Cc: Greg KH, Ingo Molnar, Brian Gerst, Thomas Gleixner, x86,
	linux-kernel, stable, akpm, alan, Tim Blechmann, Takashi Iwai

On Wed, Dec 7, 2011 at 10:00 AM, H. Peter Anvin <hpa@zytor.com> wrote:
>
> I agree in principle, although I am really not happy about the idea of
> disallowing 64-bit writes from device drivers that haven't explicitly
> indicated they won't support it.

I'd really prefer going in the other direction. Especially since
64-bit writes would be optional *anyway* (ie impossible on 32-bit
hosts). So a driver should explicitly say "I can do 64-bit stuff"
rather than having to say "I cannot do it".

And if a driver *has* to have 64-bit accesses, it had better do them
all by hand, using "writeq()" and being dependent on the architecture
actually having that support. No "memcpy_toio" and friends at all.

So adding a "memcpy_toio64()" that defaults to the normal 32-bit max
but *might* do 64-bit copies sounds fine to me. But we really should
default to something that is consistent across architectures, and that
is not 64-bit accesses.

Old PCI setups actually had trouble with 64-bit accesses afaik, and
would literally get them wrong at a hardware level. I'm sure that's
not true of anything you can actually plug into a machine that
actually has a 64-bit x86 in it, but it's an example of actual
hardware limitations. I'm pretty sure there are 64-bit alpha machines
that are from that kind of timeframe, to give an example of a natively
64-bit architecture where a 64-bit write would simply not have worked
on a hardware level.

I'd suggest adding a architecture-neutral weak alias from
memcpy_toio64 to memcpy_toio (and other combinations), and then we can
independently start using it in drivers and/or start adding it in
various architectures. That automatically gives us the default
fallback for architectures that don't care or can't do it.

Hmm?

                     Linus

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

* Re: [20/80] ALSA: lx6464es - fix device communication via command bus
  2011-12-07 17:47   ` Linus Torvalds
  2011-12-07 18:00     ` H. Peter Anvin
@ 2011-12-08  7:55     ` Brian Gerst
  2011-12-11 22:10       ` [PATCH] x86: Split off mem*io functions Brian Gerst
  1 sibling, 1 reply; 91+ messages in thread
From: Brian Gerst @ 2011-12-08  7:55 UTC (permalink / raw)
  To: Linus Torvalds
  Cc: Greg KH, H. Peter Anvin, Ingo Molnar, Thomas Gleixner, x86,
	linux-kernel, stable, akpm, alan, Tim Blechmann, Takashi Iwai

On Wed, Dec 7, 2011 at 12:47 PM, Linus Torvalds
<torvalds@linux-foundation.org> wrote:
> On Wed, Dec 7, 2011 at 8:06 AM, Greg KH <gregkh@suse.de> wrote:
>>
>> From: Tim Blechmann <tim@klingt.org>
>>
>> commit a29878553a9a7b4c06f93c7e383527cf014d4ceb upstream.
>>
>> commit 6175ddf06b6172046a329e3abfd9c901a43efd2e optimized the mem*io
>> functions that have been used to send commands to the device. these
>> optimizations somehow corrupted the communication with the lx6464es,
>> that resulted the device to be unusable with kernels after 2.6.33.
>
> Uhhuh. Looking at this, I understand why the driver can't really use
> memcpy_toio/fromio any more, and I never noticed this problem because
> it was worked around in drivers instead (or being discussed elsewhere
> and I just overlooked it)
>
> That commit (6175ddf06b61) is really bad and buggy. It probably wasn't
> horribly bad back when it was done, but it's getting increasingly bad
> as we change how "memcpy()" works.

When I originally wrote that patch, I didn't take into consideration
how the devices would react to the change (mostly due to 64-bit
writes).  What I meant by "nothing special" is that from the CPU
standpoint, nothing has to be done with regard to the address space or
cache coherency, unlike with some other arches.  Unfortunately too
many drivers make the assumption that accesses are 32-bit max, because
it "just worked" on 32-bit machines.

> For example, memcpy some day will be just "rep movsb" on newer CPU's
> ("enhanced fast string memcpy"), which can be optimal for memory. But
> it is completely unacceptable for IO devices, so saying that "Iomem
> has no special significance on x86" is just total crap.
>
> iomem can work with regular accessors, yes, but it still has
> significance even on x86: iomem is *not* RAM.
>
> And using memcpy() is wrong, wrong, wrong. It's wrong even aside from
> any future "rep movsb" issues - it's already wrong due to the crazy
> "optimized x86 memcpy" that works around Atom crap. Copying stuff
> backwards is not what memcpy_toio/fromio is supposed to do, partly
> because it can confuse devices, but partly simply because it can
> easily destroy things like PCI bursting etc. I also would not be
> totally shocked to hear that some devices dislike 8-byte writes.
>
> So I understand why the driver works around the issue, but I think the
> real fix is to undo much of that broken commit in the first place.
>
> So we should probably make memcpy_fromio/toio do the
> "__inline_memcpy()" loop that we used to use: "rep movsl" followed by
> conditional movsw/movsb. No, it's not necessarily optimal, but it's
> *safe*, and it's quite likely *more* optimal than memcpy that may well
> end up doing it a byte at a time!
>
> So I think we should just re-instate "arch/x86/lib/io.c, copy the
> "inline_memcpy" thing in there, and add a similar "rep stosl" version
> for the "memset_io()". IOW, undo most of 6175ddf06b61, just make it
> use the same code for 32-bit and 64-bit.

I am working on a patch implementing this, using simple string
instructions without the micro-optimizations that the normal mem*
functions have.

--
Brian Gerst

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

* Re: [20/80] ALSA: lx6464es - fix device communication via command bus
  2011-12-07 18:09       ` Linus Torvalds
@ 2011-12-09 23:17         ` H. Peter Anvin
  0 siblings, 0 replies; 91+ messages in thread
From: H. Peter Anvin @ 2011-12-09 23:17 UTC (permalink / raw)
  To: Linus Torvalds
  Cc: Greg KH, Ingo Molnar, Brian Gerst, Thomas Gleixner, x86,
	linux-kernel, stable, akpm, alan, Tim Blechmann, Takashi Iwai

Sorry for the late reply.  With baby prep and everything going on I'm a
bit ADD.

On 12/07/2011 10:09 AM, Linus Torvalds wrote:
> On Wed, Dec 7, 2011 at 10:00 AM, H. Peter Anvin <hpa@zytor.com> wrote:
>>
>> I agree in principle, although I am really not happy about the idea of
>> disallowing 64-bit writes from device drivers that haven't explicitly
>> indicated they won't support it.
> 
> I'd really prefer going in the other direction. Especially since
> 64-bit writes would be optional *anyway* (ie impossible on 32-bit
> hosts). So a driver should explicitly say "I can do 64-bit stuff"
> rather than having to say "I cannot do it".
> 
> And if a driver *has* to have 64-bit accesses, it had better do them
> all by hand, using "writeq()" and being dependent on the architecture
> actually having that support. No "memcpy_toio" and friends at all.
> 
> So adding a "memcpy_toio64()" that defaults to the normal 32-bit max
> but *might* do 64-bit copies sounds fine to me. But we really should
> default to something that is consistent across architectures, and that
> is not 64-bit accesses.

I feel a bit funny about memcpy_toio64() being able to *not* to 64-bit
copies... it feels like it really violates the assumptions.

What I would suggest, technically is:

- memcpy_toio() becomes a legacy alias for memcpy_toio32().
- memcpy_toio32() and memcpy_toio64() are defined to do exactly
  those reference sizes.  If the platform can't do 64-bit I/O
  then memcpy_toio64 is undefined (like readq/writeq).
- we introduce memcpy_toio_fast() which is explicitly allowed to do any
  kind of references, including larger than 64 bits if supported in
  future CPUs.

However, I *also* found that we have a metric boatload of partially
overlapping redundant aliases:

iowrite{8,16,32}_rep()
	[but iowrite64_rep() is missing]

__iowrite{32,64}_copy()

memcpy_toio()

What I have proposed to memcpy_toio{32,64}() pretty much matches
__iowrite_{32,64}_copy() and those functions should probably be
renamed... not sure what the sane thing to do with the iowrite functions
is here.

	-hpa

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

* [PATCH] x86: Split off mem*io functions
  2011-12-08  7:55     ` Brian Gerst
@ 2011-12-11 22:10       ` Brian Gerst
  2011-12-11 22:15         ` Brian Gerst
  2011-12-13 22:58         ` Linus Torvalds
  0 siblings, 2 replies; 91+ messages in thread
From: Brian Gerst @ 2011-12-11 22:10 UTC (permalink / raw)
  To: x86; +Cc: linux-kernel, tim, hpa, torvalds

Commit 6175ddf06b6172046a329e3abfd9c901a43efd2e changed the mem*io
functions to use the standard memcpy/memset routines, but there were
unintended consequences.  Some devices cannot cope with 64-bit or
non-sequential accesses that the optimized routines do.  Change them
back to simple 32-bit sequential writes.

Signed-off-by: Brian Gerst <brgerst@gmail.com>
---
 arch/x86/include/asm/io.h |   20 +++-----------------
 arch/x86/lib/Makefile     |    1 +
 arch/x86/lib/io.c         |   41 +++++++++++++++++++++++++++++++++++++++++
 3 files changed, 45 insertions(+), 17 deletions(-)
 create mode 100644 arch/x86/lib/io.c

diff --git a/arch/x86/include/asm/io.h b/arch/x86/include/asm/io.h
index d8e8eef..8115978 100644
--- a/arch/x86/include/asm/io.h
+++ b/arch/x86/include/asm/io.h
@@ -199,23 +199,9 @@ extern void set_iounmap_nonlazy(void);
  */
 #define xlate_dev_kmem_ptr(p)	p
 
-static inline void
-memset_io(volatile void __iomem *addr, unsigned char val, size_t count)
-{
-	memset((void __force *)addr, val, count);
-}
-
-static inline void
-memcpy_fromio(void *dst, const volatile void __iomem *src, size_t count)
-{
-	memcpy(dst, (const void __force *)src, count);
-}
-
-static inline void
-memcpy_toio(volatile void __iomem *dst, const void *src, size_t count)
-{
-	memcpy((void __force *)dst, src, count);
-}
+extern void memset_io(volatile void __iomem *addr, unsigned char val, size_t count);
+extern void memcpy_fromio(void *dst, const volatile void __iomem *src, size_t count);
+extern void memcpy_toio(volatile void __iomem *dst, const void *src, size_t count);
 
 /*
  * ISA space is 'always mapped' on a typical x86 system, no need to
diff --git a/arch/x86/lib/Makefile b/arch/x86/lib/Makefile
index b00f678..160d934 100644
--- a/arch/x86/lib/Makefile
+++ b/arch/x86/lib/Makefile
@@ -17,6 +17,7 @@ clean-files := inat-tables.c
 obj-$(CONFIG_SMP) += msr-smp.o cache-smp.o
 
 lib-y := delay.o
+lib-y += io.o
 lib-y += thunk_$(BITS).o
 lib-y += usercopy_$(BITS).o usercopy.o getuser.o putuser.o
 lib-y += memcpy_$(BITS).o
diff --git a/arch/x86/lib/io.c b/arch/x86/lib/io.c
new file mode 100644
index 0000000..7acdd6d
--- /dev/null
+++ b/arch/x86/lib/io.c
@@ -0,0 +1,41 @@
+#include <asm/io.h>
+#include <asm/types.h>
+#include <linux/module.h>
+
+/*
+ * Some devices can't handle 64-bit or non-sequential accesses.
+ * Use simple string instructions here instead of the normal optimized
+ * memcpy/menset functions.
+ */
+
+void memset_io(volatile void __iomem *addr, unsigned char val, size_t count)
+{
+	unsigned int v = val * 0x01010101;
+	size_t c = count / 4;
+	asm volatile("rep; stosl" : "+D" (addr), "+c" (c) : "a" (v) : "memory");
+	c = count & 3;
+	if (c)
+		asm volatile("rep; stosb" : "+D" (addr), "+c" (c) : "a" (v) : "memory");
+}
+EXPORT_SYMBOL(memset_io);
+
+static void __memcpy_io(void *dst, const void *src, size_t count)
+{
+	size_t c = count / 4;
+	asm volatile("rep; movsl" : "+S" (src), "+D" (dst), "+c" (c) : : "memory");
+	c = count & 3;
+	if (c)
+		asm volatile("rep; movsb" : "+S" (src), "+D" (dst), "+c" (c) : : "memory");
+}
+
+void memcpy_fromio(void *dst, const volatile void __iomem *src, size_t count)
+{
+        __memcpy_io(dst, (const void __force *)src, count);
+}
+EXPORT_SYMBOL(memcpy_fromio);
+
+void memcpy_toio(volatile void __iomem *dst, const void *src, size_t count)
+{
+        __memcpy_io((void __force *)dst, src, count);
+}
+EXPORT_SYMBOL(memcpy_toio);
-- 
1.7.4.4


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

* Re: [PATCH] x86: Split off mem*io functions
  2011-12-11 22:10       ` [PATCH] x86: Split off mem*io functions Brian Gerst
@ 2011-12-11 22:15         ` Brian Gerst
  2011-12-13  9:23           ` Tim Blechmann
  2011-12-13 22:58         ` Linus Torvalds
  1 sibling, 1 reply; 91+ messages in thread
From: Brian Gerst @ 2011-12-11 22:15 UTC (permalink / raw)
  To: Tim Blechmann; +Cc: linux-kernel, hpa, torvalds, x86

On Sun, Dec 11, 2011 at 5:10 PM, Brian Gerst <brgerst@gmail.com> wrote:
> Commit 6175ddf06b6172046a329e3abfd9c901a43efd2e changed the mem*io
> functions to use the standard memcpy/memset routines, but there were
> unintended consequences.  Some devices cannot cope with 64-bit or
> non-sequential accesses that the optimized routines do.  Change them
> back to simple 32-bit sequential writes.

Tim, please test the lx6464es driver with this patch and commit
a2987855 reverted.

--
Brian Gerst

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

* Re: [PATCH] x86: Split off mem*io functions
  2011-12-11 22:15         ` Brian Gerst
@ 2011-12-13  9:23           ` Tim Blechmann
  0 siblings, 0 replies; 91+ messages in thread
From: Tim Blechmann @ 2011-12-13  9:23 UTC (permalink / raw)
  To: Brian Gerst; +Cc: linux-kernel, hpa, torvalds, x86

> > Commit 6175ddf06b6172046a329e3abfd9c901a43efd2e changed the mem*io
> > functions to use the standard memcpy/memset routines, but there were
> > unintended consequences.  Some devices cannot cope with 64-bit or
> > non-sequential accesses that the optimized routines do.  Change them
> > back to simple 32-bit sequential writes.
> 
> Tim, please test the lx6464es driver with this patch and commit
> a2987855 reverted.

unfortunately, it will take some time before i will be able to access the 
machine with the lx6464es device. will report back, when i've tested your 
patch, but it might take a few weeks ...

tim


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

* Re: [PATCH] x86: Split off mem*io functions
  2011-12-11 22:10       ` [PATCH] x86: Split off mem*io functions Brian Gerst
  2011-12-11 22:15         ` Brian Gerst
@ 2011-12-13 22:58         ` Linus Torvalds
  2011-12-13 23:47           ` H. Peter Anvin
  1 sibling, 1 reply; 91+ messages in thread
From: Linus Torvalds @ 2011-12-13 22:58 UTC (permalink / raw)
  To: Brian Gerst; +Cc: x86, linux-kernel, tim, hpa

On Sun, Dec 11, 2011 at 2:10 PM, Brian Gerst <brgerst@gmail.com> wrote:
> Commit 6175ddf06b6172046a329e3abfd9c901a43efd2e changed the mem*io
> functions to use the standard memcpy/memset routines, but there were
> unintended consequences.  Some devices cannot cope with 64-bit or
> non-sequential accesses that the optimized routines do.  Change them
> back to simple 32-bit sequential writes.

It might be worth giving examples of when the optimized routines don't work:

 - some devices (for example, traditional CGA/VGA) read and write to
different banks and bit modes, so a "read-mask-write" operation just
does not work at all. You have to do pure writes when copying to such
a destination. Afaik, none of our *current* memory copies do this for
partial words, but it's an example of something that is valid (and
sometimes done) in memcpy to avoid unaligned stores, for example.

 - Many devices do not like overlapping stores, which the optimized
memory copies *do* do. Our memory copy does things like this:

        /*
         * Move data from 4 bytes to 7 bytes.
         */
        movl (%rsi), %ecx
        movl -4(%rsi, %rdx), %r8d
        movl %ecx, (%rdi)
        movl %r8d, -4(%rdi, %rdx)

   to copy 4-7 bytes from source %rsi to destination %dsi (with %rdx
containing the size), which actually writes four bytes twice - some of
th ebytes are just going to be overlapping. This often does not work
at all for memory mapped IO.

 - the "enhanced string" support actually makes "rep movsb" the most
optimal way to copy memory, but only to cacheable RAM. If the source
or destination is memory mapped IO, the microcode will make "rep
movsb" turn into the traditional slow byte-by-byte copy. That will be
*extremely* slow, even if it might work for the device.

 - Finally, 64-bit writes may confuse some devices.

But the point being that it's a much bigger issue than just 64-bit.

                   Linus

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

* Re: [PATCH] x86: Split off mem*io functions
  2011-12-13 22:58         ` Linus Torvalds
@ 2011-12-13 23:47           ` H. Peter Anvin
  0 siblings, 0 replies; 91+ messages in thread
From: H. Peter Anvin @ 2011-12-13 23:47 UTC (permalink / raw)
  To: Linus Torvalds; +Cc: Brian Gerst, x86, linux-kernel, tim

On 12/13/2011 02:58 PM, Linus Torvalds wrote:
> 
>  - some devices (for example, traditional CGA/VGA) read and write to
> different banks and bit modes, so a "read-mask-write" operation just
> does not work at all. You have to do pure writes when copying to such
> a destination. Afaik, none of our *current* memory copies do this for
> partial words, but it's an example of something that is valid (and
> sometimes done) in memcpy to avoid unaligned stores, for example.
> 

VGA is even weirder: in some modes (which noone in their sane mind use)
you can make it do operations versus an internal buffer.  The catch is
that the internal buffer is only 8 bits wide, so anything other than
byte writes will fail in the extreme in those modes.

	-hpa


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

end of thread, other threads:[~2011-12-13 23:47 UTC | newest]

Thread overview: 91+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-12-07 16:12 [00/80] 3.0.13-stable review Greg KH
2011-12-07 16:06 ` [01/80] eCryptfs: Flush file in vma close Greg KH
2011-12-07 16:06 ` [02/80] i2c-algo-bit: Generate correct i2c address sequence for 10-bit target Greg KH
2011-12-07 16:06 ` [03/80] eCryptfs: Extend array bounds for all filename chars Greg KH
2011-12-07 16:06 ` [04/80] crypto: mv_cesa - fix hashing of chunks > 1920 bytes Greg KH
2011-12-07 16:06 ` [05/80] drm: integer overflow in drm_mode_dirtyfb_ioctl() Greg KH
2011-12-07 16:06 ` [06/80] drm/radeon/kms: fix up gpio i2c mask bits for r4xx for real Greg KH
2011-12-07 16:06 ` [07/80] drm/i915: Ivybridge still has fences! Greg KH
2011-12-07 16:06 ` [08/80] drm/i915: Turn on a required 3D clock gating bit on Sandybridge Greg KH
2011-12-07 16:06 ` [09/80] drm/i915: Turn on another required clock gating bit on gen6 Greg KH
2011-12-07 16:06 ` [10/80] drm/ttm: request zeroed system memory pages for new TT buffer objects Greg KH
2011-12-07 16:06 ` [11/80] drm/i915: fix CB tuning check for ILK+ Greg KH
2011-12-07 16:06 ` [12/80] PCI hotplug: shpchp: dont blindly claim non-AMD 0x7450 device IDs Greg KH
2011-12-07 16:06 ` [13/80] drm/radeon/kms: fix up gpio i2c mask bits for r4xx Greg KH
2011-12-07 16:06 ` [14/80] viafb: correct sync polarity for OLPC DCON Greg KH
2011-12-07 16:06 ` [15/80] ARM: pxa: fix inconsistent CONFIG_USB_PXA27X Greg KH
2011-12-07 16:06 ` [16/80] arm: mx28: fix bit operation in clock setting Greg KH
2011-12-07 16:06 ` [17/80] ARM: OMAP: smartreflex: fix IRQ handling bug Greg KH
2011-12-07 16:06 ` [18/80] ARM: OMAP2: select ARM_AMBA if OMAP3_EMU is defined Greg KH
2011-12-07 16:06 ` [19/80] ARM: 7161/1: errata: no automatic store buffer drain Greg KH
2011-12-07 16:06 ` [20/80] ALSA: lx6464es - fix device communication via command bus Greg KH
2011-12-07 17:47   ` Linus Torvalds
2011-12-07 18:00     ` H. Peter Anvin
2011-12-07 18:09       ` Linus Torvalds
2011-12-09 23:17         ` H. Peter Anvin
2011-12-08  7:55     ` Brian Gerst
2011-12-11 22:10       ` [PATCH] x86: Split off mem*io functions Brian Gerst
2011-12-11 22:15         ` Brian Gerst
2011-12-13  9:23           ` Tim Blechmann
2011-12-13 22:58         ` Linus Torvalds
2011-12-13 23:47           ` H. Peter Anvin
2011-12-07 16:06 ` [21/80] ASoC: fsl_ssi: properly initialize the sysfs attribute object Greg KH
2011-12-07 16:06 ` [22/80] ASoC: wm8753: Skip noop reconfiguration of DAI mode Greg KH
2011-12-07 16:06 ` [23/80] ASoC: Ensure WM8731 register cache is synced when resuming from disabled Greg KH
2011-12-07 16:06 ` [24/80] SUNRPC: Ensure we return EAGAIN in xs_nospace if congestion is cleared Greg KH
2011-12-07 16:06 ` [25/80] genirq: fix regression in irqfixup, irqpoll Greg KH
2011-12-07 16:06 ` [26/80] cgroup_freezer: fix freezing groups with stopped tasks Greg KH
2011-12-07 16:06 ` [27/80] timekeeping: add arch_offset hook to ktime_get functions Greg KH
2011-12-07 16:06 ` [28/80] hrtimer: Fix extra wakeups from __remove_hrtimer() Greg KH
2011-12-07 16:06 ` [29/80] p54spi: Add missing spin_lock_init Greg KH
2011-12-07 16:06 ` [30/80] p54spi: Fix workqueue deadlock Greg KH
2011-12-07 16:06 ` [31/80] rt2x00: Fix efuse EEPROM reading on PPC32 Greg KH
2011-12-07 16:06 ` [32/80] nl80211: fix MAC address validation Greg KH
2011-12-07 16:06 ` [33/80] cfg80211: fix regulatory NULL dereference Greg KH
2011-12-07 16:06 ` [34/80] mac80211: dont stop a single aggregation session twice Greg KH
2011-12-07 16:06 ` [35/80] mac80211: fix race between the AGG SM and the Tx data path Greg KH
2011-12-07 16:06 ` [36/80] hwmon: (coretemp) Fix oops on driver load Greg KH
2011-12-07 16:06 ` [37/80] revert "mfd: Fix twl4030 dependencies for audio codec" Greg KH
2011-12-07 16:06 ` [38/80] SCSI: Silencing killing requests for dead queue Greg KH
2011-12-07 16:06 ` [39/80] hugetlb: release pages in the error path of hugetlb_cow() Greg KH
2011-12-07 16:07 ` [40/80] drm/radeon/kms: add some new pci ids Greg KH
2011-12-07 16:07 ` [41/80] drm/radeon/kms: add some loop timeouts in pageflip code Greg KH
2011-12-07 16:07 ` [42/80] firmware: Sigma: Prevent out of bounds memory access Greg KH
2011-12-07 16:07 ` [43/80] firmware: Sigma: Skip header during CRC generation Greg KH
2011-12-07 16:07 ` [44/80] firmware: Sigma: Fix endianess issues Greg KH
2011-12-07 16:07 ` [45/80] staging: usbip: bugfix for deadlock Greg KH
2011-12-07 16:07 ` [46/80] staging: comedi: fix oops for USB DAQ devices Greg KH
2011-12-07 16:07 ` [47/80] Staging: comedi: fix mmap_count Greg KH
2011-12-07 16:07 ` [48/80] Staging: comedi: fix signal handling in read and write Greg KH
2011-12-07 16:07 ` [49/80] USB: whci-hcd: fix endian conversion in qset_clear() Greg KH
2011-12-07 16:07 ` [50/80] HID: Correct General touch PID Greg KH
2011-12-07 16:07 ` [51/80] usb: ftdi_sio: add PID for Propox ISPcable III Greg KH
2011-12-07 16:07 ` [52/80] usb: option: add Huawei E353 controlling interfaces Greg KH
2011-12-07 16:07 ` [53/80] usb: option: add SIMCom SIM5218 Greg KH
2011-12-07 16:07 ` [54/80] USB: usb-storage: unusual_devs entry for Kingston DT 101 G2 Greg KH
2011-12-07 16:07 ` [55/80] USB: EHCI: fix HUB TT scheduling issue with iso transfer Greg KH
2011-12-07 16:07 ` [56/80] EHCI : Fix a regression in the ISO scheduler Greg KH
2011-12-07 16:07 ` [57/80] xHCI: fix bug in xhci_clear_command_ring() Greg KH
2011-12-07 16:07 ` [58/80] sched, x86: Avoid unnecessary overflow in sched_clock Greg KH
2011-12-07 16:07 ` [59/80] x86/mpparse: Account for bus types other than ISA and PCI Greg KH
2011-12-07 16:07 ` [60/80] x86: Fix "Acer Aspire 1" reboot hang Greg KH
2011-12-07 16:07 ` [61/80] x86/paravirt: PTE updates in k(un)map_atomic need to be synchronous, regardless of lazy_mmu mode Greg KH
2011-12-07 16:07 ` [62/80] perf/x86: Fix PEBS instruction unwind Greg KH
2011-12-07 16:07 ` [63/80] oprofile, x86: Fix crash when unloading module (nmi timer mode) Greg KH
2011-12-07 16:07 ` [64/80] [S390] add missing .set function for NT_S390_LAST_BREAK regset Greg KH
2011-12-07 16:07 ` [65/80] cfg80211: fix race on init and driver registration Greg KH
2011-12-07 16:07 ` [66/80] cfg80211: amend regulatory NULL dereference fix Greg KH
2011-12-07 16:07 ` [67/80] genirq: Fix race condition when stopping the irq thread Greg KH
2011-12-07 16:07 ` [68/80] NFS: Prevent 3.0 from crashing if it receives a partial layout Greg KH
2011-12-07 16:07 ` [69/80] xfs: validate acl count Greg KH
2011-12-07 16:07 ` [70/80] xfs: force buffer writeback before blocking on the ilock in inode reclaim Greg KH
2011-12-07 16:07 ` [71/80] xfs: fix attr2 vs large data fork assert Greg KH
2011-12-07 16:07 ` [72/80] trace_events_filter: Use rcu_assign_pointer() when setting ftrace_event_call->filter Greg KH
2011-12-07 16:07 ` [73/80] rtc: Disable the alarm in the hardware Greg KH
2011-12-07 16:07 ` [74/80] tracing: fix event_subsystem ref counting Greg KH
2011-12-07 16:07 ` [75/80] tick-broadcast: Stop active broadcast device when replacing it Greg KH
2011-12-07 16:07 ` [76/80] perf: Fix parsing of __print_flags() in TP_printk() Greg KH
2011-12-07 16:07 ` [77/80] jump_label: jump_label_inc may return before the code is patched Greg KH
2011-12-07 16:07 ` [78/80] oprofile: Fix crash when unloading module (hr timer mode) Greg KH
2011-12-07 16:07 ` [79/80] clocksource: Fix bug with max_deferment margin calculation Greg KH
2011-12-07 16:07 ` [80/80] clockevents: Set noop handler in clockevents_exchange_device() Greg KH

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).