|
@@ -1370,10 +1370,15 @@ static void bxt_set_cdclk(struct drm_i915_private *dev_priv,
|
|
|
break;
|
|
|
}
|
|
|
|
|
|
- /* Inform power controller of upcoming frequency change */
|
|
|
+ /*
|
|
|
+ * Inform power controller of upcoming frequency change. BSpec
|
|
|
+ * requires us to wait up to 150usec, but that leads to timeouts;
|
|
|
+ * the 2ms used here is based on experiment.
|
|
|
+ */
|
|
|
mutex_lock(&dev_priv->pcu_lock);
|
|
|
- ret = sandybridge_pcode_write(dev_priv, HSW_PCODE_DE_WRITE_FREQ_REQ,
|
|
|
- 0x80000000);
|
|
|
+ ret = sandybridge_pcode_write_timeout(dev_priv,
|
|
|
+ HSW_PCODE_DE_WRITE_FREQ_REQ,
|
|
|
+ 0x80000000, 2000);
|
|
|
mutex_unlock(&dev_priv->pcu_lock);
|
|
|
|
|
|
if (ret) {
|
|
@@ -1404,8 +1409,15 @@ static void bxt_set_cdclk(struct drm_i915_private *dev_priv,
|
|
|
I915_WRITE(CDCLK_CTL, val);
|
|
|
|
|
|
mutex_lock(&dev_priv->pcu_lock);
|
|
|
- ret = sandybridge_pcode_write(dev_priv, HSW_PCODE_DE_WRITE_FREQ_REQ,
|
|
|
- cdclk_state->voltage_level);
|
|
|
+ /*
|
|
|
+ * The timeout isn't specified, the 2ms used here is based on
|
|
|
+ * experiment.
|
|
|
+ * FIXME: Waiting for the request completion could be delayed until
|
|
|
+ * the next PCODE request based on BSpec.
|
|
|
+ */
|
|
|
+ ret = sandybridge_pcode_write_timeout(dev_priv,
|
|
|
+ HSW_PCODE_DE_WRITE_FREQ_REQ,
|
|
|
+ cdclk_state->voltage_level, 2000);
|
|
|
mutex_unlock(&dev_priv->pcu_lock);
|
|
|
|
|
|
if (ret) {
|