diff options
author | sarveshwarb <sarveshwarb@serverengines.com> | 2009-08-05 22:05:24 +0200 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2009-08-05 22:05:24 +0200 |
commit | 14074eab8dcaa7f66d8f52612b2dcec51222bb5f (patch) | |
tree | b385d8edcc1c6ce44ac7c58552cb0de7839ceb46 /drivers/net/benet/be_cmds.c | |
parent | net: implement a SO_DOMAIN getsockoption (diff) | |
download | linux-14074eab8dcaa7f66d8f52612b2dcec51222bb5f.tar.xz linux-14074eab8dcaa7f66d8f52612b2dcec51222bb5f.zip |
be2net: Patch to perform function reset at initialization
This patch is a bug fix to avoid system going into a bad state when
driver is loaded in context of kdump kernel. The patch fixes the issue
by performing a soft reset of pci function at probe time.
Signed-off-by: sarveshwarb <sarveshwarb@serverengines.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/benet/be_cmds.c')
-rw-r--r-- | drivers/net/benet/be_cmds.c | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/drivers/net/benet/be_cmds.c b/drivers/net/benet/be_cmds.c index de107732dcdc..2547ee296a7d 100644 --- a/drivers/net/benet/be_cmds.c +++ b/drivers/net/benet/be_cmds.c @@ -1019,3 +1019,24 @@ int be_cmd_query_fw_cfg(struct be_adapter *adapter, u32 *port_num) spin_unlock(&adapter->mbox_lock); return status; } + +int be_cmd_reset_function(struct be_adapter *adapter) +{ + struct be_mcc_wrb *wrb = wrb_from_mbox(&adapter->mbox_mem); + struct be_cmd_req_hdr *req = embedded_payload(wrb); + int status; + + spin_lock(&adapter->mbox_lock); + + memset(wrb, 0, sizeof(*wrb)); + + be_wrb_hdr_prepare(wrb, sizeof(*req), true, 0); + + be_cmd_hdr_prepare(req, CMD_SUBSYSTEM_COMMON, + OPCODE_COMMON_FUNCTION_RESET, sizeof(*req)); + + status = be_mbox_notify(adapter); + + spin_unlock(&adapter->mbox_lock); + return status; +} |