]> git.baikalelectronics.ru Git - kernel.git/commit
drm/i915: rework locking for intel_dpio|sbi_read|write
authorDaniel Vetter <daniel.vetter@ffwll.ch>
Wed, 12 Dec 2012 13:06:44 +0000 (14:06 +0100)
committerDaniel Vetter <daniel.vetter@ffwll.ch>
Wed, 12 Dec 2012 21:59:24 +0000 (22:59 +0100)
commitb76d2fb491db76c938cd6a9452c6bd02e5249581
treeafb797432fbb708cc2d7bdc7e18196c078ffb9e6
parent060be3579413f9d329747726c3f0ba78a728cb34
drm/i915: rework locking for intel_dpio|sbi_read|write

Spinning for up to 200 us with interrupts locked out is not good. So
let's just spin (and even that seems to be excessive).

And we don't call these functions from interrupt context, so this is
not required. Besides that doing anything in interrupt contexts which
might take a few hundred us is a no-go. So just convert the entire
thing to a mutex. Also move the mutex-grabbing out of the read/write
functions (add a WARN_ON(!is_locked)) instead) since all callers are
nicely grouped together.

Finally the real motivation for this change: Dont grab the modeset
mutex in the dpio debugfs file, we don't need that consistency. And
correctness of the dpio interface is ensured with the dpio_lock.

Reviewed-by: Jesse Barnes <jbarnes@virtuousgeek.org>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
drivers/gpu/drm/i915/i915_debugfs.c
drivers/gpu/drm/i915/i915_dma.c
drivers/gpu/drm/i915/i915_drv.h
drivers/gpu/drm/i915/intel_display.c