[Intel-gfx] [PATCH] drm/i915: Rename __force_wake_get to __force_wake_auto

Dave Gordon david.s.gordon at intel.com
Thu Mar 24 15:12:02 UTC 2016


On 24/03/16 14:31, Chris Wilson wrote:
> __force_wake_get() only acquire a temporary wakeref on forcewake that is
> automatically releases when a timer expires. When reading the code
> again, I confused __intel_uncore_forcewake_get for __force_wake_get and
> to my shame thought I found a bug in an unbalanced wake_count handling.
>
> I claim that if the function had been called __force_wake_auto instead I
> would not have embarrassed myself.
>
> Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>
> Cc: Mika Kuoppala <mika.kuoppala at linux.intel.com>
> Cc: Tvrtko Ursulin <tvrtko.ursulin at linux.intel.com>
> ---
>   drivers/gpu/drm/i915/intel_uncore.c | 18 +++++++++---------
>   1 file changed, 9 insertions(+), 9 deletions(-)

But how does this fit with arming the timer from the put() elsewhere? 
For consistency, should we not also arm it during the put() stage of 
these combined get-access-put functions? In other words, put it into the 
GEN6_{READ,WRITE}_FOOTER macros? And could they not be structured to use 
the same underlying set of functions, i.e. get -> inc ref, write 
register if previously zero, put->if ref == 1, arm timer, else dec ref?

.Dave.


More information about the Intel-gfx mailing list