Hello, Ben, Are you going to integrate Marvel's i2c patches dated March 31 to the kernel tree? Thank you for your help Konstantin On Thu, Mar 31, 2011 at 5:40 PM, Konstantin Porotchkin <kostap@xxxxxxxxxxx> wrote: > Eliminate erroneus data send in combined access mode when INT > is cleared in i2c controller. Instead disable INT delivery to CPU > and re-enable it on the next START. > > Signed-off-by: Konstantin Porotchkin <kostap@xxxxxxxxxxx> > --- > Âdrivers/i2c/busses/i2c-mv64xxx.c |  19 +++++++++++++++---- > Â1 files changed, 15 insertions(+), 4 deletions(-) > > diff --git a/drivers/i2c/busses/i2c-mv64xxx.c b/drivers/i2c/busses/i2c-mv64xxx.c > index a9941c6..d013e25 100644 > --- a/drivers/i2c/busses/i2c-mv64xxx.c > +++ b/drivers/i2c/busses/i2c-mv64xxx.c > @@ -15,6 +15,7 @@ > Â#include <linux/spinlock.h> > Â#include <linux/i2c.h> > Â#include <linux/interrupt.h> > +#include <linux/delay.h> > Â#include <linux/mv643xx_i2c.h> > Â#include <linux/platform_device.h> > Â#include <linux/io.h> > @@ -98,6 +99,7 @@ struct mv64xxx_i2c_data { >    Âint           rc; >    Âu32           freq_m; >    Âu32           freq_n; > +    int           irq_disabled; >    Âwait_queue_head_t    waitq; >    Âspinlock_t       Âlock; >    Âstruct i2c_msg     Â*msg; > @@ -239,10 +241,11 @@ mv64xxx_i2c_do_action(struct mv64xxx_i2c_data *drv_data) > Â{ >    Âswitch(drv_data->action) { >    Âcase MV64XXX_I2C_ACTION_SEND_RESTART: > -        drv_data->cntl_bits |= MV64XXX_I2C_REG_CONTROL_START; > -        drv_data->cntl_bits &= ~MV64XXX_I2C_REG_CONTROL_INTEN; > -        writel(drv_data->cntl_bits, > -            drv_data->reg_base + MV64XXX_I2C_REG_CONTROL); > +        /* can't mask interrupts by clearing the INTEN as this > +        Â* triggers the controller to send the data. > +        Â*/ > +        drv_data->irq_disabled = 1; > +        disable_irq_nosync(drv_data->irq); >        Âdrv_data->block = 0; >        Âwake_up_interruptible(&drv_data->waitq); >        Âbreak; > @@ -255,6 +258,11 @@ mv64xxx_i2c_do_action(struct mv64xxx_i2c_data *drv_data) >    Âcase MV64XXX_I2C_ACTION_SEND_START: >        Âwritel(drv_data->cntl_bits | MV64XXX_I2C_REG_CONTROL_START, >            Âdrv_data->reg_base + MV64XXX_I2C_REG_CONTROL); > +        if (drv_data->irq_disabled) { > +            udelay(3); > +            drv_data->irq_disabled = 0; > +            enable_irq(drv_data->irq); > +        } >        Âbreak; > >    Âcase MV64XXX_I2C_ACTION_SEND_ADDR_1: > @@ -327,6 +335,8 @@ mv64xxx_i2c_intr(int irq, void *dev_id) >        Âmv64xxx_i2c_fsm(drv_data, status); >        Âmv64xxx_i2c_do_action(drv_data); >        Ârc = IRQ_HANDLED; > +        if (drv_data->state == MV64XXX_I2C_STATE_WAITING_FOR_RESTART) > +            break; >    Â} >    Âspin_unlock_irqrestore(&drv_data->lock, flags); > > @@ -553,6 +563,7 @@ mv64xxx_i2c_probe(struct platform_device *pd) >        Ârc = -ENXIO; >        Âgoto exit_unmap_regs; >    Â} > +    drv_data->irq_disabled = 0; >    Âdrv_data->adapter.dev.parent = &pd->dev; >    Âdrv_data->adapter.algo = &mv64xxx_i2c_algo; >    Âdrv_data->adapter.owner = THIS_MODULE; > -- > 1.7.4.1 > > -- > To unsubscribe from this list: send the line "unsubscribe linux-i2c" in > the body of a message to majordomo@xxxxxxxxxxxxxxx > More majordomo info at Âhttp://vger.kernel.org/majordomo-info.html > -- To unsubscribe from this list: send the line "unsubscribe linux-i2c" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html