From: "Marek Marczykowski-Górecki" <marmarek@invisiblethingslab.com>
To: Jacob Keller <jacob.e.keller@intel.com>
Cc: Tony Nguyen <anthony.l.nguyen@intel.com>,
davem@davemloft.net, kuba@kernel.org, pabeni@redhat.com,
edumazet@google.com, netdev@vger.kernel.org,
Lukas Wunner <lukas@wunner.de>,
sasha.neftin@intel.com, Roman Lozko <lozko.roma@gmail.com>,
Kurt Kanzenbach <kurt@linutronix.de>,
Heiner Kallweit <hkallweit1@gmail.com>,
Simon Horman <horms@kernel.org>,
Naama Meir <naamax.meir@linux.intel.com>
Subject: Re: [PATCH net] igc: Fix LED-related deadlock on driver unbind
Date: Tue, 23 Apr 2024 01:37:33 +0200 [thread overview]
Message-ID: <Zib0veVgvgTg7Mq6@mail-itl> (raw)
In-Reply-To: <96939b80-b789-41a6-bea6-78f16833bbc9@intel.com>
[-- Attachment #1: Type: text/plain, Size: 1318 bytes --]
On Mon, Apr 22, 2024 at 04:32:01PM -0700, Jacob Keller wrote:
> On 4/22/2024 1:45 PM, Tony Nguyen wrote:
> > From: Lukas Wunner <lukas@wunner.de>
> >
> > Roman reports a deadlock on unplug of a Thunderbolt docking station
> > containing an Intel I225 Ethernet adapter.
> >
> > The root cause is that led_classdev's for LEDs on the adapter are
> > registered such that they're device-managed by the netdev. That
> > results in recursive acquisition of the rtnl_lock() mutex on unplug:
> >
> > When the driver calls unregister_netdev(), it acquires rtnl_lock(),
> > then frees the device-managed resources. Upon unregistering the LEDs,
> > netdev_trig_deactivate() invokes unregister_netdevice_notifier(),
> > which tries to acquire rtnl_lock() again.
> >
> > Avoid by using non-device-managed LED registration.
>
> Could we instead switch to using devm with the PCI device struct instead
> of the netdev struct? That would make it still get automatically cleaned
> up, but by cleaning it up only when the PCIe device goes away, which
> should be after rtnl_lock() is released..
Wouldn't that effectively leak memory if driver is unbound from the
device and then bound back (and possibly repeated multiple times)?
--
Best Regards,
Marek Marczykowski-Górecki
Invisible Things Lab
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
next prev parent reply other threads:[~2024-04-22 23:37 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-04-22 20:45 [PATCH net] igc: Fix LED-related deadlock on driver unbind Tony Nguyen
2024-04-22 23:32 ` Jacob Keller
2024-04-22 23:37 ` Marek Marczykowski-Górecki [this message]
2024-04-22 23:46 ` Jacob Keller
2024-04-23 8:08 ` Lukas Wunner
2024-04-23 7:53 ` Lukas Wunner
2024-04-25 3:40 ` patchwork-bot+netdevbpf
-- strict thread matches above, loose matches on Subject: below --
2024-04-15 13:48 Lukas Wunner
2024-04-16 13:51 ` Simon Horman
2024-04-16 14:06 ` Kurt Kanzenbach
2024-04-16 20:55 ` Lukas Wunner
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=Zib0veVgvgTg7Mq6@mail-itl \
--to=marmarek@invisiblethingslab.com \
--cc=anthony.l.nguyen@intel.com \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=hkallweit1@gmail.com \
--cc=horms@kernel.org \
--cc=jacob.e.keller@intel.com \
--cc=kuba@kernel.org \
--cc=kurt@linutronix.de \
--cc=lozko.roma@gmail.com \
--cc=lukas@wunner.de \
--cc=naamax.meir@linux.intel.com \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=sasha.neftin@intel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).