drm/i915: Mark up Ironlake ips with rpm wakerefs
authorChris Wilson <chris@chris-wilson.co.uk>
Mon, 14 Jan 2019 14:21:29 +0000 (14:21 +0000)
committerChris Wilson <chris@chris-wilson.co.uk>
Mon, 14 Jan 2019 16:18:44 +0000 (16:18 +0000)
commit4a8ab5ea0cde753b03bfefe4c98a8c4c61f46550
treef1f2439723d1874803534d662efac8e1a5075f69
parent8d761e773e29f4be5c6aae50f57262afb2b83db4
drm/i915: Mark up Ironlake ips with rpm wakerefs

Currently Ironlake operates under the assumption that rpm awake (and its
error checking is disabled). As such, we have missed a few places where we
access registers without taking the rpm wakeref and thus trigger
warnings. intel_ips being one culprit.

As this involved adding a potentially sleeping rpm_get, we have to
rearrange the spinlocks slightly and so switch to acquiring a device-ref
under the spinlock rather than hold the spinlock for the whole
operation. To be consistent, we make the change in pattern common to the
intel_ips interface even though this adds a few more atomic operations
than necessary in a few cases.

v2: Sagar noted the mb around setting mch_dev were overkill as we only
need ordering there, and that i915_emon_status was still using
struct_mutex for no reason, but lacked rpm.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Jani Nikula <jani.nikula@intel.com>
Reviewed-by: John Harrison <John.C.Harrison@Intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20190114142129.24398-21-chris@chris-wilson.co.uk
drivers/gpu/drm/i915/i915_debugfs.c
drivers/gpu/drm/i915/i915_drv.c
drivers/gpu/drm/i915/intel_pm.c