diff options
author | Tomer Tayar <Tomer.Tayar@cavium.com> | 2017-03-23 15:50:15 +0200 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2017-03-23 11:53:29 -0700 |
commit | 4ed1eea82a21ba460e53468cc1c73cfdf83d0e00 (patch) | |
tree | 4b58fb4a3f9dbcfd8263316c859bb5dc7480455d /drivers/net/ethernet/qlogic/qed/qed_mcp.h | |
parent | Merge branch 'netvsc-bug-fixes-and-cleanups' (diff) | |
download | linux-dev-4ed1eea82a21ba460e53468cc1c73cfdf83d0e00.tar.xz linux-dev-4ed1eea82a21ba460e53468cc1c73cfdf83d0e00.zip |
qed: Revise MFW command locking
Interaction of driver -> management firmware is based
on a one-pending mailbox [per interface], and various
mailbox commands need to be synchronized.
Current scheme is messy, and there's a difficulty extending
it as it deals differently with various commands as well as
making assumption on the required behavior for load/unload
requests.
Drop the current scheme into a completion-list-based approach;
Each flow would try sending the command when possible,
allowing one flow to complete another flow's completion and
relieve the mailbox before sending its own command.
Signed-off-by: Tomer Tayar <Tomer.Tayar@cavium.com>
Signed-off-by: Yuval Mintz <Yuval.Mintz@cavium.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to '')
-rw-r--r-- | drivers/net/ethernet/qlogic/qed/qed_mcp.h | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/drivers/net/ethernet/qlogic/qed/qed_mcp.h b/drivers/net/ethernet/qlogic/qed/qed_mcp.h index bdbfd6d4485e..0f7b26818acf 100644 --- a/drivers/net/ethernet/qlogic/qed/qed_mcp.h +++ b/drivers/net/ethernet/qlogic/qed/qed_mcp.h @@ -484,8 +484,13 @@ int qed_mcp_bist_nvm_test_get_image_att(struct qed_hwfn *p_hwfn, qed_device_num_engines((_p_hwfn)->cdev))) struct qed_mcp_info { - /* Spinlock used for protecting the access to the MFW mailbox */ - spinlock_t lock; + /* List for mailbox commands which were sent and wait for a response */ + struct list_head cmd_list; + + /* Spinlock used for protecting the access to the mailbox commands list + * and the sending of the commands. + */ + spinlock_t cmd_lock; /* Spinlock used for syncing SW link-changes and link-changes * originating from attention context. @@ -505,7 +510,7 @@ struct qed_mcp_info { u8 *mfw_mb_cur; u8 *mfw_mb_shadow; u16 mfw_mb_length; - u16 mcp_hist; + u32 mcp_hist; }; struct qed_mcp_mb_params { |