Re: [PATCH] i2c: cgbc: Fetch the status of a write transfer
From: Haberlander, Markus
Date: Fri Nov 27 2026 - 04:21:41 EST
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.
If you go with USEC_PER_SEC, could you simply change the timeout when
picking up the patch? I can also send an updated patch on top of your
series, tested on our conga-PA7, if you prefer that.
And could you keep it right after 2/10, with its Fixes and Cc: stable
tags? Then both can go to stable together.
Thanks,
Markus
The information contained in this message is confidential or protected by law. If you are not the intended recipient, please contact the sender and delete this message. Any unauthorised copying of this message or unauthorised distribution of the information contained herein is prohibited.
Diese E-Mail enthält vertrauliche oder rechtlich geschützte Informationen. Wenn Sie nicht der beabsichtigte Empfänger sind, informieren Sie bitte sofort den Absender und löschen Sie diese E-Mail. Das unbefugte Kopieren dieser E-Mail oder die unbefugte Weitergabe der enthaltenen Informationen ist nicht gestattet.
Data security advice: Please be aware, that data exchange via Internet or E-Mail is not 100% safe. Therefore, please handle sensitive or confidential (bank) data with care. Please take note, that Rosenberger is not asking you for bank data or providing you such data via E-Mail, in principle. In case of deviations or questions please contact us immediately.
Rosenberger Hochfrequenztechnik GmbH & Co. KG, Registergericht: Amtsgericht Traunstein, HRA 5566
Persönlich haftender Gesellschafter: Rosenberger Hochfrequenztechnik GmbH, Registergericht: Amtsgericht Traunstein, HRB 4405
Geschäftsführer: Josef Rottenaicher, Jochen Ehrenberg, Hauke Schütt
Please consider our data policy: https://www.rosenberger.com/data-policy