Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 26 Mar 2019 13:35:23 +0000 (UTC)
From:      Hans Petter Selasky <hselasky@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org
Subject:   svn commit: r345532 - stable/11/sys/dev/mlx4/mlx4_en
Message-ID:  <201903261335.x2QDZN90030830@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: hselasky
Date: Tue Mar 26 13:35:23 2019
New Revision: 345532
URL: https://svnweb.freebsd.org/changeset/base/345532

Log:
  MFC r344919:
  Don't hold state lock while detaching network device instance in mlx4en(4).
  
  It can happen during shutdown that the lock will recurse when the mlx4en(4)
  instance is part of a lagg interface. Call ether_ifdetach() unlocked.
  
  Backtrace:
  panic(): _sx_xlock_hard: recursed on non-recursive sx &mdev->state_lock
  _sx_xlock_hard()
  _sx_xlock()
  mlx4_en_ioctl()
  if_setlladdr()
  lagg_port_destroy()
  lagg_port_ifdetach()
  if_detach()
  mlx4_en_destroy_netdev()
  mlx4_en_remove()
  mlx4_remove_device()
  mlx4_unregister_device()
  mlx4_unload_one()
  mlx4_shutdown()
  linux_pci_shutdown()
  bus_generic_shutdown()
  
  Sponsored by:		Mellanox Technologies

Modified:
  stable/11/sys/dev/mlx4/mlx4_en/mlx4_en_netdev.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/dev/mlx4/mlx4_en/mlx4_en_netdev.c
==============================================================================
--- stable/11/sys/dev/mlx4/mlx4_en/mlx4_en_netdev.c	Tue Mar 26 13:33:36 2019	(r345531)
+++ stable/11/sys/dev/mlx4/mlx4_en/mlx4_en_netdev.c	Tue Mar 26 13:35:23 2019	(r345532)
@@ -1777,11 +1777,8 @@ void mlx4_en_destroy_netdev(struct net_device *dev)
 		EVENTHANDLER_DEREGISTER(vlan_unconfig, priv->vlan_detach);
 
 	/* Unregister device - this will close the port if it was up */
-	if (priv->registered) {
-		mutex_lock(&mdev->state_lock);
+	if (priv->registered)
 		ether_ifdetach(dev);
-		mutex_unlock(&mdev->state_lock);
-	}
 
 	mutex_lock(&mdev->state_lock);
 	mlx4_en_stop_port(dev);



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201903261335.x2QDZN90030830>