nouveau: don't call pci_dma_supported
authorChristoph Hellwig <hch@lst.de>
Wed, 21 Oct 2015 22:13:23 +0000 (09:13 +1100)
committerStephen Rothwell <sfr@canb.auug.org.au>
Mon, 2 Nov 2015 03:54:09 +0000 (14:54 +1100)
Just try to set a 64-bit DMA mask first and retry with the smaller dma_mask
if dma_set_mask failed.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Cc: David Airlie <airlied@linux.ie>
Cc: Ben Skeggs <bskeggs@redhat.com>
Cc: Alexandre Courbot <acourbot@nvidia.com>
Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
Cc: Thierry Reding <treding@nvidia.com>
Cc: Dave Airlie <airlied@redhat.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
drivers/gpu/drm/nouveau/nouveau_ttm.c

index 3f0fb55..bb030e6 100644 (file)
@@ -350,11 +350,14 @@ nouveau_ttm_init(struct nouveau_drm *drm)
 
        bits = nvxx_mmu(&drm->device)->dma_bits;
        if (nvxx_device(&drm->device)->func->pci) {
-               if (drm->agp.bridge ||
-                    !pci_dma_supported(dev->pdev, DMA_BIT_MASK(bits)))
+               if (drm->agp.bridge)
                        bits = 32;
 
                ret = pci_set_dma_mask(dev->pdev, DMA_BIT_MASK(bits));
+               if (ret && bits != 32) {
+                       bits = 32;
+                       ret = pci_set_dma_mask(dev->pdev, DMA_BIT_MASK(bits));
+               }
                if (ret)
                        return ret;