1 From 7239872fb3400b21a8f5547257f9f86455867bd6 Mon Sep 17 00:00:00 2001
2 From: Abhishek Sahu <absahu@codeaurora.org>
3 Date: Mon, 12 Mar 2018 18:44:51 +0530
4 Subject: [PATCH 02/13] i2c: qup: fixed releasing dma without flush operation
7 Content-Type: text/plain; charset=UTF-8
8 Content-Transfer-Encoding: 8bit
10 The QUP BSLP BAM generates the following error sometimes if the
11 current I2C DMA transfer fails and the flush operation has been
14 “bam-dma-engine 7884000.dma: Cannot free busy channel”
16 If any I2C error comes during BAM DMA transfer, then the QUP I2C
17 interrupt will be generated and the flush operation will be
18 carried out to make I2C consume all scheduled DMA transfer.
19 Currently, the same completion structure is being used for BAM
20 transfer which has already completed without reinit. It will make
21 flush operation wait_for_completion_timeout completed immediately
22 and will proceed for freeing the DMA resources where the
23 descriptors are still in process.
25 Signed-off-by: Abhishek Sahu <absahu@codeaurora.org>
26 Acked-by: Sricharan R <sricharan@codeaurora.org>
27 Reviewed-by: Austin Christ <austinwc@codeaurora.org>
28 Reviewed-by: Andy Gross <andy.gross@linaro.org>
29 Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
31 drivers/i2c/busses/i2c-qup.c | 2 ++
32 1 file changed, 2 insertions(+)
34 --- a/drivers/i2c/busses/i2c-qup.c
35 +++ b/drivers/i2c/busses/i2c-qup.c
36 @@ -835,6 +835,8 @@ static int qup_i2c_bam_do_xfer(struct qu
39 if (ret || qup->bus_err || qup->qup_err) {
40 + reinit_completion(&qup->xfer);
42 if (qup_i2c_change_state(qup, QUP_RUN_STATE)) {
43 dev_err(qup->dev, "change to run state timed out");