[PATCH v1] i2c: microchip-core: actually use repeated sends

Wolfram Sang wsa+renesas at sang-engineering.com
Tue Oct 1 01:50:56 PDT 2024


Hi Conor,

> At present, where repeated sends are intended to be used, the
> i2c-microchip-core driver sends a stop followed by a start. Lots of i2c

Oh, this is wrong. Was this just overlooked or was maybe older hardware
not able to generated correct repeated-starts?

> devices must not malfunction in the face of this behaviour, because the
> driver has operated like this for years! Try to keep track of whether or
> not a repeated send is required, and suppress sending a stop in these
> cases.

? I don't get that argument. If the driver is expected to do a repeated
start, it should do a repeated start. If it didn't, it was a bug and you
were lucky that the targets could handle this. Because most controllers
can do repeated starts correctly, we can also argue that this works for
most targets for years. In the unlikely event that a target fails after
converting this driver to proper repeated starts, the target is buggy
and needs fixing. It would not work with the majority of other
controllers this way.

I didn't look at the code but reading "keeping track whether rep start
is required" looks wrong from a high level perspective. The driver
should do repeated start when it should do repeated start.

All the best,

   Wolfram

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/linux-riscv/attachments/20241001/419e70ad/attachment.sig>


More information about the linux-riscv mailing list