[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <BYAPR12MB33986390C45475180381713FC2980@BYAPR12MB3398.namprd12.prod.outlook.com>
Date: Tue, 22 Jan 2019 23:26:08 +0000
From: Sowjanya Komatineni <skomatineni@...dia.com>
To: Dmitry Osipenko <digetx@...il.com>
CC: "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>,
"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 V3] i2c: tegra: Add Bus Clear Master Support
>> >> + 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;
>> >
>> >This changes the returned errno from -EIO to -EAGAIN for the
>> >supports_bus_clear=false case, is it okay and intentional?
>> >
>>
>> Yes EAGAIN is intentional to allow for transfer retry.
>> During single master mode, ARBITRATION LOST notification happens when
>> 1. I2C Master sees the bus is occupied by some other device when a
>> transfer is initiated 2. I2C Master lost the bus during arbitration
>> incase if slave device pulls SDA line low continuously for some
>> unknown reason If arbitration lost is due to cause 1, retry helps to
>> continue with transfer once bus is released by the slave and it just
>> added delay in communication due to bus release delay by slave. In
>> case of 2nd cause, retry never succeeds in cases where bus clear is
>> not supported.
>
>It's unclear whether the "never succeeds retry" may fail with the EAGAIN, causing an endless retry-loop. Could you please clarify this moment?
during master transmit mode, on arbitration lost and if master doesn’t support bus clear to recover then transfer will return EAGAIN.
I2c core base driver performs retries if return code from i2c_transfer is EAGAIN up to specified retries in i2c adapter and returns the ret code from the last retry.
Retry is not endless as i2c core base performs retry only up to specified adapter retries.
Following return code from documentation
https://www.kernel.org/doc/Documentation/i2c/fault-codes
Powered by blists - more mailing lists