From mboxrd@z Thu Jan 1 00:00:00 1970 From: Sergei Shtylyov Subject: Re: [Patch net 09/11] net: hns3: bugfix for handling mailbox while the command queue reinitialized Date: Sat, 27 Oct 2018 22:05:31 +0300 Message-ID: <771035e9-2e0c-9438-659b-5a54438c620f@cogentembedded.com> References: <1540608118-27449-1-git-send-email-tanhuazhong@huawei.com> <1540608118-27449-10-git-send-email-tanhuazhong@huawei.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Cc: netdev@vger.kernel.org, linuxarm@huawei.com, salil.mehta@huawei.com, yisen.zhuang@huawei.com, lipeng321@huawei.com To: Huazhong Tan , davem@davemloft.net Return-path: Received: from mail-lf1-f67.google.com ([209.85.167.67]:40739 "EHLO mail-lf1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728472AbeJ1Drj (ORCPT ); Sat, 27 Oct 2018 23:47:39 -0400 Received: by mail-lf1-f67.google.com with SMTP id n3-v6so3251225lfe.7 for ; Sat, 27 Oct 2018 12:05:43 -0700 (PDT) In-Reply-To: <1540608118-27449-10-git-send-email-tanhuazhong@huawei.com> Sender: netdev-owner@vger.kernel.org List-ID: On 27.10.2018 5:41, Huazhong Tan wrote: > In a multi-core machine, the mailbox service and reset service > will be executed at the same time. The reset server will re-initialize > the commond queue, before that, the mailbox handler can only get some Command? > 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 > hanlder recognizes this flag, it should not process the command. Handler. > > Fixes: dde1a86e93ca ("net: hns3: Add mailbox support to PF driver") > Signed-off-by: Huazhong Tan > --- > drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_mbx.c | 6 ++++++ > 1 file changed, 6 insertions(+) > > diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_mbx.c b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_mbx.c > index 04462a3..6ac2fab 100644 > --- a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_mbx.c > +++ b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_mbx.c > @@ -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 need re-initialize\n"); Needs re-initializing. [...] MBR, Sergei