aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/nouveau/nouveau_state.c
diff options
context:
space:
mode:
authorJimmy Rentz <jb17bsome@gmail.com>2011-04-17 16:15:09 -0400
committerBen Skeggs <bskeggs@redhat.com>2011-05-15 20:50:04 -0400
commit976661093dab143f164b81f15133724fa2a4bb86 (patch)
treefbeabcef93379eedcff2765a04c92c0a99446695 /drivers/gpu/drm/nouveau/nouveau_state.c
parent2abdb057e45ea9b558653a97d979053cfdd1a04a (diff)
drm/nouveau: Fix a crash at card takedown for NV40 and older cards
NV40 and older cards (pre NV50) reserve a vram bo for the vga memory at card init. This bo is then freed at card shutdown. The problem is that the ttm bo vram manager was already freed. So a crash occurs when the vga bo is freed. The fix is to free the vga bo prior to freeing the ttm bo vram manager. There might be other solutions but this seemed the simplest to me. Signed-off-by: Jimmy Rentz <jb17bsome@gmail.com> Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Diffstat (limited to 'drivers/gpu/drm/nouveau/nouveau_state.c')
-rw-r--r--drivers/gpu/drm/nouveau/nouveau_state.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/gpu/drm/nouveau/nouveau_state.c b/drivers/gpu/drm/nouveau/nouveau_state.c
index f316157217b..8771677d6c5 100644
--- a/drivers/gpu/drm/nouveau/nouveau_state.c
+++ b/drivers/gpu/drm/nouveau/nouveau_state.c
@@ -738,6 +738,11 @@ static void nouveau_card_takedown(struct drm_device *dev)
738 engine->mc.takedown(dev); 738 engine->mc.takedown(dev);
739 engine->display.late_takedown(dev); 739 engine->display.late_takedown(dev);
740 740
741 if (dev_priv->vga_ram) {
742 nouveau_bo_unpin(dev_priv->vga_ram);
743 nouveau_bo_ref(NULL, &dev_priv->vga_ram);
744 }
745
741 mutex_lock(&dev->struct_mutex); 746 mutex_lock(&dev->struct_mutex);
742 ttm_bo_clean_mm(&dev_priv->ttm.bdev, TTM_PL_VRAM); 747 ttm_bo_clean_mm(&dev_priv->ttm.bdev, TTM_PL_VRAM);
743 ttm_bo_clean_mm(&dev_priv->ttm.bdev, TTM_PL_TT); 748 ttm_bo_clean_mm(&dev_priv->ttm.bdev, TTM_PL_TT);