Skip to contentSkip to conversation

drm/i915: don't run hsw power well code on !hsw

PATCH In review Daniel Vetter 5 participants 6 messages Jan 30, 2013

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

PATCH 1/2 drm/i915: don't run hsw power well code on !hsw

Dumps annoying noise into the dmesg:

[drm:intel_set_power_well] *ERROR* Timeout enabling power well

---
 drivers/gpu/drm/i915/intel_pm.c |    3 +++
 1 file changed, 3 insertions(+)
drivers/gpu/drm/i915/intel_pm.c +3 -0
index 64d65f5..703219c 100644
@@ -4053,6 +4053,9 @@ void intel_set_power_well(struct drm_device *dev, bool enable)
 	bool is_enabled, enable_requested;
 	uint32_t tmp;
 
+	if (!IS_HASWELL(dev))
+		return;
+
 	tmp = I915_READ(HSW_PWR_WELL_DRIVER);
 	is_enabled = tmp & HSW_PWR_WELL_STATE;
 	enable_requested = tmp & HSW_PWR_WELL_ENABLE;
Signature · 1 line
1.7.10.4
#1 lore raw

PATCH 2/2 drm/i915: kill cargo-culted locking from power well code

We may not concurrently change the power wells code. Which is already guaranteed since modesets aren't concurrent. That leaves races against setup/teardown/suspend/resume, and for those we already (try) rather hard not to hit concurrent modesets.

No debug WARN_ON added since that would require us to grab the modeset locks in init/suspend code. Which is again just cargo culting since just grabbing the locks in those paths isn't good enough, we need the right order of operations, too.

---
 drivers/gpu/drm/i915/intel_pm.c |    4 ----
 1 file changed, 4 deletions(-)
drivers/gpu/drm/i915/intel_pm.c +0 -4
index 703219c..f024e7d 100644
@@ -4091,8 +4091,6 @@ void intel_init_power_well(struct drm_device *dev)
 	if (!IS_HASWELL(dev))
 		return;
 
-	mutex_lock(&dev->struct_mutex);
-
 	/* For now, we need the power well to be always enabled. */
 	intel_set_power_well(dev, true);
 
@@ -4100,8 +4098,6 @@ void intel_init_power_well(struct drm_device *dev)
 	 * the driver is in charge now. */
 	if (I915_READ(HSW_PWR_WELL_BIOS) & HSW_PWR_WELL_ENABLE)
 		I915_WRITE(HSW_PWR_WELL_BIOS, 0);
-
-	mutex_unlock(&dev->struct_mutex);
 }
 
 /* Set up chip specific power management-related functions */
Signature · 1 line
1.7.10.4
Reviewed-by on v1 2/2
#2 lore raw

Re: [PATCH 2/2] drm/i915: kill cargo-culted locking from power well code

Quoted 46 lines · Daniel Vetter

We may not concurrently change the power wells code. Which is already guaranteed since modesets aren't concurrent. That leaves races against setup/teardown/suspend/resume, and for those we already (try) rather hard not to hit concurrent modesets.

No debug WARN_ON added since that would require us to grab the modeset locks in init/suspend code. Which is again just cargo culting since just grabbing the locks in those paths isn't good enough, we need the right order of operations, too.

---
 drivers/gpu/drm/i915/intel_pm.c |    4 ----
 1 file changed, 4 deletions(-)
drivers/gpu/drm/i915/intel_pm.c +0 -5
index 703219c..f024e7d 100644
@@ -4091,8 +4091,6 @@ void intel_init_power_well(struct drm_device *dev)
        if (!IS_HASWELL(dev))
                return;
 
-       mutex_lock(&dev->struct_mutex);
-
        /* For now, we need the power well to be always enabled. */
        intel_set_power_well(dev, true);
 
@@ -4100,8 +4098,6 @@ void intel_init_power_well(struct drm_device *dev)
         * the driver is in charge now. */
        if (I915_READ(HSW_PWR_WELL_BIOS) & HSW_PWR_WELL_ENABLE)
                I915_WRITE(HSW_PWR_WELL_BIOS, 0);
-
-       mutex_unlock(&dev->struct_mutex);
 }
 
 /* Set up chip specific power management-related functions */
--

1.7.10.4

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

Signature · 2 lines
Rodrigo Vivi
Blog: http://blog.vivi.eng.br
Tested-by on v1 1/2
#3 lore raw
In reply to Daniel Vetter
Quoted 8 lines · Daniel Vetter

Dumps annoying noise into the dmesg:

[drm:intel_set_power_well] *ERROR* Timeout enabling power well

After S/R:

$ dmesg | egrep -i 'drm|i915|suspend|resume'
[   10.887952] [drm] Initialized drm 1.1.0 20060810
[   11.974280] [drm] Memory usable by graphics device = 2048M
[   11.974290] i915 0000:00:02.0: setting latency timer to 64
[   12.020550] i915 0000:00:02.0: irq 49 for MSI/MSI-X
[   12.020563] [drm] Supports vblank timestamp caching Rev 1 (10.10.2010).
[   12.020565] [drm] Driver supports precise vblank timestamp query.
[   12.049337] fbcon: inteldrmfb (fb0) is primary device
[   13.059191] i915 0000:00:02.0: fb0: inteldrmfb frame buffer device
[   13.059192] i915 0000:00:02.0: registered panic notifier
[   13.098925] [drm] Initialized i915 1.6.0 20080730 for 0000:00:02.0 on minor 0
[   13.812483] [drm] Enabling RC6 states: RC6 on, RC6p off, RC6pp off
[  231.678520] Suspending console(s) (use no_console_suspend to debug)
[  232.281962] PM: suspend of devices complete after 603.751 msecs
[  232.282107] PM: late suspend of devices complete after 0.144 msecs
[  232.377845] PM: noirq suspend of devices complete after 95.801 msecs
[  232.719152] ACPI: Low-level resume complete
[  232.956049] PM: noirq resume of devices complete after 143.982 msecs
[  232.956224] PM: early resume of devices complete after 0.110 msecs
[  232.956258] i915 0000:00:02.0: setting latency timer to 64
[  234.634962] [drm] Enabling RC6 states: RC6 on, RC6p off, RC6pp off
[  235.398226] PM: resume of devices complete after 2443.721 msecs

- Sedat -

Quoted 21 lines
---
 drivers/gpu/drm/i915/intel_pm.c |    3 +++
 1 file changed, 3 insertions(+)
drivers/gpu/drm/i915/intel_pm.c +3 -1
index 64d65f5..703219c 100644
@@ -4053,6 +4053,9 @@ void intel_set_power_well(struct drm_device *dev, bool enable)
        bool is_enabled, enable_requested;
        uint32_t tmp;
 
+       if (!IS_HASWELL(dev))
+               return;
+
        tmp = I915_READ(HSW_PWR_WELL_DRIVER);
        is_enabled = tmp & HSW_PWR_WELL_STATE;
        enable_requested = tmp & HSW_PWR_WELL_ENABLE;
--

1.7.10.4

Reviewed-by on v1 1/2
#4 lore raw
In reply to Daniel Vetter

Hi

2013/1/30 Daniel Vetter <[email protected]>:

Quoted 8 lines

Dumps annoying noise into the dmesg:

[drm:intel_set_power_well] *ERROR* Timeout enabling power well

Quoted 25 lines
---
 drivers/gpu/drm/i915/intel_pm.c |    3 +++
 1 file changed, 3 insertions(+)
drivers/gpu/drm/i915/intel_pm.c +3 -1
index 64d65f5..703219c 100644
@@ -4053,6 +4053,9 @@ void intel_set_power_well(struct drm_device *dev, bool enable)
        bool is_enabled, enable_requested;
        uint32_t tmp;
 
+       if (!IS_HASWELL(dev))
+               return;
+
        tmp = I915_READ(HSW_PWR_WELL_DRIVER);
        is_enabled = tmp & HSW_PWR_WELL_STATE;
        enable_requested = tmp & HSW_PWR_WELL_ENABLE;
--

1.7.10.4

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

Signature · 1 line
Paulo Zanoni
#5 lore raw
Quoted 5 lines · Paulo Zanoni

Hi

2013/1/30 Daniel Vetter <[email protected]>:

Quoted 2 lines

Dumps annoying noise into the dmesg:

Quoted 8 lines
Quoted 6 lines

[drm:intel_set_power_well] *ERROR* Timeout enabling power well

Both patches merged to dinq.
-Daniel

Signature · 3 lines
Daniel Vetter
Software Engineer, Intel Corporation
+41 (0) 79 365 57 48 - http://blog.ffwll.ch