drm/i915: Fix race condition in accessing GMBUS
authorYufeng Shen <miletus@chromium.org>
Mon, 13 Feb 2012 22:36:54 +0000 (17:36 -0500)
committerDaniel Vetter <daniel.vetter@ffwll.ch>
Tue, 14 Feb 2012 09:39:53 +0000 (10:39 +0100)
commit8a8ed1f5143b3df312e436ab15290e4a7ca6a559
tree90067c14702ee364b47c551d1467508329521f28
parentb1d7e4b41fd0f72ea8149056778db5d737739305
drm/i915: Fix race condition in accessing GMBUS

GMBUS has several ports and each has it's own corresponding
I2C adpater. When multiple I2C adapters call gmbus_xfer() at
the same time there is a race condition in using the underlying
GMBUS controller. Fixing this by adding a mutex lock when calling
gmbus_xfer().

v2: Moved gmbus_mutex below intel_gmbus and added comments.
Rebased to drm-intel-next-queued.

Signed-off-by: Yufeng Shen <miletus@chromium.org>
[danvet: Shortened the gmbus_mutex comment a bit and add the patch
revision comment to the commit message.]
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
drivers/gpu/drm/i915/i915_drv.h
drivers/gpu/drm/i915/intel_i2c.c