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: <168e00d3-f335-4e62-341f-224e79a08558@gmail.com>
Date:   Mon, 20 Sep 2021 09:11:08 -0700
From:   Florian Fainelli <f.fainelli@...il.com>
To:     Rafał Miłecki <zajec5@...il.com>,
        "David S . Miller" <davem@...emloft.net>,
        Jakub Kicinski <kuba@...nel.org>
Cc:     netdev@...r.kernel.org, devicetree@...r.kernel.org,
        bcm-kernel-feedback-list@...adcom.com,
        Rafał Miłecki <rafal@...ecki.pl>
Subject: Re: [PATCH net-next] net: bgmac: support MDIO described in DT

On 9/20/21 5:34 AM, Rafał Miłecki wrote:
> From: Rafał Miłecki <rafal@...ecki.pl>
> 
> Check ethernet controller DT node for "mdio" subnode and use it with
> of_mdiobus_register() when present. That allows specifying MDIO and its
> PHY devices in a standard DT based way.
> 
> This is required for BCM53573 SoC support which has an MDIO attached
> switch.
> 
> Signed-off-by: Rafał Miłecki <rafal@...ecki.pl>
> ---
>  drivers/net/ethernet/broadcom/bgmac-bcma-mdio.c | 6 +++++-
>  1 file changed, 5 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/net/ethernet/broadcom/bgmac-bcma-mdio.c b/drivers/net/ethernet/broadcom/bgmac-bcma-mdio.c
> index 6ce80cbcb48e..086739e4f40a 100644
> --- a/drivers/net/ethernet/broadcom/bgmac-bcma-mdio.c
> +++ b/drivers/net/ethernet/broadcom/bgmac-bcma-mdio.c
> @@ -10,6 +10,7 @@
>  
>  #include <linux/bcma/bcma.h>
>  #include <linux/brcmphy.h>
> +#include <linux/of_mdio.h>
>  #include "bgmac.h"
>  
>  static bool bcma_mdio_wait_value(struct bcma_device *core, u16 reg, u32 mask,
> @@ -211,6 +212,7 @@ struct mii_bus *bcma_mdio_mii_register(struct bgmac *bgmac)
>  {
>  	struct bcma_device *core = bgmac->bcma.core;
>  	struct mii_bus *mii_bus;
> +	struct device_node *np;
>  	int err;
>  
>  	mii_bus = mdiobus_alloc();
> @@ -229,7 +231,9 @@ struct mii_bus *bcma_mdio_mii_register(struct bgmac *bgmac)
>  	mii_bus->parent = &core->dev;
>  	mii_bus->phy_mask = ~(1 << bgmac->phyaddr);
>  
> -	err = mdiobus_register(mii_bus);
> +	np = of_get_child_by_name(core->dev.of_node, "mdio");

I believe this leaks np and the use case is not exactly clear to me
here. AFAICT the Northstar SoCs have two MDIO controllers: one for
internal PHYs and one for external PHYs which how you would attach a
switch to the chip (in chipcommonA). Is 53573 somewhat different here?
What is the MDIO bus driver that is being used?
-- 
Florian

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ