25d0366ec6a79d7bf8c5522a0f51ac12ee24d931
[openwrt/staging/luka.git] /
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
5 completion
6 MIME-Version: 1.0
7 Content-Type: text/plain; charset=UTF-8
8 Content-Transfer-Encoding: 8bit
9
10 The QUP BSLP BAM generates the following error sometimes if the
11 current I2C DMA transfer fails and the flush operation has been
12 scheduled
13
14 “bam-dma-engine 7884000.dma: Cannot free busy channel”
15
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.
24
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>
30 ---
31 drivers/i2c/busses/i2c-qup.c | 2 ++
32 1 file changed, 2 insertions(+)
33
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
37 }
38
39 if (ret || qup->bus_err || qup->qup_err) {
40 + reinit_completion(&qup->xfer);
41 +
42 if (qup_i2c_change_state(qup, QUP_RUN_STATE)) {
43 dev_err(qup->dev, "change to run state timed out");
44 goto desc_err;