From: Florian Fainelli <florian.fainelli@broadcom.com>
To: Andrew Lunn <andrew@lunn.ch>
Cc: netdev@vger.kernel.org, hkallweit1@gmail.com,
ansuelsmth@gmail.com, rmk+kernel@armlinux.org.uk,
Doug Berger <opendmb@gmail.com>,
Broadcom internal kernel review list
<bcm-kernel-feedback-list@broadcom.com>,
"David S. Miller" <davem@davemloft.net>,
Eric Dumazet <edumazet@google.com>,
Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
open list <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH net] net: bcmgenet: Ensure MDIO unregistration has clocks enabled
Date: Thu, 22 Jun 2023 16:50:59 +0100 [thread overview]
Message-ID: <463a64a4-d629-27bc-2269-3fcdbf8b7e50@broadcom.com> (raw)
In-Reply-To: <533872e1-b323-4bca-aacc-4d3cfbed53bd@lunn.ch>
[-- Attachment #1: Type: text/plain, Size: 1531 bytes --]
On 6/22/2023 4:36 PM, Andrew Lunn wrote:
> On Thu, Jun 22, 2023 at 03:31:07AM -0700, Florian Fainelli wrote:
>> With support for Ethernet PHY LEDs having been added, while
>> unregistering a MDIO bus and its child device liks PHYs there may be
>> "late" accesses to the MDIO bus. One typical use case is setting the PHY
>> LEDs brightness to OFF for instance.
>>
>> We need to ensure that the MDIO bus controller remains entirely
>> functional since it runs off the main GENET adapter clock.
>
> So this clock is enabled in bcmgenet_open() and disabled in
> bcmgenet_close(). The assumption being, the MDIO bus is only used when
> the interface is up.
>
> How does this work when there is an MDIO based switch attached? I had
> similar problems with the FEC and mv88e6xxx. DSA would try to talk to
> the switch with the master interface down, and MDIO would time out. I
> needed to add runtime PM support to the MDIO bus ops.
We do not have that configuration to support today, and given the way
that we do register the MDIO bus, it could actually be a bit challenging
to support DSA here, I might still have a board around to test, one day.
Passing the clock to the MDIO driver does require quite a bit of
restructuring in the driver such that the clock is only acquired around
mii_bus::write and read operations, otherwise the clock remains
constantly enabled, even if the network device is brought down, which
burns power unnecessarily.
Since this is a fix, I went with the more targeted approach here.
--
Florian
[-- Attachment #2: S/MIME Cryptographic Signature --]
[-- Type: application/pkcs7-signature, Size: 4221 bytes --]
next prev parent reply other threads:[~2023-06-22 15:51 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-06-22 10:31 Florian Fainelli
2023-06-22 15:36 ` Andrew Lunn
2023-06-22 15:50 ` Florian Fainelli [this message]
2023-06-22 19:14 ` Andrew Lunn
2023-06-24 2:00 ` patchwork-bot+netdevbpf
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=463a64a4-d629-27bc-2269-3fcdbf8b7e50@broadcom.com \
--to=florian.fainelli@broadcom.com \
--cc=andrew@lunn.ch \
--cc=ansuelsmth@gmail.com \
--cc=bcm-kernel-feedback-list@broadcom.com \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=hkallweit1@gmail.com \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=opendmb@gmail.com \
--cc=pabeni@redhat.com \
--cc=rmk+kernel@armlinux.org.uk \
/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®