drm/nouveau/device/pci: fix oops if no mmu subdev present
authorBen Skeggs <bskeggs@redhat.com>
Mon, 7 Nov 2016 23:43:50 +0000 (09:43 +1000)
committerBen Skeggs <bskeggs@redhat.com>
Wed, 16 Nov 2016 23:50:35 +0000 (09:50 +1000)
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
drivers/gpu/drm/nouveau/nvkm/engine/device/pci.c

index 0030cd9543b24f6614c957edf673526e97c3539c..74a1ffa425f73d00e832b4f44e803db63300ef68 100644 (file)
@@ -1687,7 +1687,7 @@ nvkm_device_pci_new(struct pci_dev *pci_dev, const char *cfg, const char *dbg,
         * This is necessary for platforms where the default DMA mask of 32
         * does not cover any system memory, i.e., when all RAM is > 4 GB.
         */
-       if (subdev_mask & BIT(NVKM_SUBDEV_MMU))
+       if (pdev->device.mmu)
                dma_set_mask_and_coherent(&pci_dev->dev,
                                DMA_BIT_MASK(pdev->device.mmu->dma_bits));