Linux-ARM-Kernel Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] i2c: at91: fix TXRDY interrupt spam
@ 2019-04-19 13:26 Raag Jadav
  2019-04-19 18:29 ` Wolfram Sang
  0 siblings, 1 reply; 2+ messages in thread
From: Raag Jadav @ 2019-04-19 13:26 UTC (permalink / raw)
  Cc: Alexandre Belloni, linux-kernel@vger.kernel.org,
	Ludovic Desroches, linux-i2c@vger.kernel.org, Raag Jadav,
	linux-arm-kernel@lists.infradead.org

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 ac
 cepts no liability for any damage caused by any virus transmitted by this email. *************************************************************************************************************************************************************
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2019-04-19 18:29 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-04-19 13:26 [PATCH] i2c: at91: fix TXRDY interrupt spam Raag Jadav
2019-04-19 18:29 ` Wolfram Sang

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox