From: Jisheng Zhang <jszhang@marvell.com>
To: <andriy.shevchenko@linux.intel.com>,
<jarkko.nikula@linux.intel.com>,
<mika.westerberg@linux.intel.com>, <wsa@the-dreams.de>
Cc: <linux-i2c@vger.kernel.org>, <linux-kernel@vger.kernel.org>,
<linux-arm-kernel@lists.infradead.org>,
Jisheng Zhang <jszhang@marvell.com>
Subject: [PATCH] i2c: designware: Don't mask TX_EMPTY if write is in progress
Date: Fri, 30 Oct 2015 15:37:29 +0800 [thread overview]
Message-ID: <1446190649-1318-1-git-send-email-jszhang@marvell.com> (raw)
Currently when i2c_msg index search is completed, TX_EMPTY interrupt
will be masked. But if the size of i2c_msg data is longer than the size
of the tx buffer, we still need TX_EMPTY interrupt, otherwise we will
get "controller timed out" error.
This patch fixes this issue by only masking TX_EMPTY if i2c_msg index
search is completed and write is not in progress.
Signed-off-by: Jisheng Zhang <jszhang@marvell.com>
---
drivers/i2c/busses/i2c-designware-core.c | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/drivers/i2c/busses/i2c-designware-core.c b/drivers/i2c/busses/i2c-designware-core.c
index 7441cdc..a2eb212 100644
--- a/drivers/i2c/busses/i2c-designware-core.c
+++ b/drivers/i2c/busses/i2c-designware-core.c
@@ -542,10 +542,11 @@ i2c_dw_xfer_msg(struct dw_i2c_dev *dev)
}
/*
- * If i2c_msg index search is completed, we don't need TX_EMPTY
- * interrupt any more.
+ * If i2c_msg index search is completed and writing is not in progress,
+ * we don't need TX_EMPTY interrupt any more.
*/
- if (dev->msg_write_idx == dev->msgs_num)
+ if (dev->msg_write_idx == dev->msgs_num &&
+ !(dev->status & STATUS_WRITE_IN_PROGRESS))
intr_mask &= ~DW_IC_INTR_TX_EMPTY;
if (dev->msg_err)
--
2.6.2
next reply other threads:[~2015-10-30 7:41 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-10-30 7:37 Jisheng Zhang [this message]
2015-10-30 12:03 ` Jarkko Nikula
2015-11-02 3:33 ` Jisheng Zhang
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1446190649-1318-1-git-send-email-jszhang@marvell.com \
--to=jszhang@marvell.com \
--cc=andriy.shevchenko@linux.intel.com \
--cc=jarkko.nikula@linux.intel.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-i2c@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mika.westerberg@linux.intel.com \
--cc=wsa@the-dreams.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®