All of lore.kernel.org
 help / color / mirror / Atom feed
* [001/117] USB: EHCI: defer reclamation of siTDs
  2010-05-10 22:37 [000/117] 2.6.33.4-stable review Greg KH
@ 2010-05-10 22:31 ` Greg KH
  2010-05-10 22:31 ` [002/117] p54usb: Add usbid for Corega CG-WLUSB2GT Greg KH
                   ` (115 subsequent siblings)
  116 siblings, 0 replies; 130+ messages in thread
From: Greg KH @ 2010-05-10 22:31 UTC (permalink / raw)
  To: linux-kernel, stable; +Cc: stable-review, torvalds, akpm, alan, Alan Stern

2.6.33-stable review patch.  If anyone has any objections, please let us know.

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

commit 0e5f231bc16ff9910882fa5b9d64d80e7691cfab upstream.

This patch (as1369) fixes a problem in ehci-hcd.  Some controllers
occasionally run into trouble when the driver reclaims siTDs too
quickly.  This can happen while streaming audio; it causes the
controller to crash.

The patch changes siTD reclamation to work the same way as iTD
reclamation: Completed siTDs are stored on a list and not reused until
at least one frame has passed.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Tested-by: Nate Case <ncase@xes-inc.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

---
 drivers/usb/host/ehci-hcd.c   |    1 +
 drivers/usb/host/ehci-mem.c   |    2 +-
 drivers/usb/host/ehci-sched.c |   38 ++++++++++++++++++++++++++++++--------
 drivers/usb/host/ehci.h       |    5 +++--
 4 files changed, 35 insertions(+), 11 deletions(-)

--- a/drivers/usb/host/ehci-hcd.c
+++ b/drivers/usb/host/ehci-hcd.c
@@ -543,6 +543,7 @@ static int ehci_init(struct usb_hcd *hcd
 	 */
 	ehci->periodic_size = DEFAULT_I_TDPS;
 	INIT_LIST_HEAD(&ehci->cached_itd_list);
+	INIT_LIST_HEAD(&ehci->cached_sitd_list);
 	if ((retval = ehci_mem_init(ehci, GFP_KERNEL)) < 0)
 		return retval;
 
--- a/drivers/usb/host/ehci-mem.c
+++ b/drivers/usb/host/ehci-mem.c
@@ -136,7 +136,7 @@ static inline void qh_put (struct ehci_q
 
 static void ehci_mem_cleanup (struct ehci_hcd *ehci)
 {
-	free_cached_itd_list(ehci);
+	free_cached_lists(ehci);
 	if (ehci->async)
 		qh_put (ehci->async);
 	ehci->async = NULL;
--- a/drivers/usb/host/ehci-sched.c
+++ b/drivers/usb/host/ehci-sched.c
@@ -2137,13 +2137,27 @@ sitd_complete (
 			(stream->bEndpointAddress & USB_DIR_IN) ? "in" : "out");
 	}
 	iso_stream_put (ehci, stream);
-	/* OK to recycle this SITD now that its completion callback ran. */
+
 done:
 	sitd->urb = NULL;
-	sitd->stream = NULL;
-	list_move(&sitd->sitd_list, &stream->free_list);
-	iso_stream_put(ehci, stream);
-
+	if (ehci->clock_frame != sitd->frame) {
+		/* OK to recycle this SITD now. */
+		sitd->stream = NULL;
+		list_move(&sitd->sitd_list, &stream->free_list);
+		iso_stream_put(ehci, stream);
+	} else {
+		/* HW might remember this SITD, so we can't recycle it yet.
+		 * Move it to a safe place until a new frame starts.
+		 */
+		list_move(&sitd->sitd_list, &ehci->cached_sitd_list);
+		if (stream->refcount == 2) {
+			/* If iso_stream_put() were called here, stream
+			 * would be freed.  Instead, just prevent reuse.
+			 */
+			stream->ep->hcpriv = NULL;
+			stream->ep = NULL;
+		}
+	}
 	return retval;
 }
 
@@ -2209,9 +2223,10 @@ done:
 
 /*-------------------------------------------------------------------------*/
 
-static void free_cached_itd_list(struct ehci_hcd *ehci)
+static void free_cached_lists(struct ehci_hcd *ehci)
 {
 	struct ehci_itd *itd, *n;
+	struct ehci_sitd *sitd, *sn;
 
 	list_for_each_entry_safe(itd, n, &ehci->cached_itd_list, itd_list) {
 		struct ehci_iso_stream	*stream = itd->stream;
@@ -2219,6 +2234,13 @@ static void free_cached_itd_list(struct
 		list_move(&itd->itd_list, &stream->free_list);
 		iso_stream_put(ehci, stream);
 	}
+
+	list_for_each_entry_safe(sitd, sn, &ehci->cached_sitd_list, sitd_list) {
+		struct ehci_iso_stream	*stream = sitd->stream;
+		sitd->stream = NULL;
+		list_move(&sitd->sitd_list, &stream->free_list);
+		iso_stream_put(ehci, stream);
+	}
 }
 
 /*-------------------------------------------------------------------------*/
@@ -2245,7 +2267,7 @@ scan_periodic (struct ehci_hcd *ehci)
 		clock_frame = -1;
 	}
 	if (ehci->clock_frame != clock_frame) {
-		free_cached_itd_list(ehci);
+		free_cached_lists(ehci);
 		ehci->clock_frame = clock_frame;
 	}
 	clock %= mod;
@@ -2408,7 +2430,7 @@ restart:
 			clock = now;
 			clock_frame = clock >> 3;
 			if (ehci->clock_frame != clock_frame) {
-				free_cached_itd_list(ehci);
+				free_cached_lists(ehci);
 				ehci->clock_frame = clock_frame;
 			}
 		} else {
--- a/drivers/usb/host/ehci.h
+++ b/drivers/usb/host/ehci.h
@@ -87,8 +87,9 @@ struct ehci_hcd {			/* one per controlle
 	int			next_uframe;	/* scan periodic, start here */
 	unsigned		periodic_sched;	/* periodic activity count */
 
-	/* list of itds completed while clock_frame was still active */
+	/* list of itds & sitds completed while clock_frame was still active */
 	struct list_head	cached_itd_list;
+	struct list_head	cached_sitd_list;
 	unsigned		clock_frame;
 
 	/* per root hub port */
@@ -195,7 +196,7 @@ timer_action_done (struct ehci_hcd *ehci
 	clear_bit (action, &ehci->actions);
 }
 
-static void free_cached_itd_list(struct ehci_hcd *ehci);
+static void free_cached_lists(struct ehci_hcd *ehci);
 
 /*-------------------------------------------------------------------------*/
 



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

* [002/117] p54usb: Add usbid for Corega CG-WLUSB2GT.
  2010-05-10 22:37 [000/117] 2.6.33.4-stable review Greg KH
  2010-05-10 22:31 ` [001/117] USB: EHCI: defer reclamation of siTDs Greg KH
@ 2010-05-10 22:31 ` Greg KH
  2010-05-10 22:31 ` [003/117] drm/i915: Add initial bits for VGA modesetting bringup on Sandybridge Greg KH
                   ` (114 subsequent siblings)
  116 siblings, 0 replies; 130+ messages in thread
From: Greg KH @ 2010-05-10 22:31 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: stable-review, torvalds, akpm, alan, Shimada Hirofumi,
	YOSHIFUJI Hideaki, John W. Linville, maximilian attems

2.6.33-stable review patch.  If anyone has any objections, please let us know.

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

From: Shimada Hirofumi <hirofumi@flycat.org>

commit 15a69a81731d337a3d9db51692ff8704c1114f43 upstream.

Signed-off-by: Shimada Hirofumi <hirofumi@flycat.org>
Signed-off-by: YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Cc: maximilian attems <max@stro.at>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

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

--- a/drivers/net/wireless/p54/p54usb.c
+++ b/drivers/net/wireless/p54/p54usb.c
@@ -36,6 +36,7 @@ static struct usb_device_id p54u_table[]
 	/* Version 1 devices (pci chip + net2280) */
 	{USB_DEVICE(0x0506, 0x0a11)},	/* 3COM 3CRWE254G72 */
 	{USB_DEVICE(0x0707, 0xee06)},	/* SMC 2862W-G */
+	{USB_DEVICE(0x07aa, 0x001c)},	/* Corega CG-WLUSB2GT */
 	{USB_DEVICE(0x083a, 0x4501)},	/* Accton 802.11g WN4501 USB */
 	{USB_DEVICE(0x083a, 0x4502)},	/* Siemens Gigaset USB Adapter */
 	{USB_DEVICE(0x083a, 0x5501)},	/* Phillips CPWUA054 */



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

* [003/117] drm/i915: Add initial bits for VGA modesetting bringup on Sandybridge.
  2010-05-10 22:37 [000/117] 2.6.33.4-stable review Greg KH
  2010-05-10 22:31 ` [001/117] USB: EHCI: defer reclamation of siTDs Greg KH
  2010-05-10 22:31 ` [002/117] p54usb: Add usbid for Corega CG-WLUSB2GT Greg KH
@ 2010-05-10 22:31 ` Greg KH
  2010-05-11  2:47   ` Eric Anholt
  2010-05-10 22:31 ` [004/117] drm/i915: fix tiling limits for i915 class hw v2 Greg KH
                   ` (113 subsequent siblings)
  116 siblings, 1 reply; 130+ messages in thread
From: Greg KH @ 2010-05-10 22:31 UTC (permalink / raw)
  To: linux-kernel, stable; +Cc: stable-review, torvalds, akpm, alan, Eric Anholt

2.6.33-stable review patch.  If anyone has any objections, please let us know.

------------------
From: Eric Anholt <eric@anholt.net>

commit bad720ff3e8e47a04bd88d9bbc8317e7d7e049d3 upstream.

[needed for stable as it's just a bunch of macros that other drm patches
need, it changes no code functionality besides adding support for a new
device type. - gregkh]

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

---
 drivers/gpu/drm/i915/i915_debugfs.c    |    2 -
 drivers/gpu/drm/i915/i915_dma.c        |   16 ++++++---
 drivers/gpu/drm/i915/i915_drv.h        |   26 ++++++++++++++-
 drivers/gpu/drm/i915/i915_gem.c        |    2 -
 drivers/gpu/drm/i915/i915_gem_tiling.c |    2 -
 drivers/gpu/drm/i915/i915_irq.c        |   18 +++++-----
 drivers/gpu/drm/i915/intel_bios.c      |    3 +
 drivers/gpu/drm/i915/intel_crt.c       |   14 ++++----
 drivers/gpu/drm/i915/intel_display.c   |   56 ++++++++++++++++-----------------
 drivers/gpu/drm/i915/intel_lvds.c      |    2 -
 drivers/gpu/drm/i915/intel_overlay.c   |    2 -
 include/drm/drm_pciids.h               |    1 
 12 files changed, 88 insertions(+), 56 deletions(-)

--- a/drivers/gpu/drm/i915/i915_debugfs.c
+++ b/drivers/gpu/drm/i915/i915_debugfs.c
@@ -162,7 +162,7 @@ static int i915_interrupt_info(struct se
 	struct drm_device *dev = node->minor->dev;
 	drm_i915_private_t *dev_priv = dev->dev_private;
 
-	if (!IS_IRONLAKE(dev)) {
+	if (!HAS_PCH_SPLIT(dev)) {
 		seq_printf(m, "Interrupt enable:    %08x\n",
 			   I915_READ(IER));
 		seq_printf(m, "Interrupt identity:  %08x\n",
--- a/drivers/gpu/drm/i915/i915_dma.c
+++ b/drivers/gpu/drm/i915/i915_dma.c
@@ -978,15 +978,21 @@ static int i915_probe_agp(struct drm_dev
 	 * Some of the preallocated space is taken by the GTT
 	 * and popup.  GTT is 1K per MB of aperture size, and popup is 4K.
 	 */
-	if (IS_G4X(dev) || IS_PINEVIEW(dev) || IS_IRONLAKE(dev))
+	if (IS_G4X(dev) || IS_PINEVIEW(dev) || IS_IRONLAKE(dev) || IS_GEN6(dev))
 		overhead = 4096;
 	else
 		overhead = (*aperture_size / 1024) + 4096;
 
 	switch (tmp & INTEL_GMCH_GMS_MASK) {
 	case INTEL_855_GMCH_GMS_DISABLED:
-		DRM_ERROR("video memory is disabled\n");
-		return -1;
+		/* XXX: This is what my A1 silicon has. */
+		if (IS_GEN6(dev)) {
+			stolen = 64 * 1024 * 1024;
+		} else {
+			DRM_ERROR("video memory is disabled\n");
+			return -1;
+		}
+		break;
 	case INTEL_855_GMCH_GMS_STOLEN_1M:
 		stolen = 1 * 1024 * 1024;
 		break;
@@ -1064,7 +1070,7 @@ static unsigned long i915_gtt_to_phys(st
 	int gtt_offset, gtt_size;
 
 	if (IS_I965G(dev)) {
-		if (IS_G4X(dev) || IS_IRONLAKE(dev)) {
+		if (IS_G4X(dev) || IS_IRONLAKE(dev) || IS_GEN6(dev)) {
 			gtt_offset = 2*1024*1024;
 			gtt_size = 2*1024*1024;
 		} else {
@@ -1445,7 +1451,7 @@ int i915_driver_load(struct drm_device *
 
 	dev->driver->get_vblank_counter = i915_get_vblank_counter;
 	dev->max_vblank_count = 0xffffff; /* only 24 bits of frame count */
-	if (IS_G4X(dev) || IS_IRONLAKE(dev)) {
+	if (IS_G4X(dev) || IS_IRONLAKE(dev) || IS_GEN6(dev)) {
 		dev->max_vblank_count = 0xffffffff; /* full 32 bit counter */
 		dev->driver->get_vblank_counter = gm45_get_vblank_counter;
 	}
--- a/drivers/gpu/drm/i915/i915_drv.h
+++ b/drivers/gpu/drm/i915/i915_drv.h
@@ -1026,7 +1026,7 @@ extern int i915_wait_ring(struct drm_dev
 #define IS_845G(dev)		((dev)->pci_device == 0x2562)
 #define IS_I85X(dev)		((dev)->pci_device == 0x3582)
 #define IS_I865G(dev)		((dev)->pci_device == 0x2572)
-#define IS_I8XX(dev)		(INTEL_INFO(dev)->is_i8xx)
+#define IS_GEN2(dev)		(INTEL_INFO(dev)->is_i8xx)
 #define IS_I915G(dev)		(INTEL_INFO(dev)->is_i915g)
 #define IS_I915GM(dev)		((dev)->pci_device == 0x2592)
 #define IS_I945G(dev)		((dev)->pci_device == 0x2772)
@@ -1045,8 +1045,29 @@ extern int i915_wait_ring(struct drm_dev
 #define IS_I9XX(dev)		(INTEL_INFO(dev)->is_i9xx)
 #define IS_MOBILE(dev)		(INTEL_INFO(dev)->is_mobile)
 
+#define IS_GEN3(dev)	(IS_I915G(dev) ||			\
+			 IS_I915GM(dev) ||			\
+			 IS_I945G(dev) ||			\
+			 IS_I945GM(dev) ||			\
+			 IS_G33(dev) || \
+			 IS_PINEVIEW(dev))
+#define IS_GEN4(dev)	((dev)->pci_device == 0x2972 ||		\
+			 (dev)->pci_device == 0x2982 ||		\
+			 (dev)->pci_device == 0x2992 ||		\
+			 (dev)->pci_device == 0x29A2 ||		\
+			 (dev)->pci_device == 0x2A02 ||		\
+			 (dev)->pci_device == 0x2A12 ||		\
+			 (dev)->pci_device == 0x2E02 ||		\
+			 (dev)->pci_device == 0x2E12 ||		\
+			 (dev)->pci_device == 0x2E22 ||		\
+			 (dev)->pci_device == 0x2E32 ||		\
+			 (dev)->pci_device == 0x2A42 ||		\
+			 (dev)->pci_device == 0x2E42)
+
 #define I915_NEED_GFX_HWS(dev)	(INTEL_INFO(dev)->need_gfx_hws)
 
+#define IS_GEN6(dev)	((dev)->pci_device == 0x0102)
+
 /* With the 945 and later, Y tiling got adjusted so that it was 32 128-byte
  * rows, which changed the alignment requirements and fence programming.
  */
@@ -1067,6 +1088,9 @@ extern int i915_wait_ring(struct drm_dev
 #define I915_HAS_FBC(dev) (INTEL_INFO(dev)->has_fbc)
 #define I915_HAS_RC6(dev) (INTEL_INFO(dev)->has_rc6)
 
+#define HAS_PCH_SPLIT(dev) (IS_IRONLAKE(dev) ||	\
+			    IS_GEN6(dev))
+
 #define PRIMARY_RINGBUFFER_SIZE         (128*1024)
 
 #endif
--- a/drivers/gpu/drm/i915/i915_gem.c
+++ b/drivers/gpu/drm/i915/i915_gem.c
@@ -1819,7 +1819,7 @@ i915_do_wait_request(struct drm_device *
 		return -EIO;
 
 	if (!i915_seqno_passed(i915_get_gem_seqno(dev), seqno)) {
-		if (IS_IRONLAKE(dev))
+		if (HAS_PCH_SPLIT(dev))
 			ier = I915_READ(DEIER) | I915_READ(GTIER);
 		else
 			ier = I915_READ(IER);
--- a/drivers/gpu/drm/i915/i915_gem_tiling.c
+++ b/drivers/gpu/drm/i915/i915_gem_tiling.c
@@ -209,7 +209,7 @@ i915_gem_detect_bit_6_swizzle(struct drm
 	uint32_t swizzle_y = I915_BIT_6_SWIZZLE_UNKNOWN;
 	bool need_disable;
 
-	if (IS_IRONLAKE(dev)) {
+	if (IS_IRONLAKE(dev) || IS_GEN6(dev)) {
 		/* On Ironlake whatever DRAM config, GPU always do
 		 * same swizzling setup.
 		 */
--- a/drivers/gpu/drm/i915/i915_irq.c
+++ b/drivers/gpu/drm/i915/i915_irq.c
@@ -576,7 +576,7 @@ irqreturn_t i915_driver_irq_handler(DRM_
 
 	atomic_inc(&dev_priv->irq_received);
 
-	if (IS_IRONLAKE(dev))
+	if (HAS_PCH_SPLIT(dev))
 		return ironlake_irq_handler(dev);
 
 	iir = I915_READ(IIR);
@@ -737,7 +737,7 @@ void i915_user_irq_get(struct drm_device
 
 	spin_lock_irqsave(&dev_priv->user_irq_lock, irqflags);
 	if (dev->irq_enabled && (++dev_priv->user_irq_refcount == 1)) {
-		if (IS_IRONLAKE(dev))
+		if (HAS_PCH_SPLIT(dev))
 			ironlake_enable_graphics_irq(dev_priv, GT_USER_INTERRUPT);
 		else
 			i915_enable_irq(dev_priv, I915_USER_INTERRUPT);
@@ -753,7 +753,7 @@ void i915_user_irq_put(struct drm_device
 	spin_lock_irqsave(&dev_priv->user_irq_lock, irqflags);
 	BUG_ON(dev->irq_enabled && dev_priv->user_irq_refcount <= 0);
 	if (dev->irq_enabled && (--dev_priv->user_irq_refcount == 0)) {
-		if (IS_IRONLAKE(dev))
+		if (HAS_PCH_SPLIT(dev))
 			ironlake_disable_graphics_irq(dev_priv, GT_USER_INTERRUPT);
 		else
 			i915_disable_irq(dev_priv, I915_USER_INTERRUPT);
@@ -861,7 +861,7 @@ int i915_enable_vblank(struct drm_device
 		return -EINVAL;
 
 	spin_lock_irqsave(&dev_priv->user_irq_lock, irqflags);
-	if (IS_IRONLAKE(dev))
+	if (HAS_PCH_SPLIT(dev))
 		ironlake_enable_display_irq(dev_priv, (pipe == 0) ? 
 					    DE_PIPEA_VBLANK: DE_PIPEB_VBLANK);
 	else if (IS_I965G(dev))
@@ -883,7 +883,7 @@ void i915_disable_vblank(struct drm_devi
 	unsigned long irqflags;
 
 	spin_lock_irqsave(&dev_priv->user_irq_lock, irqflags);
-	if (IS_IRONLAKE(dev))
+	if (HAS_PCH_SPLIT(dev))
 		ironlake_disable_display_irq(dev_priv, (pipe == 0) ? 
 					     DE_PIPEA_VBLANK: DE_PIPEB_VBLANK);
 	else
@@ -897,7 +897,7 @@ void i915_enable_interrupt (struct drm_d
 {
 	struct drm_i915_private *dev_priv = dev->dev_private;
 
-	if (!IS_IRONLAKE(dev))
+	if (!HAS_PCH_SPLIT(dev))
 		opregion_enable_asle(dev);
 	dev_priv->irq_enabled = 1;
 }
@@ -1076,7 +1076,7 @@ void i915_driver_irq_preinstall(struct d
 	INIT_WORK(&dev_priv->hotplug_work, i915_hotplug_work_func);
 	INIT_WORK(&dev_priv->error_work, i915_error_work_func);
 
-	if (IS_IRONLAKE(dev)) {
+	if (HAS_PCH_SPLIT(dev)) {
 		ironlake_irq_preinstall(dev);
 		return;
 	}
@@ -1108,7 +1108,7 @@ int i915_driver_irq_postinstall(struct d
 
 	dev_priv->vblank_pipe = DRM_I915_VBLANK_PIPE_A | DRM_I915_VBLANK_PIPE_B;
 
-	if (IS_IRONLAKE(dev))
+	if (HAS_PCH_SPLIT(dev))
 		return ironlake_irq_postinstall(dev);
 
 	/* Unmask the interrupts that we always want on. */
@@ -1196,7 +1196,7 @@ void i915_driver_irq_uninstall(struct dr
 
 	dev_priv->vblank_pipe = 0;
 
-	if (IS_IRONLAKE(dev)) {
+	if (HAS_PCH_SPLIT(dev)) {
 		ironlake_irq_uninstall(dev);
 		return;
 	}
--- a/drivers/gpu/drm/i915/intel_bios.c
+++ b/drivers/gpu/drm/i915/intel_bios.c
@@ -247,6 +247,7 @@ static void
 parse_general_features(struct drm_i915_private *dev_priv,
 		       struct bdb_header *bdb)
 {
+	struct drm_device *dev = dev_priv->dev;
 	struct bdb_general_features *general;
 
 	/* Set sensible defaults in case we can't find the general block */
@@ -263,7 +264,7 @@ parse_general_features(struct drm_i915_p
 			if (IS_I85X(dev_priv->dev))
 				dev_priv->lvds_ssc_freq =
 					general->ssc_freq ? 66 : 48;
-			else if (IS_IRONLAKE(dev_priv->dev))
+			else if (IS_IRONLAKE(dev_priv->dev) || IS_GEN6(dev))
 				dev_priv->lvds_ssc_freq =
 					general->ssc_freq ? 100 : 120;
 			else
--- a/drivers/gpu/drm/i915/intel_crt.c
+++ b/drivers/gpu/drm/i915/intel_crt.c
@@ -39,7 +39,7 @@ static void intel_crt_dpms(struct drm_en
 	struct drm_i915_private *dev_priv = dev->dev_private;
 	u32 temp, reg;
 
-	if (IS_IRONLAKE(dev))
+	if (HAS_PCH_SPLIT(dev))
 		reg = PCH_ADPA;
 	else
 		reg = ADPA;
@@ -113,7 +113,7 @@ static void intel_crt_mode_set(struct dr
 	else
 		dpll_md_reg = DPLL_B_MD;
 
-	if (IS_IRONLAKE(dev))
+	if (HAS_PCH_SPLIT(dev))
 		adpa_reg = PCH_ADPA;
 	else
 		adpa_reg = ADPA;
@@ -122,7 +122,7 @@ static void intel_crt_mode_set(struct dr
 	 * Disable separate mode multiplier used when cloning SDVO to CRT
 	 * XXX this needs to be adjusted when we really are cloning
 	 */
-	if (IS_I965G(dev) && !IS_IRONLAKE(dev)) {
+	if (IS_I965G(dev) && !HAS_PCH_SPLIT(dev)) {
 		dpll_md = I915_READ(dpll_md_reg);
 		I915_WRITE(dpll_md_reg,
 			   dpll_md & ~DPLL_MD_UDI_MULTIPLIER_MASK);
@@ -136,11 +136,11 @@ static void intel_crt_mode_set(struct dr
 
 	if (intel_crtc->pipe == 0) {
 		adpa |= ADPA_PIPE_A_SELECT;
-		if (!IS_IRONLAKE(dev))
+		if (!HAS_PCH_SPLIT(dev))
 			I915_WRITE(BCLRPAT_A, 0);
 	} else {
 		adpa |= ADPA_PIPE_B_SELECT;
-		if (!IS_IRONLAKE(dev))
+		if (!HAS_PCH_SPLIT(dev))
 			I915_WRITE(BCLRPAT_B, 0);
 	}
 
@@ -202,7 +202,7 @@ static bool intel_crt_detect_hotplug(str
 	u32 hotplug_en;
 	int i, tries = 0;
 
-	if (IS_IRONLAKE(dev))
+	if (HAS_PCH_SPLIT(dev))
 		return intel_ironlake_crt_detect_hotplug(connector);
 
 	/*
@@ -524,7 +524,7 @@ void intel_crt_init(struct drm_device *d
 					  &intel_output->enc);
 
 	/* Set up the DDC bus. */
-	if (IS_IRONLAKE(dev))
+	if (HAS_PCH_SPLIT(dev))
 		i2c_reg = PCH_GPIOA;
 	else {
 		i2c_reg = GPIOA;
--- a/drivers/gpu/drm/i915/intel_display.c
+++ b/drivers/gpu/drm/i915/intel_display.c
@@ -232,7 +232,7 @@ struct intel_limit {
 #define G4X_P2_DISPLAY_PORT_FAST           10
 #define G4X_P2_DISPLAY_PORT_LIMIT          0
 
-/* Ironlake */
+/* Ironlake / Sandybridge */
 /* as we calculate clock using (register_value + 2) for
    N/M1/M2, so here the range value for them is (actual_value-2).
  */
@@ -690,7 +690,7 @@ static const intel_limit_t *intel_limit(
 	struct drm_device *dev = crtc->dev;
 	const intel_limit_t *limit;
 
-	if (IS_IRONLAKE(dev))
+	if (HAS_PCH_SPLIT(dev))
 		limit = intel_ironlake_limit(crtc);
 	else if (IS_G4X(dev)) {
 		limit = intel_g4x_limit(crtc);
@@ -1366,7 +1366,7 @@ intel_pipe_set_base(struct drm_crtc *crt
 			dspcntr &= ~DISPPLANE_TILED;
 	}
 
-	if (IS_IRONLAKE(dev))
+	if (HAS_PCH_SPLIT(dev))
 		/* must disable */
 		dspcntr |= DISPPLANE_TRICKLE_FEED_DISABLE;
 
@@ -1427,7 +1427,7 @@ static void i915_disable_vga (struct drm
 	u8 sr1;
 	u32 vga_reg;
 
-	if (IS_IRONLAKE(dev))
+	if (HAS_PCH_SPLIT(dev))
 		vga_reg = CPU_VGACNTRL;
 	else
 		vga_reg = VGACNTRL;
@@ -2111,7 +2111,7 @@ static bool intel_crtc_mode_fixup(struct
 				  struct drm_display_mode *adjusted_mode)
 {
 	struct drm_device *dev = crtc->dev;
-	if (IS_IRONLAKE(dev)) {
+	if (HAS_PCH_SPLIT(dev)) {
 		/* FDI link clock is fixed at 2.7G */
 		if (mode->clock * 3 > 27000 * 4)
 			return MODE_CLOCK_HIGH;
@@ -2967,7 +2967,7 @@ static int intel_crtc_mode_set(struct dr
 					refclk / 1000);
 	} else if (IS_I9XX(dev)) {
 		refclk = 96000;
-		if (IS_IRONLAKE(dev))
+		if (HAS_PCH_SPLIT(dev))
 			refclk = 120000; /* 120Mhz refclk */
 	} else {
 		refclk = 48000;
@@ -3025,7 +3025,7 @@ static int intel_crtc_mode_set(struct dr
 	}
 
 	/* FDI link */
-	if (IS_IRONLAKE(dev)) {
+	if (HAS_PCH_SPLIT(dev)) {
 		int lane, link_bw, bpp;
 		/* eDP doesn't require FDI link, so just set DP M/N
 		   according to current link config */
@@ -3102,7 +3102,7 @@ static int intel_crtc_mode_set(struct dr
 	 * PCH B stepping, previous chipset stepping should be
 	 * ignoring this setting.
 	 */
-	if (IS_IRONLAKE(dev)) {
+	if (HAS_PCH_SPLIT(dev)) {
 		temp = I915_READ(PCH_DREF_CONTROL);
 		/* Always enable nonspread source */
 		temp &= ~DREF_NONSPREAD_SOURCE_MASK;
@@ -3149,7 +3149,7 @@ static int intel_crtc_mode_set(struct dr
 				reduced_clock.m2;
 	}
 
-	if (!IS_IRONLAKE(dev))
+	if (!HAS_PCH_SPLIT(dev))
 		dpll = DPLL_VGA_MODE_DIS;
 
 	if (IS_I9XX(dev)) {
@@ -3162,7 +3162,7 @@ static int intel_crtc_mode_set(struct dr
 			sdvo_pixel_multiply = adjusted_mode->clock / mode->clock;
 			if (IS_I945G(dev) || IS_I945GM(dev) || IS_G33(dev))
 				dpll |= (sdvo_pixel_multiply - 1) << SDVO_MULTIPLIER_SHIFT_HIRES;
-			else if (IS_IRONLAKE(dev))
+			else if (HAS_PCH_SPLIT(dev))
 				dpll |= (sdvo_pixel_multiply - 1) << PLL_REF_SDVO_HDMI_MULTIPLIER_SHIFT;
 		}
 		if (is_dp)
@@ -3174,7 +3174,7 @@ static int intel_crtc_mode_set(struct dr
 		else {
 			dpll |= (1 << (clock.p1 - 1)) << DPLL_FPA01_P1_POST_DIV_SHIFT;
 			/* also FPA1 */
-			if (IS_IRONLAKE(dev))
+			if (HAS_PCH_SPLIT(dev))
 				dpll |= (1 << (clock.p1 - 1)) << DPLL_FPA1_P1_POST_DIV_SHIFT;
 			if (IS_G4X(dev) && has_reduced_clock)
 				dpll |= (1 << (reduced_clock.p1 - 1)) << DPLL_FPA1_P1_POST_DIV_SHIFT;
@@ -3193,7 +3193,7 @@ static int intel_crtc_mode_set(struct dr
 			dpll |= DPLLB_LVDS_P2_CLOCK_DIV_14;
 			break;
 		}
-		if (IS_I965G(dev) && !IS_IRONLAKE(dev))
+		if (IS_I965G(dev) && !HAS_PCH_SPLIT(dev))
 			dpll |= (6 << PLL_LOAD_PULSE_PHASE_SHIFT);
 	} else {
 		if (is_lvds) {
@@ -3227,7 +3227,7 @@ static int intel_crtc_mode_set(struct dr
 
 	/* Ironlake's plane is forced to pipe, bit 24 is to
 	   enable color space conversion */
-	if (!IS_IRONLAKE(dev)) {
+	if (!HAS_PCH_SPLIT(dev)) {
 		if (pipe == 0)
 			dspcntr &= ~DISPPLANE_SEL_PIPE_MASK;
 		else
@@ -3254,14 +3254,14 @@ static int intel_crtc_mode_set(struct dr
 
 
 	/* Disable the panel fitter if it was on our pipe */
-	if (!IS_IRONLAKE(dev) && intel_panel_fitter_pipe(dev) == pipe)
+	if (!HAS_PCH_SPLIT(dev) && intel_panel_fitter_pipe(dev) == pipe)
 		I915_WRITE(PFIT_CONTROL, 0);
 
 	DRM_DEBUG_KMS("Mode for pipe %c:\n", pipe == 0 ? 'A' : 'B');
 	drm_mode_debug_printmodeline(mode);
 
 	/* assign to Ironlake registers */
-	if (IS_IRONLAKE(dev)) {
+	if (HAS_PCH_SPLIT(dev)) {
 		fp_reg = pch_fp_reg;
 		dpll_reg = pch_dpll_reg;
 	}
@@ -3282,7 +3282,7 @@ static int intel_crtc_mode_set(struct dr
 	if (is_lvds) {
 		u32 lvds;
 
-		if (IS_IRONLAKE(dev))
+		if (HAS_PCH_SPLIT(dev))
 			lvds_reg = PCH_LVDS;
 
 		lvds = I915_READ(lvds_reg);
@@ -3328,7 +3328,7 @@ static int intel_crtc_mode_set(struct dr
 		/* Wait for the clocks to stabilize. */
 		udelay(150);
 
-		if (IS_I965G(dev) && !IS_IRONLAKE(dev)) {
+		if (IS_I965G(dev) && !HAS_PCH_SPLIT(dev)) {
 			if (is_sdvo) {
 				sdvo_pixel_multiply = adjusted_mode->clock / mode->clock;
 				I915_WRITE(dpll_md_reg, (0 << DPLL_MD_UDI_DIVIDER_SHIFT) |
@@ -3375,14 +3375,14 @@ static int intel_crtc_mode_set(struct dr
 	/* pipesrc and dspsize control the size that is scaled from, which should
 	 * always be the user's requested size.
 	 */
-	if (!IS_IRONLAKE(dev)) {
+	if (!HAS_PCH_SPLIT(dev)) {
 		I915_WRITE(dspsize_reg, ((mode->vdisplay - 1) << 16) |
 				(mode->hdisplay - 1));
 		I915_WRITE(dsppos_reg, 0);
 	}
 	I915_WRITE(pipesrc_reg, ((mode->hdisplay - 1) << 16) | (mode->vdisplay - 1));
 
-	if (IS_IRONLAKE(dev)) {
+	if (HAS_PCH_SPLIT(dev)) {
 		I915_WRITE(data_m1_reg, TU_SIZE(m_n.tu) | m_n.gmch_m);
 		I915_WRITE(data_n1_reg, TU_SIZE(m_n.tu) | m_n.gmch_n);
 		I915_WRITE(link_m1_reg, m_n.link_m);
@@ -3403,7 +3403,7 @@ static int intel_crtc_mode_set(struct dr
 
 	intel_wait_for_vblank(dev);
 
-	if (IS_IRONLAKE(dev)) {
+	if (HAS_PCH_SPLIT(dev)) {
 		/* enable address swizzle for tiling buffer */
 		temp = I915_READ(DISP_ARB_CTL);
 		I915_WRITE(DISP_ARB_CTL, temp | DISP_TILE_SURFACE_SWIZZLING);
@@ -3438,7 +3438,7 @@ void intel_crtc_load_lut(struct drm_crtc
 		return;
 
 	/* use legacy palette for Ironlake */
-	if (IS_IRONLAKE(dev))
+	if (HAS_PCH_SPLIT(dev))
 		palreg = (intel_crtc->pipe == 0) ? LGC_PALETTE_A :
 						   LGC_PALETTE_B;
 
@@ -3922,7 +3922,7 @@ static void intel_increase_pllclock(stru
 	int dpll_reg = (pipe == 0) ? DPLL_A : DPLL_B;
 	int dpll = I915_READ(dpll_reg);
 
-	if (IS_IRONLAKE(dev))
+	if (HAS_PCH_SPLIT(dev))
 		return;
 
 	if (!dev_priv->lvds_downclock_avail)
@@ -3961,7 +3961,7 @@ static void intel_decrease_pllclock(stru
 	int dpll_reg = (pipe == 0) ? DPLL_A : DPLL_B;
 	int dpll = I915_READ(dpll_reg);
 
-	if (IS_IRONLAKE(dev))
+	if (HAS_PCH_SPLIT(dev))
 		return;
 
 	if (!dev_priv->lvds_downclock_avail)
@@ -4382,7 +4382,7 @@ static void intel_setup_outputs(struct d
 	if (IS_MOBILE(dev) && !IS_I830(dev))
 		intel_lvds_init(dev);
 
-	if (IS_IRONLAKE(dev)) {
+	if (HAS_PCH_SPLIT(dev)) {
 		int found;
 
 		if (IS_MOBILE(dev) && (I915_READ(DP_A) & DP_DETECTED))
@@ -4451,7 +4451,7 @@ static void intel_setup_outputs(struct d
 			DRM_DEBUG_KMS("probing DP_D\n");
 			intel_dp_init(dev, DP_D);
 		}
-	} else if (IS_I8XX(dev))
+	} else if (IS_GEN2(dev))
 		intel_dvo_init(dev);
 
 	if (SUPPORTS_TV(dev))
@@ -4599,7 +4599,7 @@ void intel_init_clock_gating(struct drm_
 	 * Disable clock gating reported to work incorrectly according to the
 	 * specs, but enable as much else as we can.
 	 */
-	if (IS_IRONLAKE(dev)) {
+	if (HAS_PCH_SPLIT(dev)) {
 		return;
 	} else if (IS_G4X(dev)) {
 		uint32_t dspclk_gate;
@@ -4672,7 +4672,7 @@ static void intel_init_display(struct dr
 	struct drm_i915_private *dev_priv = dev->dev_private;
 
 	/* We always want a DPMS function */
-	if (IS_IRONLAKE(dev))
+	if (HAS_PCH_SPLIT(dev))
 		dev_priv->display.dpms = ironlake_crtc_dpms;
 	else
 		dev_priv->display.dpms = i9xx_crtc_dpms;
@@ -4715,7 +4715,7 @@ static void intel_init_display(struct dr
 			i830_get_display_clock_speed;
 
 	/* For FIFO watermark updates */
-	if (IS_IRONLAKE(dev))
+	if (HAS_PCH_SPLIT(dev))
 		dev_priv->display.update_wm = NULL;
 	else if (IS_G4X(dev))
 		dev_priv->display.update_wm = g4x_update_wm;
--- a/drivers/gpu/drm/i915/intel_lvds.c
+++ b/drivers/gpu/drm/i915/intel_lvds.c
@@ -661,7 +661,7 @@ static enum drm_connector_status intel_l
 	/* ACPI lid methods were generally unreliable in this generation, so
 	 * don't even bother.
 	 */
-	if (IS_I8XX(dev))
+	if (IS_GEN2(dev))
 		return connector_status_connected;
 
 	if (!dmi_check_system(bad_lid_status) && !acpi_lid_open())
--- a/drivers/gpu/drm/i915/intel_overlay.c
+++ b/drivers/gpu/drm/i915/intel_overlay.c
@@ -172,7 +172,7 @@ struct overlay_registers {
 #define OFC_UPDATE		0x1
 
 #define OVERLAY_NONPHYSICAL(dev) (IS_G33(dev) || IS_I965G(dev))
-#define OVERLAY_EXISTS(dev) (!IS_G4X(dev) && !IS_IRONLAKE(dev))
+#define OVERLAY_EXISTS(dev) (!IS_G4X(dev) && !IS_IRONLAKE(dev) && !IS_GEN6(dev))
 
 
 static struct overlay_registers *intel_overlay_map_regs_atomic(struct intel_overlay *overlay)
--- a/include/drm/drm_pciids.h
+++ b/include/drm/drm_pciids.h
@@ -560,4 +560,5 @@
 	{0x8086, 0x35e8, PCI_ANY_ID, PCI_ANY_ID, PCI_CLASS_DISPLAY_VGA << 8, 0xffff00, 0}, \
 	{0x8086, 0x0042, PCI_ANY_ID, PCI_ANY_ID, PCI_CLASS_DISPLAY_VGA << 8, 0xffff00, 0}, \
 	{0x8086, 0x0046, PCI_ANY_ID, PCI_ANY_ID, PCI_CLASS_DISPLAY_VGA << 8, 0xffff00, 0}, \
+	{0x8086, 0x0102, PCI_ANY_ID, PCI_ANY_ID, PCI_CLASS_DISPLAY_VGA << 8, 0xffff00, 0}, \
 	{0, 0, 0}



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

* [004/117] drm/i915: fix tiling limits for i915 class hw v2
  2010-05-10 22:37 [000/117] 2.6.33.4-stable review Greg KH
                   ` (2 preceding siblings ...)
  2010-05-10 22:31 ` [003/117] drm/i915: Add initial bits for VGA modesetting bringup on Sandybridge Greg KH
@ 2010-05-10 22:31 ` Greg KH
  2010-05-10 22:31 ` [005/117] md/raid5: allow for more than 2^31 chunks Greg KH
                   ` (112 subsequent siblings)
  116 siblings, 0 replies; 130+ messages in thread
From: Greg KH @ 2010-05-10 22:31 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: stable-review, torvalds, akpm, alan, Daniel Vetter, Eric Anholt

2.6.33-stable review patch.  If anyone has any objections, please let us know.

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

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

commit c36a2a6de59e4a141a68b7575de837d3b0bd96b3 upstream.

Current code is definitely crap: Largest pitch allowed spills into
the TILING_Y bit of the fence registers ... :(

I've rewritten the limits check under the assumption that 3rd gen hw
has a 3d pitch limit of 8kb (like 2nd gen). This is supported by an
otherwise totally misleading XXX comment.

This bug mostly resulted in tiling-corrupted pixmaps because the kernel
allowed too wide buffers to be tiled. Bug brought to the light by the
xf86-video-intel 2.11 release because that unconditionally enabled
tiling for pixmaps, relying on the kernel to check things. Tiling for
the framebuffer was not affected because the ddx does some additional
checks there ensure the buffer is within hw-limits.

v2: Instead of computing the value that would be written into the
hw fence registers and then checking the limits simply check whether
the stride is above the 8kb limit. To better document the hw, add
some WARN_ONs in i915_write_fence_reg like I've done for the i830
case (using the right limits).

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=27449
Tested-by: Alexander Lam <lambchop468@gmail.com>
Signed-off-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

---
 drivers/gpu/drm/i915/i915_gem.c        |    6 ++++++
 drivers/gpu/drm/i915/i915_gem_tiling.c |   22 +++++++++-------------
 drivers/gpu/drm/i915/i915_reg.h        |    2 +-
 3 files changed, 16 insertions(+), 14 deletions(-)

--- a/drivers/gpu/drm/i915/i915_gem.c
+++ b/drivers/gpu/drm/i915/i915_gem.c
@@ -2316,6 +2316,12 @@ static void i915_write_fence_reg(struct
 	pitch_val = obj_priv->stride / tile_width;
 	pitch_val = ffs(pitch_val) - 1;
 
+	if (obj_priv->tiling_mode == I915_TILING_Y &&
+	    HAS_128_BYTE_Y_TILING(dev))
+		WARN_ON(pitch_val > I830_FENCE_MAX_PITCH_VAL);
+	else
+		WARN_ON(pitch_val > I915_FENCE_MAX_PITCH_VAL);
+
 	val = obj_priv->gtt_offset;
 	if (obj_priv->tiling_mode == I915_TILING_Y)
 		val |= 1 << I830_FENCE_TILING_Y_SHIFT;
--- a/drivers/gpu/drm/i915/i915_gem_tiling.c
+++ b/drivers/gpu/drm/i915/i915_gem_tiling.c
@@ -357,21 +357,17 @@ i915_tiling_ok(struct drm_device *dev, i
 		 * reg, so dont bother to check the size */
 		if (stride / 128 > I965_FENCE_MAX_PITCH_VAL)
 			return false;
-	} else if (IS_I9XX(dev)) {
-		uint32_t pitch_val = ffs(stride / tile_width) - 1;
-
-		/* XXX: For Y tiling, FENCE_MAX_PITCH_VAL is actually 6 (8KB)
-		 * instead of 4 (2KB) on 945s.
-		 */
-		if (pitch_val > I915_FENCE_MAX_PITCH_VAL ||
-		    size > (I830_FENCE_MAX_SIZE_VAL << 20))
+	} else if (IS_GEN3(dev) || IS_GEN2(dev)) {
+		if (stride > 8192)
 			return false;
-	} else {
-		uint32_t pitch_val = ffs(stride / tile_width) - 1;
 
-		if (pitch_val > I830_FENCE_MAX_PITCH_VAL ||
-		    size > (I830_FENCE_MAX_SIZE_VAL << 19))
-			return false;
+		if (IS_GEN3(dev)) {
+			if (size > I830_FENCE_MAX_SIZE_VAL << 20)
+				return false;
+		} else {
+			if (size > I830_FENCE_MAX_SIZE_VAL << 19)
+				return false;
+		}
 	}
 
 	/* 965+ just needs multiples of tile width */
--- a/drivers/gpu/drm/i915/i915_reg.h
+++ b/drivers/gpu/drm/i915/i915_reg.h
@@ -221,7 +221,7 @@
 #define   I830_FENCE_SIZE_BITS(size)	((ffs((size) >> 19) - 1) << 8)
 #define   I830_FENCE_PITCH_SHIFT	4
 #define   I830_FENCE_REG_VALID		(1<<0)
-#define   I915_FENCE_MAX_PITCH_VAL	0x10
+#define   I915_FENCE_MAX_PITCH_VAL	4
 #define   I830_FENCE_MAX_PITCH_VAL	6
 #define   I830_FENCE_MAX_SIZE_VAL	(1<<8)
 



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

* [005/117] md/raid5: allow for more than 2^31 chunks.
  2010-05-10 22:37 [000/117] 2.6.33.4-stable review Greg KH
                   ` (3 preceding siblings ...)
  2010-05-10 22:31 ` [004/117] drm/i915: fix tiling limits for i915 class hw v2 Greg KH
@ 2010-05-10 22:31 ` Greg KH
  2010-05-10 22:31 ` [006/117] md/raid5: fix previous patch Greg KH
                   ` (111 subsequent siblings)
  116 siblings, 0 replies; 130+ messages in thread
From: Greg KH @ 2010-05-10 22:31 UTC (permalink / raw)
  To: linux-kernel, stable; +Cc: stable-review, torvalds, akpm, alan, NeilBrown

2.6.33-stable review patch.  If anyone has any objections, please let us know.

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

From: NeilBrown <neilb@suse.de>

commit 35f2a591192d0a5d9f7fc696869c76f0b8e49c3d upstream.

With many large drives and small chunk sizes it is possible
to create a RAID5 with more than 2^31 chunks.  Make sure this
works.

Reported-by: Brett King <king.br@gmail.com>
Signed-off-by: NeilBrown <neilb@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

---
 drivers/md/raid5.c |   19 +++++++------------
 1 file changed, 7 insertions(+), 12 deletions(-)

--- a/drivers/md/raid5.c
+++ b/drivers/md/raid5.c
@@ -1649,8 +1649,8 @@ static sector_t raid5_compute_sector(rai
 				     int previous, int *dd_idx,
 				     struct stripe_head *sh)
 {
-	long stripe;
-	unsigned long chunk_number;
+	sector_t stripe;
+	sector_t chunk_number;
 	unsigned int chunk_offset;
 	int pd_idx, qd_idx;
 	int ddf_layout = 0;
@@ -1670,17 +1670,12 @@ static sector_t raid5_compute_sector(rai
 	 */
 	chunk_offset = sector_div(r_sector, sectors_per_chunk);
 	chunk_number = r_sector;
-	BUG_ON(r_sector != chunk_number);
 
 	/*
 	 * Compute the stripe number
 	 */
-	stripe = chunk_number / data_disks;
-
-	/*
-	 * Compute the data disk and parity disk indexes inside the stripe
-	 */
-	*dd_idx = chunk_number % data_disks;
+	stripe = chunk_number;
+	*dd_idx = sector_div(stripe, data_disks);
 
 	/*
 	 * Select the parity disk based on the user selected algorithm.
@@ -1869,14 +1864,14 @@ static sector_t compute_blocknr(struct s
 				 : conf->algorithm;
 	sector_t stripe;
 	int chunk_offset;
-	int chunk_number, dummy1, dd_idx = i;
+	sector_t chunk_number;
+	int dummy1, dd_idx = i;
 	sector_t r_sector;
 	struct stripe_head sh2;
 
 
 	chunk_offset = sector_div(new_sector, sectors_per_chunk);
 	stripe = new_sector;
-	BUG_ON(new_sector != stripe);
 
 	if (i == sh->pd_idx)
 		return 0;
@@ -1969,7 +1964,7 @@ static sector_t compute_blocknr(struct s
 	}
 
 	chunk_number = stripe * data_disks + i;
-	r_sector = (sector_t)chunk_number * sectors_per_chunk + chunk_offset;
+	r_sector = chunk_number * sectors_per_chunk + chunk_offset;
 
 	check = raid5_compute_sector(conf, r_sector,
 				     previous, &dummy1, &sh2);



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

* [006/117] md/raid5: fix previous patch.
  2010-05-10 22:37 [000/117] 2.6.33.4-stable review Greg KH
                   ` (4 preceding siblings ...)
  2010-05-10 22:31 ` [005/117] md/raid5: allow for more than 2^31 chunks Greg KH
@ 2010-05-10 22:31 ` Greg KH
  2010-05-10 22:31 ` [007/117] libata: fix locking around blk_abort_request() Greg KH
                   ` (110 subsequent siblings)
  116 siblings, 0 replies; 130+ messages in thread
From: Greg KH @ 2010-05-10 22:31 UTC (permalink / raw)
  To: linux-kernel, stable; +Cc: stable-review, torvalds, akpm, alan, NeilBrown

2.6.33-stable review patch.  If anyone has any objections, please let us know.

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

From: NeilBrown <neilb@suse.de>

commit 6e3b96ed610e5a1838e62ddae9fa0c3463f235fa upstream.

Previous patch changes stripe and chunk_number to sector_t but
mistakenly did not update all of the divisions to use sector_dev().

This patch changes all the those divisions (actually the '%' operator)
to sector_div.

Signed-off-by: NeilBrown <neilb@suse.de>
Tested-by: Stefan Lippers-Hollmann <s.l-h@gmx.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

---
 drivers/md/raid5.c |   35 ++++++++++++++++++-----------------
 1 file changed, 18 insertions(+), 17 deletions(-)

--- a/drivers/md/raid5.c
+++ b/drivers/md/raid5.c
@@ -1649,7 +1649,7 @@ static sector_t raid5_compute_sector(rai
 				     int previous, int *dd_idx,
 				     struct stripe_head *sh)
 {
-	sector_t stripe;
+	sector_t stripe, stripe2;
 	sector_t chunk_number;
 	unsigned int chunk_offset;
 	int pd_idx, qd_idx;
@@ -1676,7 +1676,7 @@ static sector_t raid5_compute_sector(rai
 	 */
 	stripe = chunk_number;
 	*dd_idx = sector_div(stripe, data_disks);
-
+	stripe2 = stripe;
 	/*
 	 * Select the parity disk based on the user selected algorithm.
 	 */
@@ -1688,21 +1688,21 @@ static sector_t raid5_compute_sector(rai
 	case 5:
 		switch (algorithm) {
 		case ALGORITHM_LEFT_ASYMMETRIC:
-			pd_idx = data_disks - stripe % raid_disks;
+			pd_idx = data_disks - sector_div(stripe2, raid_disks);
 			if (*dd_idx >= pd_idx)
 				(*dd_idx)++;
 			break;
 		case ALGORITHM_RIGHT_ASYMMETRIC:
-			pd_idx = stripe % raid_disks;
+			pd_idx = sector_div(stripe2, raid_disks);
 			if (*dd_idx >= pd_idx)
 				(*dd_idx)++;
 			break;
 		case ALGORITHM_LEFT_SYMMETRIC:
-			pd_idx = data_disks - stripe % raid_disks;
+			pd_idx = data_disks - sector_div(stripe2, raid_disks);
 			*dd_idx = (pd_idx + 1 + *dd_idx) % raid_disks;
 			break;
 		case ALGORITHM_RIGHT_SYMMETRIC:
-			pd_idx = stripe % raid_disks;
+			pd_idx = sector_div(stripe2, raid_disks);
 			*dd_idx = (pd_idx + 1 + *dd_idx) % raid_disks;
 			break;
 		case ALGORITHM_PARITY_0:
@@ -1722,7 +1722,7 @@ static sector_t raid5_compute_sector(rai
 
 		switch (algorithm) {
 		case ALGORITHM_LEFT_ASYMMETRIC:
-			pd_idx = raid_disks - 1 - (stripe % raid_disks);
+			pd_idx = raid_disks - 1 - sector_div(stripe2, raid_disks);
 			qd_idx = pd_idx + 1;
 			if (pd_idx == raid_disks-1) {
 				(*dd_idx)++;	/* Q D D D P */
@@ -1731,7 +1731,7 @@ static sector_t raid5_compute_sector(rai
 				(*dd_idx) += 2; /* D D P Q D */
 			break;
 		case ALGORITHM_RIGHT_ASYMMETRIC:
-			pd_idx = stripe % raid_disks;
+			pd_idx = sector_div(stripe2, raid_disks);
 			qd_idx = pd_idx + 1;
 			if (pd_idx == raid_disks-1) {
 				(*dd_idx)++;	/* Q D D D P */
@@ -1740,12 +1740,12 @@ static sector_t raid5_compute_sector(rai
 				(*dd_idx) += 2; /* D D P Q D */
 			break;
 		case ALGORITHM_LEFT_SYMMETRIC:
-			pd_idx = raid_disks - 1 - (stripe % raid_disks);
+			pd_idx = raid_disks - 1 - sector_div(stripe2, raid_disks);
 			qd_idx = (pd_idx + 1) % raid_disks;
 			*dd_idx = (pd_idx + 2 + *dd_idx) % raid_disks;
 			break;
 		case ALGORITHM_RIGHT_SYMMETRIC:
-			pd_idx = stripe % raid_disks;
+			pd_idx = sector_div(stripe2, raid_disks);
 			qd_idx = (pd_idx + 1) % raid_disks;
 			*dd_idx = (pd_idx + 2 + *dd_idx) % raid_disks;
 			break;
@@ -1764,7 +1764,7 @@ static sector_t raid5_compute_sector(rai
 			/* Exactly the same as RIGHT_ASYMMETRIC, but or
 			 * of blocks for computing Q is different.
 			 */
-			pd_idx = stripe % raid_disks;
+			pd_idx = sector_div(stripe2, raid_disks);
 			qd_idx = pd_idx + 1;
 			if (pd_idx == raid_disks-1) {
 				(*dd_idx)++;	/* Q D D D P */
@@ -1779,7 +1779,8 @@ static sector_t raid5_compute_sector(rai
 			 * D D D P Q  rather than
 			 * Q D D D P
 			 */
-			pd_idx = raid_disks - 1 - ((stripe + 1) % raid_disks);
+			stripe2 += 1;
+			pd_idx = raid_disks - 1 - sector_div(stripe2, raid_disks);
 			qd_idx = pd_idx + 1;
 			if (pd_idx == raid_disks-1) {
 				(*dd_idx)++;	/* Q D D D P */
@@ -1791,7 +1792,7 @@ static sector_t raid5_compute_sector(rai
 
 		case ALGORITHM_ROTATING_N_CONTINUE:
 			/* Same as left_symmetric but Q is before P */
-			pd_idx = raid_disks - 1 - (stripe % raid_disks);
+			pd_idx = raid_disks - 1 - sector_div(stripe2, raid_disks);
 			qd_idx = (pd_idx + raid_disks - 1) % raid_disks;
 			*dd_idx = (pd_idx + 1 + *dd_idx) % raid_disks;
 			ddf_layout = 1;
@@ -1799,27 +1800,27 @@ static sector_t raid5_compute_sector(rai
 
 		case ALGORITHM_LEFT_ASYMMETRIC_6:
 			/* RAID5 left_asymmetric, with Q on last device */
-			pd_idx = data_disks - stripe % (raid_disks-1);
+			pd_idx = data_disks - sector_div(stripe2, raid_disks-1);
 			if (*dd_idx >= pd_idx)
 				(*dd_idx)++;
 			qd_idx = raid_disks - 1;
 			break;
 
 		case ALGORITHM_RIGHT_ASYMMETRIC_6:
-			pd_idx = stripe % (raid_disks-1);
+			pd_idx = sector_div(stripe2, raid_disks-1);
 			if (*dd_idx >= pd_idx)
 				(*dd_idx)++;
 			qd_idx = raid_disks - 1;
 			break;
 
 		case ALGORITHM_LEFT_SYMMETRIC_6:
-			pd_idx = data_disks - stripe % (raid_disks-1);
+			pd_idx = data_disks - sector_div(stripe2, raid_disks-1);
 			*dd_idx = (pd_idx + 1 + *dd_idx) % (raid_disks-1);
 			qd_idx = raid_disks - 1;
 			break;
 
 		case ALGORITHM_RIGHT_SYMMETRIC_6:
-			pd_idx = stripe % (raid_disks-1);
+			pd_idx = sector_div(stripe2, raid_disks-1);
 			*dd_idx = (pd_idx + 1 + *dd_idx) % (raid_disks-1);
 			qd_idx = raid_disks - 1;
 			break;



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

* [007/117] libata: fix locking around blk_abort_request()
  2010-05-10 22:37 [000/117] 2.6.33.4-stable review Greg KH
                   ` (5 preceding siblings ...)
  2010-05-10 22:31 ` [006/117] md/raid5: fix previous patch Greg KH
@ 2010-05-10 22:31 ` Greg KH
  2010-05-10 22:31 ` [008/117] libata: ensure NCQ error result taskfile is fully initialized Greg KH
                   ` (109 subsequent siblings)
  116 siblings, 0 replies; 130+ messages in thread
From: Greg KH @ 2010-05-10 22:31 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: stable-review, torvalds, akpm, alan, Tejun Heo, Jens Axboe, Jeff Garzik

2.6.33-stable review patch.  If anyone has any objections, please let us know.

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

From: Tejun Heo <tj@kernel.org>

commit fa41efdae7de61191a7bda3a00e88ef69afb5bb9 upstream.

blk_abort_request() expectes queue lock to be held by the caller.
Grab it before calling the function.

Lack of this synchronization led to infinite loop on corrupt
q->timeout_list.

Signed-off-by: Tejun Heo <tj@kernel.org>
Cc: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

---
 drivers/ata/libata-eh.c |    4 ++++
 1 file changed, 4 insertions(+)

--- a/drivers/ata/libata-eh.c
+++ b/drivers/ata/libata-eh.c
@@ -879,6 +879,8 @@ static void ata_eh_set_pending(struct at
 void ata_qc_schedule_eh(struct ata_queued_cmd *qc)
 {
 	struct ata_port *ap = qc->ap;
+	struct request_queue *q = qc->scsicmd->device->request_queue;
+	unsigned long flags;
 
 	WARN_ON(!ap->ops->error_handler);
 
@@ -890,7 +892,9 @@ void ata_qc_schedule_eh(struct ata_queue
 	 * Note that ATA_QCFLAG_FAILED is unconditionally set after
 	 * this function completes.
 	 */
+	spin_lock_irqsave(q->queue_lock, flags);
 	blk_abort_request(qc->scsicmd->request);
+	spin_unlock_irqrestore(q->queue_lock, flags);
 }
 
 /**



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

* [008/117] libata: ensure NCQ error result taskfile is fully initialized
  2010-05-10 22:37 [000/117] 2.6.33.4-stable review Greg KH
                   ` (6 preceding siblings ...)
  2010-05-10 22:31 ` [007/117] libata: fix locking around blk_abort_request() Greg KH
@ 2010-05-10 22:31 ` Greg KH
  2010-05-10 22:31 ` [009/117] w1: w1 temp: fix negative termperature calculation Greg KH
                   ` (108 subsequent siblings)
  116 siblings, 0 replies; 130+ messages in thread
From: Greg KH @ 2010-05-10 22:31 UTC (permalink / raw)
  To: linux-kernel, stable; +Cc: stable-review, torvalds, akpm, alan, Jeff Garzik

2.6.33-stable review patch.  If anyone has any objections, please let us know.

------------------
 before returning it via qc->result_tf.

From: Jeff Garzik <jeff@garzik.org>

commit a09bf4cd53b8ab000197ef81f15d50f29ecf973c upstream.

Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

---
 drivers/ata/libata-eh.c |    1 +
 1 file changed, 1 insertion(+)

--- a/drivers/ata/libata-eh.c
+++ b/drivers/ata/libata-eh.c
@@ -1628,6 +1628,7 @@ void ata_eh_analyze_ncq_error(struct ata
 	}
 
 	/* okay, this error is ours */
+	memset(&tf, 0, sizeof(tf));
 	rc = ata_eh_read_log_10h(dev, &tag, &tf);
 	if (rc) {
 		ata_link_printk(link, KERN_ERR, "failed to read log page 10h "



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

* [009/117] w1: w1 temp: fix negative termperature calculation
  2010-05-10 22:37 [000/117] 2.6.33.4-stable review Greg KH
                   ` (7 preceding siblings ...)
  2010-05-10 22:31 ` [008/117] libata: ensure NCQ error result taskfile is fully initialized Greg KH
@ 2010-05-10 22:31 ` Greg KH
  2010-05-10 22:31 ` [010/117] memcg: fix prepare migration Greg KH
                   ` (107 subsequent siblings)
  116 siblings, 0 replies; 130+ messages in thread
From: Greg KH @ 2010-05-10 22:31 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: stable-review, torvalds, akpm, alan, Evgeniy Polyakov

2.6.33-stable review patch.  If anyone has any objections, please let us know.

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

From: Ian Dall <ian@beware.dropbear.id.au>

commit 9a6a1ecd9e9b5d046a236da2f7eb6b6812f04229 upstream.

Fix regression caused by commit 507e2fbaaacb6f164b4125b87c5002f95143174b
("w1: w1 temp calculation overflow fix") whereby negative temperatures for
the DS18B20 are not converted properly.

When the temperature exceeds 32767 milli-degrees the temperature overflows
to -32768 millidegrees.  These are both well within the -55 - +125 degree
range for the sensor.

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

Signed-of-by: Ian Dall <ian@beware.dropbear.id.au>
Cc: Evgeniy Polyakov <johnpol@2ka.mipt.ru>
Tested-by: Karsten Elfenbein <kelfe@gmx.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

---
 drivers/w1/slaves/w1_therm.c |    5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

--- a/drivers/w1/slaves/w1_therm.c
+++ b/drivers/w1/slaves/w1_therm.c
@@ -115,9 +115,8 @@ static struct w1_therm_family_converter
 
 static inline int w1_DS18B20_convert_temp(u8 rom[9])
 {
-	int t = ((s16)rom[1] << 8) | rom[0];
-	t = t*1000/16;
-	return t;
+	s16 t = le16_to_cpup((__le16 *)rom);
+	return t*1000/16;
 }
 
 static inline int w1_DS18S20_convert_temp(u8 rom[9])



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

* [010/117] memcg: fix prepare migration
  2010-05-10 22:37 [000/117] 2.6.33.4-stable review Greg KH
                   ` (8 preceding siblings ...)
  2010-05-10 22:31 ` [009/117] w1: w1 temp: fix negative termperature calculation Greg KH
@ 2010-05-10 22:31 ` Greg KH
  2010-05-10 22:31 ` [011/117] mac80211: remove bogus TX agg state assignment Greg KH
                   ` (106 subsequent siblings)
  116 siblings, 0 replies; 130+ messages in thread
From: Greg KH @ 2010-05-10 22:31 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: stable-review, torvalds, akpm, alan, Andrea Arcangeli,
	KAMEZAWA Hiroyuki, Balbir Singh, Daisuke Nishimura

2.6.33-stable review patch.  If anyone has any objections, please let us know.

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

From: Andrea Arcangeli <aarcange@redhat.com>

commit 93d5c9be1ddd57d4063ce463c9ac2be1e5ee14f1 upstream.

If a signal is pending (task being killed by sigkill)
__mem_cgroup_try_charge will write NULL into &mem, and css_put will oops
on null pointer dereference.

  BUG: unable to handle kernel NULL pointer dereference at 0000000000000010
  IP: [<ffffffff810fc6cc>] mem_cgroup_prepare_migration+0x7c/0xc0
  PGD a5d89067 PUD a5d8a067 PMD 0
  Oops: 0000 [#1] SMP
  last sysfs file: /sys/devices/platform/microcode/firmware/microcode/loading
  CPU 0
  Modules linked in: nfs lockd nfs_acl auth_rpcgss sunrpc acpi_cpufreq pcspkr sg [last unloaded: microcode]

  Pid: 5299, comm: largepages Tainted: G        W  2.6.34-rc3 #3 Penryn1600SLI-110dB/To Be Filled By O.E.M.
  RIP: 0010:[<ffffffff810fc6cc>]  [<ffffffff810fc6cc>] mem_cgroup_prepare_migration+0x7c/0xc0

[nishimura@mxp.nes.nec.co.jp: fix merge issues]
Signed-off-by: Andrea Arcangeli <aarcange@redhat.com>
Acked-by: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
Cc: Balbir Singh <balbir@in.ibm.com>
Signed-off-by: Daisuke Nishimura <nishimura@mxp.nes.nec.co.jp>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

---
 mm/memcontrol.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

--- a/mm/memcontrol.c
+++ b/mm/memcontrol.c
@@ -2215,12 +2215,12 @@ int mem_cgroup_prepare_migration(struct
 	}
 	unlock_page_cgroup(pc);
 
+	*ptr = mem;
 	if (mem) {
-		ret = __mem_cgroup_try_charge(NULL, GFP_KERNEL, &mem, false,
+		ret = __mem_cgroup_try_charge(NULL, GFP_KERNEL, ptr, false,
 						page);
 		css_put(&mem->css);
 	}
-	*ptr = mem;
 	return ret;
 }
 



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

* [011/117] mac80211: remove bogus TX agg state assignment
  2010-05-10 22:37 [000/117] 2.6.33.4-stable review Greg KH
                   ` (9 preceding siblings ...)
  2010-05-10 22:31 ` [010/117] memcg: fix prepare migration Greg KH
@ 2010-05-10 22:31 ` Greg KH
  2010-05-10 22:31 ` [012/117] flex_array: fix the panic when calling flex_array_alloc() without __GFP_ZERO Greg KH
                   ` (105 subsequent siblings)
  116 siblings, 0 replies; 130+ messages in thread
From: Greg KH @ 2010-05-10 22:31 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: stable-review, torvalds, akpm, alan, Johannes Berg, John W. Linville

2.6.33-stable review patch.  If anyone has any objections, please let us know.

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

From: Johannes Berg <johannes@sipsolutions.net>

commit b4bb5c3fd9333024044362df67e23e96158489ed upstream.

When the addba timer expires but has no work to do,
it should not affect the state machine. If it does,
TX will not see the successfully established and we
can also crash trying to re-establish the session.

Signed-off-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 |    1 -
 1 file changed, 1 deletion(-)

--- a/net/mac80211/agg-tx.c
+++ b/net/mac80211/agg-tx.c
@@ -183,7 +183,6 @@ static void sta_addba_resp_timer_expired
 		       HT_AGG_STATE_REQ_STOP_BA_MSK)) !=
 						HT_ADDBA_REQUESTED_MSK) {
 		spin_unlock_bh(&sta->lock);
-		*state = HT_AGG_STATE_IDLE;
 #ifdef CONFIG_MAC80211_HT_DEBUG
 		printk(KERN_DEBUG "timer expired on tid %d but we are not "
 				"(or no longer) expecting addBA response there",



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

* [012/117] flex_array: fix the panic when calling flex_array_alloc() without __GFP_ZERO
  2010-05-10 22:37 [000/117] 2.6.33.4-stable review Greg KH
                   ` (10 preceding siblings ...)
  2010-05-10 22:31 ` [011/117] mac80211: remove bogus TX agg state assignment Greg KH
@ 2010-05-10 22:31 ` Greg KH
  2010-05-10 22:31 ` [013/117] hugetlb: fix infinite loop in get_futex_key() when backed by huge pages Greg KH
                   ` (104 subsequent siblings)
  116 siblings, 0 replies; 130+ messages in thread
From: Greg KH @ 2010-05-10 22:31 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: stable-review, torvalds, akpm, alan, Changli Gao,
	Patrick McHardy, David Rientjes

2.6.33-stable review patch.  If anyone has any objections, please let us know.

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

From: Changli Gao <xiaosuo@gmail.com>

commit e59464c735db19619cde2aa331609adb02005f5b upstream.

memset() is called with the wrong address and the kernel panics.

Signed-off-by: Changli Gao <xiaosuo@gmail.com>
Cc: Patrick McHardy <kaber@trash.net>
Acked-by: David Rientjes <rientjes@google.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

---
 lib/flex_array.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- a/lib/flex_array.c
+++ b/lib/flex_array.c
@@ -99,7 +99,7 @@ struct flex_array *flex_array_alloc(int
 	ret->element_size = element_size;
 	ret->total_nr_elements = total;
 	if (elements_fit_in_base(ret) && !(flags & __GFP_ZERO))
-		memset(ret->parts[0], FLEX_ARRAY_FREE,
+		memset(&ret->parts[0], FLEX_ARRAY_FREE,
 						FLEX_ARRAY_BASE_BYTES_LEFT);
 	return ret;
 }



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

* [013/117] hugetlb: fix infinite loop in get_futex_key() when backed by huge pages
  2010-05-10 22:37 [000/117] 2.6.33.4-stable review Greg KH
                   ` (11 preceding siblings ...)
  2010-05-10 22:31 ` [012/117] flex_array: fix the panic when calling flex_array_alloc() without __GFP_ZERO Greg KH
@ 2010-05-10 22:31 ` Greg KH
  2010-05-10 22:31 ` [014/117] reiserfs: fix permissions on .reiserfs_priv Greg KH
                   ` (103 subsequent siblings)
  116 siblings, 0 replies; 130+ messages in thread
From: Greg KH @ 2010-05-10 22:31 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: stable-review, torvalds, akpm, alan, Mel Gorman, Peter Zijlstra,
	Darren Hart

2.6.33-stable review patch.  If anyone has any objections, please let us know.

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

From: Mel Gorman <mel@csn.ul.ie>

commit 23be7468e8802a2ac1de6ee3eecb3ec7f14dc703 upstream.

If a futex key happens to be located within a huge page mapped
MAP_PRIVATE, get_futex_key() can go into an infinite loop waiting for a
page->mapping that will never exist.

See https://bugzilla.redhat.com/show_bug.cgi?id=552257 for more details
about the problem.

This patch makes page->mapping a poisoned value that includes
PAGE_MAPPING_ANON mapped MAP_PRIVATE.  This is enough for futex to
continue but because of PAGE_MAPPING_ANON, the poisoned value is not
dereferenced or used by futex.  No other part of the VM should be
dereferencing the page->mapping of a hugetlbfs page as its page cache is
not on the LRU.

This patch fixes the problem with the test case described in the bugzilla.

[akpm@linux-foundation.org: mel cant spel]
Signed-off-by: Mel Gorman <mel@csn.ul.ie>
Acked-by: Peter Zijlstra <peterz@infradead.org>
Acked-by: Darren Hart <darren@dvhart.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

---
 include/linux/poison.h |    9 +++++++++
 mm/hugetlb.c           |    5 ++++-
 2 files changed, 13 insertions(+), 1 deletion(-)

--- a/include/linux/poison.h
+++ b/include/linux/poison.h
@@ -48,6 +48,15 @@
 #define POISON_FREE	0x6b	/* for use-after-free poisoning */
 #define	POISON_END	0xa5	/* end-byte of poisoning */
 
+/********** mm/hugetlb.c **********/
+/*
+ * Private mappings of hugetlb pages use this poisoned value for
+ * page->mapping. The core VM should not be doing anything with this mapping
+ * but futex requires the existence of some page->mapping value even though it
+ * is unused if PAGE_MAPPING_ANON is set.
+ */
+#define HUGETLB_POISON	((void *)(0x00300300 + POISON_POINTER_DELTA + PAGE_MAPPING_ANON))
+
 /********** arch/$ARCH/mm/init.c **********/
 #define POISON_FREE_INITMEM	0xcc
 
--- a/mm/hugetlb.c
+++ b/mm/hugetlb.c
@@ -546,6 +546,7 @@ static void free_huge_page(struct page *
 
 	mapping = (struct address_space *) page_private(page);
 	set_page_private(page, 0);
+	page->mapping = NULL;
 	BUG_ON(page_count(page));
 	INIT_LIST_HEAD(&page->lru);
 
@@ -2447,8 +2448,10 @@ retry:
 			spin_lock(&inode->i_lock);
 			inode->i_blocks += blocks_per_huge_page(h);
 			spin_unlock(&inode->i_lock);
-		} else
+		} else {
 			lock_page(page);
+			page->mapping = HUGETLB_POISON;
+		}
 	}
 
 	/*



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

* [014/117] reiserfs: fix permissions on .reiserfs_priv
  2010-05-10 22:37 [000/117] 2.6.33.4-stable review Greg KH
                   ` (12 preceding siblings ...)
  2010-05-10 22:31 ` [013/117] hugetlb: fix infinite loop in get_futex_key() when backed by huge pages Greg KH
@ 2010-05-10 22:31 ` Greg KH
  2010-05-10 22:31 ` [015/117] reiserfs: fix corruption during shrinking of xattrs Greg KH
                   ` (102 subsequent siblings)
  116 siblings, 0 replies; 130+ messages in thread
From: Greg KH @ 2010-05-10 22:31 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: stable-review, torvalds, akpm, alan, Jeff Mahoney,
	Edward Shishkin, Frederic Weisbecker, Al Viro

2.6.33-stable review patch.  If anyone has any objections, please let us know.

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

From: Jeff Mahoney <jeffm@suse.com>

commit cac36f707119b792b2396aed371d6b5cdc194890 upstream.

Commit 677c9b2e393a0cd203bd54e9c18b012b2c73305a ("reiserfs: remove
privroot hiding in lookup") removed the magic from the lookup code to hide
the .reiserfs_priv directory since it was getting loaded at mount-time
instead.  The intent was that the entry would be hidden from the user via
a poisoned d_compare, but this was faulty.

This introduced a security issue where unprivileged users could access and
modify extended attributes or ACLs belonging to other users, including
root.

This patch resolves the issue by properly hiding .reiserfs_priv.  This was
the intent of the xattr poisoning code, but it appears to have never
worked as expected.  This is fixed by using d_revalidate instead of
d_compare.

This patch makes -oexpose_privroot a no-op.  I'm fine leaving it this way.
The effort involved in working out the corner cases wrt permissions and
caching outweigh the benefit of the feature.

Signed-off-by: Jeff Mahoney <jeffm@suse.com>
Acked-by: Edward Shishkin <edward.shishkin@gmail.com>
Reported-by: Matt McCutchen <matt@mattmccutchen.net>
Tested-by: Matt McCutchen <matt@mattmccutchen.net>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

---
 fs/reiserfs/dir.c   |    2 --
 fs/reiserfs/xattr.c |   17 ++++-------------
 2 files changed, 4 insertions(+), 15 deletions(-)

--- a/fs/reiserfs/dir.c
+++ b/fs/reiserfs/dir.c
@@ -45,8 +45,6 @@ static inline bool is_privroot_deh(struc
 				   struct reiserfs_de_head *deh)
 {
 	struct dentry *privroot = REISERFS_SB(dir->d_sb)->priv_root;
-	if (reiserfs_expose_privroot(dir->d_sb))
-		return 0;
 	return (dir == dir->d_parent && privroot->d_inode &&
 	        deh->deh_objectid == INODE_PKEY(privroot->d_inode)->k_objectid);
 }
--- a/fs/reiserfs/xattr.c
+++ b/fs/reiserfs/xattr.c
@@ -976,21 +976,13 @@ int reiserfs_permission(struct inode *in
 	return generic_permission(inode, mask, NULL);
 }
 
-/* This will catch lookups from the fs root to .reiserfs_priv */
-static int
-xattr_lookup_poison(struct dentry *dentry, struct qstr *q1, struct qstr *name)
+static int xattr_hide_revalidate(struct dentry *dentry, struct nameidata *nd)
 {
-	struct dentry *priv_root = REISERFS_SB(dentry->d_sb)->priv_root;
-	if (container_of(q1, struct dentry, d_name) == priv_root)
-		return -ENOENT;
-	if (q1->len == name->len &&
-		   !memcmp(q1->name, name->name, name->len))
-		return 0;
-	return 1;
+	return -EPERM;
 }
 
 static const struct dentry_operations xattr_lookup_poison_ops = {
-	.d_compare = xattr_lookup_poison,
+	.d_revalidate = xattr_hide_revalidate,
 };
 
 int reiserfs_lookup_privroot(struct super_block *s)
@@ -1004,8 +996,7 @@ int reiserfs_lookup_privroot(struct supe
 				strlen(PRIVROOT_NAME));
 	if (!IS_ERR(dentry)) {
 		REISERFS_SB(s)->priv_root = dentry;
-		if (!reiserfs_expose_privroot(s))
-			s->s_root->d_op = &xattr_lookup_poison_ops;
+		dentry->d_op = &xattr_lookup_poison_ops;
 		if (dentry->d_inode)
 			dentry->d_inode->i_flags |= S_PRIVATE;
 	} else



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

* [015/117] reiserfs: fix corruption during shrinking of xattrs
  2010-05-10 22:37 [000/117] 2.6.33.4-stable review Greg KH
                   ` (13 preceding siblings ...)
  2010-05-10 22:31 ` [014/117] reiserfs: fix permissions on .reiserfs_priv Greg KH
@ 2010-05-10 22:31 ` Greg KH
  2010-05-10 22:31 ` [016/117] procfs: fix tid fdinfo Greg KH
                   ` (101 subsequent siblings)
  116 siblings, 0 replies; 130+ messages in thread
From: Greg KH @ 2010-05-10 22:31 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: stable-review, torvalds, akpm, alan, Jeff Mahoney,
	Edward Shishkin, Jethro Beekman, Greg Surbey, Marco Gatti

2.6.33-stable review patch.  If anyone has any objections, please let us know.

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

From: Jeff Mahoney <jeffm@suse.com>

commit fb2162df74bb19552db3d988fd11c787cf5fad56 upstream.

Commit 48b32a3553a54740d236b79a90f20147a25875e3 ("reiserfs: use generic
xattr handlers") introduced a problem that causes corruption when extended
attributes are replaced with a smaller value.

The issue is that the reiserfs_setattr to shrink the xattr file was moved
from before the write to after the write.

The root issue has always been in the reiserfs xattr code, but was papered
over by the fact that in the shrink case, the file would just be expanded
again while the xattr was written.

The end result is that the last 8 bytes of xattr data are lost.

This patch fixes it to use new_size.

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

Signed-off-by: Jeff Mahoney <jeffm@suse.com>
Reported-by: Christian Kujau <lists@nerdbynature.de>
Tested-by: Christian Kujau <lists@nerdbynature.de>
Cc: Edward Shishkin <edward.shishkin@gmail.com>
Cc: Jethro Beekman <kernel@jbeekman.nl>
Cc: Greg Surbey <gregsurbey@hotmail.com>
Cc: Marco Gatti <marco.gatti@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

---
 fs/reiserfs/xattr.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- a/fs/reiserfs/xattr.c
+++ b/fs/reiserfs/xattr.c
@@ -557,7 +557,7 @@ reiserfs_xattr_set_handle(struct reiserf
 	if (!err && new_size < i_size_read(dentry->d_inode)) {
 		struct iattr newattrs = {
 			.ia_ctime = current_fs_time(inode->i_sb),
-			.ia_size = buffer_size,
+			.ia_size = new_size,
 			.ia_valid = ATTR_SIZE | ATTR_CTIME,
 		};
 



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

* [016/117] procfs: fix tid fdinfo
  2010-05-10 22:37 [000/117] 2.6.33.4-stable review Greg KH
                   ` (14 preceding siblings ...)
  2010-05-10 22:31 ` [015/117] reiserfs: fix corruption during shrinking of xattrs Greg KH
@ 2010-05-10 22:31 ` Greg KH
  2010-05-10 22:31 ` [017/117] nfsd4: bug in read_buf Greg KH
                   ` (100 subsequent siblings)
  116 siblings, 0 replies; 130+ messages in thread
From: Greg KH @ 2010-05-10 22:31 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: stable-review, torvalds, akpm, alan, Jerome Marchand,
	Alexander Viro, Miklos Szeredi, Alexey Dobriyan

2.6.33-stable review patch.  If anyone has any objections, please let us know.

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

From: Jerome Marchand <jmarchan@redhat.com>

commit 3835541dd481091c4dbf5ef83c08aed12e50fd61 upstream.

Correct the file_operations struct in fdinfo entry of tid_base_stuff[].

Presently /proc/*/task/*/fdinfo contains symlinks to opened files like
/proc/*/fd/.

Signed-off-by: Jerome Marchand <jmarchan@redhat.com>
Cc: Alexander Viro <viro@zeniv.linux.org.uk>
Cc: Miklos Szeredi <mszeredi@suse.cz>
Cc: Alexey Dobriyan <adobriyan@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

---
 fs/proc/base.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- a/fs/proc/base.c
+++ b/fs/proc/base.c
@@ -2910,7 +2910,7 @@ out_no_task:
  */
 static const struct pid_entry tid_base_stuff[] = {
 	DIR("fd",        S_IRUSR|S_IXUSR, proc_fd_inode_operations, proc_fd_operations),
-	DIR("fdinfo",    S_IRUSR|S_IXUSR, proc_fdinfo_inode_operations, proc_fd_operations),
+	DIR("fdinfo",    S_IRUSR|S_IXUSR, proc_fdinfo_inode_operations, proc_fdinfo_operations),
 	REG("environ",   S_IRUSR, proc_environ_operations),
 	INF("auxv",      S_IRUSR, proc_pid_auxv),
 	ONE("status",    S_IRUGO, proc_pid_status),



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

* [017/117] nfsd4: bug in read_buf
  2010-05-10 22:37 [000/117] 2.6.33.4-stable review Greg KH
                   ` (15 preceding siblings ...)
  2010-05-10 22:31 ` [016/117] procfs: fix tid fdinfo Greg KH
@ 2010-05-10 22:31 ` Greg KH
  2010-05-10 22:31 ` [018/117] keys: the request_key() syscall should link an existing key to the dest keyring Greg KH
                   ` (99 subsequent siblings)
  116 siblings, 0 replies; 130+ messages in thread
From: Greg KH @ 2010-05-10 22:31 UTC (permalink / raw)
  To: linux-kernel, stable; +Cc: stable-review, torvalds, akpm, alan, J. Bruce Fields

2.6.33-stable review patch.  If anyone has any objections, please let us know.

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

From: Neil Brown <neilb@suse.de>

commit 2bc3c1179c781b359d4f2f3439cb3df72afc17fc upstream.

When read_buf is called to move over to the next page in the pagelist
of an NFSv4 request, it sets argp->end to essentially a random
number, certainly not an address within the page which argp->p now
points to.  So subsequent calls to READ_BUF will think there is much
more than a page of spare space (the cast to u32 ensures an unsigned
comparison) so we can expect to fall off the end of the second
page.

We never encountered thsi in testing because typically the only
operations which use more than two pages are write-like operations,
which have their own decoding logic.  Something like a getattr after a
write may cross a page boundary, but it would be very unusual for it to
cross another boundary after that.

Signed-off-by: J. Bruce Fields <bfields@citi.umich.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

---
 fs/nfsd/nfs4xdr.c |    8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

--- a/fs/nfsd/nfs4xdr.c
+++ b/fs/nfsd/nfs4xdr.c
@@ -160,10 +160,10 @@ static __be32 *read_buf(struct nfsd4_com
 	argp->p = page_address(argp->pagelist[0]);
 	argp->pagelist++;
 	if (argp->pagelen < PAGE_SIZE) {
-		argp->end = p + (argp->pagelen>>2);
+		argp->end = argp->p + (argp->pagelen>>2);
 		argp->pagelen = 0;
 	} else {
-		argp->end = p + (PAGE_SIZE>>2);
+		argp->end = argp->p + (PAGE_SIZE>>2);
 		argp->pagelen -= PAGE_SIZE;
 	}
 	memcpy(((char*)p)+avail, argp->p, (nbytes - avail));
@@ -1425,10 +1425,10 @@ nfsd4_decode_compound(struct nfsd4_compo
 			argp->p = page_address(argp->pagelist[0]);
 			argp->pagelist++;
 			if (argp->pagelen < PAGE_SIZE) {
-				argp->end = p + (argp->pagelen>>2);
+				argp->end = argp->p + (argp->pagelen>>2);
 				argp->pagelen = 0;
 			} else {
-				argp->end = p + (PAGE_SIZE>>2);
+				argp->end = argp->p + (PAGE_SIZE>>2);
 				argp->pagelen -= PAGE_SIZE;
 			}
 		}



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

* [018/117] keys: the request_key() syscall should link an existing key to the dest keyring
  2010-05-10 22:37 [000/117] 2.6.33.4-stable review Greg KH
                   ` (16 preceding siblings ...)
  2010-05-10 22:31 ` [017/117] nfsd4: bug in read_buf Greg KH
@ 2010-05-10 22:31 ` Greg KH
  2010-05-10 22:31 ` [019/117] sfc: Wait at most 10ms for the MC to finish reading out MAC statistics Greg KH
                   ` (98 subsequent siblings)
  116 siblings, 0 replies; 130+ messages in thread
From: Greg KH @ 2010-05-10 22:31 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: stable-review, torvalds, akpm, alan, David Howells, James Morris

2.6.33-stable review patch.  If anyone has any objections, please let us know.

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

From: David Howells <dhowells@redhat.com>

commit 03449cd9eaa4fa3a7faa4a59474bafe2e90bd143 upstream.

The request_key() system call and request_key_and_link() should make a
link from an existing key to the destination keyring (if supplied), not
just from a new key to the destination keyring.

This can be tested by:

	ring=`keyctl newring fred @s`
	keyctl request2 user debug:a a
	keyctl request user debug:a $ring
	keyctl list $ring

If it says:

	keyring is empty

then it didn't work.  If it shows something like:

	1 key in keyring:
	1070462727: --alswrv     0     0 user: debug:a

then it did.

request_key() system call is meant to recursively search all your keyrings for
the key you desire, and, optionally, if it doesn't exist, call out to userspace
to create one for you.

If request_key() finds or creates a key, it should, optionally, create a link
to that key from the destination keyring specified.

Therefore, if, after a successful call to request_key() with a desination
keyring specified, you see the destination keyring empty, the code didn't work
correctly.

If you see the found key in the keyring, then it did - which is what the patch
is required for.

Signed-off-by: David Howells <dhowells@redhat.com>
Cc: James Morris <jmorris@namei.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

---
 security/keys/request_key.c |    9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

--- a/security/keys/request_key.c
+++ b/security/keys/request_key.c
@@ -336,8 +336,10 @@ static int construct_alloc_key(struct ke
 
 key_already_present:
 	mutex_unlock(&key_construction_mutex);
-	if (dest_keyring)
+	if (dest_keyring) {
+		__key_link(dest_keyring, key_ref_to_ptr(key_ref));
 		up_write(&dest_keyring->sem);
+	}
 	mutex_unlock(&user->cons_lock);
 	key_put(key);
 	*_key = key = key_ref_to_ptr(key_ref);
@@ -428,6 +430,11 @@ struct key *request_key_and_link(struct
 
 	if (!IS_ERR(key_ref)) {
 		key = key_ref_to_ptr(key_ref);
+		if (dest_keyring) {
+			construct_get_dest_keyring(&dest_keyring);
+			key_link(dest_keyring, key);
+			key_put(dest_keyring);
+		}
 	} else if (PTR_ERR(key_ref) != -EAGAIN) {
 		key = ERR_CAST(key_ref);
 	} else  {



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

* [019/117] sfc: Wait at most 10ms for the MC to finish reading out MAC statistics
  2010-05-10 22:37 [000/117] 2.6.33.4-stable review Greg KH
                   ` (17 preceding siblings ...)
  2010-05-10 22:31 ` [018/117] keys: the request_key() syscall should link an existing key to the dest keyring Greg KH
@ 2010-05-10 22:31 ` Greg KH
  2010-05-10 22:31 ` [020/117] sfc: Always close net device at the end of a disabling reset Greg KH
                   ` (97 subsequent siblings)
  116 siblings, 0 replies; 130+ messages in thread
From: Greg KH @ 2010-05-10 22:31 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: stable-review, torvalds, akpm, alan, Ben Hutchings, David S. Miller

2.6.33-stable review patch.  If anyone has any objections, please let us know.

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

From: Ben Hutchings <bhutchings@solarflare.com>

commit aabc5649078310094cbffb430fcbf9c25b6268f9 upstream.

The original code would wait indefinitely if MAC stats DMA failed.

Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

---
 drivers/net/sfc/siena.c |   13 +++++++++++--
 1 file changed, 11 insertions(+), 2 deletions(-)

--- a/drivers/net/sfc/siena.c
+++ b/drivers/net/sfc/siena.c
@@ -454,8 +454,17 @@ static int siena_try_update_nic_stats(st
 
 static void siena_update_nic_stats(struct efx_nic *efx)
 {
-	while (siena_try_update_nic_stats(efx) == -EAGAIN)
-		cpu_relax();
+	int retry;
+
+	/* If we're unlucky enough to read statistics wduring the DMA, wait
+	 * up to 10ms for it to finish (typically takes <500us) */
+	for (retry = 0; retry < 100; ++retry) {
+		if (siena_try_update_nic_stats(efx) == 0)
+			return;
+		udelay(100);
+	}
+
+	/* Use the old values instead */
 }
 
 static void siena_start_nic_stats(struct efx_nic *efx)



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

* [020/117] sfc: Always close net device at the end of a disabling reset
  2010-05-10 22:37 [000/117] 2.6.33.4-stable review Greg KH
                   ` (18 preceding siblings ...)
  2010-05-10 22:31 ` [019/117] sfc: Wait at most 10ms for the MC to finish reading out MAC statistics Greg KH
@ 2010-05-10 22:31 ` Greg KH
  2010-05-10 22:31 ` [021/117] sfc: Change falcon_probe_board() to fail for unsupported boards Greg KH
                   ` (96 subsequent siblings)
  116 siblings, 0 replies; 130+ messages in thread
From: Greg KH @ 2010-05-10 22:31 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: stable-review, torvalds, akpm, alan, Ben Hutchings, David S. Miller

2.6.33-stable review patch.  If anyone has any objections, please let us know.

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

From: Ben Hutchings <bhutchings@solarflare.com>

commit f49a4589e9e25ef525da449b1ce5597cb659bbb5 upstream.

This fixes a regression introduced by commit
eb9f6744cbfa97674c13263802259b5aa0034594 "sfc: Implement ethtool
reset operation".

Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

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

--- a/drivers/net/sfc/efx.c
+++ b/drivers/net/sfc/efx.c
@@ -1862,6 +1862,7 @@ out:
 	}
 
 	if (disabled) {
+		dev_close(efx->net_dev);
 		EFX_ERR(efx, "has been disabled\n");
 		efx->state = STATE_DISABLED;
 	} else {
@@ -1885,8 +1886,7 @@ static void efx_reset_work(struct work_s
 	}
 
 	rtnl_lock();
-	if (efx_reset(efx, efx->reset_pending))
-		dev_close(efx->net_dev);
+	(void)efx_reset(efx, efx->reset_pending);
 	rtnl_unlock();
 }
 



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

* [021/117] sfc: Change falcon_probe_board() to fail for unsupported boards
  2010-05-10 22:37 [000/117] 2.6.33.4-stable review Greg KH
                   ` (19 preceding siblings ...)
  2010-05-10 22:31 ` [020/117] sfc: Always close net device at the end of a disabling reset Greg KH
@ 2010-05-10 22:31 ` Greg KH
  2010-05-10 22:31 ` [022/117] staging: usbip: Fix deadlock Greg KH
                   ` (95 subsequent siblings)
  116 siblings, 0 replies; 130+ messages in thread
From: Greg KH @ 2010-05-10 22:31 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: stable-review, torvalds, akpm, alan, Ben Hutchings, David S. Miller

2.6.33-stable review patch.  If anyone has any objections, please let us know.

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

From: Ben Hutchings <bhutchings@solarflare.com>

commit e41c11ee0cc602bcde68916be85fb97d1a484324 upstream.

The driver needs specific PHY and board support code for each SFC4000
board; there is no point trying to continue if it is missing.
Currently unsupported boards can trigger an 'oops'.

Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

---
 drivers/net/sfc/falcon.c        |    4 +++-
 drivers/net/sfc/falcon_boards.c |   13 +++----------
 drivers/net/sfc/nic.h           |    2 +-
 3 files changed, 7 insertions(+), 12 deletions(-)

--- a/drivers/net/sfc/falcon.c
+++ b/drivers/net/sfc/falcon.c
@@ -1317,7 +1317,9 @@ static int falcon_probe_nvconfig(struct
 
 	EFX_LOG(efx, "PHY is %d phy_id %d\n", efx->phy_type, efx->mdio.prtad);
 
-	falcon_probe_board(efx, board_rev);
+	rc = falcon_probe_board(efx, board_rev);
+	if (rc)
+		goto fail2;
 
 	kfree(nvconfig);
 	return 0;
--- a/drivers/net/sfc/falcon_boards.c
+++ b/drivers/net/sfc/falcon_boards.c
@@ -728,15 +728,7 @@ static const struct falcon_board_type bo
 	},
 };
 
-static const struct falcon_board_type falcon_dummy_board = {
-	.init		= efx_port_dummy_op_int,
-	.init_phy	= efx_port_dummy_op_void,
-	.fini		= efx_port_dummy_op_void,
-	.set_id_led	= efx_port_dummy_op_set_id_led,
-	.monitor	= efx_port_dummy_op_int,
-};
-
-void falcon_probe_board(struct efx_nic *efx, u16 revision_info)
+int falcon_probe_board(struct efx_nic *efx, u16 revision_info)
 {
 	struct falcon_board *board = falcon_board(efx);
 	u8 type_id = FALCON_BOARD_TYPE(revision_info);
@@ -754,8 +746,9 @@ void falcon_probe_board(struct efx_nic *
 			 (efx->pci_dev->subsystem_vendor == EFX_VENDID_SFC)
 			 ? board->type->ref_model : board->type->gen_type,
 			 'A' + board->major, board->minor);
+		return 0;
 	} else {
 		EFX_ERR(efx, "unknown board type %d\n", type_id);
-		board->type = &falcon_dummy_board;
+		return -ENODEV;
 	}
 }
--- a/drivers/net/sfc/nic.h
+++ b/drivers/net/sfc/nic.h
@@ -156,7 +156,7 @@ extern struct efx_nic_type siena_a0_nic_
  **************************************************************************
  */
 
-extern void falcon_probe_board(struct efx_nic *efx, u16 revision_info);
+extern int falcon_probe_board(struct efx_nic *efx, u16 revision_info);
 
 /* TX data path */
 extern int efx_nic_probe_tx(struct efx_tx_queue *tx_queue);



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

* [022/117] staging: usbip: Fix deadlock
  2010-05-10 22:37 [000/117] 2.6.33.4-stable review Greg KH
                   ` (20 preceding siblings ...)
  2010-05-10 22:31 ` [021/117] sfc: Change falcon_probe_board() to fail for unsupported boards Greg KH
@ 2010-05-10 22:31 ` Greg KH
  2010-05-10 22:31 ` [023/117] USB: fix remote wakeup settings during system sleep Greg KH
                   ` (94 subsequent siblings)
  116 siblings, 0 replies; 130+ messages in thread
From: Greg KH @ 2010-05-10 22:31 UTC (permalink / raw)
  To: linux-kernel, stable; +Cc: stable-review, torvalds, akpm, alan, Eric Lescouet

2.6.33-stable review patch.  If anyone has any objections, please let us know.

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

From: Eric Lescouet <lescouet@virtuallogix.com>

commit d01f42a22ef381ba973958e977209ac9a8667d57 upstream.

When detaching a port from the client side (usbip --detach 0),
the event thread, on the server side, is going to deadlock.
The "eh" server thread is getting USBIP_EH_RESET event and calls:
  -> stub_device_reset() -> usb_reset_device()
the USB framework is then calling back _in the same "eh" thread_ :
  -> stub_disconnect() -> usbip_stop_eh() -> wait_for_completion()
the "eh" thread is being asleep forever, waiting for its own completion.
This patch checks if "eh" is the current thread, in usbip_stop_eh().

Signed-off-by: Eric Lescouet <eric@lescouet.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

---
 drivers/staging/usbip/usbip_event.c |    3 +++
 1 file changed, 3 insertions(+)

--- a/drivers/staging/usbip/usbip_event.c
+++ b/drivers/staging/usbip/usbip_event.c
@@ -117,6 +117,9 @@ void usbip_stop_eh(struct usbip_device *
 {
 	struct usbip_task *eh = &ud->eh;
 
+	if (eh->thread == current)
+		return; /* do not wait for myself */
+
 	wait_for_completion(&eh->thread_done);
 	usbip_dbg_eh("usbip_eh has finished\n");
 }



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

* [023/117] USB: fix remote wakeup settings during system sleep
  2010-05-10 22:37 [000/117] 2.6.33.4-stable review Greg KH
                   ` (21 preceding siblings ...)
  2010-05-10 22:31 ` [022/117] staging: usbip: Fix deadlock Greg KH
@ 2010-05-10 22:31 ` Greg KH
  2010-05-10 22:31 ` [024/117] USB: Add id for HP ev2210 a.k.a Sierra MC5725 miniPCI-e Cell Modem Greg KH
                   ` (93 subsequent siblings)
  116 siblings, 0 replies; 130+ messages in thread
From: Greg KH @ 2010-05-10 22:31 UTC (permalink / raw)
  To: linux-kernel, stable, Greg KH
  Cc: stable-review, torvalds, akpm, alan, Alan Stern

2.6.33-stable review patch.  If anyone has any objections, please let us know.

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

This is a backport of commit 5f677f1d45b2bf08085bbba7394392dfa586fa8e.
Some of the functionality had to be removed, but it should still fix
the webcam problem.

This patch (as1363b) changes the way USB remote wakeup is handled
during system sleeps.  It won't be enabled unless an interface driver
specifically needs it.  Also, it won't be enabled during the FREEZE or
QUIESCE phases of hibernation, when the system doesn't respond to
wakeup events anyway.

This will fix problems people have reported with certain USB webcams
that generate wakeup requests when they shouldn't, and as a result
cause system suspends to fail.  See

	https://bugs.launchpad.net/ubuntu/+source/linux/+bug/515109


Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

---
 drivers/usb/core/driver.c |   32 ++++++++++++++++++++++++++++++--
 1 file changed, 30 insertions(+), 2 deletions(-)

--- a/drivers/usb/core/driver.c
+++ b/drivers/usb/core/driver.c
@@ -1255,9 +1255,8 @@ static int usb_suspend_both(struct usb_d
 			udev->state == USB_STATE_SUSPENDED)
 		goto done;
 
-	udev->do_remote_wakeup = device_may_wakeup(&udev->dev);
-
 	if (msg.event & PM_EVENT_AUTO) {
+		udev->do_remote_wakeup = device_may_wakeup(&udev->dev);
 		status = autosuspend_check(udev, 0);
 		if (status < 0)
 			goto done;
@@ -1789,6 +1788,34 @@ int usb_external_resume_device(struct us
 	return status;
 }
 
+static void choose_wakeup(struct usb_device *udev, pm_message_t msg)
+{
+	int			w, i;
+	struct usb_interface	*intf;
+
+	/* Remote wakeup is needed only when we actually go to sleep.
+	 * For things like FREEZE and QUIESCE, if the device is already
+	 * autosuspended then its current wakeup setting is okay.
+	 */
+	if (msg.event == PM_EVENT_FREEZE || msg.event == PM_EVENT_QUIESCE) {
+		udev->do_remote_wakeup = 0;
+		return;
+	}
+
+	/* If remote wakeup is permitted, see whether any interface drivers
+	 * actually want it.
+	 */
+	w = 0;
+	if (device_may_wakeup(&udev->dev) && udev->actconfig) {
+		for (i = 0; i < udev->actconfig->desc.bNumInterfaces; i++) {
+			intf = udev->actconfig->interface[i];
+			w |= intf->needs_remote_wakeup;
+		}
+	}
+
+	udev->do_remote_wakeup = w;
+}
+
 int usb_suspend(struct device *dev, pm_message_t msg)
 {
 	struct usb_device	*udev;
@@ -1808,6 +1835,7 @@ int usb_suspend(struct device *dev, pm_m
 	}
 
 	udev->skip_sys_resume = 0;
+	choose_wakeup(udev, msg);
 	return usb_external_suspend_device(udev, msg);
 }
 



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

* [024/117] USB: Add id for HP ev2210 a.k.a Sierra MC5725 miniPCI-e Cell Modem.
  2010-05-10 22:37 [000/117] 2.6.33.4-stable review Greg KH
                   ` (22 preceding siblings ...)
  2010-05-10 22:31 ` [023/117] USB: fix remote wakeup settings during system sleep Greg KH
@ 2010-05-10 22:31 ` Greg KH
  2010-05-10 22:31 ` [025/117] USB: dont read past config->interface[] if usb_control_msg() fails in usb_reset_configuration() Greg KH
                   ` (92 subsequent siblings)
  116 siblings, 0 replies; 130+ messages in thread
From: Greg KH @ 2010-05-10 22:31 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: stable-review, torvalds, akpm, alan, William Lightning

2.6.33-stable review patch.  If anyone has any objections, please let us know.

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

From: William Lightning <kassah@gmail.com>

commit cfbaa39347b34837f26e01fe8f4f8dbbae60b520 upstream.

Signed-off-by: William Lightning <kassah@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

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

--- a/drivers/usb/serial/sierra.c
+++ b/drivers/usb/serial/sierra.c
@@ -229,6 +229,7 @@ static const struct sierra_iface_info di
 static struct usb_device_id id_table [] = {
 	{ USB_DEVICE(0x0F3D, 0x0112) }, /* Airprime/Sierra PC 5220 */
 	{ USB_DEVICE(0x03F0, 0x1B1D) },	/* HP ev2200 a.k.a MC5720 */
+	{ USB_DEVICE(0x03F0, 0x211D) }, /* HP ev2210 a.k.a MC5725 */
 	{ USB_DEVICE(0x03F0, 0x1E1D) },	/* HP hs2300 a.k.a MC8775 */
 
 	{ USB_DEVICE(0x1199, 0x0017) },	/* Sierra Wireless EM5625 */



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

* [025/117] USB: dont read past config->interface[] if usb_control_msg() fails in usb_reset_configuration()
  2010-05-10 22:37 [000/117] 2.6.33.4-stable review Greg KH
                   ` (23 preceding siblings ...)
  2010-05-10 22:31 ` [024/117] USB: Add id for HP ev2210 a.k.a Sierra MC5725 miniPCI-e Cell Modem Greg KH
@ 2010-05-10 22:31 ` Greg KH
  2010-05-10 22:31 ` [026/117] USB: fix testing the wrong variable in fs_create_by_name() Greg KH
                   ` (91 subsequent siblings)
  116 siblings, 0 replies; 130+ messages in thread
From: Greg KH @ 2010-05-10 22:31 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: stable-review, torvalds, akpm, alan, Roel Kluin, Alan Stern, Sarah Sharp

2.6.33-stable review patch.  If anyone has any objections, please let us know.

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

From: Roel Kluin <roel.kluin@gmail.com>

commit e4a3d94658b5760fc947d7f7185c57db47ca362a upstream.

While looping over the interfaces, if usb_hcd_alloc_bandwidth() fails it calls
hcd->driver->reset_bandwidth(), so there was no need to reinstate the interface
again.

If no break occurred, the index equals config->desc.bNumInterfaces. A
subsequent usb_control_msg() failure resulted in a read from
config->interface[config->desc.bNumInterfaces] at label reset_old_alts.

In either case the last interface should be skipped.

Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
Acked-by: Alan Stern <stern@rowland.harvard.edu>
Acked-by: Sarah Sharp <sarah.a.sharp@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

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

--- a/drivers/usb/core/message.c
+++ b/drivers/usb/core/message.c
@@ -1471,7 +1471,7 @@ int usb_reset_configuration(struct usb_d
 	/* If not, reinstate the old alternate settings */
 	if (retval < 0) {
 reset_old_alts:
-		for (; i >= 0; i--) {
+		for (i--; i >= 0; i--) {
 			struct usb_interface *intf = config->interface[i];
 			struct usb_host_interface *alt;
 



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

* [026/117] USB: fix testing the wrong variable in fs_create_by_name()
  2010-05-10 22:37 [000/117] 2.6.33.4-stable review Greg KH
                   ` (24 preceding siblings ...)
  2010-05-10 22:31 ` [025/117] USB: dont read past config->interface[] if usb_control_msg() fails in usb_reset_configuration() Greg KH
@ 2010-05-10 22:31 ` Greg KH
  2010-05-10 22:31 ` [027/117] USB: dont choose configs with no interfaces Greg KH
                   ` (90 subsequent siblings)
  116 siblings, 0 replies; 130+ messages in thread
From: Greg KH @ 2010-05-10 22:31 UTC (permalink / raw)
  To: linux-kernel, stable; +Cc: stable-review, torvalds, akpm, alan, Dan Carpenter

2.6.33-stable review patch.  If anyone has any objections, please let us know.

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

From: Dan Carpenter <error27@gmail.com>

commit fa7fe7af146a7b613e36a311eefbbfb5555325d1 upstream.

There is a typo here.  We should be testing "*dentry" which was just
assigned instead of "dentry".  This could result in dereferencing an
ERR_PTR inside either usbfs_mkdir() or usbfs_create().

Signed-off-by: Dan Carpenter <error27@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

---
 drivers/usb/core/inode.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

--- a/drivers/usb/core/inode.c
+++ b/drivers/usb/core/inode.c
@@ -515,13 +515,13 @@ static int fs_create_by_name (const char
 	*dentry = NULL;
 	mutex_lock(&parent->d_inode->i_mutex);
 	*dentry = lookup_one_len(name, parent, strlen(name));
-	if (!IS_ERR(dentry)) {
+	if (!IS_ERR(*dentry)) {
 		if ((mode & S_IFMT) == S_IFDIR)
 			error = usbfs_mkdir (parent->d_inode, *dentry, mode);
 		else 
 			error = usbfs_create (parent->d_inode, *dentry, mode);
 	} else
-		error = PTR_ERR(dentry);
+		error = PTR_ERR(*dentry);
 	mutex_unlock(&parent->d_inode->i_mutex);
 
 	return error;



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

* [027/117] USB: dont choose configs with no interfaces
  2010-05-10 22:37 [000/117] 2.6.33.4-stable review Greg KH
                   ` (25 preceding siblings ...)
  2010-05-10 22:31 ` [026/117] USB: fix testing the wrong variable in fs_create_by_name() Greg KH
@ 2010-05-10 22:31 ` Greg KH
  2010-05-10 22:31 ` [028/117] USB: OHCI: dont look at the root hub to get the number of ports Greg KH
                   ` (89 subsequent siblings)
  116 siblings, 0 replies; 130+ messages in thread
From: Greg KH @ 2010-05-10 22:31 UTC (permalink / raw)
  To: linux-kernel, stable; +Cc: stable-review, torvalds, akpm, alan, Alan Stern

2.6.33-stable review patch.  If anyone has any objections, please let us know.

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

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

commit 62f9cfa3ece58268b3e92ca59c23b175f86205aa upstream.

This patch (as1372) fixes a bug in the routine that chooses the
default configuration to install when a new USB device is detected.
The algorithm is supposed to look for a config whose first interface
is for a non-vendor-specific class.  But the way it's currently
written, it will also accept a config with no interfaces at all, which
is not very useful.  (Believe it or not, such things do exist.)

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Tested-by: Andrew Victor <avictor.za@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

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

--- a/drivers/usb/core/generic.c
+++ b/drivers/usb/core/generic.c
@@ -120,7 +120,7 @@ int usb_choose_configuration(struct usb_
 		 * than a vendor-specific driver. */
 		else if (udev->descriptor.bDeviceClass !=
 						USB_CLASS_VENDOR_SPEC &&
-				(!desc || desc->bInterfaceClass !=
+				(desc && desc->bInterfaceClass !=
 						USB_CLASS_VENDOR_SPEC)) {
 			best = c;
 			break;



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

* [028/117] USB: OHCI: dont look at the root hub to get the number of ports
  2010-05-10 22:37 [000/117] 2.6.33.4-stable review Greg KH
                   ` (26 preceding siblings ...)
  2010-05-10 22:31 ` [027/117] USB: dont choose configs with no interfaces Greg KH
@ 2010-05-10 22:31 ` Greg KH
  2010-05-10 22:32 ` [029/117] USB: xhci: properly set the "Mult" field of the endpoint context Greg KH
                   ` (88 subsequent siblings)
  116 siblings, 0 replies; 130+ messages in thread
From: Greg KH @ 2010-05-10 22:31 UTC (permalink / raw)
  To: linux-kernel, stable; +Cc: stable-review, torvalds, akpm, alan, Alan Stern

2.6.33-stable review patch.  If anyone has any objections, please let us know.

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

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

commit fcf7d2141f4a363a4a8454c4a0f26bb69e766c5f upstream.

This patch (as1371) fixes a small bug in ohci-hcd.  The HCD already
knows how many ports the controller has; there's no need to go looking
at the root hub's usb_device structure to find out.  Especially since
the root hub's maxchild value is set correctly only while the root hub
is bound to the hub driver.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

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

--- a/drivers/usb/host/ohci-hub.c
+++ b/drivers/usb/host/ohci-hub.c
@@ -697,7 +697,7 @@ static int ohci_hub_control (
 	u16		wLength
 ) {
 	struct ohci_hcd	*ohci = hcd_to_ohci (hcd);
-	int		ports = hcd_to_bus (hcd)->root_hub->maxchild;
+	int		ports = ohci->num_ports;
 	u32		temp;
 	int		retval = 0;
 



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

* [029/117] USB: xhci: properly set the "Mult" field of the endpoint context.
  2010-05-10 22:37 [000/117] 2.6.33.4-stable review Greg KH
                   ` (27 preceding siblings ...)
  2010-05-10 22:31 ` [028/117] USB: OHCI: dont look at the root hub to get the number of ports Greg KH
@ 2010-05-10 22:32 ` Greg KH
  2010-05-10 22:32 ` [030/117] USB: xhci: properly set endpoint context fields for periodic eps Greg KH
                   ` (87 subsequent siblings)
  116 siblings, 0 replies; 130+ messages in thread
From: Greg KH @ 2010-05-10 22:32 UTC (permalink / raw)
  To: linux-kernel, stable; +Cc: stable-review, torvalds, akpm, alan, Sarah Sharp

2.6.33-stable review patch.  If anyone has any objections, please let us know.

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

From: Sarah Sharp <sarah.a.sharp@linux.intel.com>

commit 1cf62246c0e394021e494e0a8f1013e80db1a1a9 upstream.

A SuperSpeed interrupt or isochronous endpoint can define the number of
"burst transactions" it can handle in a service interval.  This is
indicated by the "Mult" bits in the bmAttributes of the SuperSpeed
Endpoint Companion Descriptor.  For example, if it has a max packet size
of 1024, a max burst of 11, and a mult of 3, the host may send 33
1024-byte packets in one service interval.

We must tell the xHCI host controller the number of multiple service
opportunities (mults) the device can handle when the endpoint is
installed.  We do that by setting the Mult field of the Endpoint Context
before a configure endpoint command is sent down.  The Mult field is
invalid for control or bulk SuperSpeed endpoints.

Signed-off-by: Sarah Sharp <sarah.a.sharp@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

---
 drivers/usb/host/xhci-mem.c |   14 ++++++++++++++
 1 file changed, 14 insertions(+)

--- a/drivers/usb/host/xhci-mem.c
+++ b/drivers/usb/host/xhci-mem.c
@@ -549,6 +549,19 @@ static inline unsigned int xhci_get_endp
 	return EP_INTERVAL(interval);
 }
 
+/* The "Mult" field in the endpoint context is only set for SuperSpeed devices.
+ * High speed endpoint descriptors can define "the number of additional
+ * transaction opportunities per microframe", but that goes in the Max Burst
+ * endpoint context field.
+ */
+static inline u32 xhci_get_endpoint_mult(struct usb_device *udev,
+		struct usb_host_endpoint *ep)
+{
+	if (udev->speed != USB_SPEED_SUPER || !ep->ss_ep_comp)
+		return 0;
+	return ep->ss_ep_comp->desc.bmAttributes;
+}
+
 static inline u32 xhci_get_endpoint_type(struct usb_device *udev,
 		struct usb_host_endpoint *ep)
 {
@@ -611,6 +624,7 @@ int xhci_endpoint_init(struct xhci_hcd *
 	ep_ctx->deq = ep_ring->first_seg->dma | ep_ring->cycle_state;
 
 	ep_ctx->ep_info = xhci_get_endpoint_interval(udev, ep);
+	ep_ctx->ep_info |= EP_MULT(xhci_get_endpoint_mult(udev, ep));
 
 	/* FIXME dig Mult and streams info out of ep companion desc */
 



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

* [030/117] USB: xhci: properly set endpoint context fields for periodic eps.
  2010-05-10 22:37 [000/117] 2.6.33.4-stable review Greg KH
                   ` (28 preceding siblings ...)
  2010-05-10 22:32 ` [029/117] USB: xhci: properly set the "Mult" field of the endpoint context Greg KH
@ 2010-05-10 22:32 ` Greg KH
  2010-05-10 22:32 ` [031/117] ocfs2: Update VFS inodes id info after reflink Greg KH
                   ` (86 subsequent siblings)
  116 siblings, 0 replies; 130+ messages in thread
From: Greg KH @ 2010-05-10 22:32 UTC (permalink / raw)
  To: linux-kernel, stable; +Cc: stable-review, torvalds, akpm, alan, Sarah Sharp

2.6.33-stable review patch.  If anyone has any objections, please let us know.

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

From: Sarah Sharp <sarah.a.sharp@linux.intel.com>

commit 9238f25d5d32a435277eb234ec82bacdd5daed41 upstream.

For periodic endpoints, we must let the xHCI hardware know the maximum
payload an endpoint can transfer in one service interval.  The xHCI
specification refers to this as the Maximum Endpoint Service Interval Time
Payload (Max ESIT Payload).  This is used by the hardware for bandwidth
management and scheduling of packets.

For SuperSpeed endpoints, the maximum is calculated by multiplying the max
packet size by the number of bursts and the number of opportunities to
transfer within a service interval (the Mult field of the SuperSpeed
Endpoint companion descriptor).  Devices advertise this in the
wBytesPerInterval field of their SuperSpeed Endpoint Companion Descriptor.

For high speed devices, this is taken by multiplying the max packet size by the
"number of additional transaction opportunities per microframe" (the high
bits of the wMaxPacketSize field in the endpoint descriptor).

For FS/LS devices, this is just the max packet size.

The other thing we must set in the endpoint context is the Average TRB
Length.  This is supposed to be the average of the total bytes in the
transfer descriptor (TD), divided by the number of transfer request blocks
(TRBs) it takes to describe the TD.  This gives the host controller an
indication of whether the driver will be enqueuing a scatter gather list
with many entries comprised of small buffers, or one contiguous buffer.

It also takes into account the number of extra TRBs you need for every TD.
This includes No-op TRBs and Link TRBs used to link ring segments
together.  Some drivers may choose to chain an Event Data TRB on the end
of every TD, thus increasing the average number of TRBs per TD.  The Linux
xHCI driver does not use Event Data TRBs.

In theory, if there was an API to allow drivers to state what their
bandwidth requirements are, we could set this field accurately.  For now,
we set it to the same number as the Max ESIT payload.

The Average TRB Length should also be set for bulk and control endpoints,
but I have no idea how to guess what it should be.

Signed-off-by: Sarah Sharp <sarah.a.sharp@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

---
 drivers/usb/host/xhci-mem.c |   51 ++++++++++++++++++++++++++++++++++++++++++++
 drivers/usb/host/xhci.h     |    4 +++
 2 files changed, 55 insertions(+)

--- a/drivers/usb/host/xhci-mem.c
+++ b/drivers/usb/host/xhci-mem.c
@@ -592,6 +592,36 @@ static inline u32 xhci_get_endpoint_type
 	return type;
 }
 
+/* Return the maximum endpoint service interval time (ESIT) payload.
+ * Basically, this is the maxpacket size, multiplied by the burst size
+ * and mult size.
+ */
+static inline u32 xhci_get_max_esit_payload(struct xhci_hcd *xhci,
+		struct usb_device *udev,
+		struct usb_host_endpoint *ep)
+{
+	int max_burst;
+	int max_packet;
+
+	/* Only applies for interrupt or isochronous endpoints */
+	if (usb_endpoint_xfer_control(&ep->desc) ||
+			usb_endpoint_xfer_bulk(&ep->desc))
+		return 0;
+
+	if (udev->speed == USB_SPEED_SUPER) {
+		if (ep->ss_ep_comp)
+			return ep->ss_ep_comp->desc.wBytesPerInterval;
+		xhci_warn(xhci, "WARN no SS endpoint companion descriptor.\n");
+		/* Assume no bursts, no multiple opportunities to send. */
+		return ep->desc.wMaxPacketSize;
+	}
+
+	max_packet = ep->desc.wMaxPacketSize & 0x3ff;
+	max_burst = (ep->desc.wMaxPacketSize & 0x1800) >> 11;
+	/* A 0 in max burst means 1 transfer per ESIT */
+	return max_packet * (max_burst + 1);
+}
+
 int xhci_endpoint_init(struct xhci_hcd *xhci,
 		struct xhci_virt_device *virt_dev,
 		struct usb_device *udev,
@@ -603,6 +633,7 @@ int xhci_endpoint_init(struct xhci_hcd *
 	struct xhci_ring *ep_ring;
 	unsigned int max_packet;
 	unsigned int max_burst;
+	u32 max_esit_payload;
 
 	ep_index = xhci_get_endpoint_index(&ep->desc);
 	ep_ctx = xhci_get_ep_ctx(xhci, virt_dev->in_ctx, ep_index);
@@ -670,6 +701,26 @@ int xhci_endpoint_init(struct xhci_hcd *
 	default:
 		BUG();
 	}
+	max_esit_payload = xhci_get_max_esit_payload(xhci, udev, ep);
+	ep_ctx->tx_info = MAX_ESIT_PAYLOAD_FOR_EP(max_esit_payload);
+
+	/*
+	 * XXX no idea how to calculate the average TRB buffer length for bulk
+	 * endpoints, as the driver gives us no clue how big each scatter gather
+	 * list entry (or buffer) is going to be.
+	 *
+	 * For isochronous and interrupt endpoints, we set it to the max
+	 * available, until we have new API in the USB core to allow drivers to
+	 * declare how much bandwidth they actually need.
+	 *
+	 * Normally, it would be calculated by taking the total of the buffer
+	 * lengths in the TD and then dividing by the number of TRBs in a TD,
+	 * including link TRBs, No-op TRBs, and Event data TRBs.  Since we don't
+	 * use Event Data TRBs, and we don't chain in a link TRB on short
+	 * transfers, we're basically dividing by 1.
+	 */
+	ep_ctx->tx_info |= AVG_TRB_LENGTH_FOR_EP(max_esit_payload);
+
 	/* FIXME Debug endpoint context */
 	return 0;
 }
--- a/drivers/usb/host/xhci.h
+++ b/drivers/usb/host/xhci.h
@@ -609,6 +609,10 @@ struct xhci_ep_ctx {
 #define MAX_PACKET_MASK		(0xffff << 16)
 #define MAX_PACKET_DECODED(p)	(((p) >> 16) & 0xffff)
 
+/* tx_info bitmasks */
+#define AVG_TRB_LENGTH_FOR_EP(p)	((p) & 0xffff)
+#define MAX_ESIT_PAYLOAD_FOR_EP(p)	(((p) & 0xffff) << 16)
+
 
 /**
  * struct xhci_input_control_context



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

* [031/117] ocfs2: Update VFS inodes id info after reflink.
  2010-05-10 22:37 [000/117] 2.6.33.4-stable review Greg KH
                   ` (29 preceding siblings ...)
  2010-05-10 22:32 ` [030/117] USB: xhci: properly set endpoint context fields for periodic eps Greg KH
@ 2010-05-10 22:32 ` Greg KH
  2010-05-10 22:32 ` [032/117] ocfs2: potential ERR_PTR dereference on error paths Greg KH
                   ` (85 subsequent siblings)
  116 siblings, 0 replies; 130+ messages in thread
From: Greg KH @ 2010-05-10 22:32 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: stable-review, torvalds, akpm, alan, Tao Ma, Joel Becker

2.6.33-stable review patch.  If anyone has any objections, please let us know.

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

From: Tao Ma <tao.ma@oracle.com>

commit c21a534e2f24968cf74976a4e721ac194db30ded upstream.

In reflink we update the id info on the disk but forgot to update
the corresponding information in the VFS inode.  Update them
accordingly when we want to preserve the attributes.

Reported-by: Jeff Liu <jeff.liu@oracle.com>
Signed-off-by: Tao Ma <tao.ma@oracle.com>
Signed-off-by: Joel Becker <joel.becker@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

---
 fs/ocfs2/refcounttree.c |    3 +++
 1 file changed, 3 insertions(+)

--- a/fs/ocfs2/refcounttree.c
+++ b/fs/ocfs2/refcounttree.c
@@ -4083,6 +4083,9 @@ static int ocfs2_complete_reflink(struct
 	di->i_attr = s_di->i_attr;
 
 	if (preserve) {
+		t_inode->i_uid = s_inode->i_uid;
+		t_inode->i_gid = s_inode->i_gid;
+		t_inode->i_mode = s_inode->i_mode;
 		di->i_uid = s_di->i_uid;
 		di->i_gid = s_di->i_gid;
 		di->i_mode = s_di->i_mode;



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

* [032/117] ocfs2: potential ERR_PTR dereference on error paths
  2010-05-10 22:37 [000/117] 2.6.33.4-stable review Greg KH
                   ` (30 preceding siblings ...)
  2010-05-10 22:32 ` [031/117] ocfs2: Update VFS inodes id info after reflink Greg KH
@ 2010-05-10 22:32 ` Greg KH
  2010-05-10 22:32 ` [033/117] ocfs2: Compute metaecc for superblocks during online resize Greg KH
                   ` (84 subsequent siblings)
  116 siblings, 0 replies; 130+ messages in thread
From: Greg KH @ 2010-05-10 22:32 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: stable-review, torvalds, akpm, alan, Dan Carpenter, Joel Becker

2.6.33-stable review patch.  If anyone has any objections, please let us know.

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

From: Dan Carpenter <error27@gmail.com>

commit 0350cb078f5035716ebdad4ad4709d02fe466a8a upstream.

If "handle" is non null at the end of the function then we assume it's a
valid pointer and pass it to ocfs2_commit_trans();

Signed-off-by: Dan Carpenter <error27@gmail.com>
Signed-off-by: Joel Becker <joel.becker@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

---
 fs/ocfs2/inode.c |    1 +
 1 file changed, 1 insertion(+)

--- a/fs/ocfs2/inode.c
+++ b/fs/ocfs2/inode.c
@@ -559,6 +559,7 @@ static int ocfs2_truncate_for_delete(str
 		handle = ocfs2_start_trans(osb, OCFS2_INODE_UPDATE_CREDITS);
 		if (IS_ERR(handle)) {
 			status = PTR_ERR(handle);
+			handle = NULL;
 			mlog_errno(status);
 			goto out;
 		}



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

* [033/117] ocfs2: Compute metaecc for superblocks during online resize.
  2010-05-10 22:37 [000/117] 2.6.33.4-stable review Greg KH
                   ` (31 preceding siblings ...)
  2010-05-10 22:32 ` [032/117] ocfs2: potential ERR_PTR dereference on error paths Greg KH
@ 2010-05-10 22:32 ` Greg KH
  2010-05-10 22:32 ` [034/117] ocfs2_dlmfs: Fix math error when reading LVB Greg KH
                   ` (83 subsequent siblings)
  116 siblings, 0 replies; 130+ messages in thread
From: Greg KH @ 2010-05-10 22:32 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: stable-review, torvalds, akpm, alan, Joel Becker, Mark Fasheh

2.6.33-stable review patch.  If anyone has any objections, please let us know.

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

From: Joel Becker <joel.becker@oracle.com>

commit a42ab8e1a37257da37e0f018e707bf365ac24531 upstream.

Online resize writes out the new superblock and its backups directly.
The metaecc data wasn't being recomputed.  Let's do that directly.

Signed-off-by: Joel Becker <joel.becker@oracle.com>
Acked-by: Mark Fasheh <mfasheh@suse.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

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

--- a/fs/ocfs2/buffer_head_io.c
+++ b/fs/ocfs2/buffer_head_io.c
@@ -407,6 +407,7 @@ int ocfs2_write_super_or_backup(struct o
 				struct buffer_head *bh)
 {
 	int ret = 0;
+	struct ocfs2_dinode *di = (struct ocfs2_dinode *)bh->b_data;
 
 	mlog_entry_void();
 
@@ -426,6 +427,7 @@ int ocfs2_write_super_or_backup(struct o
 
 	get_bh(bh); /* for end_buffer_write_sync() */
 	bh->b_end_io = end_buffer_write_sync;
+	ocfs2_compute_meta_ecc(osb->sb, bh->b_data, &di->i_check);
 	submit_bh(WRITE, bh);
 
 	wait_on_buffer(bh);



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

* [034/117] ocfs2_dlmfs: Fix math error when reading LVB.
  2010-05-10 22:37 [000/117] 2.6.33.4-stable review Greg KH
                   ` (32 preceding siblings ...)
  2010-05-10 22:32 ` [033/117] ocfs2: Compute metaecc for superblocks during online resize Greg KH
@ 2010-05-10 22:32 ` Greg KH
  2010-05-10 22:32 ` [035/117] powernow-k8: Fix frequency reporting Greg KH
                   ` (82 subsequent siblings)
  116 siblings, 0 replies; 130+ messages in thread
From: Greg KH @ 2010-05-10 22:32 UTC (permalink / raw)
  To: linux-kernel, stable; +Cc: stable-review, torvalds, akpm, alan, Joel Becker

2.6.33-stable review patch.  If anyone has any objections, please let us know.

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

From: Joel Becker <joel.becker@oracle.com>

commit a36d515c7a2dfacebcf41729f6812dbc424ebcf0 upstream.

When asked for a partial read of the LVB in a dlmfs file, we can
accidentally calculate a negative count.

Reported-by: Dan Carpenter <error27@gmail.com>
Signed-off-by: Joel Becker <joel.becker@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

---
 fs/ocfs2/dlm/dlmfs.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- a/fs/ocfs2/dlm/dlmfs.c
+++ b/fs/ocfs2/dlm/dlmfs.c
@@ -205,7 +205,7 @@ static ssize_t dlmfs_file_read(struct fi
 	if ((count + *ppos) > i_size_read(inode))
 		readlen = i_size_read(inode) - *ppos;
 	else
-		readlen = count - *ppos;
+		readlen = count;
 
 	lvb_buf = kmalloc(readlen, GFP_NOFS);
 	if (!lvb_buf)



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

* [035/117] powernow-k8: Fix frequency reporting
  2010-05-10 22:37 [000/117] 2.6.33.4-stable review Greg KH
                   ` (33 preceding siblings ...)
  2010-05-10 22:32 ` [034/117] ocfs2_dlmfs: Fix math error when reading LVB Greg KH
@ 2010-05-10 22:32 ` Greg KH
  2010-05-10 22:32 ` [036/117] nfs d_revalidate() is too trigger-happy with d_drop() Greg KH
                   ` (81 subsequent siblings)
  116 siblings, 0 replies; 130+ messages in thread
From: Greg KH @ 2010-05-10 22:32 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: stable-review, torvalds, akpm, alan, Mark Langsdorf,
	Borislav Petkov, H. Peter Anvin, Ingo Molnar

2.6.33-stable review patch.  If anyone has any objections, please let us know.

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

From: Mark Langsdorf <mark.langsdorf@amd.com>

commit b810e94c9d8e3fff6741b66cd5a6f099a7887871 upstream.

With F10, model 10, all valid frequencies are in the ACPI _PST table.

Signed-off-by: Mark Langsdorf <mark.langsdorf@amd.com>
LKML-Reference: <1270065406-1814-6-git-send-email-bp@amd64.org>
Signed-off-by: Borislav Petkov <borislav.petkov@amd.com>
Reviewed-by: Thomas Renninger <trenn@suse.de>
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

---
 arch/x86/kernel/cpu/cpufreq/powernow-k8.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

--- a/arch/x86/kernel/cpu/cpufreq/powernow-k8.c
+++ b/arch/x86/kernel/cpu/cpufreq/powernow-k8.c
@@ -929,7 +929,8 @@ static int fill_powernow_table_pstate(st
 		powernow_table[i].index = index;
 
 		/* Frequency may be rounded for these */
-		if (boot_cpu_data.x86 == 0x10 || boot_cpu_data.x86 == 0x11) {
+		if ((boot_cpu_data.x86 == 0x10 && boot_cpu_data.x86_model < 10)
+				 || boot_cpu_data.x86 == 0x11) {
 			powernow_table[i].frequency =
 				freq_from_fid_did(lo & 0x3f, (lo >> 6) & 7);
 		} else



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

* [036/117] nfs d_revalidate() is too trigger-happy with d_drop()
  2010-05-10 22:37 [000/117] 2.6.33.4-stable review Greg KH
                   ` (34 preceding siblings ...)
  2010-05-10 22:32 ` [035/117] powernow-k8: Fix frequency reporting Greg KH
@ 2010-05-10 22:32 ` Greg KH
  2010-05-10 22:32 ` [037/117] NFS: rsize and wsize settings ignored on v4 mounts Greg KH
                   ` (80 subsequent siblings)
  116 siblings, 0 replies; 130+ messages in thread
From: Greg KH @ 2010-05-10 22:32 UTC (permalink / raw)
  To: linux-kernel, stable; +Cc: stable-review, torvalds, akpm, alan, Al Viro

2.6.33-stable review patch.  If anyone has any objections, please let us know.

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

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

commit d9e80b7de91db05c1c4d2e5ebbfd70b3b3ba0e0f upstream.

If dentry found stale happens to be a root of disconnected tree, we
can't d_drop() it; its d_hash is actually part of s_anon and d_drop()
would simply hide it from shrink_dcache_for_umount(), leading to
all sorts of fun, including busy inodes on umount and oopsen after
that.

Bug had been there since at least 2006 (commit c636eb already has it),
so it's definitely -stable fodder.

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

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

--- a/fs/nfs/dir.c
+++ b/fs/nfs/dir.c
@@ -837,6 +837,8 @@ out_zap_parent:
 		/* If we have submounts, don't unhash ! */
 		if (have_submounts(dentry))
 			goto out_valid;
+		if (dentry->d_flags & DCACHE_DISCONNECTED)
+			goto out_valid;
 		shrink_dcache_parent(dentry);
 	}
 	d_drop(dentry);



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

* [037/117] NFS: rsize and wsize settings ignored on v4 mounts
  2010-05-10 22:37 [000/117] 2.6.33.4-stable review Greg KH
                   ` (35 preceding siblings ...)
  2010-05-10 22:32 ` [036/117] nfs d_revalidate() is too trigger-happy with d_drop() Greg KH
@ 2010-05-10 22:32 ` Greg KH
  2010-05-10 22:32 ` [038/117] Staging: hv: Fix a bug affecting IPv6 Greg KH
                   ` (79 subsequent siblings)
  116 siblings, 0 replies; 130+ messages in thread
From: Greg KH @ 2010-05-10 22:32 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: stable-review, torvalds, akpm, alan, Chuck Lever, Trond Myklebust

2.6.33-stable review patch.  If anyone has any objections, please let us know.

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

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

commit 356e76b855bdbfd8d1c5e75bcf0c6bf0dfe83496 upstream.

NFSv4 mounts ignore the rsize and wsize mount options, and always use
the default transfer size for both.  This seems to be because all
NFSv4 mounts are now cloned, and the cloning logic doesn't copy the
rsize and wsize settings from the parent nfs_server.

I tested Fedora's 2.6.32.11-99 and it seems to have this problem as
well, so I'm guessing that .33, .32, and perhaps older kernels have
this issue as well.

Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

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

--- a/fs/nfs/client.c
+++ b/fs/nfs/client.c
@@ -965,6 +965,8 @@ out_error:
 static void nfs_server_copy_userdata(struct nfs_server *target, struct nfs_server *source)
 {
 	target->flags = source->flags;
+	target->rsize = source->rsize;
+	target->wsize = source->wsize;
 	target->acregmin = source->acregmin;
 	target->acregmax = source->acregmax;
 	target->acdirmin = source->acdirmin;



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

* [038/117] Staging: hv: Fix a bug affecting IPv6
  2010-05-10 22:37 [000/117] 2.6.33.4-stable review Greg KH
                   ` (36 preceding siblings ...)
  2010-05-10 22:32 ` [037/117] NFS: rsize and wsize settings ignored on v4 mounts Greg KH
@ 2010-05-10 22:32 ` Greg KH
  2010-05-10 22:32 ` [039/117] Staging: hv: Fix up memory leak on HvCleanup Greg KH
                   ` (78 subsequent siblings)
  116 siblings, 0 replies; 130+ messages in thread
From: Greg KH @ 2010-05-10 22:32 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: stable-review, torvalds, akpm, alan, Hank Janssen, Haiyang Zhang

2.6.33-stable review patch.  If anyone has any objections, please let us know.

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

From: Haiyang Zhang <haiyangz@microsoft.com>

commit 95beae90aa4afce57fb28e6f8238b78217bd7c98 upstream.

Fix a bug affecting IPv6
Added the multicast flag for proper IPv6 function.

Reported-by: Toshikazu Sakai <toshikas@microsoft.com>
Signed-off-by: Hank Janssen <hjanssen@microsoft.com>
Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

---
 drivers/staging/hv/RndisFilter.c |    1 +
 1 file changed, 1 insertion(+)

--- a/drivers/staging/hv/RndisFilter.c
+++ b/drivers/staging/hv/RndisFilter.c
@@ -756,6 +756,7 @@ static int RndisFilterOpenDevice(struct
 
 	ret = RndisFilterSetPacketFilter(Device,
 					 NDIS_PACKET_TYPE_BROADCAST |
+					 NDIS_PACKET_TYPE_ALL_MULTICAST |
 					 NDIS_PACKET_TYPE_DIRECTED);
 	if (ret == 0)
 		Device->State = RNDIS_DEV_DATAINITIALIZED;



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

* [039/117] Staging: hv: Fix up memory leak on HvCleanup
  2010-05-10 22:37 [000/117] 2.6.33.4-stable review Greg KH
                   ` (37 preceding siblings ...)
  2010-05-10 22:32 ` [038/117] Staging: hv: Fix a bug affecting IPv6 Greg KH
@ 2010-05-10 22:32 ` Greg KH
  2010-05-10 22:32 ` [040/117] Staging: hv: name network device ethX rather than sethX Greg KH
                   ` (77 subsequent siblings)
  116 siblings, 0 replies; 130+ messages in thread
From: Greg KH @ 2010-05-10 22:32 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: stable-review, torvalds, akpm, alan, Cyrill Gorcunov,
	Hank Janssen, Haiyang Zhang

2.6.33-stable review patch.  If anyone has any objections, please let us know.

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

From: Cyrill Gorcunov <gorcunov@openvz.org>

commit fa8ad0257ea256381126ecf447694622216c600f upstream.

Don't assign NULL too early

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Cc: Hank Janssen <hjanssen@microsoft.com>
Cc: Haiyang Zhang <haiyangz@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

---
 drivers/staging/hv/Hv.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- a/drivers/staging/hv/Hv.c
+++ b/drivers/staging/hv/Hv.c
@@ -306,9 +306,9 @@ void HvCleanup(void)
 	DPRINT_ENTER(VMBUS);
 
 	if (gHvContext.SignalEventBuffer) {
+		kfree(gHvContext.SignalEventBuffer);
 		gHvContext.SignalEventBuffer = NULL;
 		gHvContext.SignalEventParam = NULL;
-		kfree(gHvContext.SignalEventBuffer);
 	}
 
 	if (gHvContext.GuestId == HV_LINUX_GUEST_ID) {



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

* [040/117] Staging: hv: name network device ethX rather than sethX
  2010-05-10 22:37 [000/117] 2.6.33.4-stable review Greg KH
                   ` (38 preceding siblings ...)
  2010-05-10 22:32 ` [039/117] Staging: hv: Fix up memory leak on HvCleanup Greg KH
@ 2010-05-10 22:32 ` Greg KH
  2010-05-10 22:32 ` [041/117] i2c: Fix probing of FSC hardware monitoring chips Greg KH
                   ` (76 subsequent siblings)
  116 siblings, 0 replies; 130+ messages in thread
From: Greg KH @ 2010-05-10 22:32 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: stable-review, torvalds, akpm, alan, Stephen Hemminger, Hank Janssen

2.6.33-stable review patch.  If anyone has any objections, please let us know.

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

From: Stephen Hemminger <shemminger@vyatta.com>

commit 546d9e101e7a71e6202f47a13ddcd9b8fb05a52e upstream.

This patch makes the HyperV network device use the same naming scheme as
other virtual drivers (Xen, KVM). In an ideal world, userspace tools
would not care what the name is, but some users and applications do
care. Vyatta CLI is one of the tools that does depend on what the name
is.

Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
Cc: Hank Janssen <hjanssen@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

---
 drivers/staging/hv/netvsc_drv.c |    3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

--- a/drivers/staging/hv/netvsc_drv.c
+++ b/drivers/staging/hv/netvsc_drv.c
@@ -413,8 +413,7 @@ static int netvsc_probe(struct device *d
 	if (!net_drv_obj->Base.OnDeviceAdd)
 		return -1;
 
-	net = alloc_netdev(sizeof(struct net_device_context), "seth%d",
-			   ether_setup);
+	net = alloc_etherdev(sizeof(struct net_device_context));
 	if (!net)
 		return -1;
 



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

* [041/117] i2c: Fix probing of FSC hardware monitoring chips
  2010-05-10 22:37 [000/117] 2.6.33.4-stable review Greg KH
                   ` (39 preceding siblings ...)
  2010-05-10 22:32 ` [040/117] Staging: hv: name network device ethX rather than sethX Greg KH
@ 2010-05-10 22:32 ` Greg KH
  2010-05-10 22:32 ` [042/117] perf: Fix resource leak in failure path of perf_event_open() Greg KH
                   ` (75 subsequent siblings)
  116 siblings, 0 replies; 130+ messages in thread
From: Greg KH @ 2010-05-10 22:32 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: stable-review, torvalds, akpm, alan, Jean Delvare, Hans de Goede

2.6.33-stable review patch.  If anyone has any objections, please let us know.

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

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

commit b1d4b390ea4bb480e65974ce522a04022608a8df upstream.

Some FSC hardware monitoring chips (Syleus at least) doesn't like
quick writes we typically use to probe for I2C chips. Use a regular
byte read instead for the address they live at (0x73). These are the
only known chips living at this address on PC systems.

For clarity, this fix should not be needed for kernels 2.6.30 and
later, as we started instantiating the hwmon devices explicitly based
on DMI data. Still, this fix is valuable in the following two cases:
* Support for recent FSC chips on older kernels. The DMI-based device
  instantiation is more difficult to backport than the device support
  itself.
* Case where the DMI-based device instantiation fails, whatever the
  reason. We fall back to probing in that case, so it should work.

This fixes kernel bug #15634:
https://bugzilla.kernel.org/show_bug.cgi?id=15634

Signed-off-by: Jean Delvare <khali@linux-fr.org>
Acked-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

---
 drivers/i2c/i2c-core.c |   21 ++++++++++++++++-----
 1 file changed, 16 insertions(+), 5 deletions(-)

--- a/drivers/i2c/i2c-core.c
+++ b/drivers/i2c/i2c-core.c
@@ -1210,12 +1210,23 @@ static int i2c_detect_address(struct i2c
 		return 0;
 
 	/* Make sure there is something at this address */
-	if (i2c_smbus_xfer(adapter, addr, 0, 0, 0, I2C_SMBUS_QUICK, NULL) < 0)
-		return 0;
+	if (addr == 0x73 && (adapter->class & I2C_CLASS_HWMON)) {
+		/* Special probe for FSC hwmon chips */
+		union i2c_smbus_data dummy;
+
+		if (i2c_smbus_xfer(adapter, addr, 0, I2C_SMBUS_READ, 0,
+				   I2C_SMBUS_BYTE_DATA, &dummy) < 0)
+			return 0;
+	} else {
+		if (i2c_smbus_xfer(adapter, addr, 0, I2C_SMBUS_WRITE, 0,
+				   I2C_SMBUS_QUICK, NULL) < 0)
+			return 0;
 
-	/* Prevent 24RF08 corruption */
-	if ((addr & ~0x0f) == 0x50)
-		i2c_smbus_xfer(adapter, addr, 0, 0, 0, I2C_SMBUS_QUICK, NULL);
+		/* Prevent 24RF08 corruption */
+		if ((addr & ~0x0f) == 0x50)
+			i2c_smbus_xfer(adapter, addr, 0, I2C_SMBUS_WRITE, 0,
+				       I2C_SMBUS_QUICK, NULL);
+	}
 
 	/* Finally call the custom detection function */
 	memset(&info, 0, sizeof(struct i2c_board_info));



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

* [042/117] perf: Fix resource leak in failure path of perf_event_open()
  2010-05-10 22:37 [000/117] 2.6.33.4-stable review Greg KH
                   ` (40 preceding siblings ...)
  2010-05-10 22:32 ` [041/117] i2c: Fix probing of FSC hardware monitoring chips Greg KH
@ 2010-05-10 22:32 ` Greg KH
  2010-05-10 22:32 ` [043/117] raid6: fix recovery performance regression Greg KH
                   ` (74 subsequent siblings)
  116 siblings, 0 replies; 130+ messages in thread
From: Greg KH @ 2010-05-10 22:32 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: stable-review, torvalds, akpm, alan, Tejun Heo, Peter Zijlstra,
	Paul Mackerras, Arnaldo Carvalho de Melo, Ingo Molnar

2.6.33-stable review patch.  If anyone has any objections, please let us know.

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

From: Tejun Heo <tj@kernel.org>

commit 048c852051d2bd5da54a4488bc1f16b0fc74c695 upstream.

perf_event_open() kfrees event after init failure which doesn't
release all resources allocated by perf_event_alloc().  Use
free_event() instead.

Signed-off-by: Tejun Heo <tj@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Paul Mackerras <paulus@au1.ibm.com>
Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
LKML-Reference: <4BDBE237.1040809@kernel.org>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

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

--- a/kernel/perf_event.c
+++ b/kernel/perf_event.c
@@ -4811,7 +4811,7 @@ err_fput_free_put_context:
 
 err_free_put_context:
 	if (err < 0)
-		kfree(event);
+		free_event(event);
 
 err_put_context:
 	if (err < 0)



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

* [043/117] raid6: fix recovery performance regression
  2010-05-10 22:37 [000/117] 2.6.33.4-stable review Greg KH
                   ` (41 preceding siblings ...)
  2010-05-10 22:32 ` [042/117] perf: Fix resource leak in failure path of perf_event_open() Greg KH
@ 2010-05-10 22:32 ` Greg KH
  2010-05-10 22:32 ` [044/117] serial: 8250_pnp - add Fujitsu Wacom device Greg KH
                   ` (73 subsequent siblings)
  116 siblings, 0 replies; 130+ messages in thread
From: Greg KH @ 2010-05-10 22:32 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: stable-review, torvalds, akpm, alan, NeilBrown, Dan Williams

2.6.33-stable review patch.  If anyone has any objections, please let us know.

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

From: Dan Williams <dan.j.williams@intel.com>

commit 5157b4aa5b7de8787b6318e61bcc285031bb9088 upstream.

The raid6 recovery code should immediately drop back to the optimized
synchronous path when a p+q dma resource is not available.  Otherwise we
run the non-optimized/multi-pass async code in sync mode.

Verified with raid6test (NDISKS=255)

Applies to kernels >= 2.6.32.

Acked-by: NeilBrown <neilb@suse.de>
Reported-by: H. Peter Anvin <hpa@zytor.com>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

---
 crypto/async_tx/async_raid6_recov.c |   21 +++++++++++++--------
 1 file changed, 13 insertions(+), 8 deletions(-)

--- a/crypto/async_tx/async_raid6_recov.c
+++ b/crypto/async_tx/async_raid6_recov.c
@@ -324,6 +324,7 @@ struct dma_async_tx_descriptor *
 async_raid6_2data_recov(int disks, size_t bytes, int faila, int failb,
 			struct page **blocks, struct async_submit_ctl *submit)
 {
+	void *scribble = submit->scribble;
 	int non_zero_srcs, i;
 
 	BUG_ON(faila == failb);
@@ -332,11 +333,13 @@ async_raid6_2data_recov(int disks, size_
 
 	pr_debug("%s: disks: %d len: %zu\n", __func__, disks, bytes);
 
-	/* we need to preserve the contents of 'blocks' for the async
-	 * case, so punt to synchronous if a scribble buffer is not available
+	/* if a dma resource is not available or a scribble buffer is not
+	 * available punt to the synchronous path.  In the 'dma not
+	 * available' case be sure to use the scribble buffer to
+	 * preserve the content of 'blocks' as the caller intended.
 	 */
-	if (!submit->scribble) {
-		void **ptrs = (void **) blocks;
+	if (!async_dma_find_channel(DMA_PQ) || !scribble) {
+		void **ptrs = scribble ? scribble : (void **) blocks;
 
 		async_tx_quiesce(&submit->depend_tx);
 		for (i = 0; i < disks; i++)
@@ -406,11 +409,13 @@ async_raid6_datap_recov(int disks, size_
 
 	pr_debug("%s: disks: %d len: %zu\n", __func__, disks, bytes);
 
-	/* we need to preserve the contents of 'blocks' for the async
-	 * case, so punt to synchronous if a scribble buffer is not available
+	/* if a dma resource is not available or a scribble buffer is not
+	 * available punt to the synchronous path.  In the 'dma not
+	 * available' case be sure to use the scribble buffer to
+	 * preserve the content of 'blocks' as the caller intended.
 	 */
-	if (!scribble) {
-		void **ptrs = (void **) blocks;
+	if (!async_dma_find_channel(DMA_PQ) || !scribble) {
+		void **ptrs = scribble ? scribble : (void **) blocks;
 
 		async_tx_quiesce(&submit->depend_tx);
 		for (i = 0; i < disks; i++)



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

* [044/117] serial: 8250_pnp - add Fujitsu Wacom device
  2010-05-10 22:37 [000/117] 2.6.33.4-stable review Greg KH
                   ` (42 preceding siblings ...)
  2010-05-10 22:32 ` [043/117] raid6: fix recovery performance regression Greg KH
@ 2010-05-10 22:32 ` Greg KH
  2010-05-10 22:32 ` [045/117] block: ensure jiffies wrap is handled correctly in blk_rq_timed_out_timer Greg KH
                   ` (72 subsequent siblings)
  116 siblings, 0 replies; 130+ messages in thread
From: Greg KH @ 2010-05-10 22:32 UTC (permalink / raw)
  To: linux-kernel, stable; +Cc: stable-review, torvalds, akpm, alan, Ping Cheng

2.6.33-stable review patch.  If anyone has any objections, please let us know.

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

From: Ping Cheng <pingc@wacom.com>

commit d9901660b53b92f0f3551c06588b8be38224b245 upstream.

Add Fujitsu Wacom 1FGT Tablet PC device

Signed-off-by: Ping Cheng <pingc@wacom.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

---
 drivers/serial/8250_pnp.c |    2 ++
 1 file changed, 2 insertions(+)

--- a/drivers/serial/8250_pnp.c
+++ b/drivers/serial/8250_pnp.c
@@ -348,6 +348,8 @@ static const struct pnp_device_id pnp_de
 	{	"FUJ02E6",		0	},
 	/* Fujitsu Wacom 2FGT Tablet PC device */
 	{	"FUJ02E7",		0	},
+	/* Fujitsu Wacom 1FGT Tablet PC device */
+	{	"FUJ02E9",		0	},
 	/*
 	 * LG C1 EXPRESS DUAL (C1-PB11A3) touch screen (actually a FUJ02E6 in
 	 * disguise)



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

* [045/117] block: ensure jiffies wrap is handled correctly in blk_rq_timed_out_timer
  2010-05-10 22:37 [000/117] 2.6.33.4-stable review Greg KH
                   ` (43 preceding siblings ...)
  2010-05-10 22:32 ` [044/117] serial: 8250_pnp - add Fujitsu Wacom device Greg KH
@ 2010-05-10 22:32 ` Greg KH
  2010-05-10 22:32 ` [046/117] Revert "memory-hotplug: add 0x prefix to HEX block_size_bytes" Greg KH
                   ` (71 subsequent siblings)
  116 siblings, 0 replies; 130+ messages in thread
From: Greg KH @ 2010-05-10 22:32 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: stable-review, torvalds, akpm, alan, Richard Kennedy, Jens Axboe

2.6.33-stable review patch.  If anyone has any objections, please let us know.

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

From: Richard Kennedy <richard@rsk.demon.co.uk>

commit a534dbe96e9929c7245924d8252d89048c23d569 upstream.

blk_rq_timed_out_timer() relied on blk_add_timer() never returning a
timer value of zero, but commit 7838c15b8dd18e78a523513749e5b54bda07b0cb
removed the code that bumped this value when it was zero.
Therefore when jiffies is near wrap we could get unlucky & not set the
timeout value correctly.

This patch uses a flag to indicate that the timeout value was set and so
handles jiffies wrap correctly, and it keeps all the logic in one
function so should be easier to maintain in the future.

Signed-off-by: Richard Kennedy <richard@rsk.demon.co.uk>
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

---
 block/blk-timeout.c |   12 +++++-------
 1 file changed, 5 insertions(+), 7 deletions(-)

--- a/block/blk-timeout.c
+++ b/block/blk-timeout.c
@@ -109,6 +109,7 @@ void blk_rq_timed_out_timer(unsigned lon
 	struct request_queue *q = (struct request_queue *) data;
 	unsigned long flags, next = 0;
 	struct request *rq, *tmp;
+	int next_set = 0;
 
 	spin_lock_irqsave(q->queue_lock, flags);
 
@@ -122,16 +123,13 @@ void blk_rq_timed_out_timer(unsigned lon
 			if (blk_mark_rq_complete(rq))
 				continue;
 			blk_rq_timed_out(rq);
-		} else if (!next || time_after(next, rq->deadline))
+		} else if (!next_set || time_after(next, rq->deadline)) {
 			next = rq->deadline;
+			next_set = 1;
+		}
 	}
 
-	/*
-	 * next can never be 0 here with the list non-empty, since we always
-	 * bump ->deadline to 1 so we can detect if the timer was ever added
-	 * or not. See comment in blk_add_timer()
-	 */
-	if (next)
+	if (next_set)
 		mod_timer(&q->timeout, round_jiffies_up(next));
 
 	spin_unlock_irqrestore(q->queue_lock, flags);



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

* [046/117] Revert "memory-hotplug: add 0x prefix to HEX block_size_bytes"
  2010-05-10 22:37 [000/117] 2.6.33.4-stable review Greg KH
                   ` (44 preceding siblings ...)
  2010-05-10 22:32 ` [045/117] block: ensure jiffies wrap is handled correctly in blk_rq_timed_out_timer Greg KH
@ 2010-05-10 22:32 ` Greg KH
  2010-05-10 22:32 ` [047/117] dm9601: fix phy/eeprom write routine Greg KH
                   ` (70 subsequent siblings)
  116 siblings, 0 replies; 130+ messages in thread
From: Greg KH @ 2010-05-10 22:32 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: stable-review, torvalds, akpm, alan, KOSAKI Motohiro, Wu Fengguang

2.6.33-stable review patch.  If anyone has any objections, please let us know.

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

From: Linus Torvalds <torvalds@linux-foundation.org>

commit 4dc86ae1f925b2121d4e75058675895f83e54c71 upstream.

This reverts commit ba168fc37dea145deeb8fa9e7e71c748d2e00d74.

It changes user-visible sysfs interfaces, and breaks some existing user
space applications which apparently rely on the fact that the output
does not contain the "0x" prefix.

Requested-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Acked-by: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
Acked-by: Wu Fengguang <fengguang.wu@intel.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

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

--- a/drivers/base/memory.c
+++ b/drivers/base/memory.c
@@ -311,7 +311,7 @@ static SYSDEV_ATTR(removable, 0444, show
 static ssize_t
 print_block_size(struct class *class, char *buf)
 {
-	return sprintf(buf, "%#lx\n", (unsigned long)PAGES_PER_SECTION * PAGE_SIZE);
+	return sprintf(buf, "%lx\n", (unsigned long)PAGES_PER_SECTION * PAGE_SIZE);
 }
 
 static CLASS_ATTR(block_size_bytes, 0444, print_block_size, NULL);



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

* [047/117] dm9601: fix phy/eeprom write routine
  2010-05-10 22:37 [000/117] 2.6.33.4-stable review Greg KH
                   ` (45 preceding siblings ...)
  2010-05-10 22:32 ` [046/117] Revert "memory-hotplug: add 0x prefix to HEX block_size_bytes" Greg KH
@ 2010-05-10 22:32 ` Greg KH
  2010-05-10 22:32 ` [048/117] p54pci: fix bugs in p54p_check_tx_ring Greg KH
                   ` (69 subsequent siblings)
  116 siblings, 0 replies; 130+ messages in thread
From: Greg KH @ 2010-05-10 22:32 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: stable-review, torvalds, akpm, alan, Peter Korsgaard, David S. Miller

2.6.33-stable review patch.  If anyone has any objections, please let us know.

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

From: Peter Korsgaard <jacmet@sunsite.dk>

commit e9162ab1610531d6ea6c1833daeb2613e44275e8 upstream.

Use correct bit positions in DM_SHARED_CTRL register for writes.

Michael Planes recently encountered a 'KY-RS9600 USB-LAN converter', which
came with a driver CD containing a Linux driver. This driver turns out to
be a copy of dm9601.c with symbols renamed and my copyright stripped.
That aside, it did contain 1 functional change in dm_write_shared_word(),
and after checking the datasheet the original value was indeed wrong
(read versus write bits).

On Michaels HW, this change bumps receive speed from ~30KB/s to ~900KB/s.
On other devices the difference is less spectacular, but still significant
(~30%).

Reported-by: Michael Planes <michael.planes@free.fr>
Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

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

--- a/drivers/net/usb/dm9601.c
+++ b/drivers/net/usb/dm9601.c
@@ -238,7 +238,7 @@ static int dm_write_shared_word(struct u
 		goto out;
 
 	dm_write_reg(dev, DM_SHARED_ADDR, phy ? (reg | 0x40) : reg);
-	dm_write_reg(dev, DM_SHARED_CTRL, phy ? 0x1c : 0x14);
+	dm_write_reg(dev, DM_SHARED_CTRL, phy ? 0x1a : 0x12);
 
 	for (i = 0; i < DM_TIMEOUT; i++) {
 		u8 tmp;



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

* [048/117] p54pci: fix bugs in p54p_check_tx_ring
  2010-05-10 22:37 [000/117] 2.6.33.4-stable review Greg KH
                   ` (46 preceding siblings ...)
  2010-05-10 22:32 ` [047/117] dm9601: fix phy/eeprom write routine Greg KH
@ 2010-05-10 22:32 ` Greg KH
  2010-05-10 22:32 ` [049/117] edac, mce: Fix wrong mask and macro usage Greg KH
                   ` (68 subsequent siblings)
  116 siblings, 0 replies; 130+ messages in thread
From: Greg KH @ 2010-05-10 22:32 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: stable-review, torvalds, akpm, alan, Christian Lamparter,
	John W. Linville

2.6.33-stable review patch.  If anyone has any objections, please let us know.

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

From: Hans de Goede <hdegoede@redhat.com>

commit 0250ececdf6813457c98719e2d33b3684881fde0 upstream.

Hans de Goede identified a bug in p54p_check_tx_ring:

there are two ring indices. 1 => tx data and 3 => tx management.
But the old code had a constant "1" and this resulted in spurious
dma unmapping failures.

Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=583623
Bug-Identified-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Christian Lamparter <chunkeey@googlemail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

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

--- a/drivers/net/wireless/p54/p54pci.c
+++ b/drivers/net/wireless/p54/p54pci.c
@@ -245,7 +245,7 @@ static void p54p_check_tx_ring(struct ie
 	u32 idx, i;
 
 	i = (*index) % ring_limit;
-	(*index) = idx = le32_to_cpu(ring_control->device_idx[1]);
+	(*index) = idx = le32_to_cpu(ring_control->device_idx[ring_index]);
 	idx %= ring_limit;
 
 	while (i != idx) {



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

* [049/117] edac, mce: Fix wrong mask and macro usage
  2010-05-10 22:37 [000/117] 2.6.33.4-stable review Greg KH
                   ` (47 preceding siblings ...)
  2010-05-10 22:32 ` [048/117] p54pci: fix bugs in p54p_check_tx_ring Greg KH
@ 2010-05-10 22:32 ` Greg KH
  2010-05-10 22:32 ` [050/117] x86-64: Clear a 64-bit FS/GS base on fork if selector is nonzero Greg KH
                   ` (67 subsequent siblings)
  116 siblings, 0 replies; 130+ messages in thread
From: Greg KH @ 2010-05-10 22:32 UTC (permalink / raw)
  To: linux-kernel, stable; +Cc: stable-review, torvalds, akpm, alan, Borislav Petkov

2.6.33-stable review patch.  If anyone has any objections, please let us know.

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

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

commit 35d824b28fc5544d1eb7c1e3db15a1740df8ec4b upstream.

Correct two mishaps which prevented reporting error type (CECC vs UECC)
and extended error description.

Signed-off-by: Borislav Petkov <borislav.petkov@amd.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

---
 drivers/edac/edac_mce_amd.c |    5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

--- a/drivers/edac/edac_mce_amd.c
+++ b/drivers/edac/edac_mce_amd.c
@@ -294,7 +294,6 @@ wrong_ls_mce:
 void amd_decode_nb_mce(int node_id, struct err_regs *regs, int handle_errors)
 {
 	u32 ec  = ERROR_CODE(regs->nbsl);
-	u32 xec = EXT_ERROR_CODE(regs->nbsl);
 
 	if (!handle_errors)
 		return;
@@ -324,7 +323,7 @@ void amd_decode_nb_mce(int node_id, stru
 		pr_cont("\n");
 	}
 
-	pr_emerg("%s.\n", EXT_ERR_MSG(xec));
+	pr_emerg("%s.\n", EXT_ERR_MSG(regs->nbsl));
 
 	if (BUS_ERROR(ec) && nb_bus_decoder)
 		nb_bus_decoder(node_id, regs);
@@ -374,7 +373,7 @@ static int amd_decode_mce(struct notifie
 		 ((m->status & MCI_STATUS_PCC) ? "yes" : "no"));
 
 	/* do the two bits[14:13] together */
-	ecc = m->status & (3ULL << 45);
+	ecc = (m->status >> 45) & 0x3;
 	if (ecc)
 		pr_cont(", %sECC Error", ((ecc == 2) ? "C" : "U"));
 



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

* [050/117] x86-64: Clear a 64-bit FS/GS base on fork if selector is nonzero
  2010-05-10 22:37 [000/117] 2.6.33.4-stable review Greg KH
                   ` (48 preceding siblings ...)
  2010-05-10 22:32 ` [049/117] edac, mce: Fix wrong mask and macro usage Greg KH
@ 2010-05-10 22:32 ` Greg KH
  2010-05-10 22:32 ` [051/117] x86: Disable large pages on CPUs with Atom erratum AAE44 Greg KH
                   ` (66 subsequent siblings)
  116 siblings, 0 replies; 130+ messages in thread
From: Greg KH @ 2010-05-10 22:32 UTC (permalink / raw)
  To: linux-kernel, stable; +Cc: stable-review, torvalds, akpm, alan, H. Peter Anvin

2.6.33-stable review patch.  If anyone has any objections, please let us know.

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

From: H. Peter Anvin <hpa@zytor.com>

commit 7ce5a2b9bb2e92902230e3121d8c3047fab9cb47 upstream.

When we do a thread switch, we clear the outgoing FS/GS base if the
corresponding selector is nonzero.  This is taken by __switch_to() as
an entry invariant; it does not verify that it is true on entry.
However, copy_thread() doesn't enforce this constraint, which can
result in inconsistent results after fork().

Make copy_thread() match the behavior of __switch_to().

Reported-and-tested-by: Samuel Thibault <samuel.thibault@inria.fr>
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
LKML-Reference: <4BD1E061.8030605@zytor.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

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

--- a/arch/x86/kernel/process_64.c
+++ b/arch/x86/kernel/process_64.c
@@ -282,12 +282,12 @@ int copy_thread(unsigned long clone_flag
 
 	set_tsk_thread_flag(p, TIF_FORK);
 
-	p->thread.fs = me->thread.fs;
-	p->thread.gs = me->thread.gs;
 	p->thread.io_bitmap_ptr = NULL;
 
 	savesegment(gs, p->thread.gsindex);
+	p->thread.gs = p->thread.gsindex ? 0 : me->thread.gs;
 	savesegment(fs, p->thread.fsindex);
+	p->thread.fs = p->thread.fsindex ? 0 : me->thread.fs;
 	savesegment(es, p->thread.es);
 	savesegment(ds, p->thread.ds);
 



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

* [051/117] x86: Disable large pages on CPUs with Atom erratum AAE44
  2010-05-10 22:37 [000/117] 2.6.33.4-stable review Greg KH
                   ` (49 preceding siblings ...)
  2010-05-10 22:32 ` [050/117] x86-64: Clear a 64-bit FS/GS base on fork if selector is nonzero Greg KH
@ 2010-05-10 22:32 ` Greg KH
  2010-05-10 22:32 ` [052/117] x86: Fix NULL pointer access in irq_force_complete_move() for Xen guests Greg KH
                   ` (65 subsequent siblings)
  116 siblings, 0 replies; 130+ messages in thread
From: Greg KH @ 2010-05-10 22:32 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: stable-review, torvalds, akpm, alan, Colin Ian King, Ingo Molnar,
	H. Peter Anvin

2.6.33-stable review patch.  If anyone has any objections, please let us know.

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

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

commit 7a0fc404ae663776e96db43879a0fa24fec1fa3a upstream.

Atom erratum AAE44/AAF40/AAG38/AAH41:

"If software clears the PS (page size) bit in a present PDE (page
directory entry), that will cause linear addresses mapped through this
PDE to use 4-KByte pages instead of using a large page after old TLB
entries are invalidated. Due to this erratum, if a code fetch uses
this PDE before the TLB entry for the large page is invalidated then
it may fetch from a different physical address than specified by
either the old large page translation or the new 4-KByte page
translation. This erratum may also cause speculative code fetches from
incorrect addresses."

[http://download.intel.com/design/processor/specupdt/319536.pdf]

Where as commit 211b3d03c7400f48a781977a50104c9d12f4e229 seems to
workaround errata AAH41 (mixed 4K TLBs) it reduces the window of
opportunity for the bug to occur and does not totally remove it.  This
patch disables mixed 4K/4MB page tables totally avoiding the page
splitting and not tripping this processor issue.

This is based on an original patch by Colin King.

Originally-by: Colin Ian King <colin.king@canonical.com>
Cc: Colin Ian King <colin.king@canonical.com>
Cc: Ingo Molnar <mingo@elte.hu>
Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
LKML-Reference: <1269271251-19775-1-git-send-email-colin.king@canonical.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

---
 arch/x86/kernel/cpu/intel.c |   21 +++++++++++++++++++++
 1 file changed, 21 insertions(+)

--- a/arch/x86/kernel/cpu/intel.c
+++ b/arch/x86/kernel/cpu/intel.c
@@ -47,6 +47,27 @@ static void __cpuinit early_init_intel(s
 		(c->x86 == 0x6 && c->x86_model >= 0x0e))
 		set_cpu_cap(c, X86_FEATURE_CONSTANT_TSC);
 
+	/*
+	 * Atom erratum AAE44/AAF40/AAG38/AAH41:
+	 *
+	 * A race condition between speculative fetches and invalidating
+	 * a large page.  This is worked around in microcode, but we
+	 * need the microcode to have already been loaded... so if it is
+	 * not, recommend a BIOS update and disable large pages.
+	 */
+	if (c->x86 == 6 && c->x86_model == 0x1c && c->x86_mask <= 2) {
+		u32 ucode, junk;
+
+		wrmsr(MSR_IA32_UCODE_REV, 0, 0);
+		sync_core();
+		rdmsr(MSR_IA32_UCODE_REV, junk, ucode);
+
+		if (ucode < 0x20e) {
+			printk(KERN_WARNING "Atom PSE erratum detected, BIOS microcode update recommended\n");
+			clear_cpu_cap(c, X86_FEATURE_PSE);
+		}
+	}
+
 #ifdef CONFIG_X86_64
 	set_cpu_cap(c, X86_FEATURE_SYSENTER32);
 #else



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

* [052/117] x86: Fix NULL pointer access in irq_force_complete_move() for Xen guests
  2010-05-10 22:37 [000/117] 2.6.33.4-stable review Greg KH
                   ` (50 preceding siblings ...)
  2010-05-10 22:32 ` [051/117] x86: Disable large pages on CPUs with Atom erratum AAE44 Greg KH
@ 2010-05-10 22:32 ` Greg KH
  2010-05-10 22:32 ` [053/117] x86, k8 nb: Fix boot crash: enable k8_northbridges unconditionally on AMD systems Greg KH
                   ` (64 subsequent siblings)
  116 siblings, 0 replies; 130+ messages in thread
From: Greg KH @ 2010-05-10 22:32 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: stable-review, torvalds, akpm, alan, Prarit Bhargava,
	Suresh Siddha, H. Peter Anvin

2.6.33-stable review patch.  If anyone has any objections, please let us know.

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

From: Prarit Bhargava <prarit@redhat.com>

commit bbd391a15d82e14efe9d69ba64cadb855b061dba upstream.

Upstream PV guests fail to boot because of a NULL pointer in
irq_force_complete_move().  It is possible that xen guests have
irq_desc->chip_data = NULL.

Test for NULL chip_data pointer before attempting to complete an irq move.

Signed-off-by: Prarit Bhargava <prarit@redhat.com>
LKML-Reference: <20100427152434.16193.49104.sendpatchset@prarit.bos.redhat.com>
Acked-by: Suresh Siddha <suresh.b.siddha@intel.com>
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

---
 arch/x86/kernel/apic/io_apic.c |    3 +++
 1 file changed, 3 insertions(+)

--- a/arch/x86/kernel/apic/io_apic.c
+++ b/arch/x86/kernel/apic/io_apic.c
@@ -2539,6 +2539,9 @@ void irq_force_complete_move(int irq)
 	struct irq_desc *desc = irq_to_desc(irq);
 	struct irq_cfg *cfg = desc->chip_data;
 
+	if (!cfg)
+		return;
+
 	__irq_complete_move(&desc, cfg->vector);
 }
 #else



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

* [053/117] x86, k8 nb: Fix boot crash: enable k8_northbridges unconditionally on AMD systems
  2010-05-10 22:37 [000/117] 2.6.33.4-stable review Greg KH
                   ` (51 preceding siblings ...)
  2010-05-10 22:32 ` [052/117] x86: Fix NULL pointer access in irq_force_complete_move() for Xen guests Greg KH
@ 2010-05-10 22:32 ` Greg KH
  2010-05-10 22:32 ` [054/117] ALSA: hda: Use LPIB quirk for DG965OT board version AAD63733-203 Greg KH
                   ` (63 subsequent siblings)
  116 siblings, 0 replies; 130+ messages in thread
From: Greg KH @ 2010-05-10 22:32 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: stable-review, torvalds, akpm, alan, Borislav Petkov,
	FUJITA Tomonori, Joerg Roedel, Ingo Molnar

2.6.33-stable review patch.  If anyone has any objections, please let us know.

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

From: Borislav Petkov <bp@amd64.org>

commit 0e152cd7c16832bd5cadee0c2e41d9959bc9b6f9 upstream.

de957628ce7c84764ff41331111036b3ae5bad0f changed setting of the
x86_init.iommu.iommu_init function ptr only when GART IOMMU is
found.

One side effect of it is that num_k8_northbridges
is not initialized anymore if not explicitly
called. This resulted in uninitialized pointers in
<arch/x86/kernel/cpu/intel_cacheinfo.c:amd_calc_l3_indices()>,
for example, which uses the num_k8_northbridges thing through
node_to_k8_nb_misc().

Fix that through an initcall that runs right after the PCI
subsystem and does all the scanning. Then, remove initialization
in gart_iommu_init() which is a rootfs_initcall and we're
running before that.

What is more, since num_k8_northbridges is being used in other
places beside GART IOMMU, include it whenever we add AMD CPU
support. The previous dependency chain in kconfig contained

K8_NB depends on AGP_AMD64|GART_IOMMU

which was clearly incorrect. The more natural way in terms of
hardware dependency should be

AGP_AMD64|GART_IOMMU depends on K8_NB depends on CPU_SUP_AMD &&
PCI. Make it so Number One!

Signed-off-by: Borislav Petkov <borislav.petkov@amd.com>
Cc: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Cc: Joerg Roedel <joerg.roedel@amd.com>
LKML-Reference: <20100312144303.GA29262@aftab>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Tested-by: Joerg Roedel <joerg.roedel@amd.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

---
 arch/x86/Kconfig              |    4 ++--
 arch/x86/kernel/k8.c          |   14 ++++++++++++++
 arch/x86/kernel/pci-gart_64.c |    2 +-
 drivers/char/agp/Kconfig      |    2 +-
 4 files changed, 18 insertions(+), 4 deletions(-)

--- a/arch/x86/Kconfig
+++ b/arch/x86/Kconfig
@@ -627,7 +627,7 @@ config GART_IOMMU
 	bool "GART IOMMU support" if EMBEDDED
 	default y
 	select SWIOTLB
-	depends on X86_64 && PCI
+	depends on X86_64 && PCI && K8_NB
 	---help---
 	  Support for full DMA access of devices with 32bit memory access only
 	  on systems with more than 3GB. This is usually needed for USB,
@@ -2026,7 +2026,7 @@ endif # X86_32
 
 config K8_NB
 	def_bool y
-	depends on AGP_AMD64 || (X86_64 && (GART_IOMMU || (PCI && NUMA)))
+	depends on CPU_SUP_AMD && PCI
 
 source "drivers/pcmcia/Kconfig"
 
--- a/arch/x86/kernel/k8.c
+++ b/arch/x86/kernel/k8.c
@@ -121,3 +121,17 @@ void k8_flush_garts(void)
 }
 EXPORT_SYMBOL_GPL(k8_flush_garts);
 
+static __init int init_k8_nbs(void)
+{
+	int err = 0;
+
+	err = cache_k8_northbridges();
+
+	if (err < 0)
+		printk(KERN_NOTICE "K8 NB: Cannot enumerate AMD northbridges.\n");
+
+	return err;
+}
+
+/* This has to go after the PCI subsystem */
+fs_initcall(init_k8_nbs);
--- a/arch/x86/kernel/pci-gart_64.c
+++ b/arch/x86/kernel/pci-gart_64.c
@@ -738,7 +738,7 @@ int __init gart_iommu_init(void)
 	unsigned long scratch;
 	long i;
 
-	if (cache_k8_northbridges() < 0 || num_k8_northbridges == 0)
+	if (num_k8_northbridges == 0)
 		return 0;
 
 #ifndef CONFIG_AGP_AMD64
--- a/drivers/char/agp/Kconfig
+++ b/drivers/char/agp/Kconfig
@@ -57,7 +57,7 @@ config AGP_AMD
 
 config AGP_AMD64
 	tristate "AMD Opteron/Athlon64 on-CPU GART support"
-	depends on AGP && X86
+	depends on AGP && X86 && K8_NB
 	help
 	  This option gives you AGP support for the GLX component of
 	  X using the on-CPU northbridge of the AMD Athlon64/Opteron CPUs.



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

* [054/117] ALSA: hda: Use LPIB quirk for DG965OT board version AAD63733-203
  2010-05-10 22:37 [000/117] 2.6.33.4-stable review Greg KH
                   ` (52 preceding siblings ...)
  2010-05-10 22:32 ` [053/117] x86, k8 nb: Fix boot crash: enable k8_northbridges unconditionally on AMD systems Greg KH
@ 2010-05-10 22:32 ` Greg KH
  2010-05-10 22:32 ` [055/117] ALSA: hda - Add PCI quirk for HP dv6-1110ax Greg KH
                   ` (62 subsequent siblings)
  116 siblings, 0 replies; 130+ messages in thread
From: Greg KH @ 2010-05-10 22:32 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: stable-review, torvalds, akpm, alan, Daniel T Chen, Takashi Iwai

2.6.33-stable review patch.  If anyone has any objections, please let us know.

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

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

commit 0e0280dc2b0c7395a880d25544b47f3e3e3f79db upstream.

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

The OR has verified with 2.6.32.11 and the latest alsa-driver stable
daily snapshot that position_fix=1 is necessary for the external mic
to work and for PulseAudio not to crash constantly.

This patch is necessary also for 2.6.32.11 and 2.6.33.2.

Reported-by: <imwithid@yahoo.com>
Tested-by: <imwithid@yahoo.com>
Signed-off-by: Daniel T Chen <crimsun@ubuntu.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

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

--- a/sound/pci/hda/hda_intel.c
+++ b/sound/pci/hda/hda_intel.c
@@ -2273,6 +2273,7 @@ static struct snd_pci_quirk position_fix
 	SND_PCI_QUIRK(0x1462, 0x1002, "MSI Wind U115", POS_FIX_LPIB),
 	SND_PCI_QUIRK(0x1565, 0x820f, "Biostar Microtech", POS_FIX_LPIB),
 	SND_PCI_QUIRK(0x1565, 0x8218, "Biostar Microtech", POS_FIX_LPIB),
+	SND_PCI_QUIRK(0x8086, 0x2503, "DG965OT AAD63733-203", POS_FIX_LPIB),
 	SND_PCI_QUIRK(0x8086, 0xd601, "eMachines T5212", POS_FIX_LPIB),
 	{}
 };



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

* [055/117] ALSA: hda - Add PCI quirk for HP dv6-1110ax.
  2010-05-10 22:37 [000/117] 2.6.33.4-stable review Greg KH
                   ` (53 preceding siblings ...)
  2010-05-10 22:32 ` [054/117] ALSA: hda: Use LPIB quirk for DG965OT board version AAD63733-203 Greg KH
@ 2010-05-10 22:32 ` Greg KH
  2010-05-10 22:32 ` [056/117] ALSA: hda: Use STAC_DELL_M6_BOTH quirk for Dell Studio XPS 1645 Greg KH
                   ` (61 subsequent siblings)
  116 siblings, 0 replies; 130+ messages in thread
From: Greg KH @ 2010-05-10 22:32 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: stable-review, torvalds, akpm, alan, Kunal Gangakhedkar, Takashi Iwai

2.6.33-stable review patch.  If anyone has any objections, please let us know.

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

From: Kunal Gangakhedkar <kunal.gangakhedkar@gmail.com>

commit e3d2530a6cea80987f77b75d8784a00f3aaf22ff upstream.

Adding this PCI quirk fixes the board config detection.
This also fixes jack sensing by using "hp_detect=1" via properly detected
board config.

Signed-off-by: Kunal Gangakhedkar <kunal.gangakhedkar@gmail.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

---
 sound/pci/hda/patch_sigmatel.c |    2 ++
 1 file changed, 2 insertions(+)

--- a/sound/pci/hda/patch_sigmatel.c
+++ b/sound/pci/hda/patch_sigmatel.c
@@ -1725,6 +1725,8 @@ static struct snd_pci_quirk stac92hd71bx
 		      "HP HDX", STAC_HP_HDX),  /* HDX16 */
 	SND_PCI_QUIRK_MASK(PCI_VENDOR_ID_HP, 0xfff0, 0x3620,
 		      "HP dv6", STAC_HP_DV5),
+	SND_PCI_QUIRK(PCI_VENDOR_ID_HP, 0x3061,
+		      "HP dv6", STAC_HP_DV5), /* HP dv6-1110ax */
 	SND_PCI_QUIRK_MASK(PCI_VENDOR_ID_HP, 0xfff0, 0x7010,
 		      "HP", STAC_HP_DV5),
 	SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x0233,



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

* [056/117] ALSA: hda: Use STAC_DELL_M6_BOTH quirk for Dell Studio XPS 1645
  2010-05-10 22:37 [000/117] 2.6.33.4-stable review Greg KH
                   ` (54 preceding siblings ...)
  2010-05-10 22:32 ` [055/117] ALSA: hda - Add PCI quirk for HP dv6-1110ax Greg KH
@ 2010-05-10 22:32 ` Greg KH
  2010-05-10 22:32 ` [057/117] ALSA: hda: Use STAC_DELL_M6_BOTH quirk for Dell Studio 1558 Greg KH
                   ` (60 subsequent siblings)
  116 siblings, 0 replies; 130+ messages in thread
From: Greg KH @ 2010-05-10 22:32 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: stable-review, torvalds, akpm, alan, Daniel T Chen, Takashi Iwai

2.6.33-stable review patch.  If anyone has any objections, please let us know.

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

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

commit aac78daf8f37256283f56820ae858add7139c56c upstream.

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

The OR has verified that the dell-m6 model quirk is necessary for audio
to be audible by default on the Dell Studio XPS 1645.

This change is necessary for 2.6.32.11 and 2.6.33.2 alike.

Reported-by: Robert Chambers
Tested-by: Robert Chambers
Signed-off-by: Daniel T Chen <crimsun@ubuntu.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

---
 sound/pci/hda/patch_sigmatel.c |    2 ++
 1 file changed, 2 insertions(+)

--- a/sound/pci/hda/patch_sigmatel.c
+++ b/sound/pci/hda/patch_sigmatel.c
@@ -1602,6 +1602,8 @@ static struct snd_pci_quirk stac92hd73xx
 				"Dell Studio 1555", STAC_DELL_M6_DMIC),
 	SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x02bd,
 				"Dell Studio 1557", STAC_DELL_M6_DMIC),
+	SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x02fe,
+				"Dell Studio XPS 1645", STAC_DELL_M6_BOTH),
 	{} /* terminator */
 };
 



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

* [057/117] ALSA: hda: Use STAC_DELL_M6_BOTH quirk for Dell Studio 1558
  2010-05-10 22:37 [000/117] 2.6.33.4-stable review Greg KH
                   ` (55 preceding siblings ...)
  2010-05-10 22:32 ` [056/117] ALSA: hda: Use STAC_DELL_M6_BOTH quirk for Dell Studio XPS 1645 Greg KH
@ 2010-05-10 22:32 ` Greg KH
  2010-05-10 23:30   ` Nigel Cunningham
  2010-05-10 22:32 ` [058/117] ALSA: hda: Use ALC880_F1734 quirk for Fujitsu Siemens AMILO Xi 1526 Greg KH
                   ` (59 subsequent siblings)
  116 siblings, 1 reply; 130+ messages in thread
From: Greg KH @ 2010-05-10 22:32 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: stable-review, torvalds, akpm, alan, Daniel T Chen, Takashi Iwai

2.6.33-stable review patch.  If anyone has any objections, please let us know.

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

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

commit 5c1bccf645d4ab65e4c7502acb42e8b9afdb5bdc upstream.

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

The OR has verified that the dell-m6 model quirk is necessary for audio
to be audible by default on the Dell Studio XPS 1645.

This change is necessary for 2.6.32.11 and 2.6.33.2 alike.

Reported-by: Andy Ross <andy@plausible.org>
Tested-by: Andy Ross <andy@plausible.org>
Signed-off-by: Daniel T Chen <crimsun@ubuntu.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

---
 sound/pci/hda/patch_sigmatel.c |    2 ++
 1 file changed, 2 insertions(+)

--- a/sound/pci/hda/patch_sigmatel.c
+++ b/sound/pci/hda/patch_sigmatel.c
@@ -1604,6 +1604,8 @@ static struct snd_pci_quirk stac92hd73xx
 				"Dell Studio 1557", STAC_DELL_M6_DMIC),
 	SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x02fe,
 				"Dell Studio XPS 1645", STAC_DELL_M6_BOTH),
+	SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x0413,
+				"Dell Studio 1558", STAC_DELL_M6_BOTH),
 	{} /* terminator */
 };
 



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

* [058/117] ALSA: hda: Use ALC880_F1734 quirk for Fujitsu Siemens AMILO Xi 1526
  2010-05-10 22:37 [000/117] 2.6.33.4-stable review Greg KH
                   ` (56 preceding siblings ...)
  2010-05-10 22:32 ` [057/117] ALSA: hda: Use STAC_DELL_M6_BOTH quirk for Dell Studio 1558 Greg KH
@ 2010-05-10 22:32 ` Greg KH
  2010-05-10 22:32 ` [059/117] ALSA: snd-meastro3: Add amp_gpio quirk for Compaq EVO N600C Greg KH
                   ` (58 subsequent siblings)
  116 siblings, 0 replies; 130+ messages in thread
From: Greg KH @ 2010-05-10 22:32 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: stable-review, torvalds, akpm, alan, Daniel T Chen, Takashi Iwai

2.6.33-stable review patch.  If anyone has any objections, please let us know.

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

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

commit 3353541fe533350a22a03e2fb7dc085b35912575 upstream.

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

The OR has verified that the existing model quirk, ALC880_UNIWILL,
is insufficient for audible playback and capture by default. Instead,
the ALC880_F1734 model quirk needs to be used.

This change is necessary for both 2.6.32.11 and 2.6.33.2.

Reported-by: Arnaud Malpeyre <amalpeyre@gmail.com>
Tested-by: Arnaud Malpeyre <amalpeyre@gmail.com>
Signed-off-by: Daniel T Chen <crimsun@ubuntu.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

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

--- a/sound/pci/hda/patch_realtek.c
+++ b/sound/pci/hda/patch_realtek.c
@@ -4033,7 +4033,7 @@ static struct snd_pci_quirk alc880_cfg_t
 	SND_PCI_QUIRK(0x1695, 0x4012, "EPox EP-5LDA", ALC880_5ST_DIG),
 	SND_PCI_QUIRK(0x1734, 0x107c, "FSC F1734", ALC880_F1734),
 	SND_PCI_QUIRK(0x1734, 0x1094, "FSC Amilo M1451G", ALC880_FUJITSU),
-	SND_PCI_QUIRK(0x1734, 0x10ac, "FSC", ALC880_UNIWILL),
+	SND_PCI_QUIRK(0x1734, 0x10ac, "FSC AMILO Xi 1526", ALC880_F1734),
 	SND_PCI_QUIRK(0x1734, 0x10b0, "Fujitsu", ALC880_FUJITSU),
 	SND_PCI_QUIRK(0x1854, 0x0018, "LG LW20", ALC880_LG_LW),
 	SND_PCI_QUIRK(0x1854, 0x003b, "LG", ALC880_LG),



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

* [059/117] ALSA: snd-meastro3: Add amp_gpio quirk for Compaq EVO N600C
  2010-05-10 22:37 [000/117] 2.6.33.4-stable review Greg KH
                   ` (57 preceding siblings ...)
  2010-05-10 22:32 ` [058/117] ALSA: hda: Use ALC880_F1734 quirk for Fujitsu Siemens AMILO Xi 1526 Greg KH
@ 2010-05-10 22:32 ` Greg KH
  2010-05-10 22:32 ` [060/117] ALSA: snd-meastro3: Ignore spurious HV interrupts during suspend / resume Greg KH
                   ` (57 subsequent siblings)
  116 siblings, 0 replies; 130+ messages in thread
From: Greg KH @ 2010-05-10 22:32 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: stable-review, torvalds, akpm, alan, Hans de Goede, Takashi Iwai

2.6.33-stable review patch.  If anyone has any objections, please let us know.

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

From: Hans de Goede <hdegoede@redhat.com>

commit 7efbfd1ae98ef9efe06352e2a1ad83e8c14ceeb1 upstream.

Without this quirk sound stops working after suspend resume. With this quirk,
one still needs to manually unmute the master volume control after a suspend /
/ resume cycle. That is fixed in another patch in this set.

Note that this patch was submitted to the alsa bug tracker a long time ago:
https://bugtrack.alsa-project.org/alsa-bug/view.php?id=4319

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

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

--- a/sound/pci/maestro3.c
+++ b/sound/pci/maestro3.c
@@ -884,6 +884,7 @@ static struct pci_device_id snd_m3_ids[]
 MODULE_DEVICE_TABLE(pci, snd_m3_ids);
 
 static struct snd_pci_quirk m3_amp_quirk_list[] __devinitdata = {
+	SND_PCI_QUIRK(0x0E11, 0x0094, "Compaq Evo N600c", 0x0c),
 	SND_PCI_QUIRK(0x10f7, 0x833e, "Panasonic CF-28", 0x0d),
 	SND_PCI_QUIRK(0x10f7, 0x833d, "Panasonic CF-72", 0x0d),
 	SND_PCI_QUIRK(0x1033, 0x80f1, "NEC LM800J/7", 0x03),



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

* [060/117] ALSA: snd-meastro3: Ignore spurious HV interrupts during suspend / resume
  2010-05-10 22:37 [000/117] 2.6.33.4-stable review Greg KH
                   ` (58 preceding siblings ...)
  2010-05-10 22:32 ` [059/117] ALSA: snd-meastro3: Add amp_gpio quirk for Compaq EVO N600C Greg KH
@ 2010-05-10 22:32 ` Greg KH
  2010-05-10 22:32 ` [061/117] ALSA: hda: Fix 0 dB for Packard Bell models using Conexant CX20549 (Venice) Greg KH
                   ` (56 subsequent siblings)
  116 siblings, 0 replies; 130+ messages in thread
From: Greg KH @ 2010-05-10 22:32 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: stable-review, torvalds, akpm, alan, Hans de Goede, Takashi Iwai

2.6.33-stable review patch.  If anyone has any objections, please let us know.

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

From: Hans de Goede <hdegoede@redhat.com>

commit 715aa675338ce6e1a3b4f77cf87ea611f93058a8 upstream.

Ignore spurious HV interrupts during suspend / resume, this avoids
mistaking them for a mute button press. This is not very pretty but
it seems the only way to fix the master volume control gets muted
after suspend issue I'm seeing. Note that the es1968 driver is doing
exactly the same.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

---
 sound/pci/maestro3.c |    8 ++++++++
 1 file changed, 8 insertions(+)

--- a/sound/pci/maestro3.c
+++ b/sound/pci/maestro3.c
@@ -849,6 +849,7 @@ struct snd_m3 {
 	struct snd_kcontrol *master_switch;
 	struct snd_kcontrol *master_volume;
 	struct tasklet_struct hwvol_tq;
+	unsigned int in_suspend;
 
 #ifdef CONFIG_PM
 	u16 *suspend_mem;
@@ -1614,6 +1615,11 @@ static void snd_m3_update_hw_volume(unsi
 	outb(0x88, chip->iobase + SHADOW_MIX_REG_MASTER);
 	outb(0x88, chip->iobase + HW_VOL_COUNTER_MASTER);
 
+	/* Ignore spurious HV interrupts during suspend / resume, this avoids
+	   mistaking them for a mute button press. */
+	if (chip->in_suspend)
+		return;
+
 	if (!chip->master_switch || !chip->master_volume)
 		return;
 
@@ -2425,6 +2431,7 @@ static int m3_suspend(struct pci_dev *pc
 	if (chip->suspend_mem == NULL)
 		return 0;
 
+	chip->in_suspend = 1;
 	snd_power_change_state(card, SNDRV_CTL_POWER_D3hot);
 	snd_pcm_suspend_all(chip->pcm);
 	snd_ac97_suspend(chip->ac97);
@@ -2498,6 +2505,7 @@ static int m3_resume(struct pci_dev *pci
 	snd_m3_hv_init(chip);
 
 	snd_power_change_state(card, SNDRV_CTL_POWER_D0);
+	chip->in_suspend = 0;
 	return 0;
 }
 #endif /* CONFIG_PM */



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

* [061/117] ALSA: hda: Fix 0 dB for Packard Bell models using Conexant CX20549 (Venice)
  2010-05-10 22:37 [000/117] 2.6.33.4-stable review Greg KH
                   ` (59 preceding siblings ...)
  2010-05-10 22:32 ` [060/117] ALSA: snd-meastro3: Ignore spurious HV interrupts during suspend / resume Greg KH
@ 2010-05-10 22:32 ` Greg KH
  2010-05-10 22:32 ` [062/117] ALSA: hda: Use olpc-xo-1_5 quirk for Toshiba Satellite Pro T130-15F Greg KH
                   ` (55 subsequent siblings)
  116 siblings, 0 replies; 130+ messages in thread
From: Greg KH @ 2010-05-10 22:32 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: stable-review, torvalds, akpm, alan, Daniel T Chen, Takashi Iwai

2.6.33-stable review patch.  If anyone has any objections, please let us know.

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

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

commit 8f0f5ff6777104084b4b2e1ae079541c2a6ed6d9 upstream.

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

The OR's hardware distorts at PCM 100% because it does not correspond to
0 dB. Fix this in patch_cxt5045() for all Packard Bell models.

Reported-by: Valombre
Signed-off-by: Daniel T Chen <crimsun@ubuntu.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

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

--- a/sound/pci/hda/patch_conexant.c
+++ b/sound/pci/hda/patch_conexant.c
@@ -1174,9 +1174,10 @@ static int patch_cxt5045(struct hda_code
 
 	switch (codec->subsystem_id >> 16) {
 	case 0x103c:
+	case 0x1631:
 	case 0x1734:
-		/* HP & Fujitsu-Siemens laptops have really bad sound over 0dB
-		 * on NID 0x17. Fix max PCM level to 0 dB
+		/* HP, Packard Bell, & Fujitsu-Siemens laptops have really bad
+		 * sound over 0dB on NID 0x17. Fix max PCM level to 0 dB
 		 * (originally it has 0x2b steps with 0dB offset 0x14)
 		 */
 		snd_hda_override_amp_caps(codec, 0x17, HDA_INPUT,



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

* [062/117] ALSA: hda: Use olpc-xo-1_5 quirk for Toshiba Satellite Pro T130-15F
  2010-05-10 22:37 [000/117] 2.6.33.4-stable review Greg KH
                   ` (60 preceding siblings ...)
  2010-05-10 22:32 ` [061/117] ALSA: hda: Fix 0 dB for Packard Bell models using Conexant CX20549 (Venice) Greg KH
@ 2010-05-10 22:32 ` Greg KH
  2010-05-10 22:32 ` [063/117] ALSA: hda: Use olpc-xo-1_5 quirk for Toshiba Satellite P500-PSPGSC-01800T Greg KH
                   ` (54 subsequent siblings)
  116 siblings, 0 replies; 130+ messages in thread
From: Greg KH @ 2010-05-10 22:32 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: stable-review, torvalds, akpm, alan, Daniel T Chen, Takashi Iwai

2.6.33-stable review patch.  If anyone has any objections, please let us know.

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

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

commit 4442dd4613fe3795b4c8a5f42fc96b7ffb90d01a upstream.

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

The OR verified that using the olpc-xo-1_5 model quirk allows the
headphones to be audible when inserted into the jack. Capture was
also verified to work correctly.

Reported-by: Andy Couldrake <acouldrake@googlemail.com>
Tested-by: Andy Couldrake <acouldrake@googlemail.com>
Signed-off-by: Daniel T Chen <crimsun@ubuntu.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

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

--- a/sound/pci/hda/patch_conexant.c
+++ b/sound/pci/hda/patch_conexant.c
@@ -2472,6 +2472,7 @@ static struct snd_pci_quirk cxt5066_cfg_
 		      CXT5066_DELL_LAPTOP),
 	SND_PCI_QUIRK(0x152d, 0x0833, "OLPC XO-1.5", CXT5066_OLPC_XO_1_5),
 	SND_PCI_QUIRK(0x1028, 0x0402, "Dell Vostro", CXT5066_DELL_VOSTO),
+	SND_PCI_QUIRK(0x1179, 0xffe0, "Toshiba Satellite Pro T130-15F", CXT5066_OLPC_XO_1_5),
 	{}
 };
 



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

* [063/117] ALSA: hda: Use olpc-xo-1_5 quirk for Toshiba Satellite P500-PSPGSC-01800T
  2010-05-10 22:37 [000/117] 2.6.33.4-stable review Greg KH
                   ` (61 preceding siblings ...)
  2010-05-10 22:32 ` [062/117] ALSA: hda: Use olpc-xo-1_5 quirk for Toshiba Satellite Pro T130-15F Greg KH
@ 2010-05-10 22:32 ` Greg KH
  2010-05-10 22:32 ` [064/117] PCI: Ensure we re-enable devices on resume Greg KH
                   ` (53 subsequent siblings)
  116 siblings, 0 replies; 130+ messages in thread
From: Greg KH @ 2010-05-10 22:32 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: stable-review, torvalds, akpm, alan, Daniel T Chen, Takashi Iwai

2.6.33-stable review patch.  If anyone has any objections, please let us know.

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

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

commit c53666813813a0ea3d0391e1911eefc05a5e6b4f upstream.

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

The OR verified that using the olpc-xo-1_5 model quirk allows the
headphones to be audible when inserted into the jack. Capture was
also verified to work correctly.

Reported-by: Richard Gagne
Tested-by: Richard Gagne
Signed-off-by: Daniel T Chen <crimsun@ubuntu.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

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

--- a/sound/pci/hda/patch_conexant.c
+++ b/sound/pci/hda/patch_conexant.c
@@ -2472,6 +2472,7 @@ static struct snd_pci_quirk cxt5066_cfg_
 		      CXT5066_DELL_LAPTOP),
 	SND_PCI_QUIRK(0x152d, 0x0833, "OLPC XO-1.5", CXT5066_OLPC_XO_1_5),
 	SND_PCI_QUIRK(0x1028, 0x0402, "Dell Vostro", CXT5066_DELL_VOSTO),
+	SND_PCI_QUIRK(0x1179, 0xff50, "Toshiba Satellite P500-PSPGSC-01800T", CXT5066_OLPC_XO_1_5),
 	SND_PCI_QUIRK(0x1179, 0xffe0, "Toshiba Satellite Pro T130-15F", CXT5066_OLPC_XO_1_5),
 	{}
 };



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

* [064/117] PCI: Ensure we re-enable devices on resume
  2010-05-10 22:37 [000/117] 2.6.33.4-stable review Greg KH
                   ` (62 preceding siblings ...)
  2010-05-10 22:32 ` [063/117] ALSA: hda: Use olpc-xo-1_5 quirk for Toshiba Satellite P500-PSPGSC-01800T Greg KH
@ 2010-05-10 22:32 ` Greg KH
  2010-05-10 22:32 ` [065/117] libata: Fix accesses at LBA28 boundary (old bug, but nasty) (v2) Greg KH
                   ` (52 subsequent siblings)
  116 siblings, 0 replies; 130+ messages in thread
From: Greg KH @ 2010-05-10 22:32 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: stable-review, torvalds, akpm, alan, Alex Chiang,
	Rafael J. Wysocki, Matthew Garrett, Jesse Barnes

2.6.33-stable review patch.  If anyone has any objections, please let us know.

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

From: Matthew Garrett <mjg@redhat.com>

commit cc2893b6af5265baa1d68b17b136cffca9e40cfa upstream.

If the firmware puts a device back into D0 state at resume time, we'll
update its state in resume_noirq and thus skip the platform resume code.
Calling that code twice should be safe and we ought to avoid getting to
that point anyway, so remove the check and also allow the platform pci
code to be called for D0.

Fixes USB not being powered after resume on recent Lenovo machines.

Acked-by: Alex Chiang <achiang@canonical.com>
Acked-by: Rafael J. Wysocki <rjw@sisk.pl>
Signed-off-by: Matthew Garrett <mjg@redhat.com>
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

---
 drivers/pci/pci.c |    6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)

--- a/drivers/pci/pci.c
+++ b/drivers/pci/pci.c
@@ -624,7 +624,7 @@ static void __pci_start_power_transition
  */
 int __pci_complete_power_transition(struct pci_dev *dev, pci_power_t state)
 {
-	return state > PCI_D0 ?
+	return state >= PCI_D0 ?
 			pci_platform_power_transition(dev, state) : -EINVAL;
 }
 EXPORT_SYMBOL_GPL(__pci_complete_power_transition);
@@ -661,10 +661,6 @@ int pci_set_power_state(struct pci_dev *
 		 */
 		return 0;
 
-	/* Check if we're already there */
-	if (dev->current_state == state)
-		return 0;
-
 	__pci_start_power_transition(dev, state);
 
 	/* This device is quirked not to be put into D3, so



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

* [065/117] libata: Fix accesses at LBA28 boundary (old bug, but nasty) (v2)
  2010-05-10 22:37 [000/117] 2.6.33.4-stable review Greg KH
                   ` (63 preceding siblings ...)
  2010-05-10 22:32 ` [064/117] PCI: Ensure we re-enable devices on resume Greg KH
@ 2010-05-10 22:32 ` Greg KH
  2010-05-10 22:32 ` [066/117] ext4: correctly calculate number of blocks for fiemap Greg KH
                   ` (51 subsequent siblings)
  116 siblings, 0 replies; 130+ messages in thread
From: Greg KH @ 2010-05-10 22:32 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: stable-review, torvalds, akpm, alan, Mark Lord, Jeff Garzik

2.6.33-stable review patch.  If anyone has any objections, please let us know.

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

From: Mark Lord <kernel@teksavvy.com>

commit 45c4d015a92f72ec47acd0c7557abdc0c8a6499d upstream.

Most drives from Seagate, Hitachi, and possibly other brands,
do not allow LBA28 access to sector number 0x0fffffff (2^28 - 1).
So instead use LBA48 for such accesses.

This bug could bite a lot of systems, especially when the user has
taken care to align partitions to 4KB boundaries. On misaligned systems,
it is less likely to be encountered, since a 4KB read would end at
0x10000000 rather than at 0x0fffffff.

Signed-off-by: Mark Lord <mlord@pobox.com>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

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

--- a/include/linux/ata.h
+++ b/include/linux/ata.h
@@ -1024,8 +1024,8 @@ static inline int ata_ok(u8 status)
 
 static inline int lba_28_ok(u64 block, u32 n_block)
 {
-	/* check the ending block number */
-	return ((block + n_block) < ((u64)1 << 28)) && (n_block <= 256);
+	/* check the ending block number: must be LESS THAN 0x0fffffff */
+	return ((block + n_block) < ((1 << 28) - 1)) && (n_block <= 256);
 }
 
 static inline int lba_48_ok(u64 block, u32 n_block)



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

* [066/117] ext4: correctly calculate number of blocks for fiemap
  2010-05-10 22:37 [000/117] 2.6.33.4-stable review Greg KH
                   ` (64 preceding siblings ...)
  2010-05-10 22:32 ` [065/117] libata: Fix accesses at LBA28 boundary (old bug, but nasty) (v2) Greg KH
@ 2010-05-10 22:32 ` Greg KH
  2010-05-10 22:32 ` [067/117] initramfs: handle unrecognised decompressor when unpacking Greg KH
                   ` (50 subsequent siblings)
  116 siblings, 0 replies; 130+ messages in thread
From: Greg KH @ 2010-05-10 22:32 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: stable-review, torvalds, akpm, alan, Leonard Michlmayr, Theodore Tso

2.6.33-stable review patch.  If anyone has any objections, please let us know.

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

From: Leonard Michlmayr <leonard.michlmayr@gmail.com>

commit aca92ff6f57c000d1b4523e383c8bd6b8269b8b1 upstream.

ext4_fiemap() rounds the length of the requested range down to
blocksize, which is is not the true number of blocks that cover the
requested region.  This problem is especially impressive if the user
requests only the first byte of a file: not a single extent will be
reported.

We fix this by calculating the last block of the region and then
subtract to find the number of blocks in the extents.

Signed-off-by: Leonard Michlmayr <leonard.michlmayr@gmail.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

---
 fs/ext4/extents.c |    9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

--- a/fs/ext4/extents.c
+++ b/fs/ext4/extents.c
@@ -3767,7 +3767,6 @@ int ext4_fiemap(struct inode *inode, str
 		__u64 start, __u64 len)
 {
 	ext4_lblk_t start_blk;
-	ext4_lblk_t len_blks;
 	int error = 0;
 
 	/* fallback to generic here if not in extents fmt */
@@ -3781,8 +3780,14 @@ int ext4_fiemap(struct inode *inode, str
 	if (fieinfo->fi_flags & FIEMAP_FLAG_XATTR) {
 		error = ext4_xattr_fiemap(inode, fieinfo);
 	} else {
+		ext4_lblk_t len_blks;
+		__u64 last_blk;
+
 		start_blk = start >> inode->i_sb->s_blocksize_bits;
-		len_blks = len >> inode->i_sb->s_blocksize_bits;
+		last_blk = (start + len - 1) >> inode->i_sb->s_blocksize_bits;
+		if (last_blk >= EXT_MAX_BLOCK)
+			last_blk = EXT_MAX_BLOCK-1;
+		len_blks = ((ext4_lblk_t) last_blk) - start_blk + 1;
 
 		/*
 		 * Walk the extent tree gathering extent information.



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

* [067/117] initramfs: handle unrecognised decompressor when unpacking
  2010-05-10 22:37 [000/117] 2.6.33.4-stable review Greg KH
                   ` (65 preceding siblings ...)
  2010-05-10 22:32 ` [066/117] ext4: correctly calculate number of blocks for fiemap Greg KH
@ 2010-05-10 22:32 ` Greg KH
  2010-05-10 22:32 ` [068/117] CRED: Fix a race in creds_are_invalid() in credentials debugging Greg KH
                   ` (49 subsequent siblings)
  116 siblings, 0 replies; 130+ messages in thread
From: Greg KH @ 2010-05-10 22:32 UTC (permalink / raw)
  To: linux-kernel, stable; +Cc: stable-review, torvalds, akpm, alan, Phillip Lougher

2.6.33-stable review patch.  If anyone has any objections, please let us know.

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

From: Phillip Lougher <phillip@lougher.demon.co.uk>

commit df37bd156dcb4f5441beaf5bde444adac974e9a0 upstream.

The unpack routine fails to handle the decompress_method() returning
unrecognised decompressor (compress_name == NULL).  This results in the
routine looping eventually oopsing on an out of bounds memory access.

Note this bug is usually hidden, only triggering on trailing junk after
one or more correct compressed blocks.  The case of the compressed archive
being complete junk is (by accident?) caught by the if (state != Reset)
check because state is initialised to Start, but not updated due to the
decompressor not having been called.  Obviously if the junk is trailing a
correctly decompressed buffer, state == Reset from the previous call to
the decompressor.

Signed-off-by: Phillip Lougher <phillip@lougher.demon.co.uk>
Reported-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

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

--- a/init/initramfs.c
+++ b/init/initramfs.c
@@ -457,7 +457,8 @@ static char * __init unpack_to_rootfs(ch
 					 compress_name);
 				message = msg_buf;
 			}
-		}
+		} else
+			error("junk in compressed archive");
 		if (state != Reset)
 			error("junk in compressed archive");
 		this_header = saved_offset + my_inptr;



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

* [068/117] CRED: Fix a race in creds_are_invalid() in credentials debugging
  2010-05-10 22:37 [000/117] 2.6.33.4-stable review Greg KH
                   ` (66 preceding siblings ...)
  2010-05-10 22:32 ` [067/117] initramfs: handle unrecognised decompressor when unpacking Greg KH
@ 2010-05-10 22:32 ` Greg KH
  2010-05-10 22:32 ` [069/117] jfs: fix diAllocExt error in resizing filesystem Greg KH
                   ` (48 subsequent siblings)
  116 siblings, 0 replies; 130+ messages in thread
From: Greg KH @ 2010-05-10 22:32 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: stable-review, torvalds, akpm, alan, David Howells, James Morris

2.6.33-stable review patch.  If anyone has any objections, please let us know.

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

From: David Howells <dhowells@redhat.com>

commit e134d200d57d43b171dcb0b55c178a1a0c7db14a upstream.

creds_are_invalid() reads both cred->usage and cred->subscribers and then
compares them to make sure the number of processes subscribed to a cred struct
never exceeds the refcount of that cred struct.

The problem is that this can cause a race with both copy_creds() and
exit_creds() as the two counters, whilst they are of atomic_t type, are only
atomic with respect to themselves, and not atomic with respect to each other.

This means that if creds_are_invalid() can read the values on one CPU whilst
they're being modified on another CPU, and so can observe an evolving state in
which the subscribers count now is greater than the usage count a moment
before.

Switching the order in which the counts are read cannot help, so the thing to
do is to remove that particular check.

I had considered rechecking the values to see if they're in flux if the test
fails, but I can't guarantee they won't appear the same, even if they've
changed several times in the meantime.

Note that this can only happen if CONFIG_DEBUG_CREDENTIALS is enabled.

The problem is only likely to occur with multithreaded programs, and can be
tested by the tst-eintr1 program from glibc's "make check".  The symptoms look
like:

	CRED: Invalid credentials
	CRED: At include/linux/cred.h:240
	CRED: Specified credentials: ffff88003dda5878 [real][eff]
	CRED: ->magic=43736564, put_addr=(null)
	CRED: ->usage=766, subscr=766
	CRED: ->*uid = { 0,0,0,0 }
	CRED: ->*gid = { 0,0,0,0 }
	CRED: ->security is ffff88003d72f538
	CRED: ->security {359, 359}
	------------[ cut here ]------------
	kernel BUG at kernel/cred.c:850!
	...
	RIP: 0010:[<ffffffff81049889>]  [<ffffffff81049889>] __invalid_creds+0x4e/0x52
	...
	Call Trace:
	 [<ffffffff8104a37b>] copy_creds+0x6b/0x23f

Note the ->usage=766 and subscr=766.  The values appear the same because
they've been re-read since the check was made.

Reported-by: Roland McGrath <roland@redhat.com>
Signed-off-by: David Howells <dhowells@redhat.com>
Signed-off-by: James Morris <jmorris@namei.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

---
 kernel/cred.c |    2 --
 1 file changed, 2 deletions(-)

--- a/kernel/cred.c
+++ b/kernel/cred.c
@@ -786,8 +786,6 @@ bool creds_are_invalid(const struct cred
 {
 	if (cred->magic != CRED_MAGIC)
 		return true;
-	if (atomic_read(&cred->usage) < atomic_read(&cred->subscribers))
-		return true;
 #ifdef CONFIG_SECURITY_SELINUX
 	if (selinux_is_enabled()) {
 		if ((unsigned long) cred->security < PAGE_SIZE)



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

* [069/117] jfs: fix diAllocExt error in resizing filesystem
  2010-05-10 22:37 [000/117] 2.6.33.4-stable review Greg KH
                   ` (67 preceding siblings ...)
  2010-05-10 22:32 ` [068/117] CRED: Fix a race in creds_are_invalid() in credentials debugging Greg KH
@ 2010-05-10 22:32 ` Greg KH
  2010-05-10 22:32 ` [070/117] drivers/net/wireless/p54/txrx.c Fix off by one error Greg KH
                   ` (47 subsequent siblings)
  116 siblings, 0 replies; 130+ messages in thread
From: Greg KH @ 2010-05-10 22:32 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: stable-review, torvalds, akpm, alan, Bill Pemberton,
	Dave Kleikamp, jfs-discussion

2.6.33-stable review patch.  If anyone has any objections, please let us know.

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

From: Bill Pemberton <wfp5p@virginia.edu>

commit 2b0b39517d1af5294128dbc2fd7ed39c8effa540 upstream.

Resizing the filesystem would result in an diAllocExt error in some
instances because changes in bmp->db_agsize would not get noticed if
goto extendBmap was called.

Signed-off-by: Bill Pemberton <wfp5p@virginia.edu>
Signed-off-by: Dave Kleikamp <shaggy@linux.vnet.ibm.com>
Cc: jfs-discussion@lists.sourceforge.net
Cc: linux-kernel@vger.kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

---
 fs/jfs/resize.c |    6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

--- a/fs/jfs/resize.c
+++ b/fs/jfs/resize.c
@@ -81,6 +81,7 @@ int jfs_extendfs(struct super_block *sb,
 	struct inode *iplist[1];
 	struct jfs_superblock *j_sb, *j_sb2;
 	uint old_agsize;
+	int agsizechanged = 0;
 	struct buffer_head *bh, *bh2;
 
 	/* If the volume hasn't grown, get out now */
@@ -333,6 +334,9 @@ int jfs_extendfs(struct super_block *sb,
 	 */
 	if ((rc = dbExtendFS(ipbmap, XAddress, nblocks)))
 		goto error_out;
+
+	agsizechanged |= (bmp->db_agsize != old_agsize);
+
 	/*
 	 * the map now has extended to cover additional nblocks:
 	 * dn_mapsize = oldMapsize + nblocks;
@@ -432,7 +436,7 @@ int jfs_extendfs(struct super_block *sb,
 	 * will correctly identify the new ag);
 	 */
 	/* if new AG size the same as old AG size, done! */
-	if (bmp->db_agsize != old_agsize) {
+	if (agsizechanged) {
 		if ((rc = diExtendFS(ipimap, ipbmap)))
 			goto error_out;
 



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

* [070/117] drivers/net/wireless/p54/txrx.c Fix off by one error
  2010-05-10 22:37 [000/117] 2.6.33.4-stable review Greg KH
                   ` (68 preceding siblings ...)
  2010-05-10 22:32 ` [069/117] jfs: fix diAllocExt error in resizing filesystem Greg KH
@ 2010-05-10 22:32 ` Greg KH
  2010-05-10 22:32 ` [071/117] kgdb: dont needlessly skip PAGE_USER test for Fsl booke Greg KH
                   ` (46 subsequent siblings)
  116 siblings, 0 replies; 130+ messages in thread
From: Greg KH @ 2010-05-10 22:32 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: stable-review, torvalds, akpm, alan, Darren Jenkins, John W. Linville

2.6.33-stable review patch.  If anyone has any objections, please let us know.

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

From: Darren Jenkins <darrenrjenkins@gmail.com>

commit 088ea189c4c75cdf211146faa4b341a0f7476be6 upstream.

fix off by one error in the queue size check of p54_tx_qos_accounting_alloc()

Coverity CID: 13314

Signed-off-by: Darren Jenkins <darrenrjenkins@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

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

--- a/drivers/net/wireless/p54/txrx.c
+++ b/drivers/net/wireless/p54/txrx.c
@@ -186,7 +186,7 @@ static int p54_tx_qos_accounting_alloc(s
 	struct ieee80211_tx_queue_stats *queue;
 	unsigned long flags;
 
-	if (WARN_ON(p54_queue > P54_QUEUE_NUM))
+	if (WARN_ON(p54_queue >= P54_QUEUE_NUM))
 		return -EINVAL;
 
 	queue = &priv->tx_stats[p54_queue];



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

* [071/117] kgdb: dont needlessly skip PAGE_USER test for Fsl booke
  2010-05-10 22:37 [000/117] 2.6.33.4-stable review Greg KH
                   ` (69 preceding siblings ...)
  2010-05-10 22:32 ` [070/117] drivers/net/wireless/p54/txrx.c Fix off by one error Greg KH
@ 2010-05-10 22:32 ` Greg KH
  2010-05-10 22:32 ` [072/117] r8169: use correct barrier between cacheable and non-cacheable memory Greg KH
                   ` (45 subsequent siblings)
  116 siblings, 0 replies; 130+ messages in thread
From: Greg KH @ 2010-05-10 22:32 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: stable-review, torvalds, akpm, alan, Benjamin Herrenschmidt,
	Paul Mackerras, Kumar Gala, Wufei, Jason Wessel

2.6.33-stable review patch.  If anyone has any objections, please let us know.

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

From: Wufei <fei.wu@windriver.com>

commit 56151e753468e34aeb322af4b0309ab727c97d2e upstream.

The bypassing of this test is a leftover from 2.4 vintage
kernels, and is no longer appropriate, or even used by KGDB.
Currently KGDB uses probe_kernel_write() for all access to
memory via the KGDB core, so it can simply be deleted.

This fixes CVE-2010-1446.

CC: Benjamin Herrenschmidt <benh@kernel.crashing.org>
CC: Paul Mackerras <paulus@samba.org>
CC: Kumar Gala <galak@kernel.crashing.org>
Signed-off-by: Wufei <fei.wu@windriver.com>
Signed-off-by: Jason Wessel <jason.wessel@windriver.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

---
 arch/powerpc/mm/fsl_booke_mmu.c |    5 -----
 1 file changed, 5 deletions(-)

--- a/arch/powerpc/mm/fsl_booke_mmu.c
+++ b/arch/powerpc/mm/fsl_booke_mmu.c
@@ -155,15 +155,10 @@ static void settlbcam(int index, unsigne
 	if (cur_cpu_spec->cpu_features & MMU_FTR_BIG_PHYS)
 		TLBCAM[index].MAS7 = (u64)phys >> 32;
 
-#ifndef CONFIG_KGDB /* want user access for breakpoints */
 	if (flags & _PAGE_USER) {
 	   TLBCAM[index].MAS3 |= MAS3_UX | MAS3_UR;
 	   TLBCAM[index].MAS3 |= ((flags & _PAGE_RW) ? MAS3_UW : 0);
 	}
-#else
-	TLBCAM[index].MAS3 |= MAS3_UX | MAS3_UR;
-	TLBCAM[index].MAS3 |= ((flags & _PAGE_RW) ? MAS3_UW : 0);
-#endif
 
 	tlbcam_addrs[index].start = virt;
 	tlbcam_addrs[index].limit = virt + size - 1;



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

* [072/117] r8169: use correct barrier between cacheable and non-cacheable memory
  2010-05-10 22:37 [000/117] 2.6.33.4-stable review Greg KH
                   ` (70 preceding siblings ...)
  2010-05-10 22:32 ` [071/117] kgdb: dont needlessly skip PAGE_USER test for Fsl booke Greg KH
@ 2010-05-10 22:32 ` Greg KH
  2010-05-10 22:32 ` [073/117] r8169: fix broken register writes Greg KH
                   ` (44 subsequent siblings)
  116 siblings, 0 replies; 130+ messages in thread
From: Greg KH @ 2010-05-10 22:32 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: stable-review, torvalds, akpm, alan, David Dillow, David S. Miller

2.6.33-stable review patch.  If anyone has any objections, please let us know.

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

From: David Dillow <dave@thedillows.org>

commit 4c020a961a812ffae9846b917304cea504c3a733 upstream.

r8169 needs certain writes to be visible to other CPUs or the NIC before
touching the hardware, but was using smp_wmb() which is only required to
order cacheable memory access. Switch to wmb() which is required to
order both cacheable and non-cacheable memory.

Noticed by Catalin Marinas and Paul Mackerras.

Signed-off-by: David Dillow <dave@thedillows.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

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

--- a/drivers/net/r8169.c
+++ b/drivers/net/r8169.c
@@ -4316,7 +4316,7 @@ static netdev_tx_t rtl8169_start_xmit(st
 
 	tp->cur_tx += frags + 1;
 
-	smp_wmb();
+	wmb();
 
 	RTL_W8(TxPoll, NPQ);	/* set polling bit */
 
@@ -4675,7 +4675,7 @@ static int rtl8169_poll(struct napi_stru
 		 * until it does.
 		 */
 		tp->intr_mask = 0xffff;
-		smp_wmb();
+		wmb();
 		RTL_W16(IntrMask, tp->intr_event);
 	}
 



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

* [073/117] r8169: fix broken register writes
  2010-05-10 22:37 [000/117] 2.6.33.4-stable review Greg KH
                   ` (71 preceding siblings ...)
  2010-05-10 22:32 ` [072/117] r8169: use correct barrier between cacheable and non-cacheable memory Greg KH
@ 2010-05-10 22:32 ` Greg KH
  2010-05-10 22:32 ` [074/117] r8169: more broken register writes workaround Greg KH
                   ` (43 subsequent siblings)
  116 siblings, 0 replies; 130+ messages in thread
From: Greg KH @ 2010-05-10 22:32 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: stable-review, torvalds, akpm, alan, Francois Romieu, David S. Miller

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

2.6.33-stable review patch.  If anyone has any objections, please let us know.

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

From: Francois Romieu <romieu@fr.zoreil.com>

commit 78f1cd02457252e1ffbc6caa44a17424a45286b8 upstream.

This is quite similar to b39fe41f481d20c201012e4483e76c203802dda7
though said registers are not even documented as 64-bit registers
- as opposed to the initial TxDescStartAddress ones - but as single
bytes which must be combined into 32 bits at the MMIO read/write
level before being merged into a 64 bit logical entity.

Credits go to Ben Hutchings <ben@decadent.org.uk> for the MAR
registers (aka "multicast is broken for ages on ARM) and to
Timo Teräs <timo.teras@iki.fi> for the MAC registers.

Signed-off-by: Francois Romieu <romieu@fr.zoreil.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

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

--- a/drivers/net/r8169.c
+++ b/drivers/net/r8169.c
@@ -2832,8 +2832,8 @@ static void rtl_rar_set(struct rtl8169_p
 	spin_lock_irq(&tp->lock);
 
 	RTL_W8(Cfg9346, Cfg9346_Unlock);
-	RTL_W32(MAC0, low);
 	RTL_W32(MAC4, high);
+	RTL_W32(MAC0, low);
 	RTL_W8(Cfg9346, Cfg9346_Lock);
 
 	spin_unlock_irq(&tp->lock);
@@ -4813,8 +4813,8 @@ static void rtl_set_rx_mode(struct net_d
 		mc_filter[1] = swab32(data);
 	}
 
-	RTL_W32(MAR0 + 0, mc_filter[0]);
 	RTL_W32(MAR0 + 4, mc_filter[1]);
+	RTL_W32(MAR0 + 0, mc_filter[0]);
 
 	RTL_W32(RxConfig, tmp);
 



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

* [074/117] r8169: more broken register writes workaround
  2010-05-10 22:37 [000/117] 2.6.33.4-stable review Greg KH
                   ` (72 preceding siblings ...)
  2010-05-10 22:32 ` [073/117] r8169: fix broken register writes Greg KH
@ 2010-05-10 22:32 ` Greg KH
  2010-05-10 22:32 ` [075/117] ath9k: reorder ieee80211_free_hw behind ath9k_uninit_hw to avoid oops Greg KH
                   ` (42 subsequent siblings)
  116 siblings, 0 replies; 130+ messages in thread
From: Greg KH @ 2010-05-10 22:32 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: stable-review, torvalds, akpm, alan, Francois Romieu, David S. Miller

2.6.33-stable review patch.  If anyone has any objections, please let us know.

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

From: =?UTF-8?q?fran=C3=A7ois=20romieu?= <romieu@fr.zoreil.com>

commit 908ba2bfd22253f26fa910cd855e4ccffb1467d0 upstream.

78f1cd02457252e1ffbc6caa44a17424a45286b8 ("fix broken register writes")
does not work for Al Viro's r8169 (XID 18000000).

Signed-off-by: Francois Romieu <romieu@fr.zoreil.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

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

--- a/drivers/net/r8169.c
+++ b/drivers/net/r8169.c
@@ -2832,8 +2832,13 @@ static void rtl_rar_set(struct rtl8169_p
 	spin_lock_irq(&tp->lock);
 
 	RTL_W8(Cfg9346, Cfg9346_Unlock);
+
 	RTL_W32(MAC4, high);
+	RTL_R32(MAC4);
+
 	RTL_W32(MAC0, low);
+	RTL_R32(MAC0);
+
 	RTL_W8(Cfg9346, Cfg9346_Lock);
 
 	spin_unlock_irq(&tp->lock);



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

* [075/117] ath9k: reorder ieee80211_free_hw behind ath9k_uninit_hw to avoid oops
  2010-05-10 22:37 [000/117] 2.6.33.4-stable review Greg KH
                   ` (73 preceding siblings ...)
  2010-05-10 22:32 ` [074/117] r8169: more broken register writes workaround Greg KH
@ 2010-05-10 22:32 ` Greg KH
  2010-05-10 22:32 ` [076/117] [SCSI] skip sense logging for some ATA PASS-THROUGH cdbs Greg KH
                   ` (41 subsequent siblings)
  116 siblings, 0 replies; 130+ messages in thread
From: Greg KH @ 2010-05-10 22:32 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: stable-review, torvalds, akpm, alan, John W. Linville

2.6.33-stable review patch.  If anyone has any objections, please let us know.

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

From: John W. Linville <linville@tuxdriver.com>

This code only exists in 2.6.33 -- 2.6.32 and 2.6.34 are not affected.

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

 drivers/net/wireless/ath/ath9k/main.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- a/drivers/net/wireless/ath/ath9k/main.c
+++ b/drivers/net/wireless/ath/ath9k/main.c
@@ -1358,9 +1358,9 @@ void ath_cleanup(struct ath_softc *sc)
 	free_irq(sc->irq, sc);
 	ath_bus_cleanup(common);
 	kfree(sc->sec_wiphy);
-	ieee80211_free_hw(sc->hw);
 
 	ath9k_uninit_hw(sc);
+	ieee80211_free_hw(sc->hw);
 }
 
 static int ath9k_reg_notifier(struct wiphy *wiphy,



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

* [076/117] [SCSI] skip sense logging for some ATA PASS-THROUGH cdbs
  2010-05-10 22:37 [000/117] 2.6.33.4-stable review Greg KH
                   ` (74 preceding siblings ...)
  2010-05-10 22:32 ` [075/117] ath9k: reorder ieee80211_free_hw behind ath9k_uninit_hw to avoid oops Greg KH
@ 2010-05-10 22:32 ` Greg KH
  2010-05-10 22:32 ` [077/117] tg3: Fix INTx fallback when MSI fails Greg KH
                   ` (40 subsequent siblings)
  116 siblings, 0 replies; 130+ messages in thread
From: Greg KH @ 2010-05-10 22:32 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: stable-review, torvalds, akpm, alan, Douglas Gilbert, James Bottomley

2.6.33-stable review patch.  If anyone has any objections, please let us know.

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

From: Douglas Gilbert <dgilbert@interlog.com>

commit e7efe5932b1d3916c79326a4221693ea90a900e2 upstream.

Further to the lsml thread titled:
"does scsi_io_completion need to dump sense data for ata pass through (ck_cond =
1) ?"

This is a patch to skip logging when the sense data is
associated with a SENSE_KEY of "RECOVERED_ERROR" and the
additional sense code is "ATA PASS-THROUGH INFORMATION
AVAILABLE". This only occurs with the SAT ATA PASS-THROUGH
commands when CK_COND=1 (in the cdb). It indicates that
the sense data contains ATA registers.

Smartmontools uses such commands on ATA disks connected via
SAT. Periodic checks such as those done by smartd cause
nuisance entries into logs that are:
    - neither errors nor warnings
    - pointless unless the cdb that caused them are also logged

Signed-off-by: Douglas Gilbert <dgilbert@interlog.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

---
 drivers/scsi/scsi_lib.c |   10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

--- a/drivers/scsi/scsi_lib.c
+++ b/drivers/scsi/scsi_lib.c
@@ -773,8 +773,14 @@ void scsi_io_completion(struct scsi_cmnd
 	 * we already took a copy of the original into rq->errors which
 	 * is what gets returned to the user
 	 */
-	if (sense_valid && sshdr.sense_key == RECOVERED_ERROR) {
-		if (!(req->cmd_flags & REQ_QUIET))
+	if (sense_valid && (sshdr.sense_key == RECOVERED_ERROR)) {
+		/* if ATA PASS-THROUGH INFORMATION AVAILABLE skip
+		 * print since caller wants ATA registers. Only occurs on
+		 * SCSI ATA PASS_THROUGH commands when CK_COND=1
+		 */
+		if ((sshdr.asc == 0x0) && (sshdr.ascq == 0x1d))
+			;
+		else if (!(req->cmd_flags & REQ_QUIET))
 			scsi_print_sense("", cmd);
 		result = 0;
 		/* BLOCK_PC may have set error */



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

* [077/117] tg3: Fix INTx fallback when MSI fails
  2010-05-10 22:37 [000/117] 2.6.33.4-stable review Greg KH
                   ` (75 preceding siblings ...)
  2010-05-10 22:32 ` [076/117] [SCSI] skip sense logging for some ATA PASS-THROUGH cdbs Greg KH
@ 2010-05-10 22:32 ` Greg KH
  2010-05-10 22:32   ` Greg KH
                   ` (39 subsequent siblings)
  116 siblings, 0 replies; 130+ messages in thread
From: Greg KH @ 2010-05-10 22:32 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: stable-review, torvalds, akpm, alan, Andre Detsch, Michael Chan,
	David S. Miller, Brandon Philips

2.6.33-stable review patch.  If anyone has any objections, please let us know.

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

From: Andre Detsch <adetsch@br.ibm.com>

commit dc8bf1b1a6edfc92465526de19772061302f0929 upstream.

tg3: Fix INTx fallback when MSI fails

MSI setup changes the value of irq_vec in struct tg3 *tp.
This attribute must be taken into account and restored before
we try to do a new request_irq for INTx fallback.

In powerpc, the original code was leading to an EINVAL return within
request_irq, because the driver was trying to use the disabled MSI
virtual irq number instead of tp->pdev->irq.

Signed-off-by: Andre Detsch <adetsch@br.ibm.com>
Acked-by: Michael Chan <mchan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Cc: Brandon Philips <bphilips@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

---
 drivers/net/tg3.c |    1 +
 1 file changed, 1 insertion(+)

--- a/drivers/net/tg3.c
+++ b/drivers/net/tg3.c
@@ -8572,6 +8572,7 @@ static int tg3_test_msi(struct tg3 *tp)
 	pci_disable_msi(tp->pdev);
 
 	tp->tg3_flags2 &= ~TG3_FLG2_USING_MSI;
+	tp->napi[0].irq_vec = tp->pdev->irq;
 
 	err = tg3_request_irq(tp, 0);
 	if (err)



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

* [078/117] xfs: add a shrinker to background inode reclaim
  2010-05-10 22:37 [000/117] 2.6.33.4-stable review Greg KH
@ 2010-05-10 22:32   ` Greg KH
  2010-05-10 22:31 ` [002/117] p54usb: Add usbid for Corega CG-WLUSB2GT Greg KH
                     ` (115 subsequent siblings)
  116 siblings, 0 replies; 130+ messages in thread
From: Greg KH @ 2010-05-10 22:32 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: stable-review, torvalds, akpm, alan, xfs, Dave Chinner

2.6.33-stable review patch.  If anyone has any objections, please let us know.

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

From: Dave Chinner <dchinner@redhat.com>

commit 9bf729c0af67897ea8498ce17c29b0683f7f2028 upstream

On low memory boxes or those with highmem, kernel can OOM before the
background reclaims inodes via xfssyncd. Add a shrinker to run inode
reclaim so that it inode reclaim is expedited when memory is low.

This is more complex than it needs to be because the VM folk don't
want a context added to the shrinker infrastructure. Hence we need
to add a global list of XFS mount structures so the shrinker can
traverse them.

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


---
 fs/xfs/linux-2.6/xfs_super.c   |    5 +
 fs/xfs/linux-2.6/xfs_sync.c    |  107 ++++++++++++++++++++++++++++++++++++++---
 fs/xfs/linux-2.6/xfs_sync.h    |    7 ++
 fs/xfs/quota/xfs_qm_syscalls.c |    3 -
 fs/xfs/xfs_ag.h                |    1 
 fs/xfs/xfs_mount.h             |    1 
 6 files changed, 115 insertions(+), 9 deletions(-)

--- a/fs/xfs/linux-2.6/xfs_super.c
+++ b/fs/xfs/linux-2.6/xfs_super.c
@@ -1160,6 +1160,7 @@ xfs_fs_put_super(
 
 	xfs_unmountfs(mp);
 	xfs_freesb(mp);
+	xfs_inode_shrinker_unregister(mp);
 	xfs_icsb_destroy_counters(mp);
 	xfs_close_devices(mp);
 	xfs_dmops_put(mp);
@@ -1523,6 +1524,8 @@ xfs_fs_fill_super(
 	if (error)
 		goto fail_vnrele;
 
+	xfs_inode_shrinker_register(mp);
+
 	kfree(mtpt);
 	return 0;
 
@@ -1767,6 +1770,7 @@ init_xfs_fs(void)
 		goto out_cleanup_procfs;
 
 	vfs_initquota();
+	xfs_inode_shrinker_init();
 
 	error = register_filesystem(&xfs_fs_type);
 	if (error)
@@ -1794,6 +1798,7 @@ exit_xfs_fs(void)
 {
 	vfs_exitquota();
 	unregister_filesystem(&xfs_fs_type);
+	xfs_inode_shrinker_destroy();
 	xfs_sysctl_unregister();
 	xfs_cleanup_procfs();
 	xfs_buf_terminate();
--- a/fs/xfs/linux-2.6/xfs_sync.c
+++ b/fs/xfs/linux-2.6/xfs_sync.c
@@ -95,7 +95,8 @@ xfs_inode_ag_walk(
 					   struct xfs_perag *pag, int flags),
 	int			flags,
 	int			tag,
-	int			exclusive)
+	int			exclusive,
+	int			*nr_to_scan)
 {
 	struct xfs_perag	*pag = &mp->m_perag[ag];
 	uint32_t		first_index;
@@ -135,7 +136,7 @@ restart:
 		if (error == EFSCORRUPTED)
 			break;
 
-	} while (1);
+	} while ((*nr_to_scan)--);
 
 	if (skipped) {
 		delay(1);
@@ -153,23 +154,30 @@ xfs_inode_ag_iterator(
 					   struct xfs_perag *pag, int flags),
 	int			flags,
 	int			tag,
-	int			exclusive)
+	int			exclusive,
+	int			*nr_to_scan)
 {
 	int			error = 0;
 	int			last_error = 0;
 	xfs_agnumber_t		ag;
+	int			nr;
 
+	nr = nr_to_scan ? *nr_to_scan : INT_MAX;
 	for (ag = 0; ag < mp->m_sb.sb_agcount; ag++) {
 		if (!mp->m_perag[ag].pag_ici_init)
 			continue;
 		error = xfs_inode_ag_walk(mp, ag, execute, flags, tag,
-						exclusive);
+						exclusive, &nr);
 		if (error) {
 			last_error = error;
 			if (error == EFSCORRUPTED)
 				break;
 		}
+		if (nr <= 0)
+			break;
 	}
+	if (nr_to_scan)
+		*nr_to_scan = nr;
 	return XFS_ERROR(last_error);
 }
 
@@ -289,7 +297,7 @@ xfs_sync_data(
 	ASSERT((flags & ~(SYNC_TRYLOCK|SYNC_WAIT)) == 0);
 
 	error = xfs_inode_ag_iterator(mp, xfs_sync_inode_data, flags,
-				      XFS_ICI_NO_TAG, 0);
+				      XFS_ICI_NO_TAG, 0, NULL);
 	if (error)
 		return XFS_ERROR(error);
 
@@ -311,7 +319,7 @@ xfs_sync_attr(
 	ASSERT((flags & ~SYNC_WAIT) == 0);
 
 	return xfs_inode_ag_iterator(mp, xfs_sync_inode_attr, flags,
-				     XFS_ICI_NO_TAG, 0);
+				     XFS_ICI_NO_TAG, 0, NULL);
 }
 
 STATIC int
@@ -679,6 +687,7 @@ __xfs_inode_set_reclaim_tag(
 	radix_tree_tag_set(&pag->pag_ici_root,
 			   XFS_INO_TO_AGINO(ip->i_mount, ip->i_ino),
 			   XFS_ICI_RECLAIM_TAG);
+	pag->pag_ici_reclaimable++;
 }
 
 /*
@@ -710,6 +719,7 @@ __xfs_inode_clear_reclaim_tag(
 {
 	radix_tree_tag_clear(&pag->pag_ici_root,
 			XFS_INO_TO_AGINO(mp, ip->i_ino), XFS_ICI_RECLAIM_TAG);
+	pag->pag_ici_reclaimable--;
 }
 
 STATIC int
@@ -770,5 +780,88 @@ xfs_reclaim_inodes(
 	int		mode)
 {
 	return xfs_inode_ag_iterator(mp, xfs_reclaim_inode, mode,
-					XFS_ICI_RECLAIM_TAG, 1);
+					XFS_ICI_RECLAIM_TAG, 1, NULL);
+}
+
+/*
+ * Shrinker infrastructure.
+ *
+ * This is all far more complex than it needs to be. It adds a global list of
+ * mounts because the shrinkers can only call a global context. We need to make
+ * the shrinkers pass a context to avoid the need for global state.
+ */
+static LIST_HEAD(xfs_mount_list);
+static struct rw_semaphore xfs_mount_list_lock;
+
+static int
+xfs_reclaim_inode_shrink(
+	int		nr_to_scan,
+	gfp_t		gfp_mask)
+{
+	struct xfs_mount *mp;
+	xfs_agnumber_t	ag;
+	int		reclaimable = 0;
+
+	if (nr_to_scan) {
+		if (!(gfp_mask & __GFP_FS))
+			return -1;
+
+		down_read(&xfs_mount_list_lock);
+		list_for_each_entry(mp, &xfs_mount_list, m_mplist) {
+			xfs_inode_ag_iterator(mp, xfs_reclaim_inode, 0,
+					XFS_ICI_RECLAIM_TAG, 1, &nr_to_scan);
+			if (nr_to_scan <= 0)
+				break;
+		}
+		up_read(&xfs_mount_list_lock);
+	}
+
+	down_read(&xfs_mount_list_lock);
+	list_for_each_entry(mp, &xfs_mount_list, m_mplist) {
+		for (ag = 0; ag < mp->m_sb.sb_agcount; ag++) {
+
+			if (!mp->m_perag[ag].pag_ici_init)
+				continue;
+			reclaimable += mp->m_perag[ag].pag_ici_reclaimable;
+		}
+	}
+	up_read(&xfs_mount_list_lock);
+	return reclaimable;
+}
+
+static struct shrinker xfs_inode_shrinker = {
+	.shrink = xfs_reclaim_inode_shrink,
+	.seeks = DEFAULT_SEEKS,
+};
+
+void __init
+xfs_inode_shrinker_init(void)
+{
+	init_rwsem(&xfs_mount_list_lock);
+	register_shrinker(&xfs_inode_shrinker);
+}
+
+void
+xfs_inode_shrinker_destroy(void)
+{
+	ASSERT(list_empty(&xfs_mount_list));
+	unregister_shrinker(&xfs_inode_shrinker);
+}
+
+void
+xfs_inode_shrinker_register(
+	struct xfs_mount	*mp)
+{
+	down_write(&xfs_mount_list_lock);
+	list_add_tail(&mp->m_mplist, &xfs_mount_list);
+	up_write(&xfs_mount_list_lock);
+}
+
+void
+xfs_inode_shrinker_unregister(
+	struct xfs_mount	*mp)
+{
+	down_write(&xfs_mount_list_lock);
+	list_del(&mp->m_mplist);
+	up_write(&xfs_mount_list_lock);
 }
--- a/fs/xfs/linux-2.6/xfs_sync.h
+++ b/fs/xfs/linux-2.6/xfs_sync.h
@@ -54,6 +54,11 @@ void __xfs_inode_clear_reclaim_tag(struc
 int xfs_sync_inode_valid(struct xfs_inode *ip, struct xfs_perag *pag);
 int xfs_inode_ag_iterator(struct xfs_mount *mp,
 	int (*execute)(struct xfs_inode *ip, struct xfs_perag *pag, int flags),
-	int flags, int tag, int write_lock);
+	int flags, int tag, int write_lock, int *nr_to_scan);
+
+void xfs_inode_shrinker_init(void);
+void xfs_inode_shrinker_destroy(void);
+void xfs_inode_shrinker_register(struct xfs_mount *mp);
+void xfs_inode_shrinker_unregister(struct xfs_mount *mp);
 
 #endif
--- a/fs/xfs/quota/xfs_qm_syscalls.c
+++ b/fs/xfs/quota/xfs_qm_syscalls.c
@@ -891,7 +891,8 @@ xfs_qm_dqrele_all_inodes(
 	uint		 flags)
 {
 	ASSERT(mp->m_quotainfo);
-	xfs_inode_ag_iterator(mp, xfs_dqrele_inode, flags, XFS_ICI_NO_TAG, 0);
+	xfs_inode_ag_iterator(mp, xfs_dqrele_inode, flags,
+				XFS_ICI_NO_TAG, 0, NULL);
 }
 
 /*------------------------------------------------------------------------*/
--- a/fs/xfs/xfs_ag.h
+++ b/fs/xfs/xfs_ag.h
@@ -229,6 +229,7 @@ typedef struct xfs_perag
 	int		pag_ici_init;	/* incore inode cache initialised */
 	rwlock_t	pag_ici_lock;	/* incore inode lock */
 	struct radix_tree_root pag_ici_root;	/* incore inode cache root */
+	int		pag_ici_reclaimable;	/* reclaimable inodes */
 #endif
 } xfs_perag_t;
 
--- a/fs/xfs/xfs_mount.h
+++ b/fs/xfs/xfs_mount.h
@@ -257,6 +257,7 @@ typedef struct xfs_mount {
 	wait_queue_head_t	m_wait_single_sync_task;
 	__int64_t		m_update_flags;	/* sb flags we need to update
 						   on the next remount,rw */
+	struct list_head	m_mplist;	/* inode shrinker mount list */
 } xfs_mount_t;
 
 /*



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

* [078/117] xfs: add a shrinker to background inode reclaim
@ 2010-05-10 22:32   ` Greg KH
  0 siblings, 0 replies; 130+ messages in thread
From: Greg KH @ 2010-05-10 22:32 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: xfs, Dave Chinner, akpm, torvalds, stable-review, alan

2.6.33-stable review patch.  If anyone has any objections, please let us know.

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

From: Dave Chinner <dchinner@redhat.com>

commit 9bf729c0af67897ea8498ce17c29b0683f7f2028 upstream

On low memory boxes or those with highmem, kernel can OOM before the
background reclaims inodes via xfssyncd. Add a shrinker to run inode
reclaim so that it inode reclaim is expedited when memory is low.

This is more complex than it needs to be because the VM folk don't
want a context added to the shrinker infrastructure. Hence we need
to add a global list of XFS mount structures so the shrinker can
traverse them.

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


---
 fs/xfs/linux-2.6/xfs_super.c   |    5 +
 fs/xfs/linux-2.6/xfs_sync.c    |  107 ++++++++++++++++++++++++++++++++++++++---
 fs/xfs/linux-2.6/xfs_sync.h    |    7 ++
 fs/xfs/quota/xfs_qm_syscalls.c |    3 -
 fs/xfs/xfs_ag.h                |    1 
 fs/xfs/xfs_mount.h             |    1 
 6 files changed, 115 insertions(+), 9 deletions(-)

--- a/fs/xfs/linux-2.6/xfs_super.c
+++ b/fs/xfs/linux-2.6/xfs_super.c
@@ -1160,6 +1160,7 @@ xfs_fs_put_super(
 
 	xfs_unmountfs(mp);
 	xfs_freesb(mp);
+	xfs_inode_shrinker_unregister(mp);
 	xfs_icsb_destroy_counters(mp);
 	xfs_close_devices(mp);
 	xfs_dmops_put(mp);
@@ -1523,6 +1524,8 @@ xfs_fs_fill_super(
 	if (error)
 		goto fail_vnrele;
 
+	xfs_inode_shrinker_register(mp);
+
 	kfree(mtpt);
 	return 0;
 
@@ -1767,6 +1770,7 @@ init_xfs_fs(void)
 		goto out_cleanup_procfs;
 
 	vfs_initquota();
+	xfs_inode_shrinker_init();
 
 	error = register_filesystem(&xfs_fs_type);
 	if (error)
@@ -1794,6 +1798,7 @@ exit_xfs_fs(void)
 {
 	vfs_exitquota();
 	unregister_filesystem(&xfs_fs_type);
+	xfs_inode_shrinker_destroy();
 	xfs_sysctl_unregister();
 	xfs_cleanup_procfs();
 	xfs_buf_terminate();
--- a/fs/xfs/linux-2.6/xfs_sync.c
+++ b/fs/xfs/linux-2.6/xfs_sync.c
@@ -95,7 +95,8 @@ xfs_inode_ag_walk(
 					   struct xfs_perag *pag, int flags),
 	int			flags,
 	int			tag,
-	int			exclusive)
+	int			exclusive,
+	int			*nr_to_scan)
 {
 	struct xfs_perag	*pag = &mp->m_perag[ag];
 	uint32_t		first_index;
@@ -135,7 +136,7 @@ restart:
 		if (error == EFSCORRUPTED)
 			break;
 
-	} while (1);
+	} while ((*nr_to_scan)--);
 
 	if (skipped) {
 		delay(1);
@@ -153,23 +154,30 @@ xfs_inode_ag_iterator(
 					   struct xfs_perag *pag, int flags),
 	int			flags,
 	int			tag,
-	int			exclusive)
+	int			exclusive,
+	int			*nr_to_scan)
 {
 	int			error = 0;
 	int			last_error = 0;
 	xfs_agnumber_t		ag;
+	int			nr;
 
+	nr = nr_to_scan ? *nr_to_scan : INT_MAX;
 	for (ag = 0; ag < mp->m_sb.sb_agcount; ag++) {
 		if (!mp->m_perag[ag].pag_ici_init)
 			continue;
 		error = xfs_inode_ag_walk(mp, ag, execute, flags, tag,
-						exclusive);
+						exclusive, &nr);
 		if (error) {
 			last_error = error;
 			if (error == EFSCORRUPTED)
 				break;
 		}
+		if (nr <= 0)
+			break;
 	}
+	if (nr_to_scan)
+		*nr_to_scan = nr;
 	return XFS_ERROR(last_error);
 }
 
@@ -289,7 +297,7 @@ xfs_sync_data(
 	ASSERT((flags & ~(SYNC_TRYLOCK|SYNC_WAIT)) == 0);
 
 	error = xfs_inode_ag_iterator(mp, xfs_sync_inode_data, flags,
-				      XFS_ICI_NO_TAG, 0);
+				      XFS_ICI_NO_TAG, 0, NULL);
 	if (error)
 		return XFS_ERROR(error);
 
@@ -311,7 +319,7 @@ xfs_sync_attr(
 	ASSERT((flags & ~SYNC_WAIT) == 0);
 
 	return xfs_inode_ag_iterator(mp, xfs_sync_inode_attr, flags,
-				     XFS_ICI_NO_TAG, 0);
+				     XFS_ICI_NO_TAG, 0, NULL);
 }
 
 STATIC int
@@ -679,6 +687,7 @@ __xfs_inode_set_reclaim_tag(
 	radix_tree_tag_set(&pag->pag_ici_root,
 			   XFS_INO_TO_AGINO(ip->i_mount, ip->i_ino),
 			   XFS_ICI_RECLAIM_TAG);
+	pag->pag_ici_reclaimable++;
 }
 
 /*
@@ -710,6 +719,7 @@ __xfs_inode_clear_reclaim_tag(
 {
 	radix_tree_tag_clear(&pag->pag_ici_root,
 			XFS_INO_TO_AGINO(mp, ip->i_ino), XFS_ICI_RECLAIM_TAG);
+	pag->pag_ici_reclaimable--;
 }
 
 STATIC int
@@ -770,5 +780,88 @@ xfs_reclaim_inodes(
 	int		mode)
 {
 	return xfs_inode_ag_iterator(mp, xfs_reclaim_inode, mode,
-					XFS_ICI_RECLAIM_TAG, 1);
+					XFS_ICI_RECLAIM_TAG, 1, NULL);
+}
+
+/*
+ * Shrinker infrastructure.
+ *
+ * This is all far more complex than it needs to be. It adds a global list of
+ * mounts because the shrinkers can only call a global context. We need to make
+ * the shrinkers pass a context to avoid the need for global state.
+ */
+static LIST_HEAD(xfs_mount_list);
+static struct rw_semaphore xfs_mount_list_lock;
+
+static int
+xfs_reclaim_inode_shrink(
+	int		nr_to_scan,
+	gfp_t		gfp_mask)
+{
+	struct xfs_mount *mp;
+	xfs_agnumber_t	ag;
+	int		reclaimable = 0;
+
+	if (nr_to_scan) {
+		if (!(gfp_mask & __GFP_FS))
+			return -1;
+
+		down_read(&xfs_mount_list_lock);
+		list_for_each_entry(mp, &xfs_mount_list, m_mplist) {
+			xfs_inode_ag_iterator(mp, xfs_reclaim_inode, 0,
+					XFS_ICI_RECLAIM_TAG, 1, &nr_to_scan);
+			if (nr_to_scan <= 0)
+				break;
+		}
+		up_read(&xfs_mount_list_lock);
+	}
+
+	down_read(&xfs_mount_list_lock);
+	list_for_each_entry(mp, &xfs_mount_list, m_mplist) {
+		for (ag = 0; ag < mp->m_sb.sb_agcount; ag++) {
+
+			if (!mp->m_perag[ag].pag_ici_init)
+				continue;
+			reclaimable += mp->m_perag[ag].pag_ici_reclaimable;
+		}
+	}
+	up_read(&xfs_mount_list_lock);
+	return reclaimable;
+}
+
+static struct shrinker xfs_inode_shrinker = {
+	.shrink = xfs_reclaim_inode_shrink,
+	.seeks = DEFAULT_SEEKS,
+};
+
+void __init
+xfs_inode_shrinker_init(void)
+{
+	init_rwsem(&xfs_mount_list_lock);
+	register_shrinker(&xfs_inode_shrinker);
+}
+
+void
+xfs_inode_shrinker_destroy(void)
+{
+	ASSERT(list_empty(&xfs_mount_list));
+	unregister_shrinker(&xfs_inode_shrinker);
+}
+
+void
+xfs_inode_shrinker_register(
+	struct xfs_mount	*mp)
+{
+	down_write(&xfs_mount_list_lock);
+	list_add_tail(&mp->m_mplist, &xfs_mount_list);
+	up_write(&xfs_mount_list_lock);
+}
+
+void
+xfs_inode_shrinker_unregister(
+	struct xfs_mount	*mp)
+{
+	down_write(&xfs_mount_list_lock);
+	list_del(&mp->m_mplist);
+	up_write(&xfs_mount_list_lock);
 }
--- a/fs/xfs/linux-2.6/xfs_sync.h
+++ b/fs/xfs/linux-2.6/xfs_sync.h
@@ -54,6 +54,11 @@ void __xfs_inode_clear_reclaim_tag(struc
 int xfs_sync_inode_valid(struct xfs_inode *ip, struct xfs_perag *pag);
 int xfs_inode_ag_iterator(struct xfs_mount *mp,
 	int (*execute)(struct xfs_inode *ip, struct xfs_perag *pag, int flags),
-	int flags, int tag, int write_lock);
+	int flags, int tag, int write_lock, int *nr_to_scan);
+
+void xfs_inode_shrinker_init(void);
+void xfs_inode_shrinker_destroy(void);
+void xfs_inode_shrinker_register(struct xfs_mount *mp);
+void xfs_inode_shrinker_unregister(struct xfs_mount *mp);
 
 #endif
--- a/fs/xfs/quota/xfs_qm_syscalls.c
+++ b/fs/xfs/quota/xfs_qm_syscalls.c
@@ -891,7 +891,8 @@ xfs_qm_dqrele_all_inodes(
 	uint		 flags)
 {
 	ASSERT(mp->m_quotainfo);
-	xfs_inode_ag_iterator(mp, xfs_dqrele_inode, flags, XFS_ICI_NO_TAG, 0);
+	xfs_inode_ag_iterator(mp, xfs_dqrele_inode, flags,
+				XFS_ICI_NO_TAG, 0, NULL);
 }
 
 /*------------------------------------------------------------------------*/
--- a/fs/xfs/xfs_ag.h
+++ b/fs/xfs/xfs_ag.h
@@ -229,6 +229,7 @@ typedef struct xfs_perag
 	int		pag_ici_init;	/* incore inode cache initialised */
 	rwlock_t	pag_ici_lock;	/* incore inode lock */
 	struct radix_tree_root pag_ici_root;	/* incore inode cache root */
+	int		pag_ici_reclaimable;	/* reclaimable inodes */
 #endif
 } xfs_perag_t;
 
--- a/fs/xfs/xfs_mount.h
+++ b/fs/xfs/xfs_mount.h
@@ -257,6 +257,7 @@ typedef struct xfs_mount {
 	wait_queue_head_t	m_wait_single_sync_task;
 	__int64_t		m_update_flags;	/* sb flags we need to update
 						   on the next remount,rw */
+	struct list_head	m_mplist;	/* inode shrinker mount list */
 } xfs_mount_t;
 
 /*


_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs

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

* [079/117] powerpc: Reset kernel stack on cpu online from cede state
  2010-05-10 22:37 [000/117] 2.6.33.4-stable review Greg KH
                   ` (77 preceding siblings ...)
  2010-05-10 22:32   ` Greg KH
@ 2010-05-10 22:32 ` Greg KH
  2010-05-10 22:32 ` [080/117] powerpc: Move checks in pseries_mach_cpu_die() Greg KH
                   ` (37 subsequent siblings)
  116 siblings, 0 replies; 130+ messages in thread
From: Greg KH @ 2010-05-10 22:32 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: stable-review, torvalds, akpm, alan, Vaidyanathan Srinivasan,
	Gautham R Shenoy, Benjamin Herrenschmidt

2.6.33-stable review patch.  If anyone has any objections, please let us know.

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

From: Vaidyanathan Srinivasan <svaidy@linux.vnet.ibm.com>

commit 8dbce53cc249a76e9450708d291fce5a7e29c6a1 upstream.

Cpu hotplug (offline) without dlpar operation will place cpu
in cede state and the extended_cede_processor() function will
return when resumed.

Kernel stack pointer needs to be reset before
start_secondary() is called to continue the online operation.

Added new function start_secondary_resume() to do the above
steps.

Signed-off-by: Vaidyanathan Srinivasan <svaidy@linux.vnet.ibm.com>
Cc: Gautham R Shenoy <ego@in.ibm.com>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

---
 arch/powerpc/kernel/head_64.S                   |   11 +++++++++++
 arch/powerpc/platforms/pseries/hotplug-cpu.c    |    9 ++++-----
 arch/powerpc/platforms/pseries/offline_states.h |    1 +
 3 files changed, 16 insertions(+), 5 deletions(-)

--- a/arch/powerpc/kernel/head_64.S
+++ b/arch/powerpc/kernel/head_64.S
@@ -615,6 +615,17 @@ _GLOBAL(start_secondary_prolog)
 	std	r3,0(r1)		/* Zero the stack frame pointer	*/
 	bl	.start_secondary
 	b	.
+/*
+ * Reset stack pointer and call start_secondary
+ * to continue with online operation when woken up
+ * from cede in cpu offline.
+ */
+_GLOBAL(start_secondary_resume)
+	ld	r1,PACAKSAVE(r13)	/* Reload kernel stack pointer */
+	li	r3,0
+	std	r3,0(r1)		/* Zero the stack frame pointer	*/
+	bl	.start_secondary
+	b	.
 #endif
 
 /*
--- a/arch/powerpc/platforms/pseries/hotplug-cpu.c
+++ b/arch/powerpc/platforms/pseries/hotplug-cpu.c
@@ -146,12 +146,11 @@ static void pseries_mach_cpu_die(void)
 		unregister_slb_shadow(hwcpu, __pa(get_slb_shadow()));
 
 		/*
-		 * NOTE: Calling start_secondary() here for now to
-		 * start new context.
-		 * However, need to do it cleanly by resetting the
-		 * stack pointer.
+		 * Call to start_secondary_resume() will not return.
+		 * Kernel stack will be reset and start_secondary()
+		 * will be called to continue the online operation.
 		 */
-		start_secondary();
+		start_secondary_resume();
 
 	} else if (get_preferred_offline_state(cpu) == CPU_STATE_OFFLINE) {
 
--- a/arch/powerpc/platforms/pseries/offline_states.h
+++ b/arch/powerpc/platforms/pseries/offline_states.h
@@ -35,4 +35,5 @@ static inline void set_default_offline_s
 
 extern enum cpu_state_vals get_preferred_offline_state(int cpu);
 extern int start_secondary(void);
+extern void start_secondary_resume(void);
 #endif



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

* [080/117] powerpc: Move checks in pseries_mach_cpu_die()
  2010-05-10 22:37 [000/117] 2.6.33.4-stable review Greg KH
                   ` (78 preceding siblings ...)
  2010-05-10 22:32 ` [079/117] powerpc: Reset kernel stack on cpu online from cede state Greg KH
@ 2010-05-10 22:32 ` Greg KH
  2010-05-10 22:32 ` [081/117] powerpc: Reduce printk from pseries_mach_cpu_die() Greg KH
                   ` (36 subsequent siblings)
  116 siblings, 0 replies; 130+ messages in thread
From: Greg KH @ 2010-05-10 22:32 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: stable-review, torvalds, akpm, alan, Vaidyanathan Srinivasan,
	Gautham R Shenoy, Benjamin Herrenschmidt

2.6.33-stable review patch.  If anyone has any objections, please let us know.

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

From: Vaidyanathan Srinivasan <svaidy@linux.vnet.ibm.com>

commit 0212f2602a38e740d5a96aba4cebfc2ebc993ecf upstream.

Rearrange condition checks for better code readability and
	prevention of possible race conditions when
	preferred_offline_state can potentially change during the
	execution of pseries_mach_cpu_die().  The patch will make
	pseries_mach_cpu_die() put cpu in one of the consistent states
	and not hit the run over BUG()

Signed-off-by: Vaidyanathan Srinivasan <svaidy@linux.vnet.ibm.com>
Cc: Gautham R Shenoy <ego@in.ibm.com>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

---
 arch/powerpc/platforms/pseries/hotplug-cpu.c |   30 +++++++++++++--------------
 1 file changed, 15 insertions(+), 15 deletions(-)

--- a/arch/powerpc/platforms/pseries/hotplug-cpu.c
+++ b/arch/powerpc/platforms/pseries/hotplug-cpu.c
@@ -140,25 +140,25 @@ static void pseries_mach_cpu_die(void)
 		if (!get_lppaca()->shared_proc)
 			get_lppaca()->donate_dedicated_cpu = 0;
 		get_lppaca()->idle = 0;
-	}
 
-	if (get_preferred_offline_state(cpu) == CPU_STATE_ONLINE) {
-		unregister_slb_shadow(hwcpu, __pa(get_slb_shadow()));
+		if (get_preferred_offline_state(cpu) == CPU_STATE_ONLINE) {
+			unregister_slb_shadow(hwcpu, __pa(get_slb_shadow()));
 
-		/*
-		 * Call to start_secondary_resume() will not return.
-		 * Kernel stack will be reset and start_secondary()
-		 * will be called to continue the online operation.
-		 */
-		start_secondary_resume();
+			/*
+			 * Call to start_secondary_resume() will not return.
+			 * Kernel stack will be reset and start_secondary()
+			 * will be called to continue the online operation.
+			 */
+			start_secondary_resume();
+		}
+	}
 
-	} else if (get_preferred_offline_state(cpu) == CPU_STATE_OFFLINE) {
+	/* Requested state is CPU_STATE_OFFLINE at this point */
+	WARN_ON(get_preferred_offline_state(cpu) != CPU_STATE_OFFLINE);
 
-		set_cpu_current_state(cpu, CPU_STATE_OFFLINE);
-		unregister_slb_shadow(hard_smp_processor_id(),
-					__pa(get_slb_shadow()));
-		rtas_stop_self();
-	}
+	set_cpu_current_state(cpu, CPU_STATE_OFFLINE);
+	unregister_slb_shadow(hwcpu, __pa(get_slb_shadow()));
+	rtas_stop_self();
 
 	/* Should never get here... */
 	BUG();



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

* [081/117] powerpc: Reduce printk from pseries_mach_cpu_die()
  2010-05-10 22:37 [000/117] 2.6.33.4-stable review Greg KH
                   ` (79 preceding siblings ...)
  2010-05-10 22:32 ` [080/117] powerpc: Move checks in pseries_mach_cpu_die() Greg KH
@ 2010-05-10 22:32 ` Greg KH
  2010-05-10 22:32 ` [082/117] bnx2: Fix lost MSI-X problem on 5709 NICs Greg KH
                   ` (35 subsequent siblings)
  116 siblings, 0 replies; 130+ messages in thread
From: Greg KH @ 2010-05-10 22:32 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: stable-review, torvalds, akpm, alan, Vaidyanathan Srinivasan,
	Gautham R Shenoy, Benjamin Herrenschmidt

2.6.33-stable review patch.  If anyone has any objections, please let us know.

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

From: Vaidyanathan Srinivasan <svaidy@linux.vnet.ibm.com>

commit a8e6da093ea8642b1320fb5d64134366f2a8d0ac upstream.

Remove debug printks in pseries_mach_cpu_die().  These are
noisy at runtime.  Traceevents can be added to instrument this
section of code.

The following KERN_INFO printks are removed:

cpu 62 (hwid 62) returned from cede.
Decrementer value = b2802fff Timebase value = 2fa8f95035f4a
cpu 62 (hwid 62) got prodded to go online
cpu 58 (hwid 58) ceding for offline with hint 2

Signed-off-by: Vaidyanathan Srinivasan <svaidy@linux.vnet.ibm.com>
Cc: Gautham R Shenoy <ego@in.ibm.com>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

---
 arch/powerpc/platforms/pseries/hotplug-cpu.c |   11 -----------
 1 file changed, 11 deletions(-)

--- a/arch/powerpc/platforms/pseries/hotplug-cpu.c
+++ b/arch/powerpc/platforms/pseries/hotplug-cpu.c
@@ -122,21 +122,10 @@ static void pseries_mach_cpu_die(void)
 		if (!get_lppaca()->shared_proc)
 			get_lppaca()->donate_dedicated_cpu = 1;
 
-		printk(KERN_INFO
-			"cpu %u (hwid %u) ceding for offline with hint %d\n",
-			cpu, hwcpu, cede_latency_hint);
 		while (get_preferred_offline_state(cpu) == CPU_STATE_INACTIVE) {
 			extended_cede_processor(cede_latency_hint);
-			printk(KERN_INFO "cpu %u (hwid %u) returned from cede.\n",
-				cpu, hwcpu);
-			printk(KERN_INFO
-			"Decrementer value = %x Timebase value = %llx\n",
-			get_dec(), get_tb());
 		}
 
-		printk(KERN_INFO "cpu %u (hwid %u) got prodded to go online\n",
-			cpu, hwcpu);
-
 		if (!get_lppaca()->shared_proc)
 			get_lppaca()->donate_dedicated_cpu = 0;
 		get_lppaca()->idle = 0;



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

* [082/117] bnx2: Fix lost MSI-X problem on 5709 NICs.
  2010-05-10 22:37 [000/117] 2.6.33.4-stable review Greg KH
                   ` (80 preceding siblings ...)
  2010-05-10 22:32 ` [081/117] powerpc: Reduce printk from pseries_mach_cpu_die() Greg KH
@ 2010-05-10 22:32 ` Greg KH
  2010-05-10 22:32 ` [083/117] cdc_ether: fix autosuspend for mbm devices Greg KH
                   ` (34 subsequent siblings)
  116 siblings, 0 replies; 130+ messages in thread
From: Greg KH @ 2010-05-10 22:32 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: stable-review, torvalds, akpm, alan, Michael Chan, David S. Miller

2.6.33-stable review patch.  If anyone has any objections, please let us know.

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

From: Michael Chan <mchan@broadcom.com>

commit c441b8d2cb2194b05550a558d6d95d8944e56a84 upstream.

It has been reported that under certain heavy traffic conditions in MSI-X
mode, the driver can lose an MSI-X vector causing all packets in the
associated rx/tx ring pair to be dropped.  The problem is caused by
the chip dropping the write to unmask the MSI-X vector by the kernel
(when migrating the IRQ for example).

This can be prevented by increasing the GRC timeout value for these
register read and write operations.

Thanks to Dell for helping us debug this problem.

Signed-off-by: Michael Chan <mchan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

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

--- a/drivers/net/bnx2.c
+++ b/drivers/net/bnx2.c
@@ -4772,8 +4772,12 @@ bnx2_reset_chip(struct bnx2 *bp, u32 res
 		rc = bnx2_alloc_bad_rbuf(bp);
 	}
 
-	if (bp->flags & BNX2_FLAG_USING_MSIX)
+	if (bp->flags & BNX2_FLAG_USING_MSIX) {
 		bnx2_setup_msix_tbl(bp);
+		/* Prevent MSIX table reads and write from timing out */
+		REG_WR(bp, BNX2_MISC_ECO_HW_CTL,
+			BNX2_MISC_ECO_HW_CTL_LARGE_GRC_TMOUT_EN);
+	}
 
 	return rc;
 }



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

* [083/117] cdc_ether: fix autosuspend for mbm devices
  2010-05-10 22:37 [000/117] 2.6.33.4-stable review Greg KH
                   ` (81 preceding siblings ...)
  2010-05-10 22:32 ` [082/117] bnx2: Fix lost MSI-X problem on 5709 NICs Greg KH
@ 2010-05-10 22:32 ` Greg KH
  2010-05-10 22:32 ` [084/117] ieee802154: Fix oops during ieee802154_sock_ioctl Greg KH
                   ` (33 subsequent siblings)
  116 siblings, 0 replies; 130+ messages in thread
From: Greg KH @ 2010-05-10 22:32 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: stable-review, torvalds, akpm, alan, Torgny Johansson, David S. Miller

2.6.33-stable review patch.  If anyone has any objections, please let us know.

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


From: Torgny Johansson <torgny.johansson@ericsson.com>

[ Upstream commit 55964d72d63b15df49a5df11ef91dc8601270815 ]

Autosuspend works until you bring the wwan interface up, then the
device does not enter autosuspend anymore.

The following patch fixes the problem by setting the .manage_power
field in the mbm_info struct to the same as in the cdc_info struct
(cdc_manager_power).

Signed-off-by: Torgny Johansson <torgny.johansson@ericsson.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
---
 drivers/net/usb/cdc_ether.c |    1 +
 1 file changed, 1 insertion(+)

--- a/drivers/net/usb/cdc_ether.c
+++ b/drivers/net/usb/cdc_ether.c
@@ -433,6 +433,7 @@ static const struct driver_info mbm_info
 	.bind = 	cdc_bind,
 	.unbind =	usbnet_cdc_unbind,
 	.status =	cdc_status,
+	.manage_power =	cdc_manage_power,
 };
 
 /*-------------------------------------------------------------------------*/



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

* [084/117] ieee802154: Fix oops during ieee802154_sock_ioctl
  2010-05-10 22:37 [000/117] 2.6.33.4-stable review Greg KH
                   ` (82 preceding siblings ...)
  2010-05-10 22:32 ` [083/117] cdc_ether: fix autosuspend for mbm devices Greg KH
@ 2010-05-10 22:32 ` Greg KH
  2010-05-10 22:32 ` [085/117] ipv6: Fix tcp_v6_send_response transport header setting Greg KH
                   ` (32 subsequent siblings)
  116 siblings, 0 replies; 130+ messages in thread
From: Greg KH @ 2010-05-10 22:32 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: stable-review, torvalds, akpm, alan, Stefan Schmidt,
	Dmitry Eremin-Solenikov, David S. Miller

2.6.33-stable review patch.  If anyone has any objections, please let us know.

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


From: Stefan Schmidt <stefan@datenfreihafen.org>

[ Upstream commit 93c0c8b4a5a174645550d444bd5c3ff0cccf74cb ]

Trying to run izlisten (from lowpan-tools tests) on a device that does not
exists I got the oops below. The problem is that we are using get_dev_by_name
without checking if we really get a device back. We don't in this case and
writing to dev->type generates this oops.

[Oops code removed by Dmitry Eremin-Solenikov]

If possible this patch should be applied to the current -rc fixes branch.

Signed-off-by: Stefan Schmidt <stefan@datenfreihafen.org>
Signed-off-by: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
---
 net/ieee802154/af_ieee802154.c |    3 +++
 1 file changed, 3 insertions(+)

--- a/net/ieee802154/af_ieee802154.c
+++ b/net/ieee802154/af_ieee802154.c
@@ -147,6 +147,9 @@ static int ieee802154_dev_ioctl(struct s
 	dev_load(sock_net(sk), ifr.ifr_name);
 	dev = dev_get_by_name(sock_net(sk), ifr.ifr_name);
 
+	if (!dev)
+		return -ENODEV;
+
 	if (dev->type == ARPHRD_IEEE802154 && dev->netdev_ops->ndo_do_ioctl)
 		ret = dev->netdev_ops->ndo_do_ioctl(dev, &ifr, cmd);
 



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

* [085/117] ipv6: Fix tcp_v6_send_response transport header setting.
  2010-05-10 22:37 [000/117] 2.6.33.4-stable review Greg KH
                   ` (83 preceding siblings ...)
  2010-05-10 22:32 ` [084/117] ieee802154: Fix oops during ieee802154_sock_ioctl Greg KH
@ 2010-05-10 22:32 ` Greg KH
  2010-05-10 22:32 ` [086/117] sctp: avoid irq lock inversion while call sk->sk_data_ready() Greg KH
                   ` (31 subsequent siblings)
  116 siblings, 0 replies; 130+ messages in thread
From: Greg KH @ 2010-05-10 22:32 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: stable-review, torvalds, akpm, alan, Herbert Xu, David S. Miller

2.6.33-stable review patch.  If anyone has any objections, please let us know.

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


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

[ Upstream commit 6651ffc8e8bdd5fb4b7d1867c6cfebb4f309512c ]

My recent patch to remove the open-coded checksum sequence in
tcp_v6_send_response broke it as we did not set the transport
header pointer on the new packet.

Actually, there is code there trying to set the transport
header properly, but it sets it for the wrong skb ('skb'
instead of 'buff').

This bug was introduced by commit
a8fdf2b331b38d61fb5f11f3aec4a4f9fb2dedcb ("ipv6: Fix
tcp_v6_send_response(): it didn't set skb transport header")

Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
---
 net/ipv6/tcp_ipv6.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- a/net/ipv6/tcp_ipv6.c
+++ b/net/ipv6/tcp_ipv6.c
@@ -1006,7 +1006,7 @@ static void tcp_v6_send_response(struct
 	skb_reserve(buff, MAX_HEADER + sizeof(struct ipv6hdr) + tot_len);
 
 	t1 = (struct tcphdr *) skb_push(buff, tot_len);
-	skb_reset_transport_header(skb);
+	skb_reset_transport_header(buff);
 
 	/* Swap the send and the receive. */
 	memset(t1, 0, sizeof(*t1));



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

* [086/117] sctp: avoid irq lock inversion while call sk->sk_data_ready()
  2010-05-10 22:37 [000/117] 2.6.33.4-stable review Greg KH
                   ` (84 preceding siblings ...)
  2010-05-10 22:32 ` [085/117] ipv6: Fix tcp_v6_send_response transport header setting Greg KH
@ 2010-05-10 22:32 ` Greg KH
  2010-05-10 22:32 ` [087/117] sctp: fix potential reference of a freed pointer Greg KH
                   ` (30 subsequent siblings)
  116 siblings, 0 replies; 130+ messages in thread
From: Greg KH @ 2010-05-10 22:32 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: stable-review, torvalds, akpm, alan, Wei Yongjun, Vlad Yasevich,
	David S. Miller

2.6.33-stable review patch.  If anyone has any objections, please let us know.

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


From: Wei Yongjun <yjwei@cn.fujitsu.com>

[ Upstream commit 561b1733a465cf9677356b40c27653dd45f1ac56 ]

sk->sk_data_ready() of sctp socket can be called from both BH and non-BH
contexts, but the default sk->sk_data_ready(), sock_def_readable(), can
not be used in this case. Therefore, we have to make a new function
sctp_data_ready() to grab sk->sk_data_ready() with BH disabling.

=========================================================
[ INFO: possible irq lock inversion dependency detected ]
2.6.33-rc6 #129
---------------------------------------------------------
sctp_darn/1517 just changed the state of lock:
 (clock-AF_INET){++.?..}, at: [<c06aab60>] sock_def_readable+0x20/0x80
but this lock took another, SOFTIRQ-unsafe lock in the past:
 (slock-AF_INET){+.-...}

and interrupts could create inverse lock ordering between them.

other info that might help us debug this:
1 lock held by sctp_darn/1517:
 #0:  (sk_lock-AF_INET){+.+.+.}, at: [<cdfe363d>] sctp_sendmsg+0x23d/0xc00 [sctp]

Signed-off-by: Wei Yongjun <yjwei@cn.fujitsu.com>
Signed-off-by: Vlad Yasevich <vladislav.yasevich@hp.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
---
 include/net/sctp/sctp.h |    1 +
 net/sctp/endpointola.c  |    1 +
 net/sctp/socket.c       |   10 ++++++++++
 3 files changed, 12 insertions(+)

--- a/include/net/sctp/sctp.h
+++ b/include/net/sctp/sctp.h
@@ -128,6 +128,7 @@ extern int sctp_register_pf(struct sctp_
 int sctp_backlog_rcv(struct sock *sk, struct sk_buff *skb);
 int sctp_inet_listen(struct socket *sock, int backlog);
 void sctp_write_space(struct sock *sk);
+void sctp_data_ready(struct sock *sk, int len);
 unsigned int sctp_poll(struct file *file, struct socket *sock,
 		poll_table *wait);
 void sctp_sock_rfree(struct sk_buff *skb);
--- a/net/sctp/endpointola.c
+++ b/net/sctp/endpointola.c
@@ -144,6 +144,7 @@ static struct sctp_endpoint *sctp_endpoi
 	/* Use SCTP specific send buffer space queues.  */
 	ep->sndbuf_policy = sctp_sndbuf_policy;
 
+	sk->sk_data_ready = sctp_data_ready;
 	sk->sk_write_space = sctp_write_space;
 	sock_set_flag(sk, SOCK_USE_WRITE_QUEUE);
 
--- a/net/sctp/socket.c
+++ b/net/sctp/socket.c
@@ -6188,6 +6188,16 @@ do_nonblock:
 	goto out;
 }
 
+void sctp_data_ready(struct sock *sk, int len)
+{
+	read_lock_bh(&sk->sk_callback_lock);
+	if (sk_has_sleeper(sk))
+		wake_up_interruptible_sync_poll(sk->sk_sleep, POLLIN |
+						POLLRDNORM | POLLRDBAND);
+	sk_wake_async(sk, SOCK_WAKE_WAITD, POLL_IN);
+	read_unlock_bh(&sk->sk_callback_lock);
+}
+
 /* If socket sndbuf has changed, wake up all per association waiters.  */
 void sctp_write_space(struct sock *sk)
 {



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

* [087/117] sctp: fix potential reference of a freed pointer
  2010-05-10 22:37 [000/117] 2.6.33.4-stable review Greg KH
                   ` (85 preceding siblings ...)
  2010-05-10 22:32 ` [086/117] sctp: avoid irq lock inversion while call sk->sk_data_ready() Greg KH
@ 2010-05-10 22:32 ` Greg KH
  2010-05-10 22:32 ` [088/117] sctp: per_cpu variables should be in bh_disabled section Greg KH
                   ` (29 subsequent siblings)
  116 siblings, 0 replies; 130+ messages in thread
From: Greg KH @ 2010-05-10 22:32 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: stable-review, torvalds, akpm, alan, Vlad Yasevich, David S. Miller

2.6.33-stable review patch.  If anyone has any objections, please let us know.

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


From: Vlad Yasevich <vladislav.yasevich@hp.com>

[ Upstream commit 0c42749cffbb4a06be86c5e5db6c7ebad548781f ]

When sctp attempts to update an assocition, it removes any
addresses that were not in the updated INITs.  However, the loop
may attempt to refrence a transport with address after removing it.

Signed-off-by: Vlad Yasevich <vladislav.yasevich@hp.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
---
 net/sctp/associola.c |    6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

--- a/net/sctp/associola.c
+++ b/net/sctp/associola.c
@@ -1194,8 +1194,10 @@ void sctp_assoc_update(struct sctp_assoc
 	/* Remove any peer addresses not present in the new association. */
 	list_for_each_safe(pos, temp, &asoc->peer.transport_addr_list) {
 		trans = list_entry(pos, struct sctp_transport, transports);
-		if (!sctp_assoc_lookup_paddr(new, &trans->ipaddr))
-			sctp_assoc_del_peer(asoc, &trans->ipaddr);
+		if (!sctp_assoc_lookup_paddr(new, &trans->ipaddr)) {
+			sctp_assoc_rm_peer(asoc, trans);
+			continue;
+		}
 
 		if (asoc->state >= SCTP_STATE_ESTABLISHED)
 			sctp_transport_reset(trans);



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

* [088/117] sctp: per_cpu variables should be in bh_disabled section
  2010-05-10 22:37 [000/117] 2.6.33.4-stable review Greg KH
                   ` (86 preceding siblings ...)
  2010-05-10 22:32 ` [087/117] sctp: fix potential reference of a freed pointer Greg KH
@ 2010-05-10 22:32 ` Greg KH
  2010-05-10 22:33 ` [089/117] sctp: fix to calc the INIT/INIT-ACK chunk length correctly is set Greg KH
                   ` (28 subsequent siblings)
  116 siblings, 0 replies; 130+ messages in thread
From: Greg KH @ 2010-05-10 22:32 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: stable-review, torvalds, akpm, alan, Vlad Yasevich, David S. Miller

2.6.33-stable review patch.  If anyone has any objections, please let us know.

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


From: Vlad Yasevich <vladislav.yasevich@hp.com>

[ Upstream commit 81419d862db743fe4450a021893f24bab4698c1d ]

Since the change of the atomics to percpu variables, we now
have to disable BH in process context when touching percpu variables.

Signed-off-by: Vlad Yasevich <vladislav.yasevich@hp.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
---
 net/sctp/socket.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

--- a/net/sctp/socket.c
+++ b/net/sctp/socket.c
@@ -3718,12 +3718,12 @@ SCTP_STATIC int sctp_init_sock(struct so
 	sp->hmac = NULL;
 
 	SCTP_DBG_OBJCNT_INC(sock);
-	percpu_counter_inc(&sctp_sockets_allocated);
 
 	/* Set socket backlog limit. */
 	sk->sk_backlog.limit = sysctl_sctp_rmem[1];
 
 	local_bh_disable();
+	percpu_counter_inc(&sctp_sockets_allocated);
 	sock_prot_inuse_add(sock_net(sk), sk->sk_prot, 1);
 	local_bh_enable();
 
@@ -3740,8 +3740,8 @@ SCTP_STATIC void sctp_destroy_sock(struc
 	/* Release our hold on the endpoint. */
 	ep = sctp_sk(sk)->ep;
 	sctp_endpoint_free(ep);
-	percpu_counter_dec(&sctp_sockets_allocated);
 	local_bh_disable();
+	percpu_counter_dec(&sctp_sockets_allocated);
 	sock_prot_inuse_add(sock_net(sk), sk->sk_prot, -1);
 	local_bh_enable();
 }



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

* [089/117] sctp: fix to calc the INIT/INIT-ACK chunk length correctly is set
  2010-05-10 22:37 [000/117] 2.6.33.4-stable review Greg KH
                   ` (87 preceding siblings ...)
  2010-05-10 22:32 ` [088/117] sctp: per_cpu variables should be in bh_disabled section Greg KH
@ 2010-05-10 22:33 ` Greg KH
  2010-05-10 22:33 ` [090/117] sctp: Fix oops when sending queued ASCONF chunks Greg KH
                   ` (27 subsequent siblings)
  116 siblings, 0 replies; 130+ messages in thread
From: Greg KH @ 2010-05-10 22:33 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: stable-review, torvalds, akpm, alan, Wei Yongjun, Vlad Yasevich,
	David S. Miller

2.6.33-stable review patch.  If anyone has any objections, please let us know.

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


From: Wei Yongjun <yjwei@cn.fujitsu.com>

[ Upstream commita8170c35e738d62e9919ce5b109cf4ed66e95bde ]

When calculating the INIT/INIT-ACK chunk length, we should not
only account the length of parameters, but also the parameters
zero padding length, such as AUTH HMACS parameter and CHUNKS
parameter. Without the parameters zero padding length we may get
following oops.

skb_over_panic: text:ce2068d2 len:130 put:6 head:cac3fe00 data:cac3fe00 tail:0xcac3fe82 end:0xcac3fe80 dev:<NULL>
------------[ cut here ]------------
kernel BUG at net/core/skbuff.c:127!
invalid opcode: 0000 [#2] SMP
last sysfs file: /sys/module/aes_generic/initstate
Modules linked in: authenc ......

Pid: 4102, comm: sctp_darn Tainted: G      D    2.6.34-rc2 #6
EIP: 0060:[<c0607630>] EFLAGS: 00010282 CPU: 0
EIP is at skb_over_panic+0x37/0x3e
EAX: 00000078 EBX: c07c024b ECX: c07c02b9 EDX: cb607b78
ESI: 00000000 EDI: cac3fe7a EBP: 00000002 ESP: cb607b74
 DS: 007b ES: 007b FS: 00d8 GS: 0033 SS: 0068
Process sctp_darn (pid: 4102, ti=cb607000 task=cabdc990 task.ti=cb607000)
Stack:
 c07c02b9 ce2068d2 00000082 00000006 cac3fe00 cac3fe00 cac3fe82 cac3fe80
<0> c07c024b cac3fe7c cac3fe7a c0608dec ca986e80 ce2068d2 00000006 0000007a
<0> cb8120ca ca986e80 cb812000 00000003 cb8120c4 ce208a25 cb8120ca cadd9400
Call Trace:
 [<ce2068d2>] ? sctp_addto_chunk+0x45/0x85 [sctp]
 [<c0608dec>] ? skb_put+0x2e/0x32
 [<ce2068d2>] ? sctp_addto_chunk+0x45/0x85 [sctp]
 [<ce208a25>] ? sctp_make_init+0x279/0x28c [sctp]
 [<c0686a92>] ? apic_timer_interrupt+0x2a/0x30
 [<ce1fdc0b>] ? sctp_sf_do_prm_asoc+0x2b/0x7b [sctp]
 [<ce202823>] ? sctp_do_sm+0xa0/0x14a [sctp]
 [<ce2133b9>] ? sctp_pname+0x0/0x14 [sctp]
 [<ce211d72>] ? sctp_primitive_ASSOCIATE+0x2b/0x31 [sctp]
 [<ce20f3cf>] ? sctp_sendmsg+0x7a0/0x9eb [sctp]
 [<c064eb1e>] ? inet_sendmsg+0x3b/0x43
 [<c04244b7>] ? task_tick_fair+0x2d/0xd9
 [<c06031e1>] ? sock_sendmsg+0xa7/0xc1
 [<c0416afe>] ? smp_apic_timer_interrupt+0x6b/0x75
 [<c0425123>] ? dequeue_task_fair+0x34/0x19b
 [<c0446abb>] ? sched_clock_local+0x17/0x11e
 [<c052ea87>] ? _copy_from_user+0x2b/0x10c
 [<c060ab3a>] ? verify_iovec+0x3c/0x6a
 [<c06035ca>] ? sys_sendmsg+0x186/0x1e2
 [<c042176b>] ? __wake_up_common+0x34/0x5b
 [<c04240c2>] ? __wake_up+0x2c/0x3b
 [<c057e35c>] ? tty_wakeup+0x43/0x47
 [<c04430f2>] ? remove_wait_queue+0x16/0x24
 [<c0580c94>] ? n_tty_read+0x5b8/0x65e
 [<c042be02>] ? default_wake_function+0x0/0x8
 [<c0604e0e>] ? sys_socketcall+0x17f/0x1cd
 [<c040264c>] ? sysenter_do_call+0x12/0x22
Code: 0f 45 de 53 ff b0 98 00 00 00 ff b0 94 ......
EIP: [<c0607630>] skb_over_panic+0x37/0x3e SS:ESP 0068:cb607b74

To reproduce:

# modprobe sctp
# echo 1 > /proc/sys/net/sctp/addip_enable
# echo 1 > /proc/sys/net/sctp/auth_enable
# sctp_test -H 3ffe:501:ffff:100:20c:29ff:fe4d:f37e -P 800 -l
# sctp_darn -H 3ffe:501:ffff:100:20c:29ff:fe4d:f37e -P 900 -h 192.168.0.21 -p 800 -I -s -t
sctp_darn ready to send...
3ffe:501:ffff:100:20c:29ff:fe4d:f37e:900-192.168.0.21:800 Interactive mode> bindx-add=192.168.0.21
3ffe:501:ffff:100:20c:29ff:fe4d:f37e:900-192.168.0.21:800 Interactive mode> bindx-add=192.168.1.21
3ffe:501:ffff:100:20c:29ff:fe4d:f37e:900-192.168.0.21:800 Interactive mode> snd=10

------------------------------------------------------------------
eth0 has addresses: 3ffe:501:ffff:100:20c:29ff:fe4d:f37e and 192.168.0.21
eth1 has addresses: 192.168.1.21
------------------------------------------------------------------

Reported-by: George Cheimonidis <gchimon@gmail.com>
Signed-off-by: Wei Yongjun <yjwei@cn.fujitsu.com>
Signed-off-by: Vlad Yasevich <vladislav.yasevich@hp.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
---
 net/sctp/sm_make_chunk.c |   17 ++++++++++-------
 1 file changed, 10 insertions(+), 7 deletions(-)

--- a/net/sctp/sm_make_chunk.c
+++ b/net/sctp/sm_make_chunk.c
@@ -207,7 +207,8 @@ struct sctp_chunk *sctp_make_init(const
 	sp = sctp_sk(asoc->base.sk);
 	num_types = sp->pf->supported_addrs(sp, types);
 
-	chunksize = sizeof(init) + addrs_len + SCTP_SAT_LEN(num_types);
+	chunksize = sizeof(init) + addrs_len;
+	chunksize += WORD_ROUND(SCTP_SAT_LEN(num_types));
 	chunksize += sizeof(ecap_param);
 
 	if (sctp_prsctp_enable)
@@ -237,14 +238,14 @@ struct sctp_chunk *sctp_make_init(const
 		/* Add HMACS parameter length if any were defined */
 		auth_hmacs = (sctp_paramhdr_t *)asoc->c.auth_hmacs;
 		if (auth_hmacs->length)
-			chunksize += ntohs(auth_hmacs->length);
+			chunksize += WORD_ROUND(ntohs(auth_hmacs->length));
 		else
 			auth_hmacs = NULL;
 
 		/* Add CHUNKS parameter length */
 		auth_chunks = (sctp_paramhdr_t *)asoc->c.auth_chunks;
 		if (auth_chunks->length)
-			chunksize += ntohs(auth_chunks->length);
+			chunksize += WORD_ROUND(ntohs(auth_chunks->length));
 		else
 			auth_chunks = NULL;
 
@@ -254,7 +255,8 @@ struct sctp_chunk *sctp_make_init(const
 
 	/* If we have any extensions to report, account for that */
 	if (num_ext)
-		chunksize += sizeof(sctp_supported_ext_param_t) + num_ext;
+		chunksize += WORD_ROUND(sizeof(sctp_supported_ext_param_t) +
+					num_ext);
 
 	/* RFC 2960 3.3.2 Initiation (INIT) (1)
 	 *
@@ -396,13 +398,13 @@ struct sctp_chunk *sctp_make_init_ack(co
 
 		auth_hmacs = (sctp_paramhdr_t *)asoc->c.auth_hmacs;
 		if (auth_hmacs->length)
-			chunksize += ntohs(auth_hmacs->length);
+			chunksize += WORD_ROUND(ntohs(auth_hmacs->length));
 		else
 			auth_hmacs = NULL;
 
 		auth_chunks = (sctp_paramhdr_t *)asoc->c.auth_chunks;
 		if (auth_chunks->length)
-			chunksize += ntohs(auth_chunks->length);
+			chunksize += WORD_ROUND(ntohs(auth_chunks->length));
 		else
 			auth_chunks = NULL;
 
@@ -411,7 +413,8 @@ struct sctp_chunk *sctp_make_init_ack(co
 	}
 
 	if (num_ext)
-		chunksize += sizeof(sctp_supported_ext_param_t) + num_ext;
+		chunksize += WORD_ROUND(sizeof(sctp_supported_ext_param_t) +
+					num_ext);
 
 	/* Now allocate and fill out the chunk.  */
 	retval = sctp_make_chunk(asoc, SCTP_CID_INIT_ACK, 0, chunksize);



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

* [090/117] sctp: Fix oops when sending queued ASCONF chunks
  2010-05-10 22:37 [000/117] 2.6.33.4-stable review Greg KH
                   ` (88 preceding siblings ...)
  2010-05-10 22:33 ` [089/117] sctp: fix to calc the INIT/INIT-ACK chunk length correctly is set Greg KH
@ 2010-05-10 22:33 ` Greg KH
  2010-05-10 22:33 ` [091/117] net: Fix oops from tcp_collapse() when using splice() Greg KH
                   ` (26 subsequent siblings)
  116 siblings, 0 replies; 130+ messages in thread
From: Greg KH @ 2010-05-10 22:33 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: stable-review, torvalds, akpm, alan, Yuansong Qiao,
	Shuaijun Zhang, Vlad Yasevich, David S. Miller

2.6.33-stable review patch.  If anyone has any objections, please let us know.

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


From: Vlad Yasevich <vladislav.yasevich@hp.com>

[ Upstream commit c0786693404cffd80ca3cb6e75ee7b35186b2825 ]

When we finish processing ASCONF_ACK chunk, we try to send
the next queued ASCONF.  This action runs the sctp state
machine recursively and it's not prepared to do so.

kernel BUG at kernel/timer.c:790!
invalid opcode: 0000 [#1] SMP
last sysfs file: /sys/module/ipv6/initstate
Modules linked in: sha256_generic sctp libcrc32c ipv6 dm_multipath
uinput 8139too i2c_piix4 8139cp mii i2c_core pcspkr virtio_net joydev
floppy virtio_blk virtio_pci [last unloaded: scsi_wait_scan]

Pid: 0, comm: swapper Not tainted 2.6.34-rc4 #15 /Bochs
EIP: 0060:[<c044a2ef>] EFLAGS: 00010286 CPU: 0
EIP is at add_timer+0xd/0x1b
EAX: cecbab14 EBX: 000000f0 ECX: c0957b1c EDX: 03595cf4
ESI: cecba800 EDI: cf276f00 EBP: c0957aa0 ESP: c0957aa0
 DS: 007b ES: 007b FS: 00d8 GS: 00e0 SS: 0068
Process swapper (pid: 0, ti=c0956000 task=c0988ba0 task.ti=c0956000)
Stack:
 c0957ae0 d1851214 c0ab62e4 c0ab5f26 0500ffff 00000004 00000005 00000004
<0> 00000000 d18694fd 00000004 1666b892 cecba800 cecba800 c0957b14
00000004
<0> c0957b94 d1851b11 ceda8b00 cecba800 cf276f00 00000001 c0957b14
000000d0
Call Trace:
 [<d1851214>] ? sctp_side_effects+0x607/0xdfc [sctp]
 [<d1851b11>] ? sctp_do_sm+0x108/0x159 [sctp]
 [<d1863386>] ? sctp_pname+0x0/0x1d [sctp]
 [<d1861a56>] ? sctp_primitive_ASCONF+0x36/0x3b [sctp]
 [<d185657c>] ? sctp_process_asconf_ack+0x2a4/0x2d3 [sctp]
 [<d184e35c>] ? sctp_sf_do_asconf_ack+0x1dd/0x2b4 [sctp]
 [<d1851ac1>] ? sctp_do_sm+0xb8/0x159 [sctp]
 [<d1863334>] ? sctp_cname+0x0/0x52 [sctp]
 [<d1854377>] ? sctp_assoc_bh_rcv+0xac/0xe1 [sctp]
 [<d1858f0f>] ? sctp_inq_push+0x2d/0x30 [sctp]
 [<d186329d>] ? sctp_rcv+0x797/0x82e [sctp]

Tested-by: Wei Yongjun <yjwei@cn.fujitsu.com>
Signed-off-by: Yuansong Qiao <ysqiao@research.ait.ie>
Signed-off-by: Shuaijun Zhang <szhang@research.ait.ie>
Signed-off-by: Vlad Yasevich <vladislav.yasevich@hp.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
---
 include/net/sctp/command.h |    1 +
 net/sctp/sm_make_chunk.c   |   15 ---------------
 net/sctp/sm_sideeffect.c   |   26 ++++++++++++++++++++++++++
 net/sctp/sm_statefuns.c    |    8 +++++++-
 4 files changed, 34 insertions(+), 16 deletions(-)

--- a/include/net/sctp/command.h
+++ b/include/net/sctp/command.h
@@ -107,6 +107,7 @@ typedef enum {
 	SCTP_CMD_T1_RETRAN,	 /* Mark for retransmission after T1 timeout  */
 	SCTP_CMD_UPDATE_INITTAG, /* Update peer inittag */
 	SCTP_CMD_SEND_MSG,	 /* Send the whole use message */
+	SCTP_CMD_SEND_NEXT_ASCONF, /* Send the next ASCONF after ACK */
 	SCTP_CMD_LAST
 } sctp_verb_t;
 
--- a/net/sctp/sm_make_chunk.c
+++ b/net/sctp/sm_make_chunk.c
@@ -3317,21 +3317,6 @@ int sctp_process_asconf_ack(struct sctp_
 	sctp_chunk_free(asconf);
 	asoc->addip_last_asconf = NULL;
 
-	/* Send the next asconf chunk from the addip chunk queue. */
-	if (!list_empty(&asoc->addip_chunk_list)) {
-		struct list_head *entry = asoc->addip_chunk_list.next;
-		asconf = list_entry(entry, struct sctp_chunk, list);
-
-		list_del_init(entry);
-
-		/* Hold the chunk until an ASCONF_ACK is received. */
-		sctp_chunk_hold(asconf);
-		if (sctp_primitive_ASCONF(asoc, asconf))
-			sctp_chunk_free(asconf);
-		else
-			asoc->addip_last_asconf = asconf;
-	}
-
 	return retval;
 }
 
--- a/net/sctp/sm_sideeffect.c
+++ b/net/sctp/sm_sideeffect.c
@@ -961,6 +961,29 @@ static int sctp_cmd_send_msg(struct sctp
 }
 
 
+/* Sent the next ASCONF packet currently stored in the association.
+ * This happens after the ASCONF_ACK was succeffully processed.
+ */
+static void sctp_cmd_send_asconf(struct sctp_association *asoc)
+{
+	/* Send the next asconf chunk from the addip chunk
+	 * queue.
+	 */
+	if (!list_empty(&asoc->addip_chunk_list)) {
+		struct list_head *entry = asoc->addip_chunk_list.next;
+		struct sctp_chunk *asconf = list_entry(entry,
+						struct sctp_chunk, list);
+		list_del_init(entry);
+
+		/* Hold the chunk until an ASCONF_ACK is received. */
+		sctp_chunk_hold(asconf);
+		if (sctp_primitive_ASCONF(asoc, asconf))
+			sctp_chunk_free(asconf);
+		else
+			asoc->addip_last_asconf = asconf;
+	}
+}
+
 
 /* These three macros allow us to pull the debugging code out of the
  * main flow of sctp_do_sm() to keep attention focused on the real
@@ -1616,6 +1639,9 @@ static int sctp_cmd_interpreter(sctp_eve
 			}
 			error = sctp_cmd_send_msg(asoc, cmd->obj.msg);
 			break;
+		case SCTP_CMD_SEND_NEXT_ASCONF:
+			sctp_cmd_send_asconf(asoc);
+			break;
 		default:
 			printk(KERN_WARNING "Impossible command: %u, %p\n",
 			       cmd->verb, cmd->obj.ptr);
--- a/net/sctp/sm_statefuns.c
+++ b/net/sctp/sm_statefuns.c
@@ -3675,8 +3675,14 @@ sctp_disposition_t sctp_sf_do_asconf_ack
 				SCTP_TO(SCTP_EVENT_TIMEOUT_T4_RTO));
 
 		if (!sctp_process_asconf_ack((struct sctp_association *)asoc,
-					     asconf_ack))
+					     asconf_ack)) {
+			/* Successfully processed ASCONF_ACK.  We can
+			 * release the next asconf if we have one.
+			 */
+			sctp_add_cmd_sf(commands, SCTP_CMD_SEND_NEXT_ASCONF,
+					SCTP_NULL());
 			return SCTP_DISPOSITION_CONSUME;
+		}
 
 		abort = sctp_make_abort(asoc, asconf_ack,
 					sizeof(sctp_errhdr_t));



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

* [091/117] net: Fix oops from tcp_collapse() when using splice()
  2010-05-10 22:37 [000/117] 2.6.33.4-stable review Greg KH
                   ` (89 preceding siblings ...)
  2010-05-10 22:33 ` [090/117] sctp: Fix oops when sending queued ASCONF chunks Greg KH
@ 2010-05-10 22:33 ` Greg KH
  2010-05-10 22:33 ` [092/117] tipc: Fix oops on send prior to entering networked mode (v3) Greg KH
                   ` (25 subsequent siblings)
  116 siblings, 0 replies; 130+ messages in thread
From: Greg KH @ 2010-05-10 22:33 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: stable-review, torvalds, akpm, alan, Steven J. Magnani, David S. Miller

2.6.33-stable review patch.  If anyone has any objections, please let us know.

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


From: Steven J. Magnani <steve@digidescorp.com>

[ Upstream commit baff42ab1494528907bf4d5870359e31711746ae ]

tcp_read_sock() can have a eat skbs without immediately advancing copied_seq.
This can cause a panic in tcp_collapse() if it is called as a result
of the recv_actor dropping the socket lock.

A userspace program that splices data from a socket to either another
socket or to a file can trigger this bug.

Signed-off-by: Steven J. Magnani <steve@digidescorp.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
---
 net/ipv4/tcp.c |    1 +
 1 file changed, 1 insertion(+)

--- a/net/ipv4/tcp.c
+++ b/net/ipv4/tcp.c
@@ -1368,6 +1368,7 @@ int tcp_read_sock(struct sock *sk, read_
 		sk_eat_skb(sk, skb, 0);
 		if (!desc->count)
 			break;
+		tp->copied_seq = seq;
 	}
 	tp->copied_seq = seq;
 



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

* [092/117] tipc: Fix oops on send prior to entering networked mode (v3)
  2010-05-10 22:37 [000/117] 2.6.33.4-stable review Greg KH
                   ` (90 preceding siblings ...)
  2010-05-10 22:33 ` [091/117] net: Fix oops from tcp_collapse() when using splice() Greg KH
@ 2010-05-10 22:33 ` Greg KH
  2010-05-10 22:33 ` [093/117] tun: orphan an skb on tx Greg KH
                   ` (24 subsequent siblings)
  116 siblings, 0 replies; 130+ messages in thread
From: Greg KH @ 2010-05-10 22:33 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: stable-review, torvalds, akpm, alan, Neil Horman, Allan Stephens,
	David S. Miller, tipc-discussion

2.6.33-stable review patch.  If anyone has any objections, please let us know.

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


From: Neil Horman <nhorman@tuxdriver.com>

[ Upstream commit d0021b252eaf65ca07ed14f0d66425dd9ccab9a6 ]

Fix TIPC to disallow sending to remote addresses prior to entering NET_MODE

user programs can oops the kernel by sending datagrams via AF_TIPC prior to
entering networked mode.  The following backtrace has been observed:

ID: 13459  TASK: ffff810014640040  CPU: 0   COMMAND: "tipc-client"
[exception RIP: tipc_node_select_next_hop+90]
RIP: ffffffff8869d3c3  RSP: ffff81002d9a5ab8  RFLAGS: 00010202
RAX: 0000000000000001  RBX: 0000000000000001  RCX: 0000000000000001
RDX: 0000000000000000  RSI: 0000000000000001  RDI: 0000000001001001
RBP: 0000000001001001   R8: 0074736575716552   R9: 0000000000000000
R10: ffff81003fbd0680  R11: 00000000000000c8  R12: 0000000000000008
R13: 0000000000000001  R14: 0000000000000001  R15: ffff810015c6ca00
ORIG_RAX: ffffffffffffffff  CS: 0010  SS: 0018
RIP: 0000003cbd8d49a3  RSP: 00007fffc84e0be8  RFLAGS: 00010206
RAX: 000000000000002c  RBX: ffffffff8005d116  RCX: 0000000000000000
RDX: 0000000000000008  RSI: 00007fffc84e0c00  RDI: 0000000000000003
RBP: 0000000000000000   R8: 00007fffc84e0c10   R9: 0000000000000010
R10: 0000000000000000  R11: 0000000000000246  R12: 0000000000000000
R13: 00007fffc84e0d10  R14: 0000000000000000  R15: 00007fffc84e0c30
ORIG_RAX: 000000000000002c  CS: 0033  SS: 002b

What happens is that, when the tipc module in inserted it enters a standalone
node mode in which communication to its own address is allowed <0.0.0> but not
to other addresses, since the appropriate data structures have not been
allocated yet (specifically the tipc_net pointer).  There is nothing stopping a
client from trying to send such a message however, and if that happens, we
attempt to dereference tipc_net.zones while the pointer is still NULL, and
explode.  The fix is pretty straightforward.  Since these oopses all arise from
the dereference of global pointers prior to their assignment to allocated
values, and since these allocations are small (about 2k total), lets convert
these pointers to static arrays of the appropriate size.  All the accesses to
these bits consider 0/NULL to be a non match when searching, so all the lookups
still work properly, and there is no longer a chance of a bad dererence
anywhere.  As a bonus, this lets us eliminate the setup/teardown routines for
those pointers, and elimnates the need to preform any locking around them to
prevent access while their being allocated/freed.

I've updated the tipc_net structure to behave this way to fix the exact reported
problem, and also fixed up the tipc_bearers and media_list arrays to fix an
obvious simmilar problem that arises from issuing tipc-config commands to
manipulate bearers/links prior to entering networked mode

I've tested this for a few hours by running the sanity tests and stress test
with the tipcutils suite, and nothing has fallen over.  There have been a few
lockdep warnings, but those were there before, and can be addressed later, as
they didn't actually result in any deadlock.

Signed-off-by: Neil Horman <nhorman@tuxdriver.com>
CC: Allan Stephens <allan.stephens@windriver.com>
CC: David S. Miller <davem@davemloft.net>
CC: tipc-discussion@lists.sourceforge.net
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
---
 net/tipc/bearer.c |   37 ++++++-------------------------------
 net/tipc/bearer.h |    2 +-
 net/tipc/net.c    |   25 ++++---------------------
 3 files changed, 11 insertions(+), 53 deletions(-)

--- a/net/tipc/bearer.c
+++ b/net/tipc/bearer.c
@@ -45,10 +45,10 @@
 
 #define MAX_ADDR_STR 32
 
-static struct media *media_list = NULL;
+static struct media media_list[MAX_MEDIA];
 static u32 media_count = 0;
 
-struct bearer *tipc_bearers = NULL;
+struct bearer tipc_bearers[MAX_BEARERS];
 
 /**
  * media_name_valid - validate media name
@@ -108,9 +108,11 @@ int  tipc_register_media(u32 media_type,
 	int res = -EINVAL;
 
 	write_lock_bh(&tipc_net_lock);
-	if (!media_list)
-		goto exit;
 
+	if (tipc_mode != TIPC_NET_MODE) {
+		warn("Media <%s> rejected, not in networked mode yet\n", name);
+		goto exit;
+	}
 	if (!media_name_valid(name)) {
 		warn("Media <%s> rejected, illegal name\n", name);
 		goto exit;
@@ -660,33 +662,10 @@ int tipc_disable_bearer(const char *name
 
 
 
-int tipc_bearer_init(void)
-{
-	int res;
-
-	write_lock_bh(&tipc_net_lock);
-	tipc_bearers = kcalloc(MAX_BEARERS, sizeof(struct bearer), GFP_ATOMIC);
-	media_list = kcalloc(MAX_MEDIA, sizeof(struct media), GFP_ATOMIC);
-	if (tipc_bearers && media_list) {
-		res = 0;
-	} else {
-		kfree(tipc_bearers);
-		kfree(media_list);
-		tipc_bearers = NULL;
-		media_list = NULL;
-		res = -ENOMEM;
-	}
-	write_unlock_bh(&tipc_net_lock);
-	return res;
-}
-
 void tipc_bearer_stop(void)
 {
 	u32 i;
 
-	if (!tipc_bearers)
-		return;
-
 	for (i = 0; i < MAX_BEARERS; i++) {
 		if (tipc_bearers[i].active)
 			tipc_bearers[i].publ.blocked = 1;
@@ -695,10 +674,6 @@ void tipc_bearer_stop(void)
 		if (tipc_bearers[i].active)
 			bearer_disable(tipc_bearers[i].publ.name);
 	}
-	kfree(tipc_bearers);
-	kfree(media_list);
-	tipc_bearers = NULL;
-	media_list = NULL;
 	media_count = 0;
 }
 
--- a/net/tipc/bearer.h
+++ b/net/tipc/bearer.h
@@ -114,7 +114,7 @@ struct bearer_name {
 
 struct link;
 
-extern struct bearer *tipc_bearers;
+extern struct bearer tipc_bearers[];
 
 void tipc_media_addr_printf(struct print_buf *pb, struct tipc_media_addr *a);
 struct sk_buff *tipc_media_get_names(void);
--- a/net/tipc/net.c
+++ b/net/tipc/net.c
@@ -116,7 +116,8 @@
 */
 
 DEFINE_RWLOCK(tipc_net_lock);
-struct network tipc_net = { NULL };
+struct _zone *tipc_zones[256] = { NULL, };
+struct network tipc_net = { tipc_zones };
 
 struct tipc_node *tipc_net_select_remote_node(u32 addr, u32 ref)
 {
@@ -158,28 +159,12 @@ void tipc_net_send_external_routes(u32 d
 	}
 }
 
-static int net_init(void)
-{
-	memset(&tipc_net, 0, sizeof(tipc_net));
-	tipc_net.zones = kcalloc(tipc_max_zones + 1, sizeof(struct _zone *), GFP_ATOMIC);
-	if (!tipc_net.zones) {
-		return -ENOMEM;
-	}
-	return 0;
-}
-
 static void net_stop(void)
 {
 	u32 z_num;
 
-	if (!tipc_net.zones)
-		return;
-
-	for (z_num = 1; z_num <= tipc_max_zones; z_num++) {
+	for (z_num = 1; z_num <= tipc_max_zones; z_num++)
 		tipc_zone_delete(tipc_net.zones[z_num]);
-	}
-	kfree(tipc_net.zones);
-	tipc_net.zones = NULL;
 }
 
 static void net_route_named_msg(struct sk_buff *buf)
@@ -282,9 +267,7 @@ int tipc_net_start(u32 addr)
 	tipc_named_reinit();
 	tipc_port_reinit();
 
-	if ((res = tipc_bearer_init()) ||
-	    (res = net_init()) ||
-	    (res = tipc_cltr_init()) ||
+	if ((res = tipc_cltr_init()) ||
 	    (res = tipc_bclink_init())) {
 		return res;
 	}



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

* [093/117] tun: orphan an skb on tx
  2010-05-10 22:37 [000/117] 2.6.33.4-stable review Greg KH
                   ` (91 preceding siblings ...)
  2010-05-10 22:33 ` [092/117] tipc: Fix oops on send prior to entering networked mode (v3) Greg KH
@ 2010-05-10 22:33 ` Greg KH
  2010-05-10 22:33 ` [094/117] udp: fix for unicast RX path optimization Greg KH
                   ` (23 subsequent siblings)
  116 siblings, 0 replies; 130+ messages in thread
From: Greg KH @ 2010-05-10 22:33 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: stable-review, torvalds, akpm, alan, Michael S. Tsirkin,
	Herbert Xu, David S. Miller

2.6.33-stable review patch.  If anyone has any objections, please let us know.

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


From: Michael S. Tsirkin <mst@redhat.com>

[ Upstream commit 0110d6f22f392f976e84ab49da1b42f85b64a3c5 ]

The following situation was observed in the field:
tap1 sends packets, tap2 does not consume them, as a result
tap1 can not be closed. This happens because
tun/tap devices can hang on to skbs undefinitely.

As noted by Herbert, possible solutions include a timeout followed by a
copy/change of ownership of the skb, or always copying/changing
ownership if we're going into a hostile device.

This patch implements the second approach.

Note: one issue still remaining is that since skbs
keep reference to tun socket and tun socket has a
reference to tun device, we won't flush backlog,
instead simply waiting for all skbs to get transmitted.
At least this is not user-triggerable, and
this was not reported in practice, my assumption is
other devices besides tap complete an skb
within finite time after it has been queued.

A possible solution for the second issue
would not to have socket reference the device,
instead, implement dev->destructor for tun, and
wait for all skbs to complete there, but this
needs some thought, probably too risky for 2.6.34.

Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Tested-by: Yan Vugenfirer <yvugenfi@redhat.com>
Acked-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
---
 drivers/net/tun.c |    4 ++++
 1 file changed, 4 insertions(+)

--- a/drivers/net/tun.c
+++ b/drivers/net/tun.c
@@ -380,6 +380,10 @@ static netdev_tx_t tun_net_xmit(struct s
 		}
 	}
 
+	/* Orphan the skb - required as we might hang on to it
+	 * for indefinite time. */
+	skb_orphan(skb);
+
 	/* Enqueue packet */
 	skb_queue_tail(&tun->socket.sk->sk_receive_queue, skb);
 	dev->trans_start = jiffies;



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

* [094/117] udp: fix for unicast RX path optimization
  2010-05-10 22:37 [000/117] 2.6.33.4-stable review Greg KH
                   ` (92 preceding siblings ...)
  2010-05-10 22:33 ` [093/117] tun: orphan an skb on tx Greg KH
@ 2010-05-10 22:33 ` Greg KH
  2010-05-10 22:33 ` [095/117] WAN: flush tx_queue in hdlc_ppp to prevent panic on rmmod hw_driver Greg KH
                   ` (22 subsequent siblings)
  116 siblings, 0 replies; 130+ messages in thread
From: Greg KH @ 2010-05-10 22:33 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: stable-review, torvalds, akpm, alan, Jorge Boncompte [DTI2],
	Eric Dumazet, David S. Miller

2.6.33-stable review patch.  If anyone has any objections, please let us know.

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


From: Jorge Boncompte [DTI2] <jorge@dti2.net>

[ Upstream commit 1223c67c0938d2df309fde618bd82c87c8c1af04 ]

Commits 5051ebd275de672b807c28d93002c2fb0514a3c9 and
5051ebd275de672b807c28d93002c2fb0514a3c9 ("ipv[46]: udp: optimize unicast RX
path") broke some programs.

	After upgrading a L2TP server to 2.6.33 it started to fail, tunnels going up an
down, after the 10th tunnel came up. My modified rp-l2tp uses a global
unconnected socket bound to (INADDR_ANY, 1701) and one connected socket per
tunnel after parameter negotiation.

	After ten sockets were open and due to mixed parameters to
udp[46]_lib_lookup2() kernel started to drop packets.

Signed-off-by: Jorge Boncompte [DTI2] <jorge@dti2.net>
Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
---
 net/ipv4/udp.c |    4 ++--
 net/ipv6/udp.c |    4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)

--- a/net/ipv4/udp.c
+++ b/net/ipv4/udp.c
@@ -471,8 +471,8 @@ static struct sock *__udp4_lib_lookup(st
 			if (hslot->count < hslot2->count)
 				goto begin;
 
-			result = udp4_lib_lookup2(net, INADDR_ANY, sport,
-						  daddr, hnum, dif,
+			result = udp4_lib_lookup2(net, saddr, sport,
+						  INADDR_ANY, hnum, dif,
 						  hslot2, slot2);
 		}
 		rcu_read_unlock();
--- a/net/ipv6/udp.c
+++ b/net/ipv6/udp.c
@@ -258,8 +258,8 @@ static struct sock *__udp6_lib_lookup(st
 			if (hslot->count < hslot2->count)
 				goto begin;
 
-			result = udp6_lib_lookup2(net, &in6addr_any, sport,
-						  daddr, hnum, dif,
+			result = udp6_lib_lookup2(net, saddr, sport,
+						  &in6addr_any, hnum, dif,
 						  hslot2, slot2);
 		}
 		rcu_read_unlock();



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

* [095/117] WAN: flush tx_queue in hdlc_ppp to prevent panic on rmmod hw_driver.
  2010-05-10 22:37 [000/117] 2.6.33.4-stable review Greg KH
                   ` (93 preceding siblings ...)
  2010-05-10 22:33 ` [094/117] udp: fix for unicast RX path optimization Greg KH
@ 2010-05-10 22:33 ` Greg KH
  2010-05-10 22:33 ` [096/117] sparc64: Use correct pt_regs in decode_access_size() error paths Greg KH
                   ` (21 subsequent siblings)
  116 siblings, 0 replies; 130+ messages in thread
From: Greg KH @ 2010-05-10 22:33 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: stable-review, torvalds, akpm, alan, Krzysztof Hałasa,
	David S. Miller

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

2.6.33-stable review patch.  If anyone has any objections, please let us know.

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


From: Krzysztof Halasa <khc@pm.waw.pl>

[ Upstream commit 31f634a63de7068c6a5dcb0d7b09b24b61a5cf88 ]

tx_queue is used as a temporary queue when not allowed to queue skb
directly to the hw device driver (which may sleep). Most paths flush
it before returning, but ppp_start() currently cannot. Make sure we
don't leave skbs pointing to a non-existent device.

Thanks to Michael Barkowski for reporting this problem.

Signed-off-by: Krzysztof Hałasa <khc@pm.waw.pl>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
---
 drivers/net/wan/hdlc_ppp.c |    6 ++++++
 1 file changed, 6 insertions(+)

--- a/drivers/net/wan/hdlc_ppp.c
+++ b/drivers/net/wan/hdlc_ppp.c
@@ -628,9 +628,15 @@ static void ppp_stop(struct net_device *
 	ppp_cp_event(dev, PID_LCP, STOP, 0, 0, 0, NULL);
 }
 
+static void ppp_close(struct net_device *dev)
+{
+	ppp_tx_flush();
+}
+
 static struct hdlc_proto proto = {
 	.start		= ppp_start,
 	.stop		= ppp_stop,
+	.close		= ppp_close,
 	.type_trans	= ppp_type_trans,
 	.ioctl		= ppp_ioctl,
 	.netif_rx	= ppp_rx,



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

* [096/117] sparc64: Use correct pt_regs in decode_access_size() error paths.
  2010-05-10 22:37 [000/117] 2.6.33.4-stable review Greg KH
                   ` (94 preceding siblings ...)
  2010-05-10 22:33 ` [095/117] WAN: flush tx_queue in hdlc_ppp to prevent panic on rmmod hw_driver Greg KH
@ 2010-05-10 22:33 ` Greg KH
  2010-05-10 22:33 ` [097/117] sparc64: Fix PREEMPT_ACTIVE value Greg KH
                   ` (20 subsequent siblings)
  116 siblings, 0 replies; 130+ messages in thread
From: Greg KH @ 2010-05-10 22:33 UTC (permalink / raw)
  To: linux-kernel, stable; +Cc: stable-review, torvalds, akpm, alan, David S. Miller

2.6.33-stable review patch.  If anyone has any objections, please let us know.

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


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

[ Upstream commit baa06775e224e9f74e5c2de894c95cd49678beff ]

Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
---
 arch/sparc/kernel/unaligned_64.c |    6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

--- a/arch/sparc/kernel/unaligned_64.c
+++ b/arch/sparc/kernel/unaligned_64.c
@@ -49,7 +49,7 @@ static inline enum direction decode_dire
 }
 
 /* 16 = double-word, 8 = extra-word, 4 = word, 2 = half-word */
-static inline int decode_access_size(unsigned int insn)
+static inline int decode_access_size(struct pt_regs *regs, unsigned int insn)
 {
 	unsigned int tmp;
 
@@ -65,7 +65,7 @@ static inline int decode_access_size(uns
 		return 2;
 	else {
 		printk("Impossible unaligned trap. insn=%08x\n", insn);
-		die_if_kernel("Byte sized unaligned access?!?!", current_thread_info()->kregs);
+		die_if_kernel("Byte sized unaligned access?!?!", regs);
 
 		/* GCC should never warn that control reaches the end
 		 * of this function without returning a value because
@@ -289,7 +289,7 @@ static void log_unaligned(struct pt_regs
 asmlinkage void kernel_unaligned_trap(struct pt_regs *regs, unsigned int insn)
 {
 	enum direction dir = decode_direction(insn);
-	int size = decode_access_size(insn);
+	int size = decode_access_size(regs, insn);
 	int orig_asi, asi;
 
 	current_thread_info()->kern_una_regs = regs;



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

* [097/117] sparc64: Fix PREEMPT_ACTIVE value.
  2010-05-10 22:37 [000/117] 2.6.33.4-stable review Greg KH
                   ` (95 preceding siblings ...)
  2010-05-10 22:33 ` [096/117] sparc64: Use correct pt_regs in decode_access_size() error paths Greg KH
@ 2010-05-10 22:33 ` Greg KH
  2010-05-10 22:33 ` [098/117] sparc64: Fix hardirq tracing in trap return path Greg KH
                   ` (19 subsequent siblings)
  116 siblings, 0 replies; 130+ messages in thread
From: Greg KH @ 2010-05-10 22:33 UTC (permalink / raw)
  To: linux-kernel, stable; +Cc: stable-review, torvalds, akpm, alan, David S. Miller

2.6.33-stable review patch.  If anyone has any objections, please let us know.

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


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

[ Upstream commit 6c94b1ee0ca2bfb526d779c088ec20da6a3761db ]

It currently overlaps the NMI bit.

Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
---
 arch/sparc/include/asm/thread_info_64.h |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- a/arch/sparc/include/asm/thread_info_64.h
+++ b/arch/sparc/include/asm/thread_info_64.h
@@ -121,7 +121,7 @@ struct thread_info {
 #define THREAD_SHIFT PAGE_SHIFT
 #endif /* PAGE_SHIFT == 13 */
 
-#define PREEMPT_ACTIVE		0x4000000
+#define PREEMPT_ACTIVE		0x10000000
 
 /*
  * macros/functions for gaining access to the thread information structure



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

* [098/117] sparc64: Fix hardirq tracing in trap return path.
  2010-05-10 22:37 [000/117] 2.6.33.4-stable review Greg KH
                   ` (96 preceding siblings ...)
  2010-05-10 22:33 ` [097/117] sparc64: Fix PREEMPT_ACTIVE value Greg KH
@ 2010-05-10 22:33 ` Greg KH
  2010-05-10 22:33 ` [099/117] sparc64: Use kstack_valid() in die_if_kernel() Greg KH
                   ` (18 subsequent siblings)
  116 siblings, 0 replies; 130+ messages in thread
From: Greg KH @ 2010-05-10 22:33 UTC (permalink / raw)
  To: linux-kernel, stable; +Cc: stable-review, torvalds, akpm, alan, David S. Miller

2.6.33-stable review patch.  If anyone has any objections, please let us know.

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


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

[ Upstream commit 28a1f533ae8606020238b840b82ae70a3f87609e ]

We can overflow the hardirq stack if we set the %pil here
so early, just let the normal control flow do it.

This is fine as we are allowed to do the actual IRQ enable
at any point after we call trace_hardirqs_on.

Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
---
 arch/sparc/kernel/rtrap_64.S |   12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)

--- a/arch/sparc/kernel/rtrap_64.S
+++ b/arch/sparc/kernel/rtrap_64.S
@@ -172,7 +172,17 @@ rtrap_xcall:
 		 nop
 		call			trace_hardirqs_on
 		 nop
-		wrpr			%l4, %pil
+		/* Do not actually set the %pil here.  We will do that
+		 * below after we clear PSTATE_IE in the %pstate register.
+		 * If we re-enable interrupts here, we can recurse down
+		 * the hardirq stack potentially endlessly, causing a
+		 * stack overflow.
+		 *
+		 * It is tempting to put this test and trace_hardirqs_on
+		 * call at the 'rt_continue' label, but that will not work
+		 * as that path hits unconditionally and we do not want to
+		 * execute this in NMI return paths, for example.
+		 */
 #endif
 rtrap_no_irq_enable:
 		andcc			%l1, TSTATE_PRIV, %l3



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

* [099/117] sparc64: Use kstack_valid() in die_if_kernel().
  2010-05-10 22:37 [000/117] 2.6.33.4-stable review Greg KH
                   ` (97 preceding siblings ...)
  2010-05-10 22:33 ` [098/117] sparc64: Fix hardirq tracing in trap return path Greg KH
@ 2010-05-10 22:33 ` Greg KH
  2010-05-10 22:33 ` [100/117] sparc64: Adjust __raw_local_irq_save() to cooperate in NMIs Greg KH
                   ` (17 subsequent siblings)
  116 siblings, 0 replies; 130+ messages in thread
From: Greg KH @ 2010-05-10 22:33 UTC (permalink / raw)
  To: linux-kernel, stable; +Cc: stable-review, torvalds, akpm, alan, David S. Miller

2.6.33-stable review patch.  If anyone has any objections, please let us know.

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


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

[ Upstream commit cb256aa60409efd803806cfb0528a4b3f8397dba ]

This gets rid of a local function (is_kernel_stack()) which tries to
do the same thing, yet poorly in that it doesn't handle IRQ stacks
properly.

Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
---
 arch/sparc/kernel/traps_64.c |   26 +++-----------------------
 1 file changed, 3 insertions(+), 23 deletions(-)

--- a/arch/sparc/kernel/traps_64.c
+++ b/arch/sparc/kernel/traps_64.c
@@ -2202,27 +2202,6 @@ void dump_stack(void)
 
 EXPORT_SYMBOL(dump_stack);
 
-static inline int is_kernel_stack(struct task_struct *task,
-				  struct reg_window *rw)
-{
-	unsigned long rw_addr = (unsigned long) rw;
-	unsigned long thread_base, thread_end;
-
-	if (rw_addr < PAGE_OFFSET) {
-		if (task != &init_task)
-			return 0;
-	}
-
-	thread_base = (unsigned long) task_stack_page(task);
-	thread_end = thread_base + sizeof(union thread_union);
-	if (rw_addr >= thread_base &&
-	    rw_addr < thread_end &&
-	    !(rw_addr & 0x7UL))
-		return 1;
-
-	return 0;
-}
-
 static inline struct reg_window *kernel_stack_up(struct reg_window *rw)
 {
 	unsigned long fp = rw->ins[6];
@@ -2251,6 +2230,7 @@ void die_if_kernel(char *str, struct pt_
 	show_regs(regs);
 	add_taint(TAINT_DIE);
 	if (regs->tstate & TSTATE_PRIV) {
+		struct thread_info *tp = current_thread_info();
 		struct reg_window *rw = (struct reg_window *)
 			(regs->u_regs[UREG_FP] + STACK_BIAS);
 
@@ -2258,8 +2238,8 @@ void die_if_kernel(char *str, struct pt_
 		 * find some badly aligned kernel stack.
 		 */
 		while (rw &&
-		       count++ < 30&&
-		       is_kernel_stack(current, rw)) {
+		       count++ < 30 &&
+		       kstack_valid(tp, (unsigned long) rw)) {
 			printk("Caller[%016lx]: %pS\n", rw->ins[7],
 			       (void *) rw->ins[7]);
 



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

* [100/117] sparc64: Adjust __raw_local_irq_save() to cooperate in NMIs.
  2010-05-10 22:37 [000/117] 2.6.33.4-stable review Greg KH
                   ` (98 preceding siblings ...)
  2010-05-10 22:33 ` [099/117] sparc64: Use kstack_valid() in die_if_kernel() Greg KH
@ 2010-05-10 22:33 ` Greg KH
  2010-05-10 22:33 ` [101/117] sparc64: Fix memory leak in pci_register_iommu_region() Greg KH
                   ` (16 subsequent siblings)
  116 siblings, 0 replies; 130+ messages in thread
From: Greg KH @ 2010-05-10 22:33 UTC (permalink / raw)
  To: linux-kernel, stable; +Cc: stable-review, torvalds, akpm, alan, David S. Miller

2.6.33-stable review patch.  If anyone has any objections, please let us know.

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


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

[ Upstream commits 0c25e9e6cbe7b233bb91d14d0e2c258bf8e6ec83 and
   c011f80ba0912486fe51dd2b3f71d9b33a151188 ]

If we are in an NMI then doing a plain raw_local_irq_disable() will
write PIL_NORMAL_MAX into %pil, which is lower than PIL_NMI, and thus
we'll re-enable NMIs and recurse.

Doing a simple:

	%pil = %pil | PIL_NORMAL_MAX

does what we want, if we're already at PIL_NMI (15) we leave it at
that setting, else we set it to PIL_NORMAL_MAX (14).

This should get the function tracer working on sparc64.

Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
---
 arch/sparc/include/asm/irqflags_64.h |   21 +++++++++++++++++++--
 1 file changed, 19 insertions(+), 2 deletions(-)

--- a/arch/sparc/include/asm/irqflags_64.h
+++ b/arch/sparc/include/asm/irqflags_64.h
@@ -76,9 +76,26 @@ static inline int raw_irqs_disabled(void
  */
 static inline unsigned long __raw_local_irq_save(void)
 {
-	unsigned long flags = __raw_local_save_flags();
+	unsigned long flags, tmp;
 
-	raw_local_irq_disable();
+	/* Disable interrupts to PIL_NORMAL_MAX unless we already
+	 * are using PIL_NMI, in which case PIL_NMI is retained.
+	 *
+	 * The only values we ever program into the %pil are 0,
+	 * PIL_NORMAL_MAX and PIL_NMI.
+	 *
+	 * Since PIL_NMI is the largest %pil value and all bits are
+	 * set in it (0xf), it doesn't matter what PIL_NORMAL_MAX
+	 * actually is.
+	 */
+	__asm__ __volatile__(
+		"rdpr	%%pil, %0\n\t"
+		"or	%0, %2, %1\n\t"
+		"wrpr	%1, 0x0, %%pil"
+		: "=r" (flags), "=r" (tmp)
+		: "i" (PIL_NORMAL_MAX)
+		: "memory"
+	);
 
 	return flags;
 }



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

* [101/117] sparc64: Fix memory leak in pci_register_iommu_region().
  2010-05-10 22:37 [000/117] 2.6.33.4-stable review Greg KH
                   ` (99 preceding siblings ...)
  2010-05-10 22:33 ` [100/117] sparc64: Adjust __raw_local_irq_save() to cooperate in NMIs Greg KH
@ 2010-05-10 22:33 ` Greg KH
  2010-05-10 22:33 ` [102/117] security: testing the wrong variable in create_by_name() Greg KH
                   ` (15 subsequent siblings)
  116 siblings, 0 replies; 130+ messages in thread
From: Greg KH @ 2010-05-10 22:33 UTC (permalink / raw)
  To: linux-kernel, stable; +Cc: stable-review, torvalds, akpm, alan, David S. Miller

2.6.33-stable review patch.  If anyone has any objections, please let us know.

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


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

[ Upstream commit e182c77cc291456eed127b1472952ddb59a81a9d ]

Found by kmemleak.

If request_resource() fails, we leak the struct resource we
allocated to represent the IOMMU mapping area.

This actually happens on sun4v machines because the IOMEM area is only
reported sans the IOMMU region, unlike all previous systems.  I'll
need to fix that at some point, but for now fix the leak.

Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
---
 arch/sparc/kernel/pci_common.c |   11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)

--- a/arch/sparc/kernel/pci_common.c
+++ b/arch/sparc/kernel/pci_common.c
@@ -371,14 +371,19 @@ static void pci_register_iommu_region(st
 		struct resource *rp = kzalloc(sizeof(*rp), GFP_KERNEL);
 
 		if (!rp) {
-			prom_printf("Cannot allocate IOMMU resource.\n");
-			prom_halt();
+			pr_info("%s: Cannot allocate IOMMU resource.\n",
+				pbm->name);
+			return;
 		}
 		rp->name = "IOMMU";
 		rp->start = pbm->mem_space.start + (unsigned long) vdma[0];
 		rp->end = rp->start + (unsigned long) vdma[1] - 1UL;
 		rp->flags = IORESOURCE_BUSY;
-		request_resource(&pbm->mem_space, rp);
+		if (request_resource(&pbm->mem_space, rp)) {
+			pr_info("%s: Unable to request IOMMU resource.\n",
+				pbm->name);
+			kfree(rp);
+		}
 	}
 }
 



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

* [102/117] security: testing the wrong variable in create_by_name()
  2010-05-10 22:37 [000/117] 2.6.33.4-stable review Greg KH
                   ` (100 preceding siblings ...)
  2010-05-10 22:33 ` [101/117] sparc64: Fix memory leak in pci_register_iommu_region() Greg KH
@ 2010-05-10 22:33 ` Greg KH
  2010-05-10 22:33 ` [103/117] md: restore ability of spare drives to spin down Greg KH
                   ` (14 subsequent siblings)
  116 siblings, 0 replies; 130+ messages in thread
From: Greg KH @ 2010-05-10 22:33 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: stable-review, torvalds, akpm, alan, Dan Carpenter, James Morris

2.6.33-stable review patch.  If anyone has any objections, please let us know.

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

From: Dan Carpenter <error27@gmail.com>

commit b338cc8207eae46640a8d534738fda7b5e48511d upstream.

There is a typo here.  We should be testing "*dentry" instead of
"dentry".  If "*dentry" is an ERR_PTR, it gets dereferenced in either
mkdir() or create() which would cause an OOPs.

Signed-off-by: Dan Carpenter <error27@gmail.com>
Signed-off-by: James Morris <jmorris@namei.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

---
 security/inode.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

--- a/security/inode.c
+++ b/security/inode.c
@@ -161,13 +161,13 @@ static int create_by_name(const char *na
 
 	mutex_lock(&parent->d_inode->i_mutex);
 	*dentry = lookup_one_len(name, parent, strlen(name));
-	if (!IS_ERR(dentry)) {
+	if (!IS_ERR(*dentry)) {
 		if ((mode & S_IFMT) == S_IFDIR)
 			error = mkdir(parent->d_inode, *dentry, mode);
 		else
 			error = create(parent->d_inode, *dentry, mode);
 	} else
-		error = PTR_ERR(dentry);
+		error = PTR_ERR(*dentry);
 	mutex_unlock(&parent->d_inode->i_mutex);
 
 	return error;



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

* [103/117] md: restore ability of spare drives to spin down.
  2010-05-10 22:37 [000/117] 2.6.33.4-stable review Greg KH
                   ` (101 preceding siblings ...)
  2010-05-10 22:33 ` [102/117] security: testing the wrong variable in create_by_name() Greg KH
@ 2010-05-10 22:33 ` Greg KH
  2010-05-10 22:33 ` [104/117] virtio: initialize earlier Greg KH
                   ` (13 subsequent siblings)
  116 siblings, 0 replies; 130+ messages in thread
From: Greg KH @ 2010-05-10 22:33 UTC (permalink / raw)
  To: linux-kernel, stable; +Cc: stable-review, torvalds, akpm, alan, NeilBrown

2.6.33-stable review patch.  If anyone has any objections, please let us know.

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

From: NeilBrown <neilb@suse.de>

commit 1176568de7e066c0be9e46c37503b9fd4730edcf upstream.

Some time ago we stopped the clean/active metadata updates
from being written to a 'spare' device in most cases so that
it could spin down and say spun down.  Device failure/removal
etc are still recorded on spares.

However commit 51d5668cb2e3fd1827a55 broke this 50% of the time,
depending on whether the event count is even or odd.
The change log entry said:

   This means that the alignment between 'odd/even' and
    'clean/dirty' might take a little longer to attain,

how ever the code makes no attempt to create that alignment, so it
could take arbitrarily long.

So when we find that clean/dirty is not aligned with odd/even,
force a second metadata-update immediately.  There are already cases
where a second metadata-update is needed immediately (e.g. when a
device fails during the metadata update).  We just piggy-back on that.

Reported-by: Joe Bryant <tenminjoe@yahoo.com>
Signed-off-by: NeilBrown <neilb@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

---
 drivers/md/md.c |   10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

--- a/drivers/md/md.c
+++ b/drivers/md/md.c
@@ -2108,12 +2108,18 @@ repeat:
 		if (!mddev->in_sync || mddev->recovery_cp != MaxSector) { /* not clean */
 			/* .. if the array isn't clean, an 'even' event must also go
 			 * to spares. */
-			if ((mddev->events&1)==0)
+			if ((mddev->events&1)==0) {
 				nospares = 0;
+				sync_req = 2; /* force a second update to get the
+					       * even/odd in sync */
+			}
 		} else {
 			/* otherwise an 'odd' event must go to spares */
-			if ((mddev->events&1))
+			if ((mddev->events&1)) {
 				nospares = 0;
+				sync_req = 2; /* force a second update to get the
+					       * even/odd in sync */
+			}
 		}
 	}
 



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

* [104/117] virtio: initialize earlier
  2010-05-10 22:37 [000/117] 2.6.33.4-stable review Greg KH
                   ` (102 preceding siblings ...)
  2010-05-10 22:33 ` [103/117] md: restore ability of spare drives to spin down Greg KH
@ 2010-05-10 22:33 ` Greg KH
  2010-05-10 22:33 ` [105/117] md/raid6: Fix raid-6 read-error correction in degraded state Greg KH
                   ` (12 subsequent siblings)
  116 siblings, 0 replies; 130+ messages in thread
From: Greg KH @ 2010-05-10 22:33 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: stable-review, torvalds, akpm, alan, Stijn Tintel, Rusty Russell

2.6.33-stable review patch.  If anyone has any objections, please let us know.

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

From: Stijn Tintel <stijn@linux-ipv6.be>

commit e2dbe06c271f3bb2a495627980aad3d1d8ccef2a upstream.

Move initialization of the virtio framework before the initialization of
mtd, so that block2mtd can be used on virtio-based block devices.

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

Signed-off-by: Stijn Tintel <stijn@linux-ipv6.be>
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

---
 drivers/Makefile |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- a/drivers/Makefile
+++ b/drivers/Makefile
@@ -17,6 +17,7 @@ obj-$(CONFIG_SFI)		+= sfi/
 obj-$(CONFIG_PNP)		+= pnp/
 obj-$(CONFIG_ARM_AMBA)		+= amba/
 
+obj-$(CONFIG_VIRTIO)		+= virtio/
 obj-$(CONFIG_XEN)		+= xen/
 
 # regulators early, since some subsystems rely on them to initialize
@@ -106,7 +107,6 @@ obj-$(CONFIG_HID)		+= hid/
 obj-$(CONFIG_PPC_PS3)		+= ps3/
 obj-$(CONFIG_OF)		+= of/
 obj-$(CONFIG_SSB)		+= ssb/
-obj-$(CONFIG_VIRTIO)		+= virtio/
 obj-$(CONFIG_VLYNQ)		+= vlynq/
 obj-$(CONFIG_STAGING)		+= staging/
 obj-y				+= platform/



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

* [105/117] md/raid6: Fix raid-6 read-error correction in degraded state
  2010-05-10 22:37 [000/117] 2.6.33.4-stable review Greg KH
                   ` (103 preceding siblings ...)
  2010-05-10 22:33 ` [104/117] virtio: initialize earlier Greg KH
@ 2010-05-10 22:33 ` Greg KH
  2010-05-10 22:33 ` [106/117] V4L/DVB: budget: Oops: "BUG: unable to handle kernel NULL pointer dereference" Greg KH
                   ` (11 subsequent siblings)
  116 siblings, 0 replies; 130+ messages in thread
From: Greg KH @ 2010-05-10 22:33 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: stable-review, torvalds, akpm, alan, Gabriele A. Trombetti, NeilBrown

2.6.33-stable review patch.  If anyone has any objections, please let us know.

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

From: Gabriele A. Trombetti <g.trombetti.lkrnl1213@logicschema.com>

commit 87aa63000c484bfb9909989316f615240dfee018 upstream.

Fix: Raid-6 was not trying to correct a read-error when in
singly-degraded state and was instead dropping one more device, going to
doubly-degraded state. This patch fixes this behaviour.

Tested-by: Janos Haar <janos.haar@netcenter.hu>
Signed-off-by: Gabriele A. Trombetti <g.trombetti.lkrnl1213@logicschema.com>
Reported-by: Janos Haar <janos.haar@netcenter.hu>
Signed-off-by: NeilBrown <neilb@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

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

--- a/drivers/md/raid5.c
+++ b/drivers/md/raid5.c
@@ -1526,7 +1526,7 @@ static void raid5_end_read_request(struc
 
 		clear_bit(R5_UPTODATE, &sh->dev[i].flags);
 		atomic_inc(&rdev->read_errors);
-		if (conf->mddev->degraded)
+		if (conf->mddev->degraded >= conf->max_degraded)
 			printk_rl(KERN_WARNING
 				  "raid5:%s: read error not correctable "
 				  "(sector %llu on %s).\n",



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

* [106/117] V4L/DVB: budget: Oops: "BUG: unable to handle kernel NULL pointer dereference"
  2010-05-10 22:37 [000/117] 2.6.33.4-stable review Greg KH
                   ` (104 preceding siblings ...)
  2010-05-10 22:33 ` [105/117] md/raid6: Fix raid-6 read-error correction in degraded state Greg KH
@ 2010-05-10 22:33 ` Greg KH
  2010-05-10 22:33 ` [107/117] ACPI: DMI init_set_sci_en_on_resume for multiple Lenovo ThinkPads Greg KH
                   ` (10 subsequent siblings)
  116 siblings, 0 replies; 130+ messages in thread
From: Greg KH @ 2010-05-10 22:33 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: stable-review, torvalds, akpm, alan, Bjørn Mork,
	Mauro Carvalho Chehab

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

2.6.33-stable review patch.  If anyone has any objections, please let us know.

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

From: Bjørn Mork <bjorn@mork.no>

commit 6f550dc08369ee0bc6402963c377e65f0f2e3b71 upstream.

Never call dvb_frontend_detach if we failed to attach a frontend. This fixes
the following oops, which will be triggered by a missing stv090x module:

[    8.172997] DVB: registering new adapter (TT-Budget S2-1600 PCI)
[    8.209018] adapter has MAC addr = 00:d0:5c:cc:a7:29
[    8.328665] Intel ICH 0000:00:1f.5: PCI INT B -> GSI 17 (level, low) -> IRQ 17
[    8.328753] Intel ICH 0000:00:1f.5: setting latency timer to 64
[    8.562047] DVB: Unable to find symbol stv090x_attach()
[    8.562117] BUG: unable to handle kernel NULL pointer dereference at 000000ac
[    8.562239] IP: [<e08b04a3>] dvb_frontend_detach+0x4/0x67 [dvb_core]

Ref http://bugs.debian.org/575207

Signed-off-by: Bjørn Mork <bjorn@mork.no>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

---
 drivers/media/dvb/ttpci/budget.c |    3 ---
 1 file changed, 3 deletions(-)

--- a/drivers/media/dvb/ttpci/budget.c
+++ b/drivers/media/dvb/ttpci/budget.c
@@ -643,9 +643,6 @@ static void frontend_init(struct budget
 					&budget->i2c_adap,
 					&tt1600_isl6423_config);
 
-			} else {
-				dvb_frontend_detach(budget->dvb_frontend);
-				budget->dvb_frontend = NULL;
 			}
 		}
 		break;



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

* [107/117] ACPI: DMI init_set_sci_en_on_resume for multiple Lenovo ThinkPads
  2010-05-10 22:37 [000/117] 2.6.33.4-stable review Greg KH
                   ` (105 preceding siblings ...)
  2010-05-10 22:33 ` [106/117] V4L/DVB: budget: Oops: "BUG: unable to handle kernel NULL pointer dereference" Greg KH
@ 2010-05-10 22:33 ` Greg KH
  2010-05-11  3:38   ` Alex Chiang
  2010-05-10 22:33 ` [108/117] power_meter: acpi_device_class "power_meter_resource" too long Greg KH
                   ` (9 subsequent siblings)
  116 siblings, 1 reply; 130+ messages in thread
From: Greg KH @ 2010-05-10 22:33 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: stable-review, torvalds, akpm, alan, Colin King, Alex Chiang, Len Brown

2.6.33-stable review patch.  If anyone has any objections, please let us know.

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

From: Alex Chiang <achiang@canonical.com>

commit 07bedca29b0973f36a6b6db36936deed367164ed upstream.

Multiple Lenovo ThinkPad models with Intel Core i5/i7 CPUs can
successfully suspend/resume once, and then hang on the second s/r
cycle.

We got confirmation that this was due to a BIOS defect. The BIOS
did not properly set SCI_EN coming out of S3. The BIOS guys
hinted that The Other Leading OS ignores the fact that hardware
owns the bit and sets it manually.

In any case, an existing DMI table exists for machines where this
defect is a known problem. Lenovo promise to fix their BIOS, but
for folks who either won't or can't upgrade their BIOS, allow
Linux to workaround the issue.

https://bugzilla.kernel.org/show_bug.cgi?id=15407
https://bugs.launchpad.net/ubuntu/+source/linux/+bug/532374

Confirmed by numerous testers in the launchpad bug that using
acpi_sleep=sci_force_enable fixes the issue. We add the machines
to acpisleep_dmi_table[] to automatically enable this workaround.

Cc: Colin King <colin.king@canonical.com>
Signed-off-by: Alex Chiang <achiang@canonical.com>
Signed-off-by: Len Brown <len.brown@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

---
 drivers/acpi/sleep.c |  120 +++++++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 120 insertions(+)

--- a/drivers/acpi/sleep.c
+++ b/drivers/acpi/sleep.c
@@ -450,6 +450,126 @@ static struct dmi_system_id __initdata a
 		},
 	},
 	{
+	.callback = init_set_sci_en_on_resume,
+	.ident = "Lenovo ThinkPad T410",
+	.matches = {
+		DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"),
+		DMI_MATCH(DMI_PRODUCT_VERSION, "ThinkPad T410"),
+		},
+	},
+	{
+	.callback = init_set_sci_en_on_resume,
+	.ident = "Lenovo ThinkPad T510",
+	.matches = {
+		DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"),
+		DMI_MATCH(DMI_PRODUCT_VERSION, "ThinkPad T510"),
+		},
+	},
+	{
+	.callback = init_set_sci_en_on_resume,
+	.ident = "Lenovo ThinkPad W510",
+	.matches = {
+		DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"),
+		DMI_MATCH(DMI_PRODUCT_VERSION, "ThinkPad W510"),
+		},
+	},
+	{
+	.callback = init_set_sci_en_on_resume,
+	.ident = "Lenovo ThinkPad X201",
+	.matches = {
+		DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"),
+		DMI_MATCH(DMI_PRODUCT_VERSION, "ThinkPad X201"),
+		},
+	},
+	{
+	.callback = init_set_sci_en_on_resume,
+	.ident = "Lenovo ThinkPad X201",
+	.matches = {
+		DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"),
+		DMI_MATCH(DMI_PRODUCT_VERSION, "ThinkPad X201s"),
+		},
+	},
+	{
+	.callback = init_set_sci_en_on_resume,
+	.ident = "Lenovo ThinkPad T410",
+	.matches = {
+		DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"),
+		DMI_MATCH(DMI_PRODUCT_VERSION, "ThinkPad T410"),
+		},
+	},
+	{
+	.callback = init_set_sci_en_on_resume,
+	.ident = "Lenovo ThinkPad T510",
+	.matches = {
+		DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"),
+		DMI_MATCH(DMI_PRODUCT_VERSION, "ThinkPad T510"),
+		},
+	},
+	{
+	.callback = init_set_sci_en_on_resume,
+	.ident = "Lenovo ThinkPad W510",
+	.matches = {
+		DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"),
+		DMI_MATCH(DMI_PRODUCT_VERSION, "ThinkPad W510"),
+		},
+	},
+	{
+	.callback = init_set_sci_en_on_resume,
+	.ident = "Lenovo ThinkPad X201",
+	.matches = {
+		DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"),
+		DMI_MATCH(DMI_PRODUCT_VERSION, "ThinkPad X201"),
+		},
+	},
+	{
+	.callback = init_set_sci_en_on_resume,
+	.ident = "Lenovo ThinkPad X201",
+	.matches = {
+		DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"),
+		DMI_MATCH(DMI_PRODUCT_VERSION, "ThinkPad X201s"),
+		},
+	},
+	{
+	.callback = init_set_sci_en_on_resume,
+	.ident = "Lenovo ThinkPad T410",
+	.matches = {
+		DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"),
+		DMI_MATCH(DMI_PRODUCT_VERSION, "ThinkPad T410"),
+		},
+	},
+	{
+	.callback = init_set_sci_en_on_resume,
+	.ident = "Lenovo ThinkPad T510",
+	.matches = {
+		DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"),
+		DMI_MATCH(DMI_PRODUCT_VERSION, "ThinkPad T510"),
+		},
+	},
+	{
+	.callback = init_set_sci_en_on_resume,
+	.ident = "Lenovo ThinkPad W510",
+	.matches = {
+		DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"),
+		DMI_MATCH(DMI_PRODUCT_VERSION, "ThinkPad W510"),
+		},
+	},
+	{
+	.callback = init_set_sci_en_on_resume,
+	.ident = "Lenovo ThinkPad X201",
+	.matches = {
+		DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"),
+		DMI_MATCH(DMI_PRODUCT_VERSION, "ThinkPad X201"),
+		},
+	},
+	{
+	.callback = init_set_sci_en_on_resume,
+	.ident = "Lenovo ThinkPad X201",
+	.matches = {
+		DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"),
+		DMI_MATCH(DMI_PRODUCT_VERSION, "ThinkPad X201s"),
+		},
+	},
+	{
 	.callback = init_old_suspend_ordering,
 	.ident = "Panasonic CF51-2L",
 	.matches = {



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

* [108/117] power_meter: acpi_device_class "power_meter_resource" too long
  2010-05-10 22:37 [000/117] 2.6.33.4-stable review Greg KH
                   ` (106 preceding siblings ...)
  2010-05-10 22:33 ` [107/117] ACPI: DMI init_set_sci_en_on_resume for multiple Lenovo ThinkPads Greg KH
@ 2010-05-10 22:33 ` Greg KH
  2010-05-10 22:33 ` [109/117] ACPI: sleep: init_set_sci_en_on_resume for Dell Studio 155x Greg KH
                   ` (8 subsequent siblings)
  116 siblings, 0 replies; 130+ messages in thread
From: Greg KH @ 2010-05-10 22:33 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: stable-review, torvalds, akpm, alan, Dan Carpenter, Len Brown,
	Darrick J. Wong, Len Brown

2.6.33-stable review patch.  If anyone has any objections, please let us know.

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

From: Dan Carpenter <error27@gmail.com>

commit 18262714ca0fb65c290b8ea1807b2b02bb52d0e3 upstream.

acpi_device_class can only be 19 characters and a NULL terminator.

The current code has a buffer overflow in acpi_power_meter_add():
       strcpy(acpi_device_class(device), ACPI_POWER_METER_CLASS);

Signed-off-by: Dan Carpenter <error27@gmail.com>
Cc: Len Brown <lenb@kernel.org>
Cc: "Darrick J. Wong" <djwong@us.ibm.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Len Brown <len.brown@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

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

--- a/drivers/acpi/power_meter.c
+++ b/drivers/acpi/power_meter.c
@@ -34,7 +34,7 @@
 #define ACPI_POWER_METER_NAME		"power_meter"
 ACPI_MODULE_NAME(ACPI_POWER_METER_NAME);
 #define ACPI_POWER_METER_DEVICE_NAME	"Power Meter"
-#define ACPI_POWER_METER_CLASS		"power_meter_resource"
+#define ACPI_POWER_METER_CLASS		"pwr_meter_resource"
 
 #define NUM_SENSORS			17
 



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

* [109/117] ACPI: sleep: init_set_sci_en_on_resume for Dell Studio 155x
  2010-05-10 22:37 [000/117] 2.6.33.4-stable review Greg KH
                   ` (107 preceding siblings ...)
  2010-05-10 22:33 ` [108/117] power_meter: acpi_device_class "power_meter_resource" too long Greg KH
@ 2010-05-10 22:33 ` Greg KH
  2010-05-10 22:33 ` [110/117] cpuidle: Fix incorrect optimization Greg KH
                   ` (7 subsequent siblings)
  116 siblings, 0 replies; 130+ messages in thread
From: Greg KH @ 2010-05-10 22:33 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: stable-review, torvalds, akpm, alan, Kamal Mostafa, Alex Chiang,
	Len Brown

2.6.33-stable review patch.  If anyone has any objections, please let us know.

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

From: Kamal Mostafa <kamal@canonical.com>

commit ea5bc73f4f56449b2d450068d492bcd17a675d7a upstream.

Add Dell Studio models (1558, 1557, 1555) to the 'set_sci_en_on_resume'
list to fix hang on resume.

BugLink: http://bugs.launchpad.net/bugs/553498

Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Acked-by: Alex Chiang <achiang@canonical.com>
Signed-off-by: Len Brown <len.brown@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

---
 drivers/acpi/sleep.c |   24 ++++++++++++++++++++++++
 1 file changed, 24 insertions(+)

--- a/drivers/acpi/sleep.c
+++ b/drivers/acpi/sleep.c
@@ -578,6 +578,30 @@ static struct dmi_system_id __initdata a
 		DMI_MATCH(DMI_BOARD_NAME, "CF51-2L"),
 		},
 	},
+	{
+	.callback = init_set_sci_en_on_resume,
+	.ident = "Dell Studio 1558",
+	.matches = {
+		DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
+		DMI_MATCH(DMI_PRODUCT_NAME, "Studio 1558"),
+		},
+	},
+	{
+	.callback = init_set_sci_en_on_resume,
+	.ident = "Dell Studio 1557",
+	.matches = {
+		DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
+		DMI_MATCH(DMI_PRODUCT_NAME, "Studio 1557"),
+		},
+	},
+	{
+	.callback = init_set_sci_en_on_resume,
+	.ident = "Dell Studio 1555",
+	.matches = {
+		DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
+		DMI_MATCH(DMI_PRODUCT_NAME, "Studio 1555"),
+		},
+	},
 	{},
 };
 #endif /* CONFIG_SUSPEND */



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

* [110/117] cpuidle: Fix incorrect optimization
  2010-05-10 22:37 [000/117] 2.6.33.4-stable review Greg KH
                   ` (108 preceding siblings ...)
  2010-05-10 22:33 ` [109/117] ACPI: sleep: init_set_sci_en_on_resume for Dell Studio 155x Greg KH
@ 2010-05-10 22:33 ` Greg KH
  2010-05-10 22:33 ` [111/117] [ARM] pxa/colibri: fix missing #include <mach/mfp.h> in colibri.h Greg KH
                   ` (6 subsequent siblings)
  116 siblings, 0 replies; 130+ messages in thread
From: Greg KH @ 2010-05-10 22:33 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: stable-review, torvalds, akpm, alan, Arjan van de Ven, Corrado Zoccolo

2.6.33-stable review patch.  If anyone has any objections, please let us know.

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

From: Arjan van de Ven <arjan@linux.intel.com>

commit 1c6fe0364fa7bf28248488753ee0afb6b759cd04 upstream.

commit 672917dcc78 ("cpuidle: menu governor: reduce latency on exit")
added an optimization, where the analysis on the past idle period moved
from the end of idle, to the beginning of the new idle.

Unfortunately, this optimization had a bug where it zeroed one key
variable for new use, that is needed for the analysis.  The fix is
simple, zero the variable after doing the work from the previous idle.

During the audit of the code that found this issue, another issue was
also found; the ->measured_us data structure member is never set, a
local variable is always used instead.

Signed-off-by: Arjan van de Ven <arjan@linux.intel.com>
Cc: Corrado Zoccolo <czoccolo@gmail.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

---
 drivers/cpuidle/governors/menu.c |    9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)

--- a/drivers/cpuidle/governors/menu.c
+++ b/drivers/cpuidle/governors/menu.c
@@ -101,7 +101,6 @@ struct menu_device {
 
 	unsigned int	expected_us;
 	u64		predicted_us;
-	unsigned int	measured_us;
 	unsigned int	exit_us;
 	unsigned int	bucket;
 	u64		correction_factor[BUCKETS];
@@ -187,14 +186,14 @@ static int menu_select(struct cpuidle_de
 	int i;
 	int multiplier;
 
-	data->last_state_idx = 0;
-	data->exit_us = 0;
-
 	if (data->needs_update) {
 		menu_update(dev);
 		data->needs_update = 0;
 	}
 
+	data->last_state_idx = 0;
+	data->exit_us = 0;
+
 	/* Special case when user has set very strict latency requirement */
 	if (unlikely(latency_req == 0))
 		return 0;
@@ -294,7 +293,7 @@ static void menu_update(struct cpuidle_d
 	new_factor = data->correction_factor[data->bucket]
 			* (DECAY - 1) / DECAY;
 
-	if (data->expected_us > 0 && data->measured_us < MAX_INTERESTING)
+	if (data->expected_us > 0 && measured_us < MAX_INTERESTING)
 		new_factor += RESOLUTION * measured_us / data->expected_us;
 	else
 		/*



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

* [111/117] [ARM] pxa/colibri: fix missing #include <mach/mfp.h> in colibri.h
  2010-05-10 22:37 [000/117] 2.6.33.4-stable review Greg KH
                   ` (109 preceding siblings ...)
  2010-05-10 22:33 ` [110/117] cpuidle: Fix incorrect optimization Greg KH
@ 2010-05-10 22:33 ` Greg KH
  2010-05-10 22:33 ` [112/117] SCSI: fix locking around blk_abort_request() Greg KH
                   ` (5 subsequent siblings)
  116 siblings, 0 replies; 130+ messages in thread
From: Greg KH @ 2010-05-10 22:33 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: stable-review, torvalds, akpm, alan, Daniel Mack, Jakob Viketoft,
	Eric Miao

2.6.33-stable review patch.  If anyone has any objections, please let us know.

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

From: Jakob Viketoft <jakob.viketoft@bitsim.com>

commit ccb8d8d070b8f25f0163da5c9ceacf63a5169540 upstream.

The use of mfp_cfg_t causes build errors without including <mach/mfp.h>.

CC: Daniel Mack <daniel@caiaq.de>
Signed-off-by: Jakob Viketoft <jakob.viketoft@bitsim.com>
Signed-off-by: Eric Miao <eric.y.miao@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

---
 arch/arm/mach-pxa/include/mach/colibri.h |    1 +
 1 file changed, 1 insertion(+)

--- a/arch/arm/mach-pxa/include/mach/colibri.h
+++ b/arch/arm/mach-pxa/include/mach/colibri.h
@@ -2,6 +2,7 @@
 #define _COLIBRI_H_
 
 #include <net/ax88796.h>
+#include <mach/mfp.h>
 
 /*
  * common settings for all modules



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

* [112/117] SCSI: fix locking around blk_abort_request()
  2010-05-10 22:37 [000/117] 2.6.33.4-stable review Greg KH
                   ` (110 preceding siblings ...)
  2010-05-10 22:33 ` [111/117] [ARM] pxa/colibri: fix missing #include <mach/mfp.h> in colibri.h Greg KH
@ 2010-05-10 22:33 ` Greg KH
  2010-05-10 22:33 ` [113/117] SCSI: libiscsi: regression: fix header digest errors Greg KH
                   ` (4 subsequent siblings)
  116 siblings, 0 replies; 130+ messages in thread
From: Greg KH @ 2010-05-10 22:33 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: stable-review, torvalds, akpm, alan, Tejun Heo, James Bottomley

2.6.33-stable review patch.  If anyone has any objections, please let us know.

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

From: Tejun Heo <tj@kernel.org>

commit 70b25f890ce9f0520c64075ce9225a5b020a513e upstream.

blk_abort_request() expects queue lock to be held by the caller.
Grab it before calling the function.

Lack of this synchronization led to infinite loop on corrupt
q->timeout_list.

Signed-off-by: Tejun Heo <tj@kernel.org>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

---
 drivers/scsi/libsas/sas_ata.c       |    4 ++++
 drivers/scsi/libsas/sas_scsi_host.c |    4 ++++
 2 files changed, 8 insertions(+)

--- a/drivers/scsi/libsas/sas_ata.c
+++ b/drivers/scsi/libsas/sas_ata.c
@@ -394,11 +394,15 @@ int sas_ata_init_host_and_port(struct do
 void sas_ata_task_abort(struct sas_task *task)
 {
 	struct ata_queued_cmd *qc = task->uldd_task;
+	struct request_queue *q = qc->scsicmd->device->request_queue;
 	struct completion *waiting;
+	unsigned long flags;
 
 	/* Bounce SCSI-initiated commands to the SCSI EH */
 	if (qc->scsicmd) {
+		spin_lock_irqsave(q->queue_lock, flags);
 		blk_abort_request(qc->scsicmd->request);
+		spin_unlock_irqrestore(q->queue_lock, flags);
 		scsi_schedule_eh(qc->scsicmd->device->host);
 		return;
 	}
--- a/drivers/scsi/libsas/sas_scsi_host.c
+++ b/drivers/scsi/libsas/sas_scsi_host.c
@@ -1029,6 +1029,8 @@ int __sas_task_abort(struct sas_task *ta
 void sas_task_abort(struct sas_task *task)
 {
 	struct scsi_cmnd *sc = task->uldd_task;
+	struct request_queue *q = sc->device->request_queue;
+	unsigned long flags;
 
 	/* Escape for libsas internal commands */
 	if (!sc) {
@@ -1043,7 +1045,9 @@ void sas_task_abort(struct sas_task *tas
 		return;
 	}
 
+	spin_lock_irqsave(q->queue_lock, flags);
 	blk_abort_request(sc->request);
+	spin_unlock_irqrestore(q->queue_lock, flags);
 	scsi_schedule_eh(sc->device->host);
 }
 



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

* [113/117] SCSI: libiscsi: regression: fix header digest errors
  2010-05-10 22:37 [000/117] 2.6.33.4-stable review Greg KH
                   ` (111 preceding siblings ...)
  2010-05-10 22:33 ` [112/117] SCSI: fix locking around blk_abort_request() Greg KH
@ 2010-05-10 22:33 ` Greg KH
  2010-05-10 22:33 ` [114/117] [SCSI] scsi_debug: virtual_gb ignores sector_size Greg KH
                   ` (3 subsequent siblings)
  116 siblings, 0 replies; 130+ messages in thread
From: Greg KH @ 2010-05-10 22:33 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: stable-review, torvalds, akpm, alan, Mike Christie, James Bottomley

2.6.33-stable review patch.  If anyone has any objections, please let us know.

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

From: Mike Christie <michaelc@cs.wisc.edu>

commit 96b1f96dcab87756c0a1e7ba76bc5dc2add82b88 upstream.

This fixes a regression introduced with this commit:

commit d3305f3407fa3e9452079ec6cc8379067456e4aa
Author: Mike Christie <michaelc@cs.wisc.edu>
Date:   Thu Aug 20 15:10:58 2009 -0500

    [SCSI] libiscsi: don't increment cmdsn if cmd is not sent

in 2.6.32.

When I moved the hdr->cmdsn after init_task, I added
a bug when header digests are used. The problem is
that the LLD may calculate the header digest in init_task,
so if we then set the cmdsn after the init_task call we
change what the digest will be calculated by the target.

Signed-off-by: Mike Christie <michaelc@cs.wisc.edu>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

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

--- a/drivers/scsi/libiscsi.c
+++ b/drivers/scsi/libiscsi.c
@@ -470,12 +470,12 @@ static int iscsi_prep_scsi_cmd_pdu(struc
 
 	WARN_ON(hdrlength >= 256);
 	hdr->hlength = hdrlength & 0xFF;
+	hdr->cmdsn = task->cmdsn = cpu_to_be32(session->cmdsn);
 
 	if (session->tt->init_task && session->tt->init_task(task))
 		return -EIO;
 
 	task->state = ISCSI_TASK_RUNNING;
-	hdr->cmdsn = task->cmdsn = cpu_to_be32(session->cmdsn);
 	session->cmdsn++;
 
 	conn->scsicmd_pdus_cnt++;



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

* [114/117] [SCSI] scsi_debug: virtual_gb ignores sector_size
  2010-05-10 22:37 [000/117] 2.6.33.4-stable review Greg KH
                   ` (112 preceding siblings ...)
  2010-05-10 22:33 ` [113/117] SCSI: libiscsi: regression: fix header digest errors Greg KH
@ 2010-05-10 22:33 ` Greg KH
  2010-05-10 22:33 ` [115/117] [SCSI] Enable retries for SYNCRONIZE_CACHE commands to fix I/O error Greg KH
                   ` (2 subsequent siblings)
  116 siblings, 0 replies; 130+ messages in thread
From: Greg KH @ 2010-05-10 22:33 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: stable-review, torvalds, akpm, alan, Douglas Gilbert, James Bottomley

2.6.33-stable review patch.  If anyone has any objections, please let us know.

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

From: Douglas Gilbert <dgilbert@interlog.com>

commit 5447ed6c968e7270b656afa273c2b79d15d82edd upstream.

In the scsi_debug driver, the virtual_gb option ignores the
sector_size, implicitly assuming that is 512 bytes.  So if
'virtual_gb=1 sector_size=4096' the result is an 8 GB (virtual) disk.

Signed-off-by: Douglas Gilbert <dgilbert@interlog.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

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

--- a/drivers/scsi/scsi_debug.c
+++ b/drivers/scsi/scsi_debug.c
@@ -956,7 +956,8 @@ static int resp_start_stop(struct scsi_c
 static sector_t get_sdebug_capacity(void)
 {
 	if (scsi_debug_virtual_gb > 0)
-		return 2048 * 1024 * (sector_t)scsi_debug_virtual_gb;
+		return (sector_t)scsi_debug_virtual_gb *
+			(1073741824 / scsi_debug_sector_size);
 	else
 		return sdebug_store_sectors;
 }



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

* [115/117] [SCSI] Enable retries for SYNCRONIZE_CACHE commands to fix I/O error
  2010-05-10 22:37 [000/117] 2.6.33.4-stable review Greg KH
                   ` (113 preceding siblings ...)
  2010-05-10 22:33 ` [114/117] [SCSI] scsi_debug: virtual_gb ignores sector_size Greg KH
@ 2010-05-10 22:33 ` Greg KH
  2010-05-10 22:33 ` [116/117] SCSI: Retry commands with UNIT_ATTENTION sense codes to fix ext3/ext4 " Greg KH
  2010-05-10 22:33 ` [117/117] MIPS: Sibyte: Apply M3 workaround only on affected chip types and versions Greg KH
  116 siblings, 0 replies; 130+ messages in thread
From: Greg KH @ 2010-05-10 22:33 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: stable-review, torvalds, akpm, alan, Hannes Reinecke, James Bottomley

2.6.33-stable review patch.  If anyone has any objections, please let us know.

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

From: Hannes Reinecke <hare@suse.de>

commit c213e1407be6b04b144794399a91472e0ef92aec upstream.

Some arrays are giving I/O errors with ext3 filesystems when
SYNCHRONIZE_CACHE gets a UNIT_ATTENTION.  What is happening is that
these commands have no retries, so the UNIT_ATTENTION causes the
barrier to fail.  We should be enable retries here to clear any
transient error and allow the barrier to succeed.

Signed-off-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

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

--- a/drivers/scsi/sd.c
+++ b/drivers/scsi/sd.c
@@ -1039,6 +1039,7 @@ static void sd_prepare_flush(struct requ
 {
 	rq->cmd_type = REQ_TYPE_BLOCK_PC;
 	rq->timeout = SD_TIMEOUT;
+	rq->retries = SD_MAX_RETRIES;
 	rq->cmd[0] = SYNCHRONIZE_CACHE;
 	rq->cmd_len = 10;
 }



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

* [116/117] SCSI: Retry commands with UNIT_ATTENTION sense codes to fix ext3/ext4 I/O error
  2010-05-10 22:37 [000/117] 2.6.33.4-stable review Greg KH
                   ` (114 preceding siblings ...)
  2010-05-10 22:33 ` [115/117] [SCSI] Enable retries for SYNCRONIZE_CACHE commands to fix I/O error Greg KH
@ 2010-05-10 22:33 ` Greg KH
  2010-05-10 22:33 ` [117/117] MIPS: Sibyte: Apply M3 workaround only on affected chip types and versions Greg KH
  116 siblings, 0 replies; 130+ messages in thread
From: Greg KH @ 2010-05-10 22:33 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: stable-review, torvalds, akpm, alan, Hannes Reinecke, James Bottomley

2.6.33-stable review patch.  If anyone has any objections, please let us know.

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

From: James Bottomley <James.Bottomley@suse.de>

commit 77a4229719e511a0d38d9c355317ae1469adeb54 upstream.

There's nastyness in the way we currently handle barriers (and
discards): They're effectively filesystem commands, but they get
processed as BLOCK_PC commands.  Unfortunately BLOCK_PC commands are
taken by SCSI to be SG_IO commands and the issuer expects to see and
handle any returned errors, however trivial.  This leads to a huge
problem, because the block layer doesn't expect this to happen and any
trivially retryable error on a barrier causes an immediate I/O error
to the filesystem.

The only real way to hack around this is to take the usual class of
offending errors (unit attentions) and make them all retryable in the
case of a REQ_HARDBARRIER.  A correct fix would involve a rework of
the entire block and SCSI submit system, and so is out of scope for a
quick fix.

Cc: Hannes Reinecke <hare@suse.de>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

---
 drivers/scsi/scsi_error.c |   15 ++++++++++++++-
 1 file changed, 14 insertions(+), 1 deletion(-)

--- a/drivers/scsi/scsi_error.c
+++ b/drivers/scsi/scsi_error.c
@@ -301,7 +301,20 @@ static int scsi_check_sense(struct scsi_
 		if (scmd->device->allow_restart &&
 		    (sshdr.asc == 0x04) && (sshdr.ascq == 0x02))
 			return FAILED;
-		return SUCCESS;
+
+		if (blk_barrier_rq(scmd->request))
+			/*
+			 * barrier requests should always retry on UA
+			 * otherwise block will get a spurious error
+			 */
+			return NEEDS_RETRY;
+		else
+			/*
+			 * for normal (non barrier) commands, pass the
+			 * UA upwards for a determination in the
+			 * completion functions
+			 */
+			return SUCCESS;
 
 		/* these three are not supported */
 	case COPY_ABORTED:



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

* [117/117] MIPS: Sibyte: Apply M3 workaround only on affected chip types and versions.
  2010-05-10 22:37 [000/117] 2.6.33.4-stable review Greg KH
                   ` (115 preceding siblings ...)
  2010-05-10 22:33 ` [116/117] SCSI: Retry commands with UNIT_ATTENTION sense codes to fix ext3/ext4 " Greg KH
@ 2010-05-10 22:33 ` Greg KH
  116 siblings, 0 replies; 130+ messages in thread
From: Greg KH @ 2010-05-10 22:33 UTC (permalink / raw)
  To: linux-kernel, stable, Greg KH
  Cc: stable-review, torvalds, akpm, alan, Ralf Baechle,
	Sebastian Andrzej Siewior

2.6.33-stable review patch.  If anyone has any objections, please let us know.

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

(cherry picked from commit e65c7f33d75e977350ca350573d93c517ec02776)

Previously it was unconditionally used on all Sibyte family SOCs.  The
M3 bug has to be handled in the TLB exception handler which is extremly
performance sensitive, so this modification is expected to deliver around
2-3% performance improvment.  This is important as required changes to the
M3 workaround will make it more costly.

Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

---
 arch/mips/include/asm/mach-sibyte/war.h |    6 +++++-
 arch/mips/sibyte/sb1250/setup.c         |   15 +++++++++++++++
 2 files changed, 20 insertions(+), 1 deletion(-)

--- a/arch/mips/include/asm/mach-sibyte/war.h
+++ b/arch/mips/include/asm/mach-sibyte/war.h
@@ -16,7 +16,11 @@
 #if defined(CONFIG_SB1_PASS_1_WORKAROUNDS) || \
     defined(CONFIG_SB1_PASS_2_WORKAROUNDS)
 
-#define BCM1250_M3_WAR	1
+#ifndef __ASSEMBLY__
+extern int sb1250_m3_workaround_needed(void);
+#endif
+
+#define BCM1250_M3_WAR	sb1250_m3_workaround_needed()
 #define SIBYTE_1956_WAR	1
 
 #else
--- a/arch/mips/sibyte/sb1250/setup.c
+++ b/arch/mips/sibyte/sb1250/setup.c
@@ -87,6 +87,21 @@ static int __init setup_bcm1250(void)
 	return ret;
 }
 
+int sb1250_m3_workaround_needed(void)
+{
+	switch (soc_type) {
+	case K_SYS_SOC_TYPE_BCM1250:
+	case K_SYS_SOC_TYPE_BCM1250_ALT:
+	case K_SYS_SOC_TYPE_BCM1250_ALT2:
+	case K_SYS_SOC_TYPE_BCM1125:
+	case K_SYS_SOC_TYPE_BCM1125H:
+		return soc_pass < K_SYS_REVISION_BCM1250_C0;
+
+	default:
+		return 0;
+	}
+}
+
 static int __init setup_bcm112x(void)
 {
 	int ret = 0;



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

* [000/117] 2.6.33.4-stable review
@ 2010-05-10 22:37 Greg KH
  2010-05-10 22:31 ` [001/117] USB: EHCI: defer reclamation of siTDs Greg KH
                   ` (116 more replies)
  0 siblings, 117 replies; 130+ messages in thread
From: Greg KH @ 2010-05-10 22:37 UTC (permalink / raw)
  To: linux-kernel, stable; +Cc: stable-review, torvalds, akpm, alan

This is the start of the stable review cycle for the 2.6.33.4 release.
There are 117 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 Wed, May 12, 2010, 22: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/v2.6/stable-review/patch-2.6.33.4-rc1.gz
and the diffstat can be found below.

thanks,

greg k-h


 Makefile                                        |    2 +-
 arch/arm/mach-pxa/include/mach/colibri.h        |    1 +
 arch/mips/include/asm/mach-sibyte/war.h         |    6 +-
 arch/mips/sibyte/sb1250/setup.c                 |   15 +++
 arch/powerpc/kernel/head_64.S                   |   11 ++
 arch/powerpc/mm/fsl_booke_mmu.c                 |    5 -
 arch/powerpc/platforms/pseries/hotplug-cpu.c    |   42 +++-----
 arch/powerpc/platforms/pseries/offline_states.h |    1 +
 arch/sparc/include/asm/irqflags_64.h            |   23 +++-
 arch/sparc/include/asm/thread_info_64.h         |    2 +-
 arch/sparc/kernel/pci_common.c                  |   11 ++-
 arch/sparc/kernel/rtrap_64.S                    |   12 ++-
 arch/sparc/kernel/traps_64.c                    |   26 +----
 arch/sparc/kernel/unaligned_64.c                |    6 +-
 arch/x86/Kconfig                                |    4 +-
 arch/x86/kernel/apic/io_apic.c                  |    3 +
 arch/x86/kernel/cpu/cpufreq/powernow-k8.c       |    3 +-
 arch/x86/kernel/cpu/intel.c                     |   21 ++++
 arch/x86/kernel/k8.c                            |   14 +++
 arch/x86/kernel/pci-gart_64.c                   |    2 +-
 arch/x86/kernel/process_64.c                    |    4 +-
 block/blk-timeout.c                             |   12 +-
 crypto/async_tx/async_raid6_recov.c             |   21 ++--
 drivers/Makefile                                |    2 +-
 drivers/acpi/power_meter.c                      |    2 +-
 drivers/acpi/sleep.c                            |  144 +++++++++++++++++++++++
 drivers/ata/libata-eh.c                         |    5 +
 drivers/base/memory.c                           |    2 +-
 drivers/char/agp/Kconfig                        |    2 +-
 drivers/cpuidle/governors/menu.c                |    9 +-
 drivers/edac/edac_mce_amd.c                     |    5 +-
 drivers/gpu/drm/i915/i915_debugfs.c             |    2 +-
 drivers/gpu/drm/i915/i915_dma.c                 |   16 ++-
 drivers/gpu/drm/i915/i915_drv.h                 |   26 ++++-
 drivers/gpu/drm/i915/i915_gem.c                 |    8 +-
 drivers/gpu/drm/i915/i915_gem_tiling.c          |   24 ++---
 drivers/gpu/drm/i915/i915_irq.c                 |   18 ++--
 drivers/gpu/drm/i915/i915_reg.h                 |    2 +-
 drivers/gpu/drm/i915/intel_bios.c               |    3 +-
 drivers/gpu/drm/i915/intel_crt.c                |   14 +-
 drivers/gpu/drm/i915/intel_display.c            |   56 +++++-----
 drivers/gpu/drm/i915/intel_lvds.c               |    2 +-
 drivers/gpu/drm/i915/intel_overlay.c            |    2 +-
 drivers/i2c/i2c-core.c                          |   21 +++-
 drivers/md/md.c                                 |   10 ++-
 drivers/md/raid5.c                              |   54 ++++-----
 drivers/media/dvb/ttpci/budget.c                |    3 -
 drivers/net/bnx2.c                              |    6 +-
 drivers/net/r8169.c                             |   13 ++-
 drivers/net/sfc/efx.c                           |    4 +-
 drivers/net/sfc/falcon.c                        |    4 +-
 drivers/net/sfc/falcon_boards.c                 |   13 +--
 drivers/net/sfc/nic.h                           |    2 +-
 drivers/net/sfc/siena.c                         |   13 ++-
 drivers/net/tg3.c                               |    1 +
 drivers/net/tun.c                               |    4 +
 drivers/net/usb/cdc_ether.c                     |    1 +
 drivers/net/usb/dm9601.c                        |    2 +-
 drivers/net/wan/hdlc_ppp.c                      |    6 +
 drivers/net/wireless/ath/ath9k/main.c           |    2 +-
 drivers/net/wireless/p54/p54pci.c               |    2 +-
 drivers/net/wireless/p54/p54usb.c               |    1 +
 drivers/net/wireless/p54/txrx.c                 |    2 +-
 drivers/pci/pci.c                               |    6 +-
 drivers/scsi/libiscsi.c                         |    2 +-
 drivers/scsi/libsas/sas_ata.c                   |    4 +
 drivers/scsi/libsas/sas_scsi_host.c             |    4 +
 drivers/scsi/scsi_debug.c                       |    3 +-
 drivers/scsi/scsi_error.c                       |   15 +++-
 drivers/scsi/scsi_lib.c                         |   10 ++-
 drivers/scsi/sd.c                               |    1 +
 drivers/serial/8250_pnp.c                       |    2 +
 drivers/staging/hv/Hv.c                         |    2 +-
 drivers/staging/hv/RndisFilter.c                |    1 +
 drivers/staging/hv/netvsc_drv.c                 |    3 +-
 drivers/staging/usbip/usbip_event.c             |    3 +
 drivers/usb/core/driver.c                       |   32 +++++-
 drivers/usb/core/generic.c                      |    2 +-
 drivers/usb/core/inode.c                        |    4 +-
 drivers/usb/core/message.c                      |    2 +-
 drivers/usb/host/ehci-hcd.c                     |    1 +
 drivers/usb/host/ehci-mem.c                     |    2 +-
 drivers/usb/host/ehci-sched.c                   |   38 +++++--
 drivers/usb/host/ehci.h                         |    5 +-
 drivers/usb/host/ohci-hub.c                     |    2 +-
 drivers/usb/host/xhci-mem.c                     |   65 ++++++++++
 drivers/usb/host/xhci.h                         |    4 +
 drivers/usb/serial/sierra.c                     |    1 +
 drivers/w1/slaves/w1_therm.c                    |    5 +-
 fs/ext4/extents.c                               |    9 +-
 fs/jfs/resize.c                                 |    6 +-
 fs/nfs/client.c                                 |    2 +
 fs/nfs/dir.c                                    |    2 +
 fs/nfsd/nfs4xdr.c                               |    8 +-
 fs/ocfs2/buffer_head_io.c                       |    2 +
 fs/ocfs2/dlm/dlmfs.c                            |    2 +-
 fs/ocfs2/inode.c                                |    1 +
 fs/ocfs2/refcounttree.c                         |    3 +
 fs/proc/base.c                                  |    2 +-
 fs/reiserfs/dir.c                               |    2 -
 fs/reiserfs/xattr.c                             |   19 +---
 fs/xfs/linux-2.6/xfs_super.c                    |    5 +
 fs/xfs/linux-2.6/xfs_sync.c                     |  107 ++++++++++++++++-
 fs/xfs/linux-2.6/xfs_sync.h                     |    7 +-
 fs/xfs/quota/xfs_qm_syscalls.c                  |    3 +-
 fs/xfs/xfs_ag.h                                 |    1 +
 fs/xfs/xfs_mount.h                              |    1 +
 include/drm/drm_pciids.h                        |    1 +
 include/linux/ata.h                             |    4 +-
 include/linux/poison.h                          |    9 ++
 include/net/sctp/command.h                      |    1 +
 include/net/sctp/sctp.h                         |    1 +
 init/initramfs.c                                |    3 +-
 kernel/cred.c                                   |    2 -
 kernel/perf_event.c                             |    2 +-
 lib/flex_array.c                                |    2 +-
 mm/hugetlb.c                                    |    5 +-
 mm/memcontrol.c                                 |    4 +-
 net/ieee802154/af_ieee802154.c                  |    3 +
 net/ipv4/tcp.c                                  |    1 +
 net/ipv4/udp.c                                  |    4 +-
 net/ipv6/tcp_ipv6.c                             |    2 +-
 net/ipv6/udp.c                                  |    4 +-
 net/mac80211/agg-tx.c                           |    1 -
 net/sctp/associola.c                            |    6 +-
 net/sctp/endpointola.c                          |    1 +
 net/sctp/sm_make_chunk.c                        |   32 ++----
 net/sctp/sm_sideeffect.c                        |   26 ++++
 net/sctp/sm_statefuns.c                         |    8 +-
 net/sctp/socket.c                               |   14 ++-
 net/tipc/bearer.c                               |   37 +-----
 net/tipc/bearer.h                               |    2 +-
 net/tipc/net.c                                  |   25 +----
 security/inode.c                                |    4 +-
 security/keys/request_key.c                     |    9 ++-
 sound/pci/hda/hda_intel.c                       |    1 +
 sound/pci/hda/patch_conexant.c                  |    7 +-
 sound/pci/hda/patch_realtek.c                   |    2 +-
 sound/pci/hda/patch_sigmatel.c                  |    6 +
 sound/pci/maestro3.c                            |    9 ++
 140 files changed, 989 insertions(+), 405 deletions(-)

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

* Re: [057/117] ALSA: hda: Use STAC_DELL_M6_BOTH quirk for Dell Studio 1558
  2010-05-10 22:32 ` [057/117] ALSA: hda: Use STAC_DELL_M6_BOTH quirk for Dell Studio 1558 Greg KH
@ 2010-05-10 23:30   ` Nigel Cunningham
  2010-05-11  5:53     ` Daniel Chen
  0 siblings, 1 reply; 130+ messages in thread
From: Nigel Cunningham @ 2010-05-10 23:30 UTC (permalink / raw)
  To: Greg KH
  Cc: linux-kernel, stable, stable-review, torvalds, akpm, alan,
	Daniel T Chen, Takashi Iwai

Hi Greg et al.

On 11/05/10 08:32, Greg KH wrote:
> 2.6.33-stable review patch.  If anyone has any objections, please let us know.
>
> ------------------
>
> From: Daniel T Chen<crimsun@ubuntu.com>
>
> commit 5c1bccf645d4ab65e4c7502acb42e8b9afdb5bdc upstream.
>
> BugLink: https://launchpad.net/bugs/568600
>
> The OR has verified that the dell-m6 model quirk is necessary for audio
> to be audible by default on the Dell Studio XPS 1645.

Just that the commit comment doesn't match the code here.

Regards,

Nigel

> This change is necessary for 2.6.32.11 and 2.6.33.2 alike.
>
> Reported-by: Andy Ross<andy@plausible.org>
> Tested-by: Andy Ross<andy@plausible.org>
> Signed-off-by: Daniel T Chen<crimsun@ubuntu.com>
> Signed-off-by: Takashi Iwai<tiwai@suse.de>
> Signed-off-by: Greg Kroah-Hartman<gregkh@suse.de>
>
> ---
>   sound/pci/hda/patch_sigmatel.c |    2 ++
>   1 file changed, 2 insertions(+)
>
> --- a/sound/pci/hda/patch_sigmatel.c
> +++ b/sound/pci/hda/patch_sigmatel.c
> @@ -1604,6 +1604,8 @@ static struct snd_pci_quirk stac92hd73xx
>   				"Dell Studio 1557", STAC_DELL_M6_DMIC),
>   	SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x02fe,
>   				"Dell Studio XPS 1645", STAC_DELL_M6_BOTH),
> +	SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x0413,
> +				"Dell Studio 1558", STAC_DELL_M6_BOTH),
>   	{} /* terminator */
>   };
>
>
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at  http://www.tux.org/lkml/
>


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

* Re: [003/117] drm/i915: Add initial bits for VGA modesetting bringup on Sandybridge.
  2010-05-10 22:31 ` [003/117] drm/i915: Add initial bits for VGA modesetting bringup on Sandybridge Greg KH
@ 2010-05-11  2:47   ` Eric Anholt
  2010-05-11 15:04     ` Greg KH
  0 siblings, 1 reply; 130+ messages in thread
From: Eric Anholt @ 2010-05-11  2:47 UTC (permalink / raw)
  To: Greg KH, linux-kernel, stable; +Cc: stable-review, torvalds, akpm, alan

[-- Attachment #1: Type: text/plain, Size: 1131 bytes --]

On Mon, 10 May 2010 15:31:34 -0700, Greg KH <gregkh@suse.de> wrote:
> 2.6.33-stable review patch.  If anyone has any objections, please let us know.
> 
> ------------------
> From: Eric Anholt <eric@anholt.net>
> 
> commit bad720ff3e8e47a04bd88d9bbc8317e7d7e049d3 upstream.
> 
> [needed for stable as it's just a bunch of macros that other drm patches
> need, it changes no code functionality besides adding support for a new
> device type. - gregkh]
> 
> Signed-off-by: Eric Anholt <eric@anholt.net>
> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

This patch should not go in stable because of this hunk:

> --- a/include/drm/drm_pciids.h
> +++ b/include/drm/drm_pciids.h
> @@ -560,4 +560,5 @@
>  	{0x8086, 0x35e8, PCI_ANY_ID, PCI_ANY_ID, PCI_CLASS_DISPLAY_VGA << 8, 0xffff00, 0}, \
>  	{0x8086, 0x0042, PCI_ANY_ID, PCI_ANY_ID, PCI_CLASS_DISPLAY_VGA << 8, 0xffff00, 0}, \
>  	{0x8086, 0x0046, PCI_ANY_ID, PCI_ANY_ID, PCI_CLASS_DISPLAY_VGA << 8, 0xffff00, 0}, \
> +	{0x8086, 0x0102, PCI_ANY_ID, PCI_ANY_ID, PCI_CLASS_DISPLAY_VGA << 8, 0xffff00, 0}, \
>  	{0, 0, 0}

Without that, it would be fine.

[-- Attachment #2: Type: application/pgp-signature, Size: 197 bytes --]

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

* Re: [107/117] ACPI: DMI init_set_sci_en_on_resume for multiple Lenovo ThinkPads
  2010-05-10 22:33 ` [107/117] ACPI: DMI init_set_sci_en_on_resume for multiple Lenovo ThinkPads Greg KH
@ 2010-05-11  3:38   ` Alex Chiang
  2010-05-11 15:10     ` Greg KH
  0 siblings, 1 reply; 130+ messages in thread
From: Alex Chiang @ 2010-05-11  3:38 UTC (permalink / raw)
  To: Greg KH
  Cc: linux-kernel, stable, stable-review, torvalds, akpm, alan,
	Colin King, Len Brown

Hm, this patch looks a little wonky.

Why is every entry repeated 3x?

> +	.callback = init_set_sci_en_on_resume,
> +	.ident = "Lenovo ThinkPad T410",

[snip]

> +	.callback = init_set_sci_en_on_resume,
> +	.ident = "Lenovo ThinkPad T410",

[snip[

> +	.callback = init_set_sci_en_on_resume,
> +	.ident = "Lenovo ThinkPad T410",

Oh crap, it's broken upstream too. :(

http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=patch;h=07bedca29b0973f36a6b6db36936deed367164ed

Not sure what happened, but I think some sort of hiccup occurred
when the patch was applied, since this is what hit the mailing
lists:

https://patchwork.kernel.org/patch/94711/

Len, Greg, what would you like me to do? I think the cleanest
thing to do to help keep -stable clean would be to:

	a) drop this patch from current -stable queue
	b) revert 07bedca29b09 upstream
	c) apply the patch from patchwork
	d) re-apply to -stable

Thoughts?

Thanks,
/ac

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

* Re: [057/117] ALSA: hda: Use STAC_DELL_M6_BOTH quirk for Dell Studio  1558
  2010-05-10 23:30   ` Nigel Cunningham
@ 2010-05-11  5:53     ` Daniel Chen
  2010-05-11 15:07       ` Greg KH
  0 siblings, 1 reply; 130+ messages in thread
From: Daniel Chen @ 2010-05-11  5:53 UTC (permalink / raw)
  To: Nigel Cunningham
  Cc: Greg KH, linux-kernel, stable, stable-review, torvalds, akpm,
	alan, Daniel T Chen, Takashi Iwai

On 11/05/10 08:32, Greg KH wrote:
>> 2.6.33-stable review patch.  If anyone has any objections, please let us
>> know.
...
>> commit 5c1bccf645d4ab65e4c7502acb42e8b9afdb5bdc upstream.
>>
>> BugLink: https://launchpad.net/bugs/568600
>>
>> The OR has verified that the dell-m6 model quirk is necessary for audio
>> to be audible by default on the Dell Studio XPS 1645.
...
>>  sound/pci/hda/patch_sigmatel.c |    2 ++
>>  1 file changed, 2 insertions(+)
>>
>> --- a/sound/pci/hda/patch_sigmatel.c
>> +++ b/sound/pci/hda/patch_sigmatel.c
>> @@ -1604,6 +1604,8 @@ static struct snd_pci_quirk stac92hd73xx
>>                                "Dell Studio 1557", STAC_DELL_M6_DMIC),
>>        SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x02fe,
>>                                "Dell Studio XPS 1645", STAC_DELL_M6_BOTH),
>> +       SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x0413,
>> +                               "Dell Studio 1558", STAC_DELL_M6_BOTH),
>>        {} /* terminator */
>>  };


On Tue, May 11, 2010 at 1:30 AM, Nigel Cunningham <nigel@tuxonice.net> wrote:
> Just that the commit comment doesn't match the code here.

Oops, simply brown paper bag copy-n'-paste error. I'm happy to respin
for clarification if necessary.

Best,
-Dan

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

* Re: [078/117] xfs: add a shrinker to background inode reclaim
  2010-05-10 22:32   ` Greg KH
@ 2010-05-11 14:46     ` Alex Elder
  -1 siblings, 0 replies; 130+ messages in thread
From: Alex Elder @ 2010-05-11 14:46 UTC (permalink / raw)
  To: Greg KH
  Cc: linux-kernel, stable, stable-review, torvalds, akpm, alan, xfs,
	Dave Chinner

On Mon, 2010-05-10 at 15:32 -0700, Greg KH wrote:
> 2.6.33-stable review patch.  If anyone has any objections, please let us know.

Acked-by: Alex Elder <aelder@sgi.com>

> ------------------
> 
> From: Dave Chinner <dchinner@redhat.com>
> 
> commit 9bf729c0af67897ea8498ce17c29b0683f7f2028 upstream
> 
> On low memory boxes or those with highmem, kernel can OOM before the
> background reclaims inodes via xfssyncd. Add a shrinker to run inode
> reclaim so that it inode reclaim is expedited when memory is low.
> 
...


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

* Re: [078/117] xfs: add a shrinker to background inode reclaim
@ 2010-05-11 14:46     ` Alex Elder
  0 siblings, 0 replies; 130+ messages in thread
From: Alex Elder @ 2010-05-11 14:46 UTC (permalink / raw)
  To: Greg KH
  Cc: linux-kernel, stable, Dave Chinner, akpm, xfs, torvalds,
	stable-review, alan

On Mon, 2010-05-10 at 15:32 -0700, Greg KH wrote:
> 2.6.33-stable review patch.  If anyone has any objections, please let us know.

Acked-by: Alex Elder <aelder@sgi.com>

> ------------------
> 
> From: Dave Chinner <dchinner@redhat.com>
> 
> commit 9bf729c0af67897ea8498ce17c29b0683f7f2028 upstream
> 
> On low memory boxes or those with highmem, kernel can OOM before the
> background reclaims inodes via xfssyncd. Add a shrinker to run inode
> reclaim so that it inode reclaim is expedited when memory is low.
> 
...

_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs

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

* Re: [003/117] drm/i915: Add initial bits for VGA modesetting bringup on Sandybridge.
  2010-05-11  2:47   ` Eric Anholt
@ 2010-05-11 15:04     ` Greg KH
  0 siblings, 0 replies; 130+ messages in thread
From: Greg KH @ 2010-05-11 15:04 UTC (permalink / raw)
  To: Eric Anholt; +Cc: linux-kernel, stable, stable-review, torvalds, akpm, alan

On Mon, May 10, 2010 at 07:47:52PM -0700, Eric Anholt wrote:
> On Mon, 10 May 2010 15:31:34 -0700, Greg KH <gregkh@suse.de> wrote:
> > 2.6.33-stable review patch.  If anyone has any objections, please let us know.
> > 
> > ------------------
> > From: Eric Anholt <eric@anholt.net>
> > 
> > commit bad720ff3e8e47a04bd88d9bbc8317e7d7e049d3 upstream.
> > 
> > [needed for stable as it's just a bunch of macros that other drm patches
> > need, it changes no code functionality besides adding support for a new
> > device type. - gregkh]
> > 
> > Signed-off-by: Eric Anholt <eric@anholt.net>
> > Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
> 
> This patch should not go in stable because of this hunk:
> 
> > --- a/include/drm/drm_pciids.h
> > +++ b/include/drm/drm_pciids.h
> > @@ -560,4 +560,5 @@
> >  	{0x8086, 0x35e8, PCI_ANY_ID, PCI_ANY_ID, PCI_CLASS_DISPLAY_VGA << 8, 0xffff00, 0}, \
> >  	{0x8086, 0x0042, PCI_ANY_ID, PCI_ANY_ID, PCI_CLASS_DISPLAY_VGA << 8, 0xffff00, 0}, \
> >  	{0x8086, 0x0046, PCI_ANY_ID, PCI_ANY_ID, PCI_CLASS_DISPLAY_VGA << 8, 0xffff00, 0}, \
> > +	{0x8086, 0x0102, PCI_ANY_ID, PCI_ANY_ID, PCI_CLASS_DISPLAY_VGA << 8, 0xffff00, 0}, \
> >  	{0, 0, 0}
> 
> Without that, it would be fine.

Ok, thanks, I've dropped this hunk from the patch now.

greg k-h

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

* Re: [057/117] ALSA: hda: Use STAC_DELL_M6_BOTH quirk for Dell Studio 1558
  2010-05-11  5:53     ` Daniel Chen
@ 2010-05-11 15:07       ` Greg KH
  2010-05-11 19:15         ` Daniel Chen
  0 siblings, 1 reply; 130+ messages in thread
From: Greg KH @ 2010-05-11 15:07 UTC (permalink / raw)
  To: Daniel Chen
  Cc: Nigel Cunningham, linux-kernel, stable, stable-review, torvalds,
	akpm, alan, Daniel T Chen, Takashi Iwai

On Tue, May 11, 2010 at 07:53:25AM +0200, Daniel Chen wrote:
> On 11/05/10 08:32, Greg KH wrote:
> >> 2.6.33-stable review patch.  If anyone has any objections, please let us
> >> know.
> ...
> >> commit 5c1bccf645d4ab65e4c7502acb42e8b9afdb5bdc upstream.
> >>
> >> BugLink: https://launchpad.net/bugs/568600
> >>
> >> The OR has verified that the dell-m6 model quirk is necessary for audio
> >> to be audible by default on the Dell Studio XPS 1645.
> ...
> >>  sound/pci/hda/patch_sigmatel.c |    2 ++
> >>  1 file changed, 2 insertions(+)
> >>
> >> --- a/sound/pci/hda/patch_sigmatel.c
> >> +++ b/sound/pci/hda/patch_sigmatel.c
> >> @@ -1604,6 +1604,8 @@ static struct snd_pci_quirk stac92hd73xx
> >>                                "Dell Studio 1557", STAC_DELL_M6_DMIC),
> >>        SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x02fe,
> >>                                "Dell Studio XPS 1645", STAC_DELL_M6_BOTH),
> >> +       SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x0413,
> >> +                               "Dell Studio 1558", STAC_DELL_M6_BOTH),
> >>        {} /* terminator */
> >>  };
> 
> 
> On Tue, May 11, 2010 at 1:30 AM, Nigel Cunningham <nigel@tuxonice.net> wrote:
> > Just that the commit comment doesn't match the code here.
> 
> Oops, simply brown paper bag copy-n'-paste error. I'm happy to respin
> for clarification if necessary.

As this mirrors what is in Linus's tree, I say we just leave it alone,
is that ok?

thanks,

greg k-h

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

* Re: [107/117] ACPI: DMI init_set_sci_en_on_resume for multiple Lenovo ThinkPads
  2010-05-11  3:38   ` Alex Chiang
@ 2010-05-11 15:10     ` Greg KH
  2010-05-11 16:21       ` Alex Chiang
  0 siblings, 1 reply; 130+ messages in thread
From: Greg KH @ 2010-05-11 15:10 UTC (permalink / raw)
  To: Alex Chiang, linux-kernel, stable, stable-review, torvalds, akpm,
	alan, Colin King, Len Brown

On Mon, May 10, 2010 at 09:38:25PM -0600, Alex Chiang wrote:
> Hm, this patch looks a little wonky.
> 
> Why is every entry repeated 3x?
> 
> > +	.callback = init_set_sci_en_on_resume,
> > +	.ident = "Lenovo ThinkPad T410",
> 
> [snip]
> 
> > +	.callback = init_set_sci_en_on_resume,
> > +	.ident = "Lenovo ThinkPad T410",
> 
> [snip[
> 
> > +	.callback = init_set_sci_en_on_resume,
> > +	.ident = "Lenovo ThinkPad T410",
> 
> Oh crap, it's broken upstream too. :(
> 
> http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=patch;h=07bedca29b0973f36a6b6db36936deed367164ed
> 
> Not sure what happened, but I think some sort of hiccup occurred
> when the patch was applied, since this is what hit the mailing
> lists:
> 
> https://patchwork.kernel.org/patch/94711/
> 
> Len, Greg, what would you like me to do? I think the cleanest
> thing to do to help keep -stable clean would be to:
> 
> 	a) drop this patch from current -stable queue
> 	b) revert 07bedca29b09 upstream
> 	c) apply the patch from patchwork
> 	d) re-apply to -stable
> 
> Thoughts?

How about getting a fixup patch into Linus's tree and then I'll apply
that fixup patch to stable as well?

In the meantime, triplicates don't hurt anyone :)

thanks,

greg k-h

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

* Re: [107/117] ACPI: DMI init_set_sci_en_on_resume for multiple Lenovo ThinkPads
  2010-05-11 15:10     ` Greg KH
@ 2010-05-11 16:21       ` Alex Chiang
  0 siblings, 0 replies; 130+ messages in thread
From: Alex Chiang @ 2010-05-11 16:21 UTC (permalink / raw)
  To: Greg KH
  Cc: linux-kernel, stable, stable-review, torvalds, akpm, alan,
	Colin King, Len Brown

* Greg KH <gregkh@suse.de>:
> 
> > Len, Greg, what would you like me to do? I think the cleanest
> > thing to do to help keep -stable clean would be to:
> > 
> >	a) drop this patch from current -stable queue
> >	b) revert 07bedca29b09 upstream
> >	c)  apply the patch from patchwork
> >	d) re-apply to -stable
>
> How about getting a fixup patch into Linus's tree and then I'll
> apply that fixup patch to stable as well?

Sure, here's a patch against Linus's latest. I'll leave it up to
Len to decide which approach he'd prefer.

From: Alex Chiang <achiang@canonical.com>

ACPI: sleep: eliminate duplicate entries in acpisleep_dmi_table[]

Duplicate entries ended up acpisleep_dmi_table[] by accident.
They don't hurt functionality, but they are ugly, so let's get
rid of them.

Cc: stable@kernel.org
Signed-off-by: Alex Chiang <achiang@canonical.com>
---
diff --git a/drivers/acpi/sleep.c b/drivers/acpi/sleep.c
index e2e9925..baa76bb 100644
--- a/drivers/acpi/sleep.c
+++ b/drivers/acpi/sleep.c
@@ -475,101 +475,13 @@ static struct dmi_system_id __initdata acpisleep_dmi_table[] = {
 	},
 	{
 	.callback = init_set_sci_en_on_resume,
-	.ident = "Lenovo ThinkPad X201",
+	.ident = "Lenovo ThinkPad X201[s]",
 	.matches = {
 		DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"),
 		DMI_MATCH(DMI_PRODUCT_VERSION, "ThinkPad X201"),
 		},
 	},
 	{
-	.callback = init_set_sci_en_on_resume,
-	.ident = "Lenovo ThinkPad X201",
-	.matches = {
-		DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"),
-		DMI_MATCH(DMI_PRODUCT_VERSION, "ThinkPad X201s"),
-		},
-	},
-	{
-	.callback = init_set_sci_en_on_resume,
-	.ident = "Lenovo ThinkPad T410",
-	.matches = {
-		DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"),
-		DMI_MATCH(DMI_PRODUCT_VERSION, "ThinkPad T410"),
-		},
-	},
-	{
-	.callback = init_set_sci_en_on_resume,
-	.ident = "Lenovo ThinkPad T510",
-	.matches = {
-		DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"),
-		DMI_MATCH(DMI_PRODUCT_VERSION, "ThinkPad T510"),
-		},
-	},
-	{
-	.callback = init_set_sci_en_on_resume,
-	.ident = "Lenovo ThinkPad W510",
-	.matches = {
-		DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"),
-		DMI_MATCH(DMI_PRODUCT_VERSION, "ThinkPad W510"),
-		},
-	},
-	{
-	.callback = init_set_sci_en_on_resume,
-	.ident = "Lenovo ThinkPad X201",
-	.matches = {
-		DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"),
-		DMI_MATCH(DMI_PRODUCT_VERSION, "ThinkPad X201"),
-		},
-	},
-	{
-	.callback = init_set_sci_en_on_resume,
-	.ident = "Lenovo ThinkPad X201",
-	.matches = {
-		DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"),
-		DMI_MATCH(DMI_PRODUCT_VERSION, "ThinkPad X201s"),
-		},
-	},
-	{
-	.callback = init_set_sci_en_on_resume,
-	.ident = "Lenovo ThinkPad T410",
-	.matches = {
-		DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"),
-		DMI_MATCH(DMI_PRODUCT_VERSION, "ThinkPad T410"),
-		},
-	},
-	{
-	.callback = init_set_sci_en_on_resume,
-	.ident = "Lenovo ThinkPad T510",
-	.matches = {
-		DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"),
-		DMI_MATCH(DMI_PRODUCT_VERSION, "ThinkPad T510"),
-		},
-	},
-	{
-	.callback = init_set_sci_en_on_resume,
-	.ident = "Lenovo ThinkPad W510",
-	.matches = {
-		DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"),
-		DMI_MATCH(DMI_PRODUCT_VERSION, "ThinkPad W510"),
-		},
-	},
-	{
-	.callback = init_set_sci_en_on_resume,
-	.ident = "Lenovo ThinkPad X201",
-	.matches = {
-		DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"),
-		DMI_MATCH(DMI_PRODUCT_VERSION, "ThinkPad X201"),
-		},
-	},
-	{
-	.callback = init_set_sci_en_on_resume,
-	.ident = "Lenovo ThinkPad X201",
-	.matches = {
-		DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"),
-		DMI_MATCH(DMI_PRODUCT_VERSION, "ThinkPad X201s"),
-		},
-	},
-	{
 	.callback = init_old_suspend_ordering,
 	.ident = "Panasonic CF51-2L",
 	.matches = {

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

* Re: [057/117] ALSA: hda: Use STAC_DELL_M6_BOTH quirk for Dell Studio  1558
  2010-05-11 15:07       ` Greg KH
@ 2010-05-11 19:15         ` Daniel Chen
  0 siblings, 0 replies; 130+ messages in thread
From: Daniel Chen @ 2010-05-11 19:15 UTC (permalink / raw)
  To: Greg KH
  Cc: Nigel Cunningham, linux-kernel, stable, stable-review, torvalds,
	akpm, alan, Daniel T Chen, Takashi Iwai

On Tue, May 11, 2010 at 5:07 PM, Greg KH <gregkh@suse.de> wrote:
> As this mirrors what is in Linus's tree, I say we just leave it alone,
> is that ok?

That, too, is fine. The quirk is correct in the source code.

-Dan

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

end of thread, other threads:[~2010-05-11 19:15 UTC | newest]

Thread overview: 130+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-05-10 22:37 [000/117] 2.6.33.4-stable review Greg KH
2010-05-10 22:31 ` [001/117] USB: EHCI: defer reclamation of siTDs Greg KH
2010-05-10 22:31 ` [002/117] p54usb: Add usbid for Corega CG-WLUSB2GT Greg KH
2010-05-10 22:31 ` [003/117] drm/i915: Add initial bits for VGA modesetting bringup on Sandybridge Greg KH
2010-05-11  2:47   ` Eric Anholt
2010-05-11 15:04     ` Greg KH
2010-05-10 22:31 ` [004/117] drm/i915: fix tiling limits for i915 class hw v2 Greg KH
2010-05-10 22:31 ` [005/117] md/raid5: allow for more than 2^31 chunks Greg KH
2010-05-10 22:31 ` [006/117] md/raid5: fix previous patch Greg KH
2010-05-10 22:31 ` [007/117] libata: fix locking around blk_abort_request() Greg KH
2010-05-10 22:31 ` [008/117] libata: ensure NCQ error result taskfile is fully initialized Greg KH
2010-05-10 22:31 ` [009/117] w1: w1 temp: fix negative termperature calculation Greg KH
2010-05-10 22:31 ` [010/117] memcg: fix prepare migration Greg KH
2010-05-10 22:31 ` [011/117] mac80211: remove bogus TX agg state assignment Greg KH
2010-05-10 22:31 ` [012/117] flex_array: fix the panic when calling flex_array_alloc() without __GFP_ZERO Greg KH
2010-05-10 22:31 ` [013/117] hugetlb: fix infinite loop in get_futex_key() when backed by huge pages Greg KH
2010-05-10 22:31 ` [014/117] reiserfs: fix permissions on .reiserfs_priv Greg KH
2010-05-10 22:31 ` [015/117] reiserfs: fix corruption during shrinking of xattrs Greg KH
2010-05-10 22:31 ` [016/117] procfs: fix tid fdinfo Greg KH
2010-05-10 22:31 ` [017/117] nfsd4: bug in read_buf Greg KH
2010-05-10 22:31 ` [018/117] keys: the request_key() syscall should link an existing key to the dest keyring Greg KH
2010-05-10 22:31 ` [019/117] sfc: Wait at most 10ms for the MC to finish reading out MAC statistics Greg KH
2010-05-10 22:31 ` [020/117] sfc: Always close net device at the end of a disabling reset Greg KH
2010-05-10 22:31 ` [021/117] sfc: Change falcon_probe_board() to fail for unsupported boards Greg KH
2010-05-10 22:31 ` [022/117] staging: usbip: Fix deadlock Greg KH
2010-05-10 22:31 ` [023/117] USB: fix remote wakeup settings during system sleep Greg KH
2010-05-10 22:31 ` [024/117] USB: Add id for HP ev2210 a.k.a Sierra MC5725 miniPCI-e Cell Modem Greg KH
2010-05-10 22:31 ` [025/117] USB: dont read past config->interface[] if usb_control_msg() fails in usb_reset_configuration() Greg KH
2010-05-10 22:31 ` [026/117] USB: fix testing the wrong variable in fs_create_by_name() Greg KH
2010-05-10 22:31 ` [027/117] USB: dont choose configs with no interfaces Greg KH
2010-05-10 22:31 ` [028/117] USB: OHCI: dont look at the root hub to get the number of ports Greg KH
2010-05-10 22:32 ` [029/117] USB: xhci: properly set the "Mult" field of the endpoint context Greg KH
2010-05-10 22:32 ` [030/117] USB: xhci: properly set endpoint context fields for periodic eps Greg KH
2010-05-10 22:32 ` [031/117] ocfs2: Update VFS inodes id info after reflink Greg KH
2010-05-10 22:32 ` [032/117] ocfs2: potential ERR_PTR dereference on error paths Greg KH
2010-05-10 22:32 ` [033/117] ocfs2: Compute metaecc for superblocks during online resize Greg KH
2010-05-10 22:32 ` [034/117] ocfs2_dlmfs: Fix math error when reading LVB Greg KH
2010-05-10 22:32 ` [035/117] powernow-k8: Fix frequency reporting Greg KH
2010-05-10 22:32 ` [036/117] nfs d_revalidate() is too trigger-happy with d_drop() Greg KH
2010-05-10 22:32 ` [037/117] NFS: rsize and wsize settings ignored on v4 mounts Greg KH
2010-05-10 22:32 ` [038/117] Staging: hv: Fix a bug affecting IPv6 Greg KH
2010-05-10 22:32 ` [039/117] Staging: hv: Fix up memory leak on HvCleanup Greg KH
2010-05-10 22:32 ` [040/117] Staging: hv: name network device ethX rather than sethX Greg KH
2010-05-10 22:32 ` [041/117] i2c: Fix probing of FSC hardware monitoring chips Greg KH
2010-05-10 22:32 ` [042/117] perf: Fix resource leak in failure path of perf_event_open() Greg KH
2010-05-10 22:32 ` [043/117] raid6: fix recovery performance regression Greg KH
2010-05-10 22:32 ` [044/117] serial: 8250_pnp - add Fujitsu Wacom device Greg KH
2010-05-10 22:32 ` [045/117] block: ensure jiffies wrap is handled correctly in blk_rq_timed_out_timer Greg KH
2010-05-10 22:32 ` [046/117] Revert "memory-hotplug: add 0x prefix to HEX block_size_bytes" Greg KH
2010-05-10 22:32 ` [047/117] dm9601: fix phy/eeprom write routine Greg KH
2010-05-10 22:32 ` [048/117] p54pci: fix bugs in p54p_check_tx_ring Greg KH
2010-05-10 22:32 ` [049/117] edac, mce: Fix wrong mask and macro usage Greg KH
2010-05-10 22:32 ` [050/117] x86-64: Clear a 64-bit FS/GS base on fork if selector is nonzero Greg KH
2010-05-10 22:32 ` [051/117] x86: Disable large pages on CPUs with Atom erratum AAE44 Greg KH
2010-05-10 22:32 ` [052/117] x86: Fix NULL pointer access in irq_force_complete_move() for Xen guests Greg KH
2010-05-10 22:32 ` [053/117] x86, k8 nb: Fix boot crash: enable k8_northbridges unconditionally on AMD systems Greg KH
2010-05-10 22:32 ` [054/117] ALSA: hda: Use LPIB quirk for DG965OT board version AAD63733-203 Greg KH
2010-05-10 22:32 ` [055/117] ALSA: hda - Add PCI quirk for HP dv6-1110ax Greg KH
2010-05-10 22:32 ` [056/117] ALSA: hda: Use STAC_DELL_M6_BOTH quirk for Dell Studio XPS 1645 Greg KH
2010-05-10 22:32 ` [057/117] ALSA: hda: Use STAC_DELL_M6_BOTH quirk for Dell Studio 1558 Greg KH
2010-05-10 23:30   ` Nigel Cunningham
2010-05-11  5:53     ` Daniel Chen
2010-05-11 15:07       ` Greg KH
2010-05-11 19:15         ` Daniel Chen
2010-05-10 22:32 ` [058/117] ALSA: hda: Use ALC880_F1734 quirk for Fujitsu Siemens AMILO Xi 1526 Greg KH
2010-05-10 22:32 ` [059/117] ALSA: snd-meastro3: Add amp_gpio quirk for Compaq EVO N600C Greg KH
2010-05-10 22:32 ` [060/117] ALSA: snd-meastro3: Ignore spurious HV interrupts during suspend / resume Greg KH
2010-05-10 22:32 ` [061/117] ALSA: hda: Fix 0 dB for Packard Bell models using Conexant CX20549 (Venice) Greg KH
2010-05-10 22:32 ` [062/117] ALSA: hda: Use olpc-xo-1_5 quirk for Toshiba Satellite Pro T130-15F Greg KH
2010-05-10 22:32 ` [063/117] ALSA: hda: Use olpc-xo-1_5 quirk for Toshiba Satellite P500-PSPGSC-01800T Greg KH
2010-05-10 22:32 ` [064/117] PCI: Ensure we re-enable devices on resume Greg KH
2010-05-10 22:32 ` [065/117] libata: Fix accesses at LBA28 boundary (old bug, but nasty) (v2) Greg KH
2010-05-10 22:32 ` [066/117] ext4: correctly calculate number of blocks for fiemap Greg KH
2010-05-10 22:32 ` [067/117] initramfs: handle unrecognised decompressor when unpacking Greg KH
2010-05-10 22:32 ` [068/117] CRED: Fix a race in creds_are_invalid() in credentials debugging Greg KH
2010-05-10 22:32 ` [069/117] jfs: fix diAllocExt error in resizing filesystem Greg KH
2010-05-10 22:32 ` [070/117] drivers/net/wireless/p54/txrx.c Fix off by one error Greg KH
2010-05-10 22:32 ` [071/117] kgdb: dont needlessly skip PAGE_USER test for Fsl booke Greg KH
2010-05-10 22:32 ` [072/117] r8169: use correct barrier between cacheable and non-cacheable memory Greg KH
2010-05-10 22:32 ` [073/117] r8169: fix broken register writes Greg KH
2010-05-10 22:32 ` [074/117] r8169: more broken register writes workaround Greg KH
2010-05-10 22:32 ` [075/117] ath9k: reorder ieee80211_free_hw behind ath9k_uninit_hw to avoid oops Greg KH
2010-05-10 22:32 ` [076/117] [SCSI] skip sense logging for some ATA PASS-THROUGH cdbs Greg KH
2010-05-10 22:32 ` [077/117] tg3: Fix INTx fallback when MSI fails Greg KH
2010-05-10 22:32 ` [078/117] xfs: add a shrinker to background inode reclaim Greg KH
2010-05-10 22:32   ` Greg KH
2010-05-11 14:46   ` Alex Elder
2010-05-11 14:46     ` Alex Elder
2010-05-10 22:32 ` [079/117] powerpc: Reset kernel stack on cpu online from cede state Greg KH
2010-05-10 22:32 ` [080/117] powerpc: Move checks in pseries_mach_cpu_die() Greg KH
2010-05-10 22:32 ` [081/117] powerpc: Reduce printk from pseries_mach_cpu_die() Greg KH
2010-05-10 22:32 ` [082/117] bnx2: Fix lost MSI-X problem on 5709 NICs Greg KH
2010-05-10 22:32 ` [083/117] cdc_ether: fix autosuspend for mbm devices Greg KH
2010-05-10 22:32 ` [084/117] ieee802154: Fix oops during ieee802154_sock_ioctl Greg KH
2010-05-10 22:32 ` [085/117] ipv6: Fix tcp_v6_send_response transport header setting Greg KH
2010-05-10 22:32 ` [086/117] sctp: avoid irq lock inversion while call sk->sk_data_ready() Greg KH
2010-05-10 22:32 ` [087/117] sctp: fix potential reference of a freed pointer Greg KH
2010-05-10 22:32 ` [088/117] sctp: per_cpu variables should be in bh_disabled section Greg KH
2010-05-10 22:33 ` [089/117] sctp: fix to calc the INIT/INIT-ACK chunk length correctly is set Greg KH
2010-05-10 22:33 ` [090/117] sctp: Fix oops when sending queued ASCONF chunks Greg KH
2010-05-10 22:33 ` [091/117] net: Fix oops from tcp_collapse() when using splice() Greg KH
2010-05-10 22:33 ` [092/117] tipc: Fix oops on send prior to entering networked mode (v3) Greg KH
2010-05-10 22:33 ` [093/117] tun: orphan an skb on tx Greg KH
2010-05-10 22:33 ` [094/117] udp: fix for unicast RX path optimization Greg KH
2010-05-10 22:33 ` [095/117] WAN: flush tx_queue in hdlc_ppp to prevent panic on rmmod hw_driver Greg KH
2010-05-10 22:33 ` [096/117] sparc64: Use correct pt_regs in decode_access_size() error paths Greg KH
2010-05-10 22:33 ` [097/117] sparc64: Fix PREEMPT_ACTIVE value Greg KH
2010-05-10 22:33 ` [098/117] sparc64: Fix hardirq tracing in trap return path Greg KH
2010-05-10 22:33 ` [099/117] sparc64: Use kstack_valid() in die_if_kernel() Greg KH
2010-05-10 22:33 ` [100/117] sparc64: Adjust __raw_local_irq_save() to cooperate in NMIs Greg KH
2010-05-10 22:33 ` [101/117] sparc64: Fix memory leak in pci_register_iommu_region() Greg KH
2010-05-10 22:33 ` [102/117] security: testing the wrong variable in create_by_name() Greg KH
2010-05-10 22:33 ` [103/117] md: restore ability of spare drives to spin down Greg KH
2010-05-10 22:33 ` [104/117] virtio: initialize earlier Greg KH
2010-05-10 22:33 ` [105/117] md/raid6: Fix raid-6 read-error correction in degraded state Greg KH
2010-05-10 22:33 ` [106/117] V4L/DVB: budget: Oops: "BUG: unable to handle kernel NULL pointer dereference" Greg KH
2010-05-10 22:33 ` [107/117] ACPI: DMI init_set_sci_en_on_resume for multiple Lenovo ThinkPads Greg KH
2010-05-11  3:38   ` Alex Chiang
2010-05-11 15:10     ` Greg KH
2010-05-11 16:21       ` Alex Chiang
2010-05-10 22:33 ` [108/117] power_meter: acpi_device_class "power_meter_resource" too long Greg KH
2010-05-10 22:33 ` [109/117] ACPI: sleep: init_set_sci_en_on_resume for Dell Studio 155x Greg KH
2010-05-10 22:33 ` [110/117] cpuidle: Fix incorrect optimization Greg KH
2010-05-10 22:33 ` [111/117] [ARM] pxa/colibri: fix missing #include <mach/mfp.h> in colibri.h Greg KH
2010-05-10 22:33 ` [112/117] SCSI: fix locking around blk_abort_request() Greg KH
2010-05-10 22:33 ` [113/117] SCSI: libiscsi: regression: fix header digest errors Greg KH
2010-05-10 22:33 ` [114/117] [SCSI] scsi_debug: virtual_gb ignores sector_size Greg KH
2010-05-10 22:33 ` [115/117] [SCSI] Enable retries for SYNCRONIZE_CACHE commands to fix I/O error Greg KH
2010-05-10 22:33 ` [116/117] SCSI: Retry commands with UNIT_ATTENTION sense codes to fix ext3/ext4 " Greg KH
2010-05-10 22:33 ` [117/117] MIPS: Sibyte: Apply M3 workaround only on affected chip types and versions Greg KH

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.