Netdev List
 help / color / mirror / Atom feed
From: Sven Schuchmann <schuchmann@schleissheimer.de>
To: Andrew Lunn <andrew@lunn.ch>
Cc: "netdev@vger.kernel.org" <netdev@vger.kernel.org>
Subject: AW: assert in phylink.c with lan7801 and dp83tc811 since kernel 6.18
Date: Wed, 6 May 2026 14:36:11 +0000	[thread overview]
Message-ID: <BEZP281MB2245E8C2E2E757761DB5F952D93F2@BEZP281MB2245.DEUP281.PROD.OUTLOOK.COM> (raw)
In-Reply-To: <62b15f5f-c9db-4443-b0ee-ac7044459c08@lunn.ch>

Hello Andrew

> Von: Andrew Lunn <andrew@lunn.ch>
> Gesendet: Mittwoch, 06. Mai 2026 15:15
> An: Sven Schuchmann <schuchmann@schleissheimer.de>
> Cc: netdev@vger.kernel.org <netdev@vger.kernel.org>
> Betreff: Re: assert in phylink.c with lan7801 and dp83tc811 since kernel 6.18
>
> [...]
>
> Please try this patch.
>
>      Andrew

> From ea55645b23092a0de7aa3ab0eaf7bcb73a7fb0e1 Mon Sep 17 00:00:00 2001
> From: Andrew Lunn <andrew@lunn.ch>
> Date: Wed, 6 May 2026 08:10:29 -0500
> Subject: [PATCH] net: usb: lan78xx: Fix cleanup in lan78xx_phy_init
>
> If phylink_connect_phy() fails, phylink_disconnect() should not be
> called. Rather than use lan78xx_phy_uninit() which does too much, add
> the cleanup at the end of the function and only undo what was
> successfully done.
>
> Signed-off-by: Andrew Lunn <andrew@lunn.ch>
>
> ---
>  drivers/net/usb/lan78xx.c | 14 ++++++++------
>  1 file changed, 8 insertions(+), 6 deletions(-)
> 
> diff --git a/drivers/net/usb/lan78xx.c b/drivers/net/usb/lan78xx.c
> index bcf293ea1bd3..9cfc122d76ef 100644
> --- a/drivers/net/usb/lan78xx.c
> +++ b/drivers/net/usb/lan78xx.c
> @@ -2842,7 +2842,7 @@ static int lan78xx_phy_init(struct lan78xx_net *dev)
>  
>          ret = lan78xx_mac_prepare_for_phy(dev);
>          if (ret < 0)
> -               goto phylink_uninit;
> +               goto destroy_phylink;
>  
>          /* If no PHY is found, set up a fixed link. It is very specific to
>           * the LAN7801 and is used in special cases like EVB-KSZ9897-1 where
> @@ -2852,7 +2852,7 @@ static int lan78xx_phy_init(struct lan78xx_net *dev)
>          if (!phydev) {
>                  ret = lan78xx_set_fixed_link(dev);
>                  if (ret < 0)
> -                       goto phylink_uninit;
> +                       goto destroy_phylink;
>  
>                  /* No PHY found, so set up a fixed link and return early.
>                   * No need to configure PHY IRQ or attach to phylink.
> @@ -2871,17 +2871,19 @@ static int lan78xx_phy_init(struct lan78xx_net *dev)
>          if (ret) {
>                  netdev_err(dev->net, "can't attach PHY to %s, error %pe\n",
>                             dev->mdiobus->id, ERR_PTR(ret));
> -               goto phylink_uninit;
> +               goto destroy_phylink;
>         }
>  
>          ret = lan78xx_configure_leds_from_dt(dev, phydev);
> 
>      if (ret < 0)
> -               goto phylink_uninit;
> +               goto disconnect_phylink;
>  
>          return 0;
>  
> -phylink_uninit:
> -       lan78xx_phy_uninit(dev);
> 
> +disconnect_phylink:
> +       phylink_disconnect_phy(dev->phylink);
> +destroy_phylink:
> +       phylink_destroy(dev->phylink);
> 
>          return ret;
>  }
> --
> 2.53.0

This prevents the crash. I think this is the fix for the RTNL Problem. Thank you!
But as you already said it is not giving me working ethernet. Will answer in another email.

Regards,

   Sven




  reply	other threads:[~2026-05-06 14:36 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-05-05  9:53 assert in phylink.c with lan7801 and dp83tc811 since kernel 6.18 Sven Schuchmann
2026-05-05 13:13 ` Andrew Lunn
2026-05-06 11:10   ` AW: " Sven Schuchmann
2026-05-06 12:39     ` Andrew Lunn
2026-05-06 13:04       ` Maxime Chevallier
2026-05-06 13:18         ` Andrew Lunn
2026-05-06 16:00           ` AW: " Sven Schuchmann
2026-05-06 16:40             ` Andrew Lunn
2026-05-07  6:52               ` AW: " Sven Schuchmann
2026-05-07 12:49                 ` Andrew Lunn
2026-05-06 13:15     ` Andrew Lunn
2026-05-06 14:36       ` Sven Schuchmann [this message]
2026-05-06 12:30   ` AW: " Sven Schuchmann
2026-05-06 12:52     ` Andrew Lunn

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=BEZP281MB2245E8C2E2E757761DB5F952D93F2@BEZP281MB2245.DEUP281.PROD.OUTLOOK.COM \
    --to=schuchmann@schleissheimer.de \
    --cc=andrew@lunn.ch \
    --cc=netdev@vger.kernel.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox