Commit 4ed1eea8 authored by Tomer Tayar's avatar Tomer Tayar Committed by David S. Miller

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: default avatarTomer Tayar <Tomer.Tayar@cavium.com>
Signed-off-by: default avatarYuval Mintz <Yuval.Mintz@cavium.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 4deece6c
This diff is collapsed.
...@@ -484,8 +484,13 @@ int qed_mcp_bist_nvm_test_get_image_att(struct qed_hwfn *p_hwfn, ...@@ -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))) qed_device_num_engines((_p_hwfn)->cdev)))
struct qed_mcp_info { struct qed_mcp_info {
/* Spinlock used for protecting the access to the MFW mailbox */ /* List for mailbox commands which were sent and wait for a response */
spinlock_t lock; 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 /* Spinlock used for syncing SW link-changes and link-changes
* originating from attention context. * originating from attention context.
...@@ -505,7 +510,7 @@ struct qed_mcp_info { ...@@ -505,7 +510,7 @@ struct qed_mcp_info {
u8 *mfw_mb_cur; u8 *mfw_mb_cur;
u8 *mfw_mb_shadow; u8 *mfw_mb_shadow;
u16 mfw_mb_length; u16 mfw_mb_length;
u16 mcp_hist; u32 mcp_hist;
}; };
struct qed_mcp_mb_params { struct qed_mcp_mb_params {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment