Skip to content

Commit 933bfb4

Browse files
Sagar Arun Kamblevsyrjala
authored andcommitted
drm/i915: Hold RPM reference while setting freq limits through sysfs
This changes ensures device is active when frequency limits are changed. This is needed as we are writing to register RPNSWREQ in intel_set_rps. If not done, might lead to undesired errors like: [ 1965.189137] [drm:fw_domains_get] *ERROR* blitter: timed out waiting for forcewake ack to clear. v2: Added elaborate commit message. (Jani) Fixing RPM reference drop in early exit paths. (Ville) Signed-off-by: Sagar Arun Kamble <[email protected]> Link: http://patchwork.freedesktop.org/patch/msgid/[email protected] Signed-off-by: Ville Syrjälä <[email protected]>
1 parent ca37780 commit 933bfb4

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

drivers/gpu/drm/i915/i915_sysfs.c

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -370,6 +370,8 @@ static ssize_t gt_max_freq_mhz_store(struct device *kdev,
370370

371371
flush_delayed_work(&dev_priv->rps.delayed_resume_work);
372372

373+
intel_runtime_pm_get(dev_priv);
374+
373375
mutex_lock(&dev_priv->rps.hw_lock);
374376

375377
val = intel_freq_opcode(dev_priv, val);
@@ -378,6 +380,7 @@ static ssize_t gt_max_freq_mhz_store(struct device *kdev,
378380
val > dev_priv->rps.max_freq ||
379381
val < dev_priv->rps.min_freq_softlimit) {
380382
mutex_unlock(&dev_priv->rps.hw_lock);
383+
intel_runtime_pm_put(dev_priv);
381384
return -EINVAL;
382385
}
383386

@@ -398,6 +401,8 @@ static ssize_t gt_max_freq_mhz_store(struct device *kdev,
398401

399402
mutex_unlock(&dev_priv->rps.hw_lock);
400403

404+
intel_runtime_pm_put(dev_priv);
405+
401406
return count;
402407
}
403408

@@ -433,6 +438,8 @@ static ssize_t gt_min_freq_mhz_store(struct device *kdev,
433438

434439
flush_delayed_work(&dev_priv->rps.delayed_resume_work);
435440

441+
intel_runtime_pm_get(dev_priv);
442+
436443
mutex_lock(&dev_priv->rps.hw_lock);
437444

438445
val = intel_freq_opcode(dev_priv, val);
@@ -441,6 +448,7 @@ static ssize_t gt_min_freq_mhz_store(struct device *kdev,
441448
val > dev_priv->rps.max_freq ||
442449
val > dev_priv->rps.max_freq_softlimit) {
443450
mutex_unlock(&dev_priv->rps.hw_lock);
451+
intel_runtime_pm_put(dev_priv);
444452
return -EINVAL;
445453
}
446454

@@ -457,6 +465,8 @@ static ssize_t gt_min_freq_mhz_store(struct device *kdev,
457465

458466
mutex_unlock(&dev_priv->rps.hw_lock);
459467

468+
intel_runtime_pm_put(dev_priv);
469+
460470
return count;
461471

462472
}

0 commit comments

Comments
 (0)