Thread View: linux.kernel.netdev
1 messages
1 total messages
Started by Nicolai Buchwitz
Fri, 20 Nov 2026 20:29
Re: [PATCH net-next v5 4/4] net: mdio: mdio-bcm-unimac: Add Clause 45 support
Author: Nicolai Buchwitz
Date: Fri, 20 Nov 2026 20:29
Date: Fri, 20 Nov 2026 20:29
63 lines
11208 bytes
11208 bytes
On 20.11.2026 20:43, Florian Fainelli wrote: > Add Clause 45 read/write support to the UniMAC MDIO bus controller > driver > by implementing the read_c45/write_c45 bus callbacks. Each access > performs > the two-step C45 sequence (ADDR cycle followed by a READ/WRITE cycle) > under > the bus lock and switches MDIO_CFG between C22 and C45 mode as needed; > MDIO_CFG is only written when the mode actually changes. > > Since MDIO_CFG also holds the clock divider, unimac_mdio_resume() now > takes > the bus lock around unimac_mdio_clk_set() so that it cannot race with > the > read-modify-write done by the accessors. Resume may therefore wait for > an > MDIO access that is in flight. > > Some wait_func implementations (e.g.: bcmgenet_mii_wait()) return 0 > even > when the controller is still busy. For C45 this would let the data > cycle > or the next access's MDIO_CFG switch start while a frame is in flight, > and > return the command bits instead of the read data. Check that the > controller > is idle after every cycle, C22 ones included, and report a timeout > instead. > > Also skip the BMSR workaround read in unimac_mdio_reset() for children > compatible with "ethernet-phy-ieee802.3-c45", since such PHYs are not > expected to respond to C22 accesses. > > Note that providing read_c45/write_c45 also makes the MDIO core scan > for > C45 PHYs at registration time, on addresses that are not masked and do > not > already have a C22 device. This is not the case when the bus is > registered > from a Device Tree node, which masks all addresses. > > The platform device that GENET instantiates when it is probed without a > Device Tree node (e.g.: ACPI) does not mask any address, so it is > scanned > too. Its wait_func is bcmgenet_mii_wait(), which sleeps for up to a > timeout > per frame since GENET's interrupt is not registered yet when the bus is > registered. That makes the scan slower at probe time on such systems, > the > same way the C22 scan already is. > > Signed-off-by: Florian Fainelli <florian.fainelli@broadcom.com> > Co-developed-by: Carlos Soto <carlos.soto@broadcom.com> > Signed-off-by: Carlos Soto <carlos.soto@broadcom.com> > Co-developed-by: Justin Chen <justin.chen@broadcom.com> > Signed-off-by: Justin Chen <justin.chen@broadcom.com> Forgot to mention: Your tag needs to go last (v3 had it right). You can keep my R-b as the changes are OK. Thanks, Nicolai
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads