diff options
author | Imre Deak <imre.deak@intel.com> | 2016-05-12 16:18:51 +0300 |
---|---|---|
committer | Imre Deak <imre.deak@intel.com> | 2016-05-13 15:17:58 +0300 |
commit | 7d7792e5e2bb5fc176dfb3f56d3c79b9c716519e (patch) | |
tree | da7c25690f9a42eaf9997d0d0cf2dd0cbff5e8bd /drivers/gpu/drm/i915/i915_dma.c | |
parent | drm/i915: Add comments about fixed pipe->transcoder/PLL mapping (diff) | |
download | linux-dev-7d7792e5e2bb5fc176dfb3f56d3c79b9c716519e.tar.xz linux-dev-7d7792e5e2bb5fc176dfb3f56d3c79b9c716519e.zip |
drm/i915: Handle error return from dma_set_coherent_mask()
A failure from these functions can lead to obscure bugs later, so it's
better not to suppress them and just fail module loading.
Signed-off-by: Imre Deak <imre.deak@intel.com>
Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: http://patchwork.freedesktop.org/patch/msgid/1463059132-1720-4-git-send-email-imre.deak@intel.com
Diffstat (limited to 'drivers/gpu/drm/i915/i915_dma.c')
-rw-r--r-- | drivers/gpu/drm/i915/i915_dma.c | 22 |
1 files changed, 18 insertions, 4 deletions
diff --git a/drivers/gpu/drm/i915/i915_dma.c b/drivers/gpu/drm/i915/i915_dma.c index 05b2b1901d60..547100fa3122 100644 --- a/drivers/gpu/drm/i915/i915_dma.c +++ b/drivers/gpu/drm/i915/i915_dma.c @@ -1262,8 +1262,15 @@ static int i915_driver_init_hw(struct drm_i915_private *dev_priv) pci_set_master(dev->pdev); /* overlay on gen2 is broken and can't address above 1G */ - if (IS_GEN2(dev)) - dma_set_coherent_mask(&dev->pdev->dev, DMA_BIT_MASK(30)); + if (IS_GEN2(dev)) { + ret = dma_set_coherent_mask(&dev->pdev->dev, DMA_BIT_MASK(30)); + if (ret) { + DRM_ERROR("failed to set DMA mask\n"); + + goto out_ggtt; + } + } + /* 965GM sometimes incorrectly writes to hardware status page (HWS) * using 32bit addressing, overwriting memory if HWS is located @@ -1273,8 +1280,15 @@ static int i915_driver_init_hw(struct drm_i915_private *dev_priv) * behaviour if any general state is accessed within a page above 4GB, * which also needs to be handled carefully. */ - if (IS_BROADWATER(dev) || IS_CRESTLINE(dev)) - dma_set_coherent_mask(&dev->pdev->dev, DMA_BIT_MASK(32)); + if (IS_BROADWATER(dev) || IS_CRESTLINE(dev)) { + ret = dma_set_coherent_mask(&dev->pdev->dev, DMA_BIT_MASK(32)); + + if (ret) { + DRM_ERROR("failed to set DMA mask\n"); + + goto out_ggtt; + } + } aperture_size = ggtt->mappable_end; |