From: Dmitry Osipenko <digetx@gmail.com>
To: Sowjanya Komatineni <skomatineni@nvidia.com>
Cc: "thierry.reding@gmail.com" <thierry.reding@gmail.com>,
Jonathan Hunter <jonathanh@nvidia.com>,
Mantravadi Karthik <mkarthik@nvidia.com>,
Shardar Mohammed <smohammed@nvidia.com>,
Timo Alho <talho@nvidia.com>,
"linux-tegra@vger.kernel.org" <linux-tegra@vger.kernel.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"linux-i2c@vger.kernel.org" <linux-i2c@vger.kernel.org>
Subject: Re: [PATCH V3] i2c: tegra: Add Bus Clear Master Support
Date: Wed, 23 Jan 2019 16:17:19 +0300 [thread overview]
Message-ID: <783993ec-6d88-9a84-b1bd-cd44d45e2584@gmail.com> (raw)
In-Reply-To: <BYAPR12MB33986390C45475180381713FC2980@BYAPR12MB3398.namprd12.prod.outlook.com>
23.01.2019 2:26, Sowjanya Komatineni пишет:
>
>
>>>>> + 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
>
>
Could you please point at the code that sets the number of retries for the Tegra's I2C? Looks it is always 0 and hence EAGAIN won't do anything useful.
prev parent reply other threads:[~2019-01-23 13:17 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-01-22 20:02 [PATCH V3] i2c: tegra: Add Bus Clear Master Support Sowjanya Komatineni
2019-01-22 20:12 ` Dmitry Osipenko
2019-01-22 22:13 ` Sowjanya Komatineni
2019-01-22 22:40 ` Dmitry Osipenko
2019-01-22 23:26 ` Sowjanya Komatineni
2019-01-22 23:39 ` Dmitry Osipenko
2019-01-23 13:17 ` Dmitry Osipenko [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=783993ec-6d88-9a84-b1bd-cd44d45e2584@gmail.com \
--to=digetx@gmail.com \
--cc=jonathanh@nvidia.com \
--cc=linux-i2c@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-tegra@vger.kernel.org \
--cc=mkarthik@nvidia.com \
--cc=skomatineni@nvidia.com \
--cc=smohammed@nvidia.com \
--cc=talho@nvidia.com \
--cc=thierry.reding@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox