[PATCH] [PATCH] drm/i915: Fix race condition in accessing GMBUS

2012-02-13 Thread Daniel Vetter
On Fri, Feb 10, 2012 at 12:50:01PM -0500, Yufeng Shen wrote: > 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 mut

[PATCH] [PATCH] drm/i915: Fix race condition in accessing GMBUS

2012-02-13 Thread Yufeng Shen
Hi Ben, So I2C core does protect multiple access to one adapter, but I2C core does not protect the case where multiple adapters share the same underlying device. GMBUS has 7 different pin pairs and each pair is registered as an I2C adapter. I2C core can serialize the access to one pin pair, say t

Re: [PATCH] [PATCH] drm/i915: Fix race condition in accessing GMBUS

2012-02-13 Thread Yufeng Shen
Hi Ben, So I2C core does protect multiple access to one adapter, but I2C core does not protect the case where multiple adapters share the same underlying device. GMBUS has 7 different pin pairs and each pair is registered as an I2C adapter. I2C core can serialize the access to one pin pair, say t

Re: [PATCH] [PATCH] drm/i915: Fix race condition in accessing GMBUS

2012-02-13 Thread Daniel Vetter
On Fri, Feb 10, 2012 at 12:50:01PM -0500, Yufeng Shen wrote: > 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 mut

[PATCH] [PATCH] drm/i915: Fix race condition in accessing GMBUS

2012-02-13 Thread Ben Widawsky
On Fri, Feb 10, 2012 at 12:50:01PM -0500, Yufeng Shen wrote: > 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 mut

Re: [PATCH] [PATCH] drm/i915: Fix race condition in accessing GMBUS

2012-02-13 Thread Ben Widawsky
On Fri, Feb 10, 2012 at 12:50:01PM -0500, Yufeng Shen wrote: > 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 mut

[PATCH] [PATCH] drm/i915: Fix race condition in accessing GMBUS

2012-02-11 Thread Yufeng Shen
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(). Signed-off-by: Yufeng Shen ---

[PATCH] [PATCH] drm/i915: Fix race condition in accessing GMBUS

2012-02-10 Thread Yufeng Shen
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(). Signed-off-by: Yufeng Shen ---