summaryrefslogtreecommitdiff
path: root/drivers/net/cxgb4vf/cxgb4vf_main.c
diff options
context:
space:
mode:
authorCasey Leedom <leedom@chelsio.com>2010-11-11 09:06:53 (GMT)
committerDavid S. Miller <davem@davemloft.net>2010-11-12 20:31:01 (GMT)
commite68e6133e2daef6fc40e91621a1e26938e428e9e (patch)
tree21759991e47e782de8ebb4153396b651a0ef0095 /drivers/net/cxgb4vf/cxgb4vf_main.c
parente7a3795f56122cc92530c3f9412b8ff19b70184c (diff)
downloadlinux-fsl-qoriq-e68e6133e2daef6fc40e91621a1e26938e428e9e.tar.xz
cxgb4vf: add call to Firmware to reset VF State.
Add call to Firmware to reset its VF State when we first attach to the VF. Signed-off-by: Casey Leedom <leedom@chelsio.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/cxgb4vf/cxgb4vf_main.c')
-rw-r--r--drivers/net/cxgb4vf/cxgb4vf_main.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/drivers/net/cxgb4vf/cxgb4vf_main.c b/drivers/net/cxgb4vf/cxgb4vf_main.c
index 8da3bda..c3449bb 100644
--- a/drivers/net/cxgb4vf/cxgb4vf_main.c
+++ b/drivers/net/cxgb4vf/cxgb4vf_main.c
@@ -2065,6 +2065,22 @@ static int adap_init0(struct adapter *adapter)
}
/*
+ * Some environments do not properly handle PCIE FLRs -- e.g. in Linux
+ * 2.6.31 and later we can't call pci_reset_function() in order to
+ * issue an FLR because of a self- deadlock on the device semaphore.
+ * Meanwhile, the OS infrastructure doesn't issue FLRs in all the
+ * cases where they're needed -- for instance, some versions of KVM
+ * fail to reset "Assigned Devices" when the VM reboots. Therefore we
+ * use the firmware based reset in order to reset any per function
+ * state.
+ */
+ err = t4vf_fw_reset(adapter);
+ if (err < 0) {
+ dev_err(adapter->pdev_dev, "FW reset failed: err=%d\n", err);
+ return err;
+ }
+
+ /*
* Grab basic operational parameters. These will predominantly have
* been set up by the Physical Function Driver or will be hard coded
* into the adapter. We just have to live with them ... Note that