[kernel/f14/master] nouveau: fix potential dma race

Ben Skeggs bskeggs at fedoraproject.org
Thu Sep 30 03:19:30 UTC 2010


commit 7043d42b5aa70ca638d63b479968ad550822e070
Author: Ben Skeggs <bskeggs at redhat.com>
Date:   Thu Sep 30 13:19:07 2010 +1000

    nouveau: fix potential dma race

 drm-nouveau-ibdma-race.patch |   29 +++++++++++++++++++++++++++++
 kernel.spec                  |    8 +++++++-
 2 files changed, 36 insertions(+), 1 deletions(-)
---
diff --git a/drm-nouveau-ibdma-race.patch b/drm-nouveau-ibdma-race.patch
new file mode 100644
index 0000000..23a6004
--- /dev/null
+++ b/drm-nouveau-ibdma-race.patch
@@ -0,0 +1,29 @@
+From 55647c139cf7d6caeaa08a99b2165763a02ab71a Mon Sep 17 00:00:00 2001
+From: Ben Skeggs <bskeggs at redhat.com>
+Date: Thu, 30 Sep 2010 09:09:42 +1000
+Subject: [PATCH] drm/nv50: prevent (IB_PUT == IB_GET) for occurring unless idle
+
+Should fix a DMA race condition I've never seen myself, but could be
+the culprit in some random hangs that have been reported.
+
+Signed-off-by: Ben Skeggs <bskeggs at redhat.com>
+---
+ drivers/gpu/drm/nouveau/nouveau_dma.c |    2 +-
+ 1 files changed, 1 insertions(+), 1 deletions(-)
+
+diff --git a/drivers/gpu/drm/nouveau/nouveau_dma.c b/drivers/gpu/drm/nouveau/nouveau_dma.c
+index 9d27acd..eb24e2b 100644
+--- a/drivers/gpu/drm/nouveau/nouveau_dma.c
++++ b/drivers/gpu/drm/nouveau/nouveau_dma.c
+@@ -214,7 +214,7 @@ nv50_dma_push_wait(struct nouveau_channel *chan, int count)
+ 
+ 		chan->dma.ib_free = get - chan->dma.ib_put;
+ 		if (chan->dma.ib_free <= 0)
+-			chan->dma.ib_free += chan->dma.ib_max + 1;
++			chan->dma.ib_free += chan->dma.ib_max;
+ 	}
+ 
+ 	return 0;
+-- 
+1.7.2.2
+
diff --git a/kernel.spec b/kernel.spec
index d68ba8d..186da00 100644
--- a/kernel.spec
+++ b/kernel.spec
@@ -48,7 +48,7 @@ Summary: The Linux kernel
 # reset this by hand to 1 (or to 0 and then use rpmdev-bumpspec).
 # scripts/rebase.sh should be made to do that for you, actually.
 #
-%global baserelease 35
+%global baserelease 36
 %global fedora_build %{baserelease}
 
 # base_sublevel is the kernel version we're starting with and patching
@@ -666,6 +666,7 @@ Patch1807: drm-i2c-ch7006-fix.patch
 Patch1810: drm-nouveau-updates.patch
 Patch1811: drm-nouveau-race-fix.patch
 Patch1812: drm-nouveau-nva3-noaccel.patch
+Patch1813: drm-nouveau-ibdma-race.patch
 Patch1819: drm-intel-big-hammer.patch
 # intel drm is all merged upstream
 Patch1824: drm-intel-next.patch
@@ -1300,6 +1301,7 @@ ApplyPatch drm-i2c-ch7006-fix.patch
 ApplyPatch drm-nouveau-updates.patch
 ApplyPatch drm-nouveau-race-fix.patch
 ApplyPatch drm-nouveau-nva3-noaccel.patch
+ApplyPatch drm-nouveau-ibdma-race.patch
 
 ApplyPatch drm-intel-big-hammer.patch
 ApplyOptionalPatch drm-intel-next.patch
@@ -1968,6 +1970,10 @@ fi
 # and build.
 
 %changelog
+* Thu Sep 30 2010 Ben Skeggs <bskeggs at redhat.com> 2.6.35.6-36
+- nouveau: fix theoretical race condition which may be the cause of some
+  random hangs people reported.
+
 * Wed Sep 29 2010 Dave Jones <davej at redhat.com> 2.6.35.6-35
 - Add back an old hack to make an SDV e1000e variant work.
 


More information about the scm-commits mailing list