fm10k: always check init_hw for errors
authorJacob Keller <jacob.e.keller@intel.com>
Fri, 16 Oct 2015 17:56:58 +0000 (10:56 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 15 Sep 2016 06:27:39 +0000 (08:27 +0200)
commit134d78e9d4625aa237d9e6a516965e753bb02e67
tree29f8eadfe3d761992211a189ff91bb4b60bb24ea
parent587e0cfdad34aa76d6bafa9151e4afabadbdbfbd
fm10k: always check init_hw for errors

[ Upstream commit 1343c65f70ee1b1f968a08b30e1836a4e37116cd ]

A recent change modified init_hw in some flows the function may fail on
VF devices. For example, if a VF doesn't yet own its own queues.
However, many callers of init_hw didn't bother to check the error code.
Other callers checked but only displayed diagnostic messages without
actually handling the consequences.

Fix this by (a) always returning and preventing the netdevice from going
up, and (b) printing the diagnostic in every flow for consistency. This
should resolve an issue where VF drivers would attempt to come up
before the PF has finished assigning queues.

In addition, change the dmesg output to explicitly show the actual
function that failed, instead of combining reset_hw and init_hw into a
single check, to help for future debugging.

Fixes: 1d568b0f6424 ("fm10k: do not assume VF always has 1 queue")
Signed-off-by: Jacob Keller <jacob.e.keller@intel.com>
Reviewed-by: Bruce Allan <bruce.w.allan@intel.com>
Tested-by: Krishneil Singh <Krishneil.k.singh@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/net/ethernet/intel/fm10k/fm10k_pci.c