[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <BYAPR12MB3398C3E7C5842C698B5CA1CCC2910@BYAPR12MB3398.namprd12.prod.outlook.com>
Date: Thu, 31 Jan 2019 03:34:59 +0000
From: Sowjanya Komatineni <skomatineni@...dia.com>
To: Dmitry Osipenko <digetx@...il.com>,
"thierry.reding@...il.com" <thierry.reding@...il.com>,
Jonathan Hunter <jonathanh@...dia.com>,
Mantravadi Karthik <mkarthik@...dia.com>,
Shardar Mohammed <smohammed@...dia.com>,
Timo Alho <talho@...dia.com>
CC: "linux-tegra@...r.kernel.org" <linux-tegra@...r.kernel.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
"linux-i2c@...r.kernel.org" <linux-i2c@...r.kernel.org>
Subject: RE: [PATCH V7 3/5] i2c: tegra: Add DMA Support
> I2C_INT_ALL_PACKETS_XFER_COMPLETE shall be masked for the PIO mode
> I2C_INT_PACKET_XFER_COMPLETE shall be masked for the DMA mode, if I'm not missing something.
>
for packets with repeated start or continue xfer, PACKET_XFER_COMPLETE will be triggers
for packets with stop bit, both PACKET_XFER_COMPLETE and ALL_PACKET_XFER_COMPLETE will be triggered.
To be align with what PIO mode is doing, will not use ALL_PACKETS_XFER_COMPLETE for DMA in next version.
>
> Handle the error-case here:
>
> if (i2c_dev->msg_err != I2C_ERR_NONE) {
> dev_err(i2c_dev->dev, "i2c dma transfer failed\n");
> goto i2c_recover;
> }
>
>...
> <--- end of tegra_i2c_xfer_msg() -->
>
> if (likely(i2c_dev->msg_err == I2C_ERR_NONE))
> return 0;
>
> i2c_recover:
> tegra_i2c_init(i2c_dev);
> /* start recovery upon arbitration loss in single master mode */
> if (i2c_dev->msg_err == I2C_ERR_ARBITRATION_LOST) {
> if (!i2c_dev->is_multimaster_mode)
> return tegra_i2c_issue_bus_clear(i2c_dev);
> return -EAGAIN;
> }
> if (i2c_dev->msg_err == I2C_ERR_NO_ACK) {
> if (msg->flags & I2C_M_IGNORE_NAK)
> return 0;
> return -EREMOTEIO;
> }
>
> return -EIO;
When DMA transfer timeout, no need to check for ARB LOST or NO_ACK as if any of those interrupts trigger interrupt handler will terminate dmaengine and completes so DMA timeout will not be seen in those cases and falls thru msg_err check
Powered by blists - more mailing lists