From: Jakub Kicinski <kuba@kernel.org>
To: Chenguang Zhao <chenguang.zhao@linux.dev>
Cc: andrew@lunn.ch, hkallweit1@gmail.com, linux@armlinux.org.uk,
davem@davemloft.net, edumazet@google.com, pabeni@redhat.com,
netdev@vger.kernel.org, Chenguang Zhao <zhaochenguang@kylinos.cn>,
syzbot+694b49f41098a5df4fd7@syzkaller.appspotmail.com
Subject: Re: [PATCH net-next v3] net: phy: make the hwtstamp provider lifetime symmetric with the PHY
Date: Tue, 29 Sep 2026 17:03:00 -0700 [thread overview]
Message-ID: <20260929170300.39a8cb63@kernel.org> (raw)
In-Reply-To: <20260923071132.908826-1-chenguang.zhao@linux.dev>
On Wed, 23 Sep 2026 15:11:32 +0800 Chenguang Zhao wrote:
> phy_detach() removes dev->hwprov when it points at the PHY being
> detached, but phy_attach() does not install anything: the setup and
> teardown are not symmetric. The teardown path is also reached from
> the probe error path with no RTNL and an unregistered netdev, making
> rtnl_dereference() of dev->hwprov trigger a lockdep splat.
>
> Track the provider with the PHY instead: dev_attach_hwtstamp_phylib()
> installs a default provider in phy_attach_direct(), and
> dev_clear_hwtstamp_phylib() removes it in phy_detach(). Both sit
> next to dev_set_hwtstamp_phylib() so the locking is obviously the
> same, relaxed for unregistered netdevs via
> netdev_ops_lock_dereference_or_invisible(). No driver callback is
> invoked; installation is skipped when the PHY is not the default
> hwtstamp provider or when ethtool already set one.
This is pure slop, you added this incredibly ugly
netdev_ops_lock_dereference_or_invisible()
instead of just taking the RCU lock.
Please don't send send any patches to networking for the next 2 months
and use this time to learn kernel programming basics.
--
pw-bot: reject
pv-ban: 2mo
next prev parent reply other threads:[~2026-09-30 0:03 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-23 7:11 [PATCH net-next v3] net: phy: make the hwtstamp provider lifetime symmetric with the PHY Chenguang Zhao
2026-09-30 0:03 ` Jakub Kicinski [this message]
2026-10-02 9:43 ` Chenguang Zhao
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=20260929170300.39a8cb63@kernel.org \
--to=kuba@kernel.org \
--cc=andrew@lunn.ch \
--cc=chenguang.zhao@linux.dev \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=hkallweit1@gmail.com \
--cc=linux@armlinux.org.uk \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=syzbot+694b49f41098a5df4fd7@syzkaller.appspotmail.com \
--cc=zhaochenguang@kylinos.cn \
/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.