From patchwork Wed Jun 6 13:07:51 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Salil Mehta X-Patchwork-Id: 137828 Delivered-To: patch@linaro.org Received: by 2002:a2e:970d:0:0:0:0:0 with SMTP id r13-v6csp782029lji; Wed, 6 Jun 2018 06:08:54 -0700 (PDT) X-Google-Smtp-Source: ADUXVKKqpFpRUZJCQMEQSMG5ds9Uafop+Gao1Ay2vDrJ6tIvcjaESIJKu2uXV97qzT3y+tn0Td1f X-Received: by 2002:a62:499b:: with SMTP id r27-v6mr2440456pfi.74.1528290534210; Wed, 06 Jun 2018 06:08:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1528290534; cv=none; d=google.com; s=arc-20160816; b=yPHfS7vf1hvnpbFXjw/YamFLKikJoLP+OP4mywjI4a6bE1MIPxZ4M4wqdV/+UjJVZH WKvA4utXduyAsdoVwvn8Ci70FWQqBkhOoRKFsLWobPRYGKshq0Jl/g0EJ08Fa6Nws57D H8UeQ8awOkSbU4JfjsfG8S3fQ0RqNdmYFa3Bh0avHw3++fpLTY3g7IlwPgl+UeNTh4a3 eQE1mBpMcWp4EI8UECk5YDHnjqMQt6EMFdz1cDWzPtp8edq+ZcflntbspNXcaDiU6uMw oci0o+pnlSrU89VrAE13voZYb0SkH5PnlFEWMcPt8eG5c85DfjCfigla02wL08Qqu5OH 9Dag== 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 m8-v6si9933064pga.530.2018.06.06.06.08.53; Wed, 06 Jun 2018 06:08:54 -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 S1752193AbeFFNIu (ORCPT + 30 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 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); }