mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Florian Fainelli <florian.fainelli@broadcom.com>
To: Nicolai Buchwitz <nb@tipi-net.de>
Cc: netdev@vger.kernel.org, Carlos Soto <carlos.soto@broadcom.com>,
	Justin Chen <justin.chen@broadcom.com>,
	Doug Berger <opendmb@gmail.com>,
	Broadcom internal kernel review list
	<bcm-kernel-feedback-list@broadcom.com>,
	Andrew Lunn <andrew@lunn.ch>,
	Heiner Kallweit <hkallweit1@gmail.com>,
	Russell King <linux@armlinux.org.uk>,
	"David S. Miller" <davem@davemloft.net>,
	Eric Dumazet <edumazet@kernel.org>,
	Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
	linux-kernel@vger.kernel.org, Mlody12 mlody12 <kudzo51@gmail.com>
Subject: Re: [PATCH net-next v5 4/4] net: mdio: mdio-bcm-unimac: Add Clause 45 support
Date: Fri, 20 Nov 2026 14:01:08 -0800	[thread overview]
Message-ID: <b3a4817a-d514-4c3c-840c-8104e6a447c0@broadcom.com> (raw)
In-Reply-To: <905c34c37a843cfc95f95e10b32f513e@tipi-net.de>

On 11/20/26 12:29, Nicolai Buchwitz wrote:
> 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.

Indeed I did, thanks!

pw-bot: cr
-- 
Florian

      reply	other threads:[~2026-11-20 22:01 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-20 19:43 [PATCH net-next v5 0/4] net: mdio: Clause 45 support for mdio-bcm-unimac Florian Fainelli
2026-11-20 19:43 ` [PATCH net-next v5 1/4] net: phy: Map C45 probe read errors to -ENODEV during bus scan Florian Fainelli
2026-11-20 19:43 ` [PATCH net-next v5 2/4] net: mdio: mdio-bcm-unimac: Define MDIO_OP_SHIFT Florian Fainelli
2026-11-20 19:43 ` [PATCH net-next v5 3/4] net: mdio: mdio-bcm-unimac: Poll for completion at 1us granularity Florian Fainelli
2026-11-20 19:43 ` [PATCH net-next v5 4/4] net: mdio: mdio-bcm-unimac: Add Clause 45 support Florian Fainelli
2026-11-20 20:23   ` Nicolai Buchwitz
2026-11-20 20:29   ` Nicolai Buchwitz
2026-11-20 22:01     ` Florian Fainelli [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=b3a4817a-d514-4c3c-840c-8104e6a447c0@broadcom.com \
    --to=florian.fainelli@broadcom.com \
    --cc=andrew@lunn.ch \
    --cc=bcm-kernel-feedback-list@broadcom.com \
    --cc=carlos.soto@broadcom.com \
    --cc=davem@davemloft.net \
    --cc=edumazet@kernel.org \
    --cc=hkallweit1@gmail.com \
    --cc=justin.chen@broadcom.com \
    --cc=kuba@kernel.org \
    --cc=kudzo51@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@armlinux.org.uk \
    --cc=nb@tipi-net.de \
    --cc=netdev@vger.kernel.org \
    --cc=opendmb@gmail.com \
    --cc=pabeni@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®