]> www.infradead.org Git - users/jedix/linux-maple.git/commit
i40e/i40evf: avoid mutex re-init
authorJesse Brandeburg <jesse.brandeburg@intel.com>
Wed, 18 Nov 2015 23:47:06 +0000 (15:47 -0800)
committerChuck Anderson <chuck.anderson@oracle.com>
Thu, 10 Mar 2016 16:36:44 +0000 (08:36 -0800)
commit14e8583cd001014505b338fe20382c57ec69e33e
tree82c058332a3e66b1e56513eff40b73aed7e0d029
parent79b8185053117a2522bf0e1cd54e0d44829658c8
i40e/i40evf: avoid mutex re-init

Orabug: 22342532

If the driver were to happen to have a mutex held while
the i40e_init_adminq call was called, the init_adminq might
inadvertently call mutex_init on a lock that was held
which is a violation of the calling semantics.

Fix this by avoiding adminq.c code allocating/freeing this memory, and
then do the same work only once in probe/remove.

Testing Hints (Required if no HSD): for VF, load i40evf in bare metal
and echo 32 > sriov_numvfs; echo 0 > sriov_numvfs in a loop.  Yes this
is a horrible thing to do.

Change-ID: Ida263c51b34e195252179e7e5e400d73a99be7a2
Reported-by: Stefan Assmann <sassmann@redhat.com>
Signed-off-by: Jesse Brandeburg <jesse.brandeburg@intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
(cherry picked from commit 8ddb33268902c80ecd9a0e1bc766a2dc4bc9fede)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
drivers/net/ethernet/intel/i40e/i40e_adminq.c
drivers/net/ethernet/intel/i40e/i40e_main.c
drivers/net/ethernet/intel/i40evf/i40e_adminq.c
drivers/net/ethernet/intel/i40evf/i40evf_main.c