Skip to content

Commit

Permalink
net: hns3: bugfix for handling mailbox while the command queue reinit…
Browse files Browse the repository at this point in the history
…ialized

In a multi-core machine, the mailbox service and reset service
will be executed at the same time. The reset service will re-initialize
the command queue, before that, the mailbox handler can only get some
invalid messages.

The HCLGE_STATE_CMD_DISABLE flag means that the command queue is not
available and needs to be reinitialized. Therefore, when the mailbox
handler recognizes this flag, it should not process the command.

Fixes: dde1a86 ("net: hns3: Add mailbox support to PF driver")
Signed-off-by: Huazhong Tan <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
  • Loading branch information
Huazhong Tan authored and davem330 committed Oct 31, 2018
1 parent 7fa6be4 commit 3c88ed1
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_mbx.c
Original file line number Diff line number Diff line change
Expand Up @@ -400,6 +400,12 @@ void hclge_mbx_handler(struct hclge_dev *hdev)

/* handle all the mailbox requests in the queue */
while (!hclge_cmd_crq_empty(&hdev->hw)) {
if (test_bit(HCLGE_STATE_CMD_DISABLE, &hdev->state)) {
dev_warn(&hdev->pdev->dev,
"command queue needs re-initializing\n");
return;
}

desc = &crq->desc[crq->next_to_use];
req = (struct hclge_mbx_vf_to_pf_cmd *)desc->data;

Expand Down

0 comments on commit 3c88ed1

Please sign in to comment.