linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Raag Jadav <raag.jadav@einfochips.com>
To: unlisted-recipients:; (no To-header on input)
Cc: Raag Jadav <raag.jadav@einfochips.com>,
	Ludovic Desroches <ludovic.desroches@microchip.com>,
	Nicolas Ferre <nicolas.ferre@microchip.com>,
	Alexandre Belloni <alexandre.belloni@bootlin.com>,
	"linux-i2c@vger.kernel.org" <linux-i2c@vger.kernel.org>,
	"linux-arm-kernel@lists.infradead.org" 
	<linux-arm-kernel@lists.infradead.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: [PATCH] i2c: at91: fix TXRDY interrupt spam
Date: Fri, 19 Apr 2019 13:26:53 +0000	[thread overview]
Message-ID: <1555680298-518-1-git-send-email-raag.jadav@einfochips.com> (raw)

Performing i2c write operation while SDA or SCL line is grounded,
TXRDY interrupt spam hangs the processor, not allowing to boot.

Signed-off-by: raag <raag.jadav@einfochips.com>
---
 drivers/i2c/busses/i2c-at91.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/i2c/busses/i2c-at91.c b/drivers/i2c/busses/i2c-at91.c
index bfd1fdf..47b5e8a 100644
--- a/drivers/i2c/busses/i2c-at91.c
+++ b/drivers/i2c/busses/i2c-at91.c
@@ -270,9 +270,11 @@ static void at91_twi_write_next_byte(struct at91_twi_dev *dev)
 writeb_relaxed(*dev->buf, dev->base + AT91_TWI_THR);

 /* send stop when last byte has been written */
-if (--dev->buf_len == 0)
+if (--dev->buf_len == 0) {
 if (!dev->use_alt_cmd)
 at91_twi_write(dev, AT91_TWI_CR, AT91_TWI_STOP);
+at91_twi_write(dev, AT91_TWI_IDR, AT91_TWI_TXRDY);
+}

 dev_dbg(dev->dev, "wrote 0x%x, to go %zu\n", *dev->buf, dev->buf_len);

--
2.7.4

************************************************************************************************************************************************************* eInfochips Business Disclaimer: This e-mail message and all attachments transmitted with it are intended solely for the use of the addressee and may contain legally privileged and confidential information. If the reader of this message is not the intended recipient, or an employee or agent responsible for delivering this message to the intended recipient, you are hereby notified that any dissemination, distribution, copying, or other use of this message or its attachments is strictly prohibited. If you have received this message in error, please notify the sender immediately by replying to this message and please delete it from your computer. Any views expressed in this message are those of the individual sender unless otherwise stated. Company has taken enough precautions to prevent the spread of viruses. However the company accepts no liability for any damage caused by any virus transmitted by this email. *************************************************************************************************************************************************************

             reply	other threads:[~2019-04-19 18:16 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-04-19 13:26 Raag Jadav [this message]
2019-04-19 18:29 ` [PATCH] i2c: at91: fix TXRDY interrupt spam Wolfram Sang

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=1555680298-518-1-git-send-email-raag.jadav@einfochips.com \
    --to=raag.jadav@einfochips.com \
    --cc=alexandre.belloni@bootlin.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-i2c@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=ludovic.desroches@microchip.com \
    --cc=nicolas.ferre@microchip.com \
    /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;
as well as URLs for NNTP newsgroup(s).