Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp795381imm; Wed, 6 Jun 2018 06:10:39 -0700 (PDT) X-Google-Smtp-Source: ADUXVKKkWeRcuxwKuprgEaX38wXHFqzZqU2FNHrFUckXsp1Qi7ggmznvG1Dp5+oEXAxqZCgiwVjJ X-Received: by 2002:a62:6e01:: with SMTP id j1-v6mr2407285pfc.93.1528290638936; Wed, 06 Jun 2018 06:10:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1528290638; cv=none; d=google.com; s=arc-20160816; b=s2FTyog/xrqIJT09rxPR6rV4OskKO/lw76M0InWm36DHM05VWUA5sDhAVJuSm/5wi2 WdKsLOXIGUWozx5hKfzCNzcg3BxT3W0LPHQl3Co6EOd84/5mL4HDViGIR73P3q3YXVge 8admKqm9D2iGjEPknMY9I43azj3SjssryeQehkB9w5s7hrnF8xsn5LGZ6v+svh97PF0H dYb1pu5gETrh+ovOVxhj7agMCyzIZBy2DbODvUt+A/XE9tJ0csW7CP0xytZilf8GkosQ zlE0lhwj9mgrVhSi9RP7J8IU0rDew9aUq4tJj6nfibmaMvIImahKPMaMOljR1LaXNHPS JmGw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:arc-authentication-results; bh=YvY2bOgjW0qWrfCtwMnX6EeGTJsQ+jBOF/XFQEpPMhw=; b=mkKlydNPoHBhLfTmeHlGW8wG7aLwDO1k34QNQ6wLdvH1QS4yqcvI2GbNrFRV8O+lmY ny1XtjvnKJvEkpttE03PuDqUfjmZR94miWEI8i/vCn49u5JPMfGiZkKPd8sdZLNLF0Xp CIy3P7fKBibz9KmL7T29e6MmlouA+48a3EoAjonrlqE0Q2SvlzNXRrkALVekchDMK5Ai 3KgbgWeIchujm2ApVat7uEljVQJ6Xi8+VySnWtNbI6orR5d/7GoJSQVvPoLflLIOZaXO rFViNcpU2A0ZTx6pnzp7pm0DlAQlJl4jVQ3YnqtW3m9EiYpJyID2CePdjwMKsFFrr197 yuVQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 89-v6si23239043plf.224.2018.06.06.06.10.23; Wed, 06 Jun 2018 06:10:38 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752180AbeFFNIu (ORCPT + 99 others); Wed, 6 Jun 2018 09:08:50 -0400 Received: from szxga06-in.huawei.com ([45.249.212.32]:58546 "EHLO huawei.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1752046AbeFFNIr (ORCPT ); Wed, 6 Jun 2018 09:08:47 -0400 Received: from DGGEMS411-HUB.china.huawei.com (unknown [172.30.72.59]) by Forcepoint Email with ESMTP id B939C5611DA9D; Wed, 6 Jun 2018 21:08:43 +0800 (CST) Received: from S00293818-DELL1.china.huawei.com (10.202.227.234) by DGGEMS411-HUB.china.huawei.com (10.3.19.211) with Microsoft SMTP Server id 14.3.382.0; Wed, 6 Jun 2018 21:08:34 +0800 From: Salil Mehta To: CC: , , , , , , , Xi Wang Subject: [PATCH V2 net-next 1/3] net: hns3: Fix for VF mailbox cannot receiving PF response Date: Wed, 6 Jun 2018 14:07:51 +0100 Message-ID: <20180606130753.54428-2-salil.mehta@huawei.com> X-Mailer: git-send-email 2.8.3 In-Reply-To: <20180606130753.54428-1-salil.mehta@huawei.com> References: <20180606130753.54428-1-salil.mehta@huawei.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.202.227.234] X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Xi Wang When the VF frequently switches the CMDQ interrupt, if the CMDQ_SRC is not cleared, the VF will not receive the new PF response after the interrupt is re-enabled, the corresponding log is as follows: [ 317.482222] hns3 0000:00:03.0: VF could not get mbx resp(=0) from PF in 500 tries [ 317.483137] hns3 0000:00:03.0: VF request to get tqp info from PF failed -5 This patch fixes this problem by clearing CMDQ_SRC before enabling interrupt and syncing pending IRQ handlers after disabling interrupt. Fixes: e2cb1dec9779 ("net: hns3: Add HNS3 VF HCL(Hardware Compatibility Layer) Support") Signed-off-by: Xi Wang Signed-off-by: Peng Li Signed-off-by: Salil Mehta --- drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c b/drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c index dd8e8e6..d55ee9c 100644 --- a/drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c +++ b/drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c @@ -1576,6 +1576,8 @@ static int hclgevf_misc_irq_init(struct hclgevf_dev *hdev) return ret; } + hclgevf_clear_event_cause(hdev, 0); + /* enable misc. vector(vector 0) */ hclgevf_enable_vector(&hdev->misc_vector, true); @@ -1586,6 +1588,7 @@ static void hclgevf_misc_irq_uninit(struct hclgevf_dev *hdev) { /* disable misc vector(vector 0) */ hclgevf_enable_vector(&hdev->misc_vector, false); + synchronize_irq(hdev->misc_vector.vector_irq); free_irq(hdev->misc_vector.vector_irq, hdev); hclgevf_free_vector(hdev, 0); } -- 2.7.4