Re: [PATCH v6] drm/i915/pmu: Use GT parked for estimating RC6 while asleep

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Quoting Chris Wilson (2019-09-12 11:41:31)
> +       spin_lock_irqsave(&pmu->lock, flags);
> +       if (intel_gt_pm_get_if_awake(gt)) {
> +               val = __get_rc6(gt);
> +               intel_gt_pm_put(gt);

As food for thought, what about

val = 0;
if (intel_gt_pm_get_if_awake(gt)) {
	val = __get_rc6(gt);
	intel_gt_pm_put(gt);
}

spin_lock_irqsave(&pmu->lock, flags);
if (val) {
> +
> +               /*
> +                * If we are coming back from being runtime suspended we must
> +                * be careful not to report a larger value than returned
> +                * previously.
> +                */
> +               val = __pmu_update_rc6(pmu, val);
> +       } else {
> +               /*
> +                * We are runtime suspended.
> +                *
> +                * Report the delta from when the device was suspended to now,
> +                * on top of the last known real value, as the approximated RC6
> +                * counter value.
> +                */
> +               val = __pmu_estimate_rc6(pmu);
> +       }
> +
> +       spin_unlock_irqrestore(&pmu->lock, flags);
> +
> +       return val;
> +}

Just feels riskier... But we can try and sleep on it.
-Chris
_______________________________________________
Intel-gfx mailing list
Intel-gfx@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/intel-gfx




[Index of Archives]     [AMD Graphics]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux