lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <463a64a4-d629-27bc-2269-3fcdbf8b7e50@broadcom.com>
Date: Thu, 22 Jun 2023 16:50:59 +0100
From: Florian Fainelli <florian.fainelli@...adcom.com>
To: Andrew Lunn <andrew@...n.ch>
Cc: netdev@...r.kernel.org, hkallweit1@...il.com, ansuelsmth@...il.com,
 rmk+kernel@...linux.org.uk, 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>,
 open list <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH net] net: bcmgenet: Ensure MDIO unregistration has clocks
 enabled



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

Download attachment "smime.p7s" of type "application/pkcs7-signature" (4221 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ