[kernel] r16988 - in dists/squeeze/linux-2.6/debian: . patches/bugfix/all patches/series

Ben Hutchings benh at alioth.debian.org
Sat Mar 5 21:42:12 UTC 2011


Author: benh
Date: Sat Mar  5 21:42:08 2011
New Revision: 16988

Log:
drm/i915: Fix DMA masks for some i9xx devices

The memory controllers in some i9xx chips support more RAM than the
GPU in the same chip can address.

drm/i915: Overlay on gen2 can't address above 1G
drm/i915: Fix memory corruption with GM965 and >4GB RAM

Added:
   dists/squeeze/linux-2.6/debian/patches/bugfix/all/drm-i915-fix-memory-corruption-with-GM965-and-4GB-RAM.patch
   dists/squeeze/linux-2.6/debian/patches/bugfix/all/drm-i915-overlay-on-gen2-can-t-address-above-1G.patch
Modified:
   dists/squeeze/linux-2.6/debian/changelog
   dists/squeeze/linux-2.6/debian/patches/series/31

Modified: dists/squeeze/linux-2.6/debian/changelog
==============================================================================
--- dists/squeeze/linux-2.6/debian/changelog	Sat Mar  5 13:46:51 2011	(r16987)
+++ dists/squeeze/linux-2.6/debian/changelog	Sat Mar  5 21:42:08 2011	(r16988)
@@ -39,6 +39,8 @@
   * brcm80211: Fix suspend/resume in brcmsmac (Closes: #600769, #604802)
   * brcm80211: Fix race between scanning and calibration on SMP
     (Closes: 602444)
+  * drm/i915: Overlay on gen2 can't address above 1G
+  * drm/i915: Fix memory corruption with GM965 and >4GB RAM
 
   [ dann frazier ]
   * xfs: Fix information leak using stale NFS handle (CVE-2010-2943)

Added: dists/squeeze/linux-2.6/debian/patches/bugfix/all/drm-i915-fix-memory-corruption-with-GM965-and-4GB-RAM.patch
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/bugfix/all/drm-i915-fix-memory-corruption-with-GM965-and-4GB-RAM.patch	Sat Mar  5 21:42:08 2011	(r16988)
@@ -0,0 +1,56 @@
+From 78c925d9936f54bc654e430ef54eeedc416d32f8 Mon Sep 17 00:00:00 2001
+From: Jan Niehusmann <jan at gondor.com>
+Date: Fri, 4 Mar 2011 00:28:02 +0100
+Subject: [PATCH 2/2] drm/i915: fix memory corruption with GM965 and >4GB RAM
+
+commit 6927faf30920b8c03dfa007e732642a1f1f20089 upstream.
+
+On a Thinkpad x61s, I noticed some memory corruption when
+plugging/unplugging the external VGA connection. The symptoms are that
+4 bytes at the beginning of a page get overwritten by zeroes.
+The address of the corruption varies when rebooting the machine, but
+stays constant while it's running (so it's possible to repeatedly write
+some data and then corrupt it again by plugging the cable).
+
+Further investigation revealed that the corrupted address is
+(dev_priv->status_page_dmah->busaddr & 0xffffffff), ie. the beginning of
+the hardware status page of the i965 graphics card, cut to 32 bits.
+
+So it seems that for some memory access, the hardware uses only 32 bit
+addressing. If the hardware status page is located >4GB, this
+corrupts unrelated memory.
+
+Signed-off-by: Jan Niehusmann <jan at gondor.com>
+Acked-by: Daniel Vetter <daniel.vetter at ffwll.ch>
+Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>
+Signed-off-by: Greg Kroah-Hartman <gregkh at suse.de>
+[bwh: Backport to 2.6.33]
+---
+ drivers/gpu/drm/i915/i915_dma.c |   11 +++++++++++
+ 1 files changed, 11 insertions(+), 0 deletions(-)
+
+diff --git a/drivers/gpu/drm/i915/i915_dma.c b/drivers/gpu/drm/i915/i915_dma.c
+index c93c98a..be27acc 100644
+--- a/drivers/gpu/drm/i915/i915_dma.c
++++ b/drivers/gpu/drm/i915/i915_dma.c
+@@ -1411,6 +1411,17 @@ int i915_driver_load(struct drm_device *dev, unsigned long flags)
+ 	if (IS_GEN2(dev))
+ 		pci_set_consistent_dma_mask(dev->pdev, DMA_BIT_MASK(30));
+ 
++	/* 965GM sometimes incorrectly writes to hardware status page (HWS)
++	 * using 32bit addressing, overwriting memory if HWS is located
++	 * above 4GB.
++	 *
++	 * The documentation also mentions an issue with undefined
++	 * behaviour if any general state is accessed within a page above 4GB,
++	 * which also needs to be handled carefully.
++	 */
++	if (IS_I965G(dev) && !IS_G4X(dev) && !IS_IRONLAKE(dev))
++		pci_set_consistent_dma_mask(dev->pdev, DMA_BIT_MASK(32));
++
+ 	dev_priv->regs = ioremap(base, size);
+ 	if (!dev_priv->regs) {
+ 		DRM_ERROR("failed to map registers\n");
+-- 
+1.7.4.1
+

Added: dists/squeeze/linux-2.6/debian/patches/bugfix/all/drm-i915-overlay-on-gen2-can-t-address-above-1G.patch
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/bugfix/all/drm-i915-overlay-on-gen2-can-t-address-above-1G.patch	Sat Mar  5 21:42:08 2011	(r16988)
@@ -0,0 +1,46 @@
+From 7f61c474281d7cecced9f270e74d48a17ddd8cdf Mon Sep 17 00:00:00 2001
+From: Daniel Vetter <daniel.vetter at ffwll.ch>
+Date: Mon, 30 Aug 2010 21:25:23 +0200
+Subject: [PATCH 1/2] drm/i915: overlay on gen2 can't address above 1G
+
+commit 9f82d23846146990d475f6753be733e55788d88d upstream.
+
+So set the coherent dma mask accordingly. This dma mask is only used
+for physical objects, so it won't really matter allocation-wise.
+
+Now this never really surfaced because sane 32bit kernels only have 1G
+of lowmem. But some eager testers (distros?) still carry around the patch
+to adjust lowmem via a kconfig option. And the kernel seems to favour
+high allocations on boot-up, hence the overlay blowing up reliably.
+
+Because the patch is tiny and nicely shows how broken gen2 is it's imho
+worth to merge despite the fact that mucking around with the lowmem/
+highmem division is (no longer) supported.
+
+Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=28318
+Cc: stable at kernel.org
+Signed-off-by: Daniel Vetter <daniel.vetter at ffwll.ch>
+Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>
+[bwh: Backport to 2.6.33]
+---
+ drivers/gpu/drm/i915/i915_dma.c |    4 ++++
+ 1 files changed, 4 insertions(+), 0 deletions(-)
+
+diff --git a/drivers/gpu/drm/i915/i915_dma.c b/drivers/gpu/drm/i915/i915_dma.c
+index 2b2adb5..c93c98a 100644
+--- a/drivers/gpu/drm/i915/i915_dma.c
++++ b/drivers/gpu/drm/i915/i915_dma.c
+@@ -1407,6 +1407,10 @@ int i915_driver_load(struct drm_device *dev, unsigned long flags)
+ 		goto free_priv;
+ 	}
+ 
++	/* overlay on gen2 is broken and can't address above 1G */
++	if (IS_GEN2(dev))
++		pci_set_consistent_dma_mask(dev->pdev, DMA_BIT_MASK(30));
++
+ 	dev_priv->regs = ioremap(base, size);
+ 	if (!dev_priv->regs) {
+ 		DRM_ERROR("failed to map registers\n");
+-- 
+1.7.4.1
+

Modified: dists/squeeze/linux-2.6/debian/patches/series/31
==============================================================================
--- dists/squeeze/linux-2.6/debian/patches/series/31	Sat Mar  5 13:46:51 2011	(r16987)
+++ dists/squeeze/linux-2.6/debian/patches/series/31	Sat Mar  5 21:42:08 2011	(r16988)
@@ -51,3 +51,5 @@
 + bugfix/all/drm-radeon-remove-0x4243-pci-id.patch
 + bugfix/all/brcm80211-fix-suspend-resume-issue-in-brcmsmac.patch
 + bugfix/all/brcm80211-bugfix-for-softmac-crash-on-multi-cpu-configurations.patch
++ bugfix/all/drm-i915-overlay-on-gen2-can-t-address-above-1G.patch
++ bugfix/all/drm-i915-fix-memory-corruption-with-GM965-and-4GB-RAM.patch



More information about the Kernel-svn-changes mailing list