intel-wired-lan.lists.osuosl.org archive mirror
 help / color / mirror / Atom feed
From: Simon Horman <horms@kernel.org>
To: Kurt Kanzenbach <kurt@linutronix.de>
Cc: "Andrew Lunn" <andrew@lunn.ch>,
	"Sasha Neftin" <sasha.neftin@intel.com>,
	"Roman Lozko" <lozko.roma@gmail.com>,
	"Marek Marczykowski-Górecki" <marmarek@invisiblethingslab.com>,
	"Eric Dumazet" <edumazet@google.com>,
	"Lukas Wunner" <lukas@wunner.de>,
	"Tony Nguyen" <anthony.l.nguyen@intel.com>,
	intel-wired-lan@lists.osuosl.org,
	"Jakub Kicinski" <kuba@kernel.org>,
	netdev@vger.kernel.org, "Paolo Abeni" <pabeni@redhat.com>,
	"David S. Miller" <davem@davemloft.net>
Subject: Re: [Intel-wired-lan] [PATCH iwl-net v2] igc: Fix deadlock on module removal
Date: Tue, 16 Apr 2024 14:51:29 +0100	[thread overview]
Message-ID: <20240416135129.GA3769813@kernel.org> (raw)
In-Reply-To: <20240411-igc_led_deadlock-v2-1-b758c0c88b2b@linutronix.de>

On Mon, Apr 15, 2024 at 12:59:37PM +0200, Kurt Kanzenbach wrote:
> From: Lukas Wunner <lukas@wunner.de>
> 
> The removal of the igc module leads to a deadlock:
> 
> |[Mon Apr  8 17:38:55 2024]  __mutex_lock.constprop.0+0x3e5/0x7a0
> |[Mon Apr  8 17:38:55 2024]  ? preempt_count_add+0x85/0xd0
> |[Mon Apr  8 17:38:55 2024]  __mutex_lock_slowpath+0x13/0x20
> |[Mon Apr  8 17:38:55 2024]  mutex_lock+0x3b/0x50
> |[Mon Apr  8 17:38:55 2024]  rtnl_lock+0x19/0x20
> |[Mon Apr  8 17:38:55 2024]  unregister_netdevice_notifier+0x2a/0xc0
> |[Mon Apr  8 17:38:55 2024]  netdev_trig_deactivate+0x25/0x70
> |[Mon Apr  8 17:38:55 2024]  led_trigger_set+0xe2/0x2d0
> |[Mon Apr  8 17:38:55 2024]  led_classdev_unregister+0x4f/0x100
> |[Mon Apr  8 17:38:55 2024]  devm_led_classdev_release+0x15/0x20
> |[Mon Apr  8 17:38:55 2024]  release_nodes+0x47/0xc0
> |[Mon Apr  8 17:38:55 2024]  devres_release_all+0x9f/0xe0
> |[Mon Apr  8 17:38:55 2024]  device_del+0x272/0x3c0
> |[Mon Apr  8 17:38:55 2024]  netdev_unregister_kobject+0x8c/0xa0
> |[Mon Apr  8 17:38:55 2024]  unregister_netdevice_many_notify+0x530/0x7c0
> |[Mon Apr  8 17:38:55 2024]  unregister_netdevice_queue+0xad/0xf0
> |[Mon Apr  8 17:38:55 2024]  unregister_netdev+0x21/0x30
> |[Mon Apr  8 17:38:55 2024]  igc_remove+0xfb/0x1f0 [igc]
> |[Mon Apr  8 17:38:55 2024]  pci_device_remove+0x42/0xb0
> |[Mon Apr  8 17:38:55 2024]  device_remove+0x43/0x70
> 
> unregister_netdev() acquires the RNTL lock and releases the LEDs bound
> to that netdevice. However, netdev_trig_deactivate() and later
> unregister_netdevice_notifier() try to acquire the RTNL lock again.
> 
> Avoid this situation by not using the device-managed LED class
> functions.
> 
> Link: https://lore.kernel.org/r/CAEhC_B=ksywxCG_+aQqXUrGEgKq+4mqnSV8EBHOKbC3-Obj9+Q@mail.gmail.com/
> Link: https://lore.kernel.org/r/ZhRD3cOtz5i-61PB@mail-itl/
> Reported-by: Roman Lozko <lozko.roma@gmail.com>
> Reported-by: "Marek Marczykowski-Górecki" <marmarek@invisiblethingslab.com>
> Fixes: ea578703b03d ("igc: Add support for LEDs on i225/i226")
> Signed-off-by: Lukas Wunner <lukas@wunner.de>
> [Kurt: Wrote commit message and tested on i225]
> Signed-off-by: Kurt Kanzenbach <kurt@linutronix.de>

I am aware that this patch seems to have also been submitted by Lucas
himself. I'd like to suggest that we focus on review of that submission.

https://lore.kernel.org/netdev/2f1be6b1cf2b3346929b0049f2ac7d7d79acb5c9.1713188539.git.lukas@wunner.de/


      reply	other threads:[~2024-04-16 13:51 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-04-15 10:59 [Intel-wired-lan] [PATCH iwl-net v2] igc: Fix deadlock on module removal Kurt Kanzenbach
2024-04-16 13:51 ` Simon Horman [this message]

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=20240416135129.GA3769813@kernel.org \
    --to=horms@kernel.org \
    --cc=andrew@lunn.ch \
    --cc=anthony.l.nguyen@intel.com \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=intel-wired-lan@lists.osuosl.org \
    --cc=kuba@kernel.org \
    --cc=kurt@linutronix.de \
    --cc=lozko.roma@gmail.com \
    --cc=lukas@wunner.de \
    --cc=marmarek@invisiblethingslab.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 read-only IMAP folder(s) and NNTP newsgroup(s).