Skip to contentSkip to conversation

drm/i915: initialize gen6 rps work queue for Ironlake+

PATCH In review Jesse Barnes 3 participants 5 messages May 18, 2011

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drm/i915: initialize gen6 rps work queue for Ironlake+

Looks like I didn't merge Ben's RPS work queue stuff correctly with the new IRQ split code (diff was sparse enough that git didn't complain). This should prevent null derefs on ILK+ due to the missing work queue.

drivers/gpu/drm/i915/i915_irq.c +1 -1
index 349a03e..9112bf5 100644
@@ -1736,6 +1736,7 @@ void ironlake_irq_preinstall(struct drm_device *dev)
 
 	INIT_WORK(&dev_priv->hotplug_work, i915_hotplug_work_func);
 	INIT_WORK(&dev_priv->error_work, i915_error_work_func);
+	INIT_WORK(&dev_priv->rps_work, gen6_pm_rps_work);
 
 	I915_WRITE(HWSTAM, 0xeffe);
 
@@ -1887,7 +1888,6 @@ void i915_driver_irq_preinstall(struct drm_device * dev)
 
 	INIT_WORK(&dev_priv->hotplug_work, i915_hotplug_work_func);
 	INIT_WORK(&dev_priv->error_work, i915_error_work_func);
-	INIT_WORK(&dev_priv->rps_work, gen6_pm_rps_work);
 
 	if (I915_HAS_HOTPLUG(dev)) {
 		I915_WRITE(PORT_HOTPLUG_EN, 0);
#1 lore raw

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Quoted 3 lines · Jesse Barnes

Looks like I didn't merge Ben's RPS work queue stuff correctly with the new IRQ split code (diff was sparse enough that git didn't complain). This should prevent null derefs on ILK+ due to the missing work queue.

Is this actually needed on Ironlake (i.e., gen5)?

Quoted 15 lines
drivers/gpu/drm/i915/i915_irq.c +1 -0
index 349a03e..9112bf5 100644
@@ -1736,6 +1736,7 @@ void ironlake_irq_preinstall(struct drm_device *dev)
 
 	INIT_WORK(&dev_priv->hotplug_work, i915_hotplug_work_func);
 	INIT_WORK(&dev_priv->error_work, i915_error_work_func);
+	INIT_WORK(&dev_priv->rps_work, gen6_pm_rps_work);
 
 	I915_WRITE(HWSTAM, 0xeffe);
 

drivers/gpu/drm/i915/i915_irq.c void i915_driver_irq_preinstall(struct drm_device * dev) · line 1893

Quoted 7 lines
drivers/gpu/drm/i915/i915_irq.c +0 -1
@@ -1887,7 +1888,6 @@ void i915_driver_irq_preinstall(struct drm_device * dev)
 
 	INIT_WORK(&dev_priv->hotplug_work, i915_hotplug_work_func);
 	INIT_WORK(&dev_priv->error_work, i915_error_work_func);
-	INIT_WORK(&dev_priv->rps_work, gen6_pm_rps_work);
 
 	if (I915_HAS_HOTPLUG(dev)) {
 		I915_WRITE(PORT_HOTPLUG_EN, 0);

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)
Comment: Using GnuPG with Fedora - http://enigmail.mozdev.org/

iEYEARECAAYFAk3T9dwACgkQX1gOwKyEAw/wRACeLPeHTmjvu0ObCV3iJsZMXNud gwUAn3vuXo6J59viQrw5aMn6r8of68pL
=zjHv
-----END PGP SIGNATURE-----

#2 lore raw
Quoted 11 lines · On Wed, 18 May 2011 18:37:48 +0200 Ian Romanick <[email protected]> wrote:

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Quoted 3 lines · Jesse Barnes

Looks like I didn't merge Ben's RPS work queue stuff correctly with the new IRQ split code (diff was sparse enough that git didn't complain). This should prevent null derefs on ILK+ due to the missing work queue.

Is this actually needed on Ironlake (i.e., gen5)?

Quoted 1 line

The work queue is only used on gen6, but gen6 and ilk share an irq handler. I could make the work queue init conditional on gen6 though, if that's what you're thinking.

Signature · 1 line
Jesse Barnes, Intel Open Source Technology Center
#3 lore raw
Quoted 3 lines · Jesse Barnes

The work queue is only used on gen6, but gen6 and ilk share an irq handler. I could make the work queue init conditional on gen6 though, if that's what you're thinking.

Probably a good idea, mostly as documentation for which chips it is used on?

Signature · 1 line
[email protected]

_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx

#4 lore raw
Quoted 8 lines · On Wed, 18 May 2011 13:42:54 -0700 Keith Packard <[email protected]> wrote:
Quoted 3 lines · Jesse Barnes

The work queue is only used on gen6, but gen6 and ilk share an irq handler. I could make the work queue init conditional on gen6 though, if that's what you're thinking.

Probably a good idea, mostly as documentation for which chips it is used on?

Here you go.

Jesse

Quoted 1 line

From e0f3a48a7ef22cc8dc5c3c0a05756f7bce46d68c Mon Sep 17 00:00:00 2001

From: Jesse Barnes <[email protected]>
Date: Wed, 18 May 2011 13:49:41 -0700
Subject: [PATCH] drm/i915: initialize gen6 rps work queue on Sandy Bridge and Ivy Bridge

It's not used on Ironlake, but is used on later generations, so make sure it exists before we try to use it in the interrupt handlers.

---
 drivers/gpu/drm/i915/i915_irq.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
drivers/gpu/drm/i915/i915_irq.c +2 -1
index 349a03e..b79619a 100644
@@ -1736,6 +1736,8 @@ void ironlake_irq_preinstall(struct drm_device *dev)
 
 	INIT_WORK(&dev_priv->hotplug_work, i915_hotplug_work_func);
 	INIT_WORK(&dev_priv->error_work, i915_error_work_func);
+	if (IS_GEN6(dev) || IS_IVYBRIDGE(dev))
+		INIT_WORK(&dev_priv->rps_work, gen6_pm_rps_work);
 
 	I915_WRITE(HWSTAM, 0xeffe);
 
@@ -1887,7 +1889,6 @@ void i915_driver_irq_preinstall(struct drm_device * dev)
 
 	INIT_WORK(&dev_priv->hotplug_work, i915_hotplug_work_func);
 	INIT_WORK(&dev_priv->error_work, i915_error_work_func);
-	INIT_WORK(&dev_priv->rps_work, gen6_pm_rps_work);
 
 	if (I915_HAS_HOTPLUG(dev)) {
 		I915_WRITE(PORT_HOTPLUG_EN, 0);
Signature · 1 line
1.7.4.1