Linux Documentation
 help / color / mirror / Atom feed
* Re: [PATCH net-next v3 1/3] i2c: xiic: allow platforms to require 32-bit register accesses
       [not found] <20261116-wiwi-v3-87afa10a8-1-ahmadexp@gmail.com>
@ 2026-11-18 18:22 ` netdev-bot+sashiko
  2026-11-18 20:05   ` Ahmad Byagowi
  0 siblings, 1 reply; 2+ messages in thread
From: netdev-bot+sashiko @ 2026-11-18 18:22 UTC (permalink / raw)
  To: ahmadexp
  Cc: netdev, vadim.fedorenko, andi.shyti, andrew+netdev, corbet, davem,
	edumazet, horms, jiri, kuba, linux-doc, linux-i2c, linux-kernel,
	pabeni, rdunlap, richardcochran, skhan

Thank you for your contribution! Sashiko AI review found more severe
issue(s) in other patches of this series. This mail is only an FYI, in case
you want to address the nit picks below when you respin.

Low priority / nit picks for your consideration:

- [Low] In drivers/i2c/busses/i2c-xiic.c, this patch extends the block
  comment above the register accessors (lines 281-290), but the…

--

i2c: xiic: allow platforms to require 32-bit register accesses

This patch adds a force_32bit_access flag to the xiic platform data. When
the flag is set, the byte and halfword register accessors issue aligned
32-bit accesses, still in the detected endianness. The first user is the
WiWi Time Card, whose LitePCIe bridge cannot handle subword MMIO.

> diff --git a/drivers/i2c/busses/i2c-xiic.c b/drivers/i2c/busses/i2c-xiic.c
> index ab7916745ad39..edb5e271c8cde 100644
> --- a/drivers/i2c/busses/i2c-xiic.c
> +++ b/drivers/i2c/busses/i2c-xiic.c

[ ... ]

> @@ -282,52 +284,68 @@ static int xiic_i2c_runtime_resume(struct device *dev)
>   * Only the least significant byte [doublet] of the register are ever
>   * accessed. This requires an offset of 3 [2] from the base address for
>   * big-endian systems.
> + * Some bridges only support aligned 32-bit accesses. For these, access the
> + * entire register in its detected byte order, without a read-modify-write:
> + * reading or writing a FIFO register must perform exactly one transaction.
>   */

[Severity: Low]
This isn't a bug, but the first sentence of this comment now contradicts
the new mode. It still says only the least significant byte [doublet] is
"ever accessed", using a +3 [+2] offset on big-endian.

When i2c->force_32bit_access is set, xiic_setreg8() and xiic_setreg16()
zero-extend the value and write the whole 32-bit register at the base
offset, with no +3/+2 adjustment:

    if (i2c->force_32bit_access) {
        xiic_setreg32(i2c, reg, value);
        return;
    }

In the same mode, xiic_getreg8() reads the full register through
xiic_getreg32() and truncates the result.

Could the first sentence be changed so it only describes the default
accessors?

The comment also doesn't say what the new mode relies on. The registers
written through xiic_setreg8() and xiic_setreg16() (XIIC_CR_REG_OFFSET,
XIIC_RFD_REG_OFFSET, XIIC_DTR_REG_OFFSET) now get zeros in their upper
bits. Should the comment note that those upper bits must be reserved or
ignored on write?

[ ... ]

-- 
Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261116-wiwi-v3-87afa10a8-0-ahmadexp%40gmail.com

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH net-next v3 1/3] i2c: xiic: allow platforms to require 32-bit register accesses
  2026-11-18 18:22 ` [PATCH net-next v3 1/3] i2c: xiic: allow platforms to require 32-bit register accesses netdev-bot+sashiko
@ 2026-11-18 20:05   ` Ahmad Byagowi
  0 siblings, 0 replies; 2+ messages in thread
From: Ahmad Byagowi @ 2026-11-18 20:05 UTC (permalink / raw)
  To: netdev-bot+sashiko
  Cc: andi.shyti, andrew+netdev, corbet, davem, edumazet, horms, jiri,
	kuba, linux-doc, linux-i2c, linux-kernel, netdev, pabeni, rdunlap,
	richardcochran, skhan, vadim.fedorenko

Thanks. I have clarified the comment in the v4 draft: the subword offsets
describe the default access mode, not the forced-word mode. The latter
requires unused upper bits in CR, RFD and DTR to accept zero on writes.
It still performs one transaction, without read-modify-write, for FIFO
accesses.

Patch 3 remains the first user of this flag. Other platforms keep their
existing access mode. The revised objects and accessor tests pass; this
revision has not been tested on the physical card.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2026-11-18 20:05 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <20261116-wiwi-v3-87afa10a8-1-ahmadexp@gmail.com>
2026-11-18 18:22 ` [PATCH net-next v3 1/3] i2c: xiic: allow platforms to require 32-bit register accesses netdev-bot+sashiko
2026-11-18 20:05   ` Ahmad Byagowi

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox