lkml.org 
[lkml]   [2012]   [Apr]   [26]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
SubjectRe: [PATCH v10 3/4] drivers/i2c/busses/i2c-at91.c: add new driver
Hi Carsten,

On Wed, 25 Apr 2012, Carsten Behling wrote:
> I cannot find the fix for the RXRDY overrun bug in this patch:

The fix refers to the bug when RXRDY flag was masked out by TXCOMP,
reported by Hubert. I hope this is fixed with v10.

[...]
> here you only report the status flags after a complete transfer, but
> an overrun can happen after every byte. After reading the status
> register after an overrun for the next byte this info will be lost !

Right, I didn't consider this. Would you mind to test if the attached
patch on top of v10 fixes your problem?

Thanks,
Niko

P.S. Are you using a RM9200? Seems that this SOC has some problems...

diff --git a/drivers/i2c/busses/i2c-at91.c b/drivers/i2c/busses/i2c-at91.c
index 97f4365..df0f6ed 100644
--- a/drivers/i2c/busses/i2c-at91.c
+++ b/drivers/i2c/busses/i2c-at91.c
@@ -186,9 +186,11 @@ static irqreturn_t atmel_twi_interrupt(int irq, void *dev_id)
else if (irqstatus & AT91_TWI_TXRDY)
at91_twi_write_next_byte(dev);

+ /* catch error flags */
+ dev->transfer_status |= status;
+
if (irqstatus & AT91_TWI_TXCOMP) {
at91_disable_twi_interrupts(dev);
- dev->transfer_status = status;
complete(&dev->cmd_complete);
}

@@ -203,6 +205,7 @@ static int at91_do_twi_transfer(struct at91_twi_dev *dev)
(dev->msg->flags & I2C_M_RD) ? "read" : "write", dev->buf_len);

INIT_COMPLETION(dev->cmd_complete);
+ dev->transfer_status = 0;
if (dev->msg->flags & I2C_M_RD) {
unsigned start_flags = AT91_TWI_START;


\
 
 \ /
  Last update: 2012-04-26 13:09    [W:0.496 / U:0.036 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site