Browse Source

drm/nouveau/device/pci: fix oops if no mmu subdev present

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Ben Skeggs 8 years ago
parent
commit
9e38b13ea5
1 changed files with 1 additions and 1 deletions
  1. 1 1
      drivers/gpu/drm/nouveau/nvkm/engine/device/pci.c

+ 1 - 1
drivers/gpu/drm/nouveau/nvkm/engine/device/pci.c

@@ -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
 	 * 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.
 	 * 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_set_mask_and_coherent(&pci_dev->dev,
 				DMA_BIT_MASK(pdev->device.mmu->dma_bits));
 				DMA_BIT_MASK(pdev->device.mmu->dma_bits));