Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp794827imm; Tue, 5 Jun 2018 04:43:53 -0700 (PDT) X-Google-Smtp-Source: ADUXVKJRAhxKijB4TfY06OqGA9oT9pjzqSSsnL27UkWQLbcpvsEIN/2CVuRhPRZyNCWyxC2B+9h+ X-Received: by 2002:a65:52cc:: with SMTP id z12-v6mr20400518pgp.126.1528199033704; Tue, 05 Jun 2018 04:43:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1528199033; cv=none; d=google.com; s=arc-20160816; b=m3yB6447tUenSB3c1btP8P9ioKJbEDkoj82TcWgD1IGUkCYFI6hdivEcSP8GzaFUwm LcINDUpPnEIVi2wuVvlWZ3ybAqtleKGpPuvK3boidpG2LLRHt4QOO9oMKr0VAp7aO5xo h1WCGKkSVybdwM5+jSaP0EAlISx67BbcFkDNstzSZ64udhhPOuvhOw2qfPb8Khm0J7OS Vy7kAONPFJKkYaMnOhsKaZ9G7kHMmY5DfnLkZLbqRTNQ8iz60dnjSjHog7Nojz5tbZ9W /Y18bWon8IF50ChG5PWf9Tg64yvXFs61c/EWlZ5Paio1/FaFWm9FOB7eerkg8b4MEiwy 9/Vw== 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 w5-v6si47197202plz.356.2018.06.05.04.43.39; Tue, 05 Jun 2018 04:43:53 -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 S1751925AbeFELnL (ORCPT + 99 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 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