From: Thomas Richard <thomas.richard@bootlin.com>
To: "Haberlander, Markus" <Markus.Haberlander@rosenberger.com>,
Andi Shyti <andi.shyti@kernel.org>
Cc: Lee Jones <lee@kernel.org>,
"mfd@lists.linux.dev" <mfd@lists.linux.dev>,
"linux-i2c@vger.kernel.org" <linux-i2c@vger.kernel.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"stable@vger.kernel.org" <stable@vger.kernel.org>
Subject: Re: [PATCH] i2c: cgbc: Fetch the status of a write transfer
Date: Fri, 27 Nov 2026 12:04:53 +0100 [thread overview]
Message-ID: <67f6aa99-c625-437a-bae8-ea7a1637afe1@bootlin.com> (raw)
In-Reply-To: <FR4P281MB4840894892BD79C05D844CEC84412@FR4P281MB4840.DEUP281.PROD.OUTLOOK.COM>
On 11/27/26 10:20 AM, Haberlander, Markus wrote:
> Hi Thomas, Andi,
>
> On 11/26/26 9:18 PM, Thomas Richard wrote:
>> If I'm not mistaken, USEC_PER_SEC is only used if master_xfer returns
>> -EGAIN (arbitration loss), else __i2c_transfer() directly returns so no
>> 1s timeout. And we never return -EAGAIN.
>>
>> So why should we wait 1s?
>
> Thanks for looking into this! I think Andi means the one-second loop in
> cgbc_i2c_xfer(). Before my patch, when the controller was still busy
> with a write, the next call returned -EBUSY and that loop simply tried
> again, for up to a second.
>
> My patch now waits only 2 * read_maxtime_us for a write to finish. That
> is enough for the transfer itself. But if a device stretches the clock,
> the controller might stay busy for longer, and the write would fail
> where it used to succeed. That's why USEC_PER_SEC sounds like the safer
> choice to me. I'm happy with either, though - you know this hardware
> much better than I do.
Ah yes clock stretching, makes sense. So it is also valid for read
operation. So we could drop read_maxtime_us. But it's an other story, I
want my series to be merged, I'll send a patch later.
Markus I'll add your patch in my series, and make the USEC_PER_SEC
modification. Thanks for your contribution.
Best Regards,
Thomas Richard
prev parent reply other threads:[~2026-11-27 11:04 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-23 12:33 Markus Haberlander via B4 Relay
2026-11-26 10:19 ` Thomas Richard (congatec GmbH)
2026-11-26 13:14 ` Andi Shyti
2026-11-26 17:49 ` Andi Shyti
2026-11-26 18:04 ` Thomas Richard
2026-11-26 18:28 ` Lee Jones
2026-11-26 20:18 ` Thomas Richard
2026-11-27 9:20 ` Haberlander, Markus
2026-11-27 11:04 ` Thomas Richard [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=67f6aa99-c625-437a-bae8-ea7a1637afe1@bootlin.com \
--to=thomas.richard@bootlin.com \
--cc=Markus.Haberlander@rosenberger.com \
--cc=andi.shyti@kernel.org \
--cc=lee@kernel.org \
--cc=linux-i2c@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mfd@lists.linux.dev \
--cc=stable@vger.kernel.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
all inboxes | Powered by JetHome®