Re: [PATCH] phy: marvell: a3700-comphy: Guard missing polarity argument

From: Miquel Raynal

Date: Thu Oct 01 2026 - 13:01:03 EST


On 01/10/2026 at 17:19:38 +02, Štěpán Dalecký <daleckystepan@xxxxxxxxx> wrote:

> The Armada 3700 COMPHY binding specifies #phy-cells = <1>, so PHY
> references supply only the port argument. However,
> mvebu_a3700_comphy_xlate() unconditionally reads args[1] to select TX
> and RX polarity inversion. The PHY core does not initialize its
> of_phandle_args structure, and the phandle parser fills only the
> supplied cells, leaving args[1] uninitialized.
>
> Using the unused cell can program unintended SerDes polarity. On a
> Turris MOX with a Peridot switch running OpenWrt with Linux 6.18.54,
> the CPU link reports RX CRC errors and fails to pass traffic. The
> switch PCS does not record a partner advertisement despite link-up.
>
> Check args_count before reading args[1], leaving polarity inversion
> disabled when the second argument was not supplied. This does not
> change the binding or introduce a supported two-cell interface.
>
> The same change restores 2500BASE-X communication on the affected
> MOX with no CRC errors. Cold boots, reboots and interface down/up
> cycles were also tested successfully on Linux 6.18.54.
>
> Fixes: 934337080c6c ("phy: marvell: phy-mvebu-a3700-comphy: Add native kernel implementation")
> Cc: stable@xxxxxxxxxxxxxxx
> Closes: https://github.com/openwrt/openwrt/issues/24069
> Assisted-by: LLM
> Signed-off-by: Štěpán Dalecký <daleckystepan@xxxxxxxxx>

Reviewed-by: Miquel Raynal <miquel.raynal@xxxxxxxxxxx>