drm/nv50: fix two potential suspend/resume oopses
authorBen Skeggs <bskeggs@redhat.com>
Wed, 16 Dec 2009 04:51:13 +0000 (14:51 +1000)
committerBen Skeggs <bskeggs@redhat.com>
Wed, 16 Dec 2009 07:05:50 +0000 (17:05 +1000)
This avoids touching the dummy channel 0/127 we have on nv50.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
drivers/gpu/drm/nouveau/nouveau_drv.c
drivers/gpu/drm/nouveau/nv50_fifo.c

index 78662cc1c8d5645f4597d3e2357419e81ba826b7..58c717247f267d5f60d1aa86d1e34f4e56d21bab 100644 (file)
@@ -277,7 +277,7 @@ nouveau_pci_resume(struct pci_dev *pdev)
 
                for (i = 0; i < dev_priv->engine.fifo.channels; i++) {
                        chan = dev_priv->fifos[i];
-                       if (!chan)
+                       if (!chan || !chan->pushbuf_bo)
                                continue;
 
                        for (j = 0; j < NOUVEAU_DMA_SKIPS; j++)
index 77ae1aaa0bcea90babc84b8b202318f101c2e7af..b7282284f0806f4db2cb71b57eddda7606e3c055 100644 (file)
@@ -416,7 +416,7 @@ nv50_fifo_unload_context(struct drm_device *dev)
        NV_DEBUG(dev, "\n");
 
        chid = pfifo->channel_id(dev);
-       if (chid < 0 || chid >= dev_priv->engine.fifo.channels)
+       if (chid < 1 || chid >= dev_priv->engine.fifo.channels - 1)
                return 0;
 
        chan = dev_priv->fifos[chid];