From: <Claudiu.Beznea@microchip.com>
To: <linux@roeck-us.net>, <Nicolas.Ferre@microchip.com>
Cc: <davem@davemloft.net>, <kuba@kernel.org>,
<netdev@vger.kernel.org>, <linux-kernel@vger.kernel.org>,
<sean.anderson@seco.com>, <andrew@lunn.ch>
Subject: Re: [PATCH] net: macb: Fix mdio child node detection
Date: Wed, 27 Oct 2021 08:38:49 +0000 [thread overview]
Message-ID: <c6a5361b-5199-766a-c85a-f802ca77670e@microchip.com> (raw)
In-Reply-To: <20211026173950.353636-1-linux@roeck-us.net>
On 26.10.2021 20:39, Guenter Roeck wrote:
> EXTERNAL EMAIL: Do not click links or open attachments unless you know the content is safe
>
> Commit 4d98bb0d7ec2 ("net: macb: Use mdio child node for MDIO bus if it
> exists") added code to detect if a 'mdio' child node exists to the macb
> driver. Ths added code does, however, not actually check if the child node
> exists, but if the parent node exists. This results in errors such as
>
> macb 10090000.ethernet eth0: Could not attach PHY (-19)
>
> if there is no 'mdio' child node. Fix the code to actually check for
> the child node.
>
> Fixes: 4d98bb0d7ec2 ("net: macb: Use mdio child node for MDIO bus if it exists")
> Cc: Sean Anderson <sean.anderson@seco.com>
> Cc: Andrew Lunn <andrew@lunn.ch>
> Signed-off-by: Guenter Roeck <linux@roeck-us.net>> ---
Patch solves the failure also on sama5d2_xplained. You can add:
Tested-by: Claudiu Beznea <claudiu.beznea@microchip.com>
Thank you,
Claudiu Beznea
> drivers/net/ethernet/cadence/macb_main.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/net/ethernet/cadence/macb_main.c b/drivers/net/ethernet/cadence/macb_main.c
> index 309371abfe23..ffce528aa00e 100644
> --- a/drivers/net/ethernet/cadence/macb_main.c
> +++ b/drivers/net/ethernet/cadence/macb_main.c
> @@ -901,7 +901,7 @@ static int macb_mdiobus_register(struct macb *bp)
> * directly under the MAC node
> */
> child = of_get_child_by_name(np, "mdio");
> - if (np) {
> + if (child) {
> int ret = of_mdiobus_register(bp->mii_bus, child);
>
> of_node_put(child);
> --
> 2.33.0
>
next prev parent reply other threads:[~2021-10-27 8:38 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-10-26 17:39 [PATCH] net: macb: Fix mdio child node detection Guenter Roeck
2021-10-26 17:42 ` Sean Anderson
2021-10-27 8:38 ` Claudiu.Beznea [this message]
2021-10-27 8:40 ` Nicolas Ferre
2021-10-28 1:10 ` 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=c6a5361b-5199-766a-c85a-f802ca77670e@microchip.com \
--to=claudiu.beznea@microchip.com \
--cc=Nicolas.Ferre@microchip.com \
--cc=andrew@lunn.ch \
--cc=davem@davemloft.net \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@roeck-us.net \
--cc=netdev@vger.kernel.org \
--cc=sean.anderson@seco.com \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.