On Thu, 15 Oct 2026 at 19:11, Marcelo Manzo <[email protected]> wrote:
>
> From: Sergey Kambalin <[email protected]>
>
> Implement the MDIO command register handling used to read/write the
> BCM54213PE PHY's standard MII registers (BMCR, BMSR, LPA, ...) plus
> its vendor "shadow" register blocks reached through the AUX_CTL/
> EXP_SHD indirection scheme, and a simple link-state model (PHY
> starts down, comes up once BMCR is programmed and autonegotiation
> is (re)started).
>
> Part of Sergey Kambalin's original Raspberry Pi 4B PCIe/GENET
> networking series (patchwork series 829638, posted to qemu-devel in
> 2024, never merged). Carried forward and completed by Marcelo Manzo.
>
> While carrying this forward, fix the autonegotiation-restart handling
> in bcm2838_genet_mdio_cmd(): the guest PHY driver sets BMCR.ANRESTART
> and polls BMCR until it reads back as cleared, but the result of
> FIELD_DP16() (which returns a new value rather than modifying its
> argument) was discarded, so the bit never cleared and the guest
> spun forever at boot. Also refresh the link state once the restart
> has been handled.
>
> Signed-off-by: Sergey Kambalin <[email protected]>
> Signed-off-by: Marcelo Manzo <[email protected]>

This doesn't compile at this point in the patchseries, because
this function:

> +static void bcm2838_genet_phy_update_link(BCM2838GenetState *s);

is prototyped and called, but never defined:

../../hw/net/bcm2838_genet.c:23:13: error:
‘bcm2838_genet_phy_update_link’ used but never defined [-Werror]
   23 | static void bcm2838_genet_phy_update_link(BCM2838GenetState *s);
      |             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
cc1: all warnings being treated as errors

The patchset has to be able to compile at all points, to
avoid breaking future 'git bisect' operations. Moving the
callsite and the prototype from here to the "RX path" patch
that adds the function is probably the simplest fix.

thanks
-- PMM

Reply via email to