diff mbox

[1/7] drm/i915: Prevent using uninitialized MMIO funcs

Message ID 1380946975-14431-1-git-send-email-benjamin.widawsky@intel.com (mailing list archive)
State New, archived
Headers show

Commit Message

Ben Widawsky Oct. 5, 2013, 4:22 a.m. UTC
For upcoming patches which will have GEN specific MMIO functions, we'll
need to initialize the uncore data structure earlier than we do today.

If we do not do this, the following will be problematic:

intel_uncore_sanitize
	intel_disable_gt_powersave
		gen6_disable_rps
			I915_WRITE(GEN6_RC_CONTROL, 0); <--- MMIO
intel_uncore_init // initializes MMIO

By initializing the function pointers first, we should be safe.

Signed-off-by: Ben Widawsky <ben@bwidawsk.net>
---
 drivers/gpu/drm/i915/i915_dma.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Lespiau, Damien Oct. 8, 2013, 1:38 p.m. UTC | #1
On Fri, Oct 04, 2013 at 09:22:49PM -0700, Ben Widawsky wrote:
> For upcoming patches which will have GEN specific MMIO functions, we'll
> need to initialize the uncore data structure earlier than we do today.
> 
> If we do not do this, the following will be problematic:
> 
> intel_uncore_sanitize
> 	intel_disable_gt_powersave
> 		gen6_disable_rps
> 			I915_WRITE(GEN6_RC_CONTROL, 0); <--- MMIO
> intel_uncore_init // initializes MMIO
> 
> By initializing the function pointers first, we should be safe.
> 
> Signed-off-by: Ben Widawsky <ben@bwidawsk.net>

For the whole series:

Reviewed-by: Damien Lespiau <damien.lespiau@intel.com>
Daniel Vetter Oct. 8, 2013, 3:23 p.m. UTC | #2
On Tue, Oct 08, 2013 at 02:38:22PM +0100, Damien Lespiau wrote:
> On Fri, Oct 04, 2013 at 09:22:49PM -0700, Ben Widawsky wrote:
> > For upcoming patches which will have GEN specific MMIO functions, we'll
> > need to initialize the uncore data structure earlier than we do today.
> > 
> > If we do not do this, the following will be problematic:
> > 
> > intel_uncore_sanitize
> > 	intel_disable_gt_powersave
> > 		gen6_disable_rps
> > 			I915_WRITE(GEN6_RC_CONTROL, 0); <--- MMIO
> > intel_uncore_init // initializes MMIO
> > 
> > By initializing the function pointers first, we should be safe.
> > 
> > Signed-off-by: Ben Widawsky <ben@bwidawsk.net>
> 
> For the whole series:
> 
> Reviewed-by: Damien Lespiau <damien.lespiau@intel.com>

All merged, thanks for patches&review.
-Daniel
diff mbox

Patch

diff --git a/drivers/gpu/drm/i915/i915_dma.c b/drivers/gpu/drm/i915/i915_dma.c
index f221631..0a84cd5 100644
--- a/drivers/gpu/drm/i915/i915_dma.c
+++ b/drivers/gpu/drm/i915/i915_dma.c
@@ -1621,8 +1621,8 @@  int i915_driver_load(struct drm_device *dev, unsigned long flags)
 
 	intel_irq_init(dev);
 	intel_pm_init(dev);
-	intel_uncore_sanitize(dev);
 	intel_uncore_init(dev);
+	intel_uncore_sanitize(dev);
 
 	/* Try to make sure MCHBAR is enabled before poking at it */
 	intel_setup_mchbar(dev);