From: Sam Edwards <cfsworks@gmail.com>
To: hs@denx.de, u-boot@lists.denx.de
Cc: Stefan Roese <sr@denx.de>
Subject: Re: [RFC PATCH] i2c: mvtwsi: reinitialize controller to clear bus errors
Date: Mon, 12 Jun 2023 14:16:54 -0600 [thread overview]
Message-ID: <d285aef0-4a1a-b01f-e582-41c3179af511@gmail.com> (raw)
In-Reply-To: <1bf44310-1d33-79fd-a116-578c8b5c47ce@denx.de>
Hey there Heiko,
On 6/12/23 06:35, Heiko Schocher wrote:
> I have not the deep knowledge of this specific i2c driver, but may
> also an option is to set
>
> int (*deblock)(struct udevice *bus);
>
> in
>
> static const struct dm_i2c_ops mvtwsi_i2c_ops = {
>
> for this driver and do there the stuff needed to deblock the bus,
> as you have done in twsi_i2c_reinit() in your patch?
I'm not sure that this is a good fit. The comment explaining deblock
says this is for situations where "Resetting the I2C master does not
help. The only way is to force the bus through a series of transitions
to make sure that all slaves are done with the transaction."
Which reads to me like it's for situations where some slave is holding
down SDA (making it impossible for us to send a start/stop) and several
SCL pulses are required in order to shake it loose.
In this case, the *bus* is okay and the *master* is upset (ironically, I
think, because the Realtek just did its own "deblock" equivalent), so a
master reset is really all that's required here. We also know the
specific state that it runs off to, so it's easy to detect this
situation and resolve it.
> Currently this deblock function is only used from i2c core in
> i2c command, but may it makes sense to add in dm_i2c_xfer function in
>
> drivers/i2c/i2c-uclass.c
>
> a call to i2c_deblock() in case bus is blocked?
I wouldn't object to such a change, but since deblock is an "active"
operation that might have side effects, this probably needs a bigger
discussion (beyond what I'm trying to do here) since other users might
be unhappy about this happening without their explicit say-so.
Thanks for your feedback,
Sam
next prev parent reply other threads:[~2023-06-12 20:17 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-06-10 6:15 [RFC PATCH] i2c: mvtwsi: reinitialize controller to clear bus errors Sam Edwards
2023-06-12 12:35 ` Heiko Schocher
2023-06-12 20:16 ` Sam Edwards [this message]
2023-06-13 4:50 ` Heiko Schocher
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=d285aef0-4a1a-b01f-e582-41c3179af511@gmail.com \
--to=cfsworks@gmail.com \
--cc=hs@denx.de \
--cc=sr@denx.de \
--cc=u-boot@lists.denx.de \
/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