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-next>] [day] [month] [year] [list]
Message-ID: <CADuippAvUXHH2Mjuxyz+9JFf-SR5j8itmRi5YvUJowmbVXR9Og@mail.gmail.com>
Date:   Sat, 29 Feb 2020 15:19:15 +0800
From:   Pengcheng Xu <i@...eward.moe>
To:     Nicolas Ferre <nicolas.ferre@...rochip.com>,
        "David S. Miller" <davem@...emloft.net>
Cc:     netdev@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] net: macb: add support for fixed-link

Sorry for forgetting to CC the mailing lists.  Adding them now.

2020年2月29日(土) 15:09 Pengcheng Xu <i@...eward.moe>:
>
> The Cadence macb driver did not support fixed-link PHYs.  This patch
> adds support for fixed-link PHYs to the driver.
>
> The driver only checks if there's a valid PHY over MDIO, which is either
> present as a device tree node, or (if absent) searched on the MDIO bus.
> This patch detects if there is a `fixed-link` PHY instead of a regular
> MDIO-attached PHY.  The device tree node of the MAC is checked for a
> fixed-link PHY via `of_phy_is_fixed_link`, and, if so, the normal MDIO
> register routine is skipped, and `of_phy_register_fixed_link` is
> performed instead.
>
> The changes were borrowed from
> drivers/net/ethernet/altera/altera_tse_main.c and tested to work on a
> Xilinx Zynq UltraScale+ device.
>
> Signed-off-by: Pengcheng Xu <i@...eward.moe>
> ---
>  drivers/net/ethernet/cadence/macb_main.c | 15 ++++++++++++---
>  1 file changed, 12 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/net/ethernet/cadence/macb_main.c b/drivers/net/ethernet/cadence/macb_main.c
> index 2c28da1737fe..fb359ce90ae4 100644
> --- a/drivers/net/ethernet/cadence/macb_main.c
> +++ b/drivers/net/ethernet/cadence/macb_main.c
> @@ -744,6 +744,7 @@ static int macb_mdiobus_register(struct macb *bp)
>
>  static int macb_mii_init(struct macb *bp)
>  {
> +       struct device_node *np = bp->pdev->dev.of_node;
>         int err = -ENXIO;
>
>         /* Enable management port */
> @@ -765,9 +766,17 @@ static int macb_mii_init(struct macb *bp)
>
>         dev_set_drvdata(&bp->dev->dev, bp->mii_bus);
>
> -       err = macb_mdiobus_register(bp);
> -       if (err)
> -               goto err_out_free_mdiobus;
> +       if (of_phy_is_fixed_link(np)) {
> +               err = of_phy_register_fixed_link(np);
> +               if (err) {
> +                       netdev_err(bp->dev, "cannot register fixed-link PHY\n");
> +                       goto err_out_free_mdiobus;
> +               }
> +       } else {
> +               err = macb_mdiobus_register(bp);
> +               if (err)
> +                       goto err_out_free_mdiobus;
> +       }
>
>         err = macb_mii_probe(bp->dev);
>         if (err)
> --
> 2.25.1
>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ