]> git.baikalelectronics.ru Git - kernel.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)
committerJeff Kirsher <jeffrey.t.kirsher@intel.com>
Thu, 3 Dec 2015 21:43:06 +0000 (13:43 -0800)
commitcdb527e9cee30f47ca2e267b68e5ee11cd27b507
treed01fe095c8d1511a4cc7abaca47f07532eca2839
parent79eba136cc55b1881068eb536c0a285914fc0124
i40e/i40evf: avoid mutex re-init

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>
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