Date: Tue, 26 Mar 2019 13:33:37 +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-12@freebsd.org Subject: svn commit: r345531 - stable/12/sys/dev/mlx4/mlx4_en Message-ID: <201903261333.x2QDXbqU030682@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: hselasky Date: Tue Mar 26 13:33:36 2019 New Revision: 345531 URL: https://svnweb.freebsd.org/changeset/base/345531 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/12/sys/dev/mlx4/mlx4_en/mlx4_en_netdev.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/dev/mlx4/mlx4_en/mlx4_en_netdev.c ============================================================================== --- stable/12/sys/dev/mlx4/mlx4_en/mlx4_en_netdev.c Tue Mar 26 11:03:09 2019 (r345530) +++ stable/12/sys/dev/mlx4/mlx4_en/mlx4_en_netdev.c Tue Mar 26 13:33:36 2019 (r345531) @@ -1779,11 +1779,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?201903261333.x2QDXbqU030682>