Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

i2c: mxs: disable QUEUE when sending is done

Since the last fixes to this driver ensure now the queue termination is
done correctly, we can finally disable the queue after a transfer
without problems. The gain is that it will only be reenabled after the
next transfer is fully set up. Before, the queue was running all the
time and if the setup of the next message was interrupted by another
thread, an incomplete buffer could have been sent, padded with zeroes.

Signed-off-by: Wolfram Sang <w.sang@pengutronix.de>
  • Loading branch information...
commit 1e4f0b82577e59f23484c99056c96465e202fdd5 1 parent c95eeae
Wolfram Sang authored

Showing 1 changed file with 3 additions and 2 deletions. Show diff stats Hide diff stats

  1. +3 2 drivers/i2c/busses/i2c-mxs.c
5 drivers/i2c/busses/i2c-mxs.c
@@ -253,6 +253,9 @@ static int mxs_i2c_xfer_msg(struct i2c_adapter *adap, struct i2c_msg *msg,
253 253
254 254 if (i2c->cmd_err == -ENXIO)
255 255 mxs_i2c_reset(i2c);
  256 + else
  257 + writel(MXS_I2C_QUEUECTRL_QUEUE_RUN,
  258 + i2c->regs + MXS_I2C_QUEUECTRL_CLR);
256 259
257 260 dev_dbg(i2c->dev, "Done with err=%d\n", i2c->cmd_err);
258 261
@@ -383,8 +386,6 @@ static int __devexit mxs_i2c_remove(struct platform_device *pdev)
383 386 if (ret)
384 387 return -EBUSY;
385 388
386   - writel(MXS_I2C_QUEUECTRL_QUEUE_RUN,
387   - i2c->regs + MXS_I2C_QUEUECTRL_CLR);
388 389 writel(MXS_I2C_CTRL0_SFTRST, i2c->regs + MXS_I2C_CTRL0_SET);
389 390
390 391 platform_set_drvdata(pdev, NULL);

0 comments on commit 1e4f0b8

Please sign in to comment.
Something went wrong with that request. Please try again.