[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <9229efc2-832d-4b13-b3ce-8b3db22653a4@intel.com>
Date: Fri, 16 Feb 2024 14:37:45 -0800
From: Jacob Keller <jacob.e.keller@...el.com>
To: Florian Fainelli <florian.fainelli@...adcom.com>, <netdev@...r.kernel.org>
CC: Doug Berger <opendmb@...il.com>, Broadcom internal kernel review list
<bcm-kernel-feedback-list@...adcom.com>, "David S. Miller"
<davem@...emloft.net>, Eric Dumazet <edumazet@...gle.com>, Jakub Kicinski
<kuba@...nel.org>, Paolo Abeni <pabeni@...hat.com>, Andrew Lunn
<andrew@...n.ch>, Heiner Kallweit <hkallweit1@...il.com>, Russell King
<linux@...linux.org.uk>, open list <linux-kernel@...r.kernel.org>, "Justin
Chen" <justin.chen@...adcom.com>
Subject: Re: [PATCH net-next 1/3] net: mdio: mdio-bcm-unimac: Manage clock
around I/O accesses
On 2/16/2024 10:42 AM, Florian Fainelli wrote:
> Up until now we have managed not to have the mdio-bcm-unimac manage its
> clock except during probe and suspend/resume. This works most of the
> time, except where it does not.
>
This made me chuckle :)
> With a fully modular build, we can get into a situation whereby the
> GENET driver is fully registered, and so is the mdio-bcm-unimac driver,
> however the Ethernet PHY driver is not yet, because it depends on a
> resource that is not yet available (e.g.: GPIO provider). In that state,
> the network device is not usable yet, and so to conserve power, the
> GENET driver will have turned off its "main" clock which feeds its MDIO
> controller.
>
> When the PHY driver finally probes however, we make an access to the PHY
> registers to e.g.: disable interrupts, and this causes a bus error
> within the MDIO controller space because the MDIO controller clock(s)
> are turned off.
>
> To remedy that, we manage the clock around all of the I/O accesses to
> the hardware which are done exclusively during read, write and clock
> divider configuration.
>
> This ensures that the register space is accessible, and this also
> ensures that there are not unnecessarily elevated reference counts
> keeping the clocks active when the network device is administratively
> turned off. It would be the case with the previous way of managing the
> clock.
>
Good description of the issues.
> Signed-off-by: Florian Fainelli <florian.fainelli@...adcom.com>
> ---
Reviewed-by: Jacob Keller <jacob.e.keller@...el.com>
Powered by blists - more mailing lists