drm/i915: Fix forcewake counts for gen8
authorMika Kuoppala <mika.kuoppala@linux.intel.com>
Tue, 18 Feb 2014 17:10:24 +0000 (19:10 +0200)
committerDaniel Vetter <daniel.vetter@ffwll.ch>
Wed, 5 Mar 2014 20:30:09 +0000 (21:30 +0100)
commite9dbd2b20201b49b04476d2e5763faa822967913
treee03f0f6fea3e2ddf2507992b7743ccbbedd4c212
parent93c73e8c6eae891f73e39fb4bad19f996d3a8c1f
drm/i915: Fix forcewake counts for gen8

Sometimes generic driver code gets forcewake explicitly by
gen6_gt_force_wake_get(), which check forcewake_count before accessing
hardware. However the register access with gen8_write function access
low level hw accessors directly, ignoring the forcewake_count. This
leads to nested forcewake get from hardware, in ring init and possibly
elsewhere, causing forcewake ack clear errors and/or hangs.

Fix this by checking the forcewake count also in gen8_write

v2: Read side doesn't care about shadowed registers,
    Remove __needs_put funkiness from gen8_write. (Ville)
    Improved commit message.

References: https://bugs.freedesktop.org/show_bug.cgi?id=74007
Signed-off-by: Mika Kuoppala <mika.kuoppala@intel.com>
Cc: Ben Widawsky <benjamin.widawsky@intel.com>
Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
Signed-off-by: Mika Kuoppala <mika.kuoppala@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
drivers/gpu/drm/i915/intel_uncore.c