summaryrefslogtreecommitdiffstats
path: root/drivers/i2c/busses/i2c-designware-core.c
diff options
context:
space:
mode:
authorBaruch Siach2016-01-12 14:16:35 +0100
committerWolfram Sang2016-02-12 20:40:12 +0100
commite3c97650081cbe40dfad7326aa0ab61e1e56ea23 (patch)
treec84c752d6f8735963e8c77643b42f8d410c1db69 /drivers/i2c/busses/i2c-designware-core.c
parenti2c: qup: Transfer each i2c_msg in i2c_msgs without a stop bit (diff)
downloadkernel-qcow2-linux-e3c97650081cbe40dfad7326aa0ab61e1e56ea23.tar.gz
kernel-qcow2-linux-e3c97650081cbe40dfad7326aa0ab61e1e56ea23.tar.xz
kernel-qcow2-linux-e3c97650081cbe40dfad7326aa0ab61e1e56ea23.zip
i2c: designware: remove redundant lock
The per adapter bus_lock already projects from concurrent calls to the master_xfer callback. No need to add a driver internal lock. Also, rephrase a comment to drop mention of this lock. Reported-by: Rongrong Zou <zourongrong@gmail.com> Signed-off-by: Baruch Siach <baruch@tkos.co.il> Acked-by: Mika Westerberg <mika.westerberg@linux.intel.com> Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
Diffstat (limited to 'drivers/i2c/busses/i2c-designware-core.c')
-rw-r--r--drivers/i2c/busses/i2c-designware-core.c14
1 files changed, 6 insertions, 8 deletions
diff --git a/drivers/i2c/busses/i2c-designware-core.c b/drivers/i2c/busses/i2c-designware-core.c
index 10fbd6d841e0..4255eaab96d1 100644
--- a/drivers/i2c/busses/i2c-designware-core.c
+++ b/drivers/i2c/busses/i2c-designware-core.c
@@ -634,7 +634,6 @@ i2c_dw_xfer(struct i2c_adapter *adap, struct i2c_msg msgs[], int num)
dev_dbg(dev->dev, "%s: msgs: %d\n", __func__, num);
- mutex_lock(&dev->lock);
pm_runtime_get_sync(dev->dev);
reinit_completion(&dev->cmd_complete);
@@ -673,11 +672,12 @@ i2c_dw_xfer(struct i2c_adapter *adap, struct i2c_msg msgs[], int num)
}
/*
- * We must disable the adapter before unlocking the &dev->lock mutex
- * below. Otherwise the hardware might continue generating interrupts
- * which in turn causes a race condition with the following transfer.
- * Needs some more investigation if the additional interrupts are
- * a hardware bug or this driver doesn't handle them correctly yet.
+ * We must disable the adapter before returning and signaling the end
+ * of the current transfer. Otherwise the hardware might continue
+ * generating interrupts which in turn causes a race condition with
+ * the following transfer. Needs some more investigation if the
+ * additional interrupts are a hardware bug or this driver doesn't
+ * handle them correctly yet.
*/
__i2c_dw_enable(dev, false);
@@ -706,7 +706,6 @@ done:
done_nolock:
pm_runtime_mark_last_busy(dev->dev);
pm_runtime_put_autosuspend(dev->dev);
- mutex_unlock(&dev->lock);
return ret;
}
@@ -860,7 +859,6 @@ int i2c_dw_probe(struct dw_i2c_dev *dev)
int r;
init_completion(&dev->cmd_complete);
- mutex_init(&dev->lock);
r = i2c_dw_init(dev);
if (r)