linux-kernel.vger.kernel.org archive mirror
 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: Raag Jadav, Ludovic Desroches, Nicolas Ferre, Alexandre Belloni,
	linux-i2c, linux-arm-kernel, linux-kernel

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. *************************************************************************************************************************************************************

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

* Re: [PATCH] i2c: at91: fix TXRDY interrupt spam
  2019-04-19 13:26 [PATCH] i2c: at91: fix TXRDY interrupt spam Raag Jadav
@ 2019-04-19 18:29 ` Wolfram Sang
  0 siblings, 0 replies; 2+ messages in thread
From: Wolfram Sang @ 2019-04-19 18:29 UTC (permalink / raw)
  To: Raag Jadav
  Cc: Ludovic Desroches, Nicolas Ferre, Alexandre Belloni, linux-i2c,
	linux-arm-kernel, linux-kernel

[-- Attachment #1: Type: text/plain, Size: 1678 bytes --]


> *************************************************************************************************************************************************************
> 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.
> *************************************************************************************************************************************************************

Your patch might be correct, but as a general rule we do not accept it
with a disclaimer like this. I mean we spread your patch all over the
world if it is accepted :) Could you ask your company to drop the
disclaimer when employees communicate with free software projects? Or if
it is OK with them if you use another email address?

Oh, and your mail had no To: header, please use the i2c-list next time.


[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[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;
as well as URLs for NNTP newsgroup(s).