diff options
author | Tomer Tayar <Tomer.Tayar@qlogic.com> | 2016-03-09 09:16:24 +0200 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2016-03-11 15:20:20 -0500 |
commit | 5529bad98f10f742e3ab490733bed8e108508759 (patch) | |
tree | 8564fbcf435afad3c794c1b965e333fb839ef419 /drivers/net/ethernet/qlogic/qed/qed_mcp.h | |
parent | fc916ff2027760900f3b373c388a2098253f3c2a (diff) | |
download | linux-5529bad98f10f742e3ab490733bed8e108508759.tar.bz2 |
qed: Major changes to MB locking
Driver interaction with the managemnt firmware is done via mailbox
commands which the management firmware periodically sample, as well
as placing of additional data in set places in the shared memory.
Each PF has a single designated mailbox address, and all flows that
require messaging to the management should use it.
This patch does 2 things:
1. It re-defines the critical section surrounding the mailbox sending -
that section should include the setting of the shared memory as well as
the sending of the command [otherwise a race might send a command with
the data of a different command].
2. It moves the locking scheme from using mutices into using spinlocks.
This lays the groundwork for sending MFW commands from non-sleepable
contexts.
Signed-off-by: Tomer Tayar <Tomer.Tayar@qlogic.com>
Signed-off-by: Yuval Mintz <Yuval.Mintz@qlogic.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/qlogic/qed/qed_mcp.h')
-rw-r--r-- | drivers/net/ethernet/qlogic/qed/qed_mcp.h | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/drivers/net/ethernet/qlogic/qed/qed_mcp.h b/drivers/net/ethernet/qlogic/qed/qed_mcp.h index 506197d5c3dd..50917a2131a5 100644 --- a/drivers/net/ethernet/qlogic/qed/qed_mcp.h +++ b/drivers/net/ethernet/qlogic/qed/qed_mcp.h @@ -11,8 +11,8 @@ #include <linux/types.h> #include <linux/delay.h> -#include <linux/mutex.h> #include <linux/slab.h> +#include <linux/spinlock.h> #include "qed_hsi.h" struct qed_mcp_link_speed_params { @@ -255,7 +255,8 @@ int qed_mcp_set_led(struct qed_hwfn *p_hwfn, #define MFW_PORT(_p_hwfn) ((_p_hwfn)->abs_pf_id % \ ((_p_hwfn)->cdev->num_ports_in_engines * 2)) struct qed_mcp_info { - struct mutex mutex; /* MCP access lock */ + spinlock_t lock; + bool block_mb_sending; u32 public_base; u32 drv_mb_addr; u32 mfw_mb_addr; @@ -272,6 +273,15 @@ struct qed_mcp_info { u16 mcp_hist; }; +struct qed_mcp_mb_params { + u32 cmd; + u32 param; + union drv_union_data *p_data_src; + union drv_union_data *p_data_dst; + u32 mcp_resp; + u32 mcp_param; +}; + /** * @brief Initialize the interface with the MCP * |