diff mbox

[3/7] drm/i915: clear the FPGA_DBG_RM_NOCLAIM bit at driver init

Message ID 1359147462-3902-4-git-send-email-przanoni@gmail.com (mailing list archive)
State New, archived
Headers show

Commit Message

Paulo Zanoni Jan. 25, 2013, 8:57 p.m. UTC
From: Paulo Zanoni <paulo.r.zanoni@intel.com>

Otherwise, if the BIOS did anything wrong, our first I915_{READ,WRITE}
will give us "unclaimed regsiter" messages.

Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
---
 drivers/gpu/drm/i915/i915_dma.c |    4 ++++
 1 file changed, 4 insertions(+)

Comments

Ben Widawsky Jan. 26, 2013, 1:05 a.m. UTC | #1
On Fri, 25 Jan 2013 18:57:38 -0200
Paulo Zanoni <przanoni@gmail.com> wrote:

> From: Paulo Zanoni <paulo.r.zanoni@intel.com>
> 
> Otherwise, if the BIOS did anything wrong, our first I915_{READ,WRITE}
> will give us "unclaimed regsiter" messages.
> 
> Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
> ---
>  drivers/gpu/drm/i915/i915_dma.c |    4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/drivers/gpu/drm/i915/i915_dma.c b/drivers/gpu/drm/i915/i915_dma.c
> index 11c7aa8..505d7eb 100644
> --- a/drivers/gpu/drm/i915/i915_dma.c
> +++ b/drivers/gpu/drm/i915/i915_dma.c
> @@ -1578,6 +1578,10 @@ int i915_driver_load(struct drm_device *dev, unsigned long flags)
>  	/* This must be called before any calls to HAS_PCH_* */
>  	intel_detect_pch(dev);
>  
> +	/* This must happen before any I915_{READ,WRITE}: */
> +	if (IS_HASWELL(dev))
> +		I915_WRITE_NOTRACE(FPGA_DBG, FPGA_DBG_RM_NOCLAIM);
> +
>  	intel_irq_init(dev);
>  	intel_gt_init(dev);
>  

This is too late, I think. It should happen as soon as we map the MMIO.
Just in case stupid people (like me) add in stuff at driver load. You
say it in the comment, but it would be clearer in code if you did it
immediately after:

dev_priv->regs = pci_iomap(dev->pdev, mmio_bar, mmio_size);
diff mbox

Patch

diff --git a/drivers/gpu/drm/i915/i915_dma.c b/drivers/gpu/drm/i915/i915_dma.c
index 11c7aa8..505d7eb 100644
--- a/drivers/gpu/drm/i915/i915_dma.c
+++ b/drivers/gpu/drm/i915/i915_dma.c
@@ -1578,6 +1578,10 @@  int i915_driver_load(struct drm_device *dev, unsigned long flags)
 	/* This must be called before any calls to HAS_PCH_* */
 	intel_detect_pch(dev);
 
+	/* This must happen before any I915_{READ,WRITE}: */
+	if (IS_HASWELL(dev))
+		I915_WRITE_NOTRACE(FPGA_DBG, FPGA_DBG_RM_NOCLAIM);
+
 	intel_irq_init(dev);
 	intel_gt_init(dev);