i2c: xiic: Do not continue in case of errors in Rx
authorShubhrajyoti Datta <shubhraj@xilinx.com>
Wed, 17 Jun 2015 15:18:19 +0000 (20:48 +0530)
committerWolfram Sang <wsa@the-dreams.de>
Mon, 10 Aug 2015 06:37:33 +0000 (08:37 +0200)
In case of error conditions like Arbitration lost or NACK lets signal
the waiting process.

Handle error cases in the Rx path

Signed-off-by: Shubhrajyoti Datta <shubhraj@xilinx.com>
Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
drivers/i2c/busses/i2c-xiic.c

index 987a18c8b6e338f86878aa3e0dd1b1f3ad75e2b3..e23a7b068c601906bb1b245d637b0413c2b2c29f 100644 (file)
@@ -399,6 +399,8 @@ static irqreturn_t xiic_process(int irq, void *dev_id)
                 */
                xiic_reinit(i2c);
 
+               if (i2c->rx_msg)
+                       xiic_wakeup(i2c, STATE_ERROR);
                if (i2c->tx_msg)
                        xiic_wakeup(i2c, STATE_ERROR);
        }