From patchwork Tue Jun 5 11:41:59 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Salil Mehta X-Patchwork-Id: 137711 Delivered-To: patch@linaro.org Received: by 2002:a2e:970d:0:0:0:0:0 with SMTP id r13-v6csp850129lji; Tue, 5 Jun 2018 04:43:13 -0700 (PDT) X-Google-Smtp-Source: ADUXVKLrs9kzLn4lNi2Gp3Xl/Myp3ivPg2JU0A78PIFXfFvoF0dw8FwAqigbSGfI82DtfsZwCgrR X-Received: by 2002:a63:aa07:: with SMTP id e7-v6mr20497214pgf.331.1528198993184; Tue, 05 Jun 2018 04:43:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1528198993; cv=none; d=google.com; s=arc-20160816; b=e6Rde/mD6s97e9+AJiKfOcAFxfA7gjgnPrkMX8ZPTkChLmBU/A2SpO6tP+IGNMvvdk LV0+tRM/DIj2mJ2Cn61EJvUlyQTbLiTl1tGN0LHBujDqyJPAMy0pTnHBHZ1ss/R9y8bx XFHr4lhNIDdbRzGxzlQslWyB9JvzK57032+CScvY3YJh0XnuOlr1B3MPY6VyJL7B6uGu LMyWGB3SAIZaEEz84vkYcHqCw4Fmcv7OjpTUw3QNpCrFo5w6cC2o9EebWQ9Tj7dc0Cde 60Zq9Wub1qer0P2L8z6KSuV/qAn02Lk0S1FzSLcYKPpVGR/ayyucqvjX6gXnqKAcqj0A i1CQ== 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=lIc8o9PQjpPkMUBartNDwBDGQH93mmzzxuKLRJaBtn8sB762RPWt5dHerRpQFehf5Y ytCU4bvzPV97zrgf9R2Yz5aC1j+dTkedcXH794lyomE7lMIr4UVFxqEwmO7KpCgI8Je1 L8jOeGAPclfo1JJ7he57NPIsa/vHS5VJhHfKnLluz3PlTQelOJbNcboyd56PtQW8VkT+ BCLpP8B5dfHN3U9IJfekOZwtm5Gd3zsTqXG4g7DGjduLplkBRHd8Tlb5W7uL6hz40DI+ 9EfvS+1y3vOOXTsPk+l4GdGPLT/QnNCRBcn24GbXCA+VXRk9uu15EQbn5DFICvva7cwV e97A== 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 e11-v6si36165523pgs.476.2018.06.05.04.43.12; Tue, 05 Jun 2018 04:43:13 -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 S1751929AbeFELnL (ORCPT + 30 others); Tue, 5 Jun 2018 07:43:11 -0400 Received: from szxga05-in.huawei.com ([45.249.212.191]:8695 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751856AbeFELnI (ORCPT ); Tue, 5 Jun 2018 07:43:08 -0400 Received: from DGGEMS412-HUB.china.huawei.com (unknown [172.30.72.59]) by Forcepoint Email with ESMTP id 9BF17D6669B82; Tue, 5 Jun 2018 19:42:53 +0800 (CST) Received: from S00293818-DELL1.china.huawei.com (10.202.227.234) by DGGEMS412-HUB.china.huawei.com (10.3.19.212) with Microsoft SMTP Server id 14.3.382.0; Tue, 5 Jun 2018 19:42:45 +0800 From: Salil Mehta To: CC: , , , , , , , Xi Wang Subject: [PATCH net-next 1/3] net: hns3: Fix for VF mailbox cannot receiving PF response Date: Tue, 5 Jun 2018 12:41:59 +0100 Message-ID: <20180605114201.29900-2-salil.mehta@huawei.com> X-Mailer: git-send-email 2.8.3 In-Reply-To: <20180605114201.29900-1-salil.mehta@huawei.com> References: <20180605114201.29900-1-salil.mehta@huawei.com> MIME-Version: 1.0 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(+) -- 2.7.4 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); }