mutex_lock in designware-i2c
Hi, baruch
I found a mutex lock in dw_i2c_dev for each adapter,
struct dw_i2c_dev {
struct device *dev;
void __iomem *base;
struct completion cmd_complete;
struct mutex lock;
struct clk *clk;but there is another lock: adapter->bus_lock, this lock is also for each adapter, why we need both of them ?
Regards,
Rongrong
Hi Rongrong Zou,
Quoted 10 lines · Rongrong Zou
I found a mutex lock in
dw_i2c_devfor each adapter,struct dw_i2c_dev { struct device *dev; void __iomem *base; struct completion cmd_complete; struct mutex lock; struct clk *clk;but there is another lock:
adapter->bus_lock, this lock is also for each adapter, why we need both of them ?
As far as I can see from the code the master_xfer callback is never called concurrently for the same adaptor. So indeed the internal lock looks redundant. I can't remember why I put it there.
baruch
Signature · 3 lines
http://baruch.siach.name/blog/ ~. .~ Tk Open Systems
=}------------------------------------------------ooO--U--Ooo------------{=
- [email protected] - tel: +972.2.679.5364, http://www.tkos.co.il -