Hi Troy, On Fri, 25 Apr 2008 09:58:14 -0700, Troy Kisky wrote: > If an interrupt happens before an I2c master read/write, > complete is called on uninitialized structure.
I'm curious why an interrupt would happen if no transaction has been started. And even then, it seems to me that the interrupt handler should be fixed to simply do nothing if it doesn't have anything to do. Nevertheless... > > Signed-off-by: Troy Kisky <[EMAIL PROTECTED]> > Signed-off-by: Kevin Hilman <[EMAIL PROTECTED]> > --- > drivers/i2c/busses/i2c-davinci.c | 3 ++- > 1 files changed, 2 insertions(+), 1 deletions(-) > > diff --git a/drivers/i2c/busses/i2c-davinci.c > b/drivers/i2c/busses/i2c-davinci.c > index 6719cdb..7d8f1b0 100644 > --- a/drivers/i2c/busses/i2c-davinci.c > +++ b/drivers/i2c/busses/i2c-davinci.c > @@ -262,7 +262,7 @@ i2c_davinci_xfer_msg(struct i2c_adapter *adap, struct > i2c_msg *msg, int stop) > > davinci_i2c_write_reg(dev, DAVINCI_I2C_CNT_REG, dev->buf_len); > > - init_completion(&dev->cmd_complete); > + INIT_COMPLETION(dev->cmd_complete); > dev->cmd_err = 0; > > /* Take I2C out of reset, configure it as master and set the > @@ -518,6 +518,7 @@ static int davinci_i2c_probe(struct platform_device *pdev) > goto err_release_region; > } > > + init_completion(&dev->cmd_complete); > dev->dev = get_device(&pdev->dev); > dev->irq = irq->start; > platform_set_drvdata(pdev, dev); ... this patch is good to have from a performance point of view, so I'll apply it. -- Jean Delvare _______________________________________________ i2c mailing list [email protected] http://lists.lm-sensors.org/mailman/listinfo/i2c
