From: Alexander Sverdlin <alexander.sverdlin-xNZwKgViW5gAvxtiuMwx3w@public.gmane.org>
To: ext Grygorii Strashko
<grygorii.strashko-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
Cc: linux-i2c-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Subject: Re: [PATCH 2/3] i2c: davinci: Refactor i2c_davinci_wait_bus_not_busy()
Date: Fri, 13 Mar 2015 08:54:37 +0100 [thread overview]
Message-ID: <550297BD.5000004@nokia.com> (raw)
In-Reply-To: <CAO5CWPJWhpGCb4NvXnJJ00-9kOvvqtxQsSQbTMxODNC4tjtWzQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
Hi!
On 12/03/15 13:37, ext Grygorii Strashko wrote:
>>>> + if (i2c_davinci_wait_status_change(dev, DAVINCI_I2C_STR_BB, 0)) {
>>>> >>> + dev_warn(dev->dev, "timeout waiting for bus ready\n");
>>>> >>> + davinci_i2c_recover_bus(dev);
>>>> >>> + i2c_davinci_init(dev);
>>>> >>> + /*
>>>> >>> + * the bus should not be busy after init, otherwise something
>>>> >>> + * is badly broken
>>>> >>> + */
>>> >>
>>> >> I think you should recheck BB and return error if it's still detected.
>> >
>> > But after re-reading the datasheet, I must conclude, this is almost not possible.
>> > It will be a dead code. Reset will clear BB anyway and the only possibility to see
>> > BB set to 1 here is when another master transmits right after our reset. We cannot
>> > guarantee that we will always catch this here, so this must be any way handled over
>> > AL interrupt.
> The question here what is worse:
> - silently continue execution with undefined behavior
> - or recheck and return error (That's how it was before).
>
> I like option 2 :) - don't believe HW.
OK, it will at least catch the cases when the bus is short-circuited.
--
Best regards,
Alexander Sverdlin.
prev parent reply other threads:[~2015-03-13 7:54 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-03-11 13:08 [PATCH 2/3] i2c: davinci: Refactor i2c_davinci_wait_bus_not_busy() Alexander Sverdlin
[not found] ` <55003E6B.40008-xNZwKgViW5gAvxtiuMwx3w@public.gmane.org>
2015-03-11 18:35 ` Grygorii.Strashko-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org
2015-03-11 19:22 ` Alexander Sverdlin
[not found] ` <55008AD7.4070905-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
2015-03-12 8:50 ` Alexander Sverdlin
[not found] ` <55015351.7040508-xNZwKgViW5gAvxtiuMwx3w@public.gmane.org>
2015-03-12 12:37 ` Grygorii Strashko
[not found] ` <CAO5CWPJWhpGCb4NvXnJJ00-9kOvvqtxQsSQbTMxODNC4tjtWzQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2015-03-13 7:54 ` Alexander Sverdlin [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=550297BD.5000004@nokia.com \
--to=alexander.sverdlin-xnzwkgviw5gavxtiumwx3w@public.gmane.org \
--cc=grygorii.strashko-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org \
--cc=linux-i2c-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
/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;
as well as URLs for NNTP newsgroup(s).