OSDN Git Service

i2c: xiic: Make the start and the byte count write atomic
authorShubhrajyoti Datta <shubhrajyoti.datta@xilinx.com>
Mon, 3 Sep 2018 09:41:11 +0000 (15:11 +0530)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 19 Sep 2018 20:48:55 +0000 (22:48 +0200)
commitad53f98feee72e1805a02b78022919ef5a998b58
tree97b90756a58cccd10f267fdb9b92e09fa241dd71
parentc40a7b3592b3b7519eadc130c5583db2aaf70f68
i2c: xiic: Make the start and the byte count write atomic

commit ae7304c3ea28a3ba47a7a8312c76c654ef24967e upstream.

Disable interrupts while configuring the transfer and enable them back.

We have below as the programming sequence
1. start and slave address
2. byte count and stop

In some customer platform there was a lot of interrupts between 1 and 2
and after slave address (around 7 clock cyles) if 2 is not executed
then the transaction is nacked.

To fix this case make the 2 writes atomic.

Signed-off-by: Shubhrajyoti Datta <shubhrajyoti.datta@xilinx.com>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
[wsa: added a newline for better readability]
Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
Cc: stable@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/i2c/busses/i2c-xiic.c