drm/i915: Rework sdvo proxy i2c locking
authorDaniel Vetter <daniel.vetter@ffwll.ch>
Wed, 26 Jul 2017 13:26:47 +0000 (15:26 +0200)
committerDaniel Vetter <daniel.vetter@ffwll.ch>
Thu, 27 Jul 2017 08:05:48 +0000 (10:05 +0200)
commita85066840d29fc68d95ce7dbd6bcf15ef2775d66
tree86c0619b327a1c103444d8ed2f646be347684a57
parent8fb6a5df4612757d6aa4218750aa3ecaca609bd0
drm/i915: Rework sdvo proxy i2c locking

lockdep complaints about a locking recursion for the i2c bus lock
because both the sdvo ddc proxy bus and the gmbus nested within use
the same locking class. It's not really a deadlock since we never nest
the other way round, but it's annoying.

Fix it by pulling the gmbus locking into the i2c lock_ops for both
i2c_adapater and making sure that the ddc_proxy_xfer function is
entirely lockless.

Re-layouting the extracted function resulted in some whitespace
cleanups, I figured we might as well keep them.

v2: Review from Chris:
- s/locked/unlocked/ since I got the naming backwards
- Use the vfuncs of the proxied adatper instead of re-rolling copies.
  That's more consistent with the other proxying we're doing.

Cc: Chris Wilson <chris@chris-wilson.co.uk>
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20170726132647.31833-1-daniel.vetter@ffwll.ch
drivers/gpu/drm/i915/intel_i2c.c
drivers/gpu/drm/i915/intel_sdvo.c