From patchwork Tue Jun 5 11:42:01 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Salil Mehta X-Patchwork-Id: 137712 Delivered-To: patch@linaro.org Received: by 2002:a2e:970d:0:0:0:0:0 with SMTP id r13-v6csp850248lji; Tue, 5 Jun 2018 04:43:20 -0700 (PDT) X-Google-Smtp-Source: ADUXVKKAKUeqD/b3fZtGiMXGNB2mB6d2ujWJhs//1sBA+7kN7OTXtXur13bduEX8ca/9QkpyW5Kp X-Received: by 2002:a63:a00a:: with SMTP id r10-v6mr20796663pge.222.1528198999905; Tue, 05 Jun 2018 04:43:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1528198999; cv=none; d=google.com; s=arc-20160816; b=CYsnlLPgaDRQbjpWlZzr8k+efTj5MX8k/EkdwRhRKZ2ZzHe0GIXxwgYUz8mbYTHw5Q s8E0htR067XfV6P8VxrSsxzaYO2/Ksc7OaDPnijXOrzrG8ld+KkTDsd/V6MdeE7PwssD GSiCvs7oiK7bibgVkhPlxMfJELARC9GMza9YpqmGLPq/1kPI+urHZxIEQYptfh944ZNh 0CasKz7znk9pzD82scXsnH08EI7tJcUfjckyr3dYlDufXbc6jQiNmW8dshLZ+82O4Uk/ rpf5+LvrMsey/22dNtaMw00VKjJWdyfYFOQ8qmxHXpuw1W73KTE8OciS3xwmoFrKtjeC SbDA== 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=rUgOCcetzR3rd/qOhiYTAQuxdtuSsjBHeb1E7oyQUns=; b=e3Vc0R395jHQiEX7FicYaiNn8FUHy05JYXSkPhUf5nu4bkrY7sJAqk441tVSDR74a8 eKJXfVEg4Rd5977W7ew2LcXnA7ClJzCaxGgqLJ/u8nH5GtcHgAdmqtfng76zyAcgi11G M1Fz1KaKzNn3CTPbba+2/5FA1aZ1QbT4TYJ5xNV9hT675nuUVjGFcVWPuz10uGLeu/YD FP2XH0Af+tKz03neipO5Tr+gqMeiTk4FI15Hm7GrZJGSUlphBCYjT/MvLTbGCyjFjqLs UznNI1/bw+E+rKPeN1yZmCukuPHvCMCIFu4tRT22OkiFd816eOASyarQs1L6S4emdwKf fETA== 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 k5-v6si8598725pgs.680.2018.06.05.04.43.19; Tue, 05 Jun 2018 04:43:19 -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 S1751953AbeFELnR (ORCPT + 30 others); Tue, 5 Jun 2018 07:43:17 -0400 Received: from szxga04-in.huawei.com ([45.249.212.190]:8644 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751721AbeFELnO (ORCPT ); Tue, 5 Jun 2018 07:43:14 -0400 Received: from DGGEMS412-HUB.china.huawei.com (unknown [172.30.72.60]) by Forcepoint Email with ESMTP id B68BC3F6DA4A; Tue, 5 Jun 2018 19:42:58 +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:50 +0800 From: Salil Mehta To: CC: , , , , , , , Xi Wang Subject: [PATCH net-next 3/3] net: hns3: Optimize PF CMDQ interrupt switching process Date: Tue, 5 Jun 2018 12:42:01 +0100 Message-ID: <20180605114201.29900-4-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 PF frequently switches the CMDQ interrupt, if the CMDQ_SRC is not cleared before the hardware interrupt is generated, the new interrupt will not be reported. This patch optimizes this problem by clearing CMDQ_SRC and RESET_STS before enabling interrupt and syncing pending IRQ handlers after disabling interrupt. Fixes: 466b0c00391b ("net: hns3: Add support for misc interrupt") Signed-off-by: Xi Wang Signed-off-by: Peng Li Signed-off-by: Salil Mehta --- drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) -- 2.7.4 diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c index 2a80134..d318d35 100644 --- a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c +++ b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c @@ -2557,6 +2557,15 @@ static void hclge_clear_event_cause(struct hclge_dev *hdev, u32 event_type, } } +static void hclge_clear_all_event_cause(struct hclge_dev *hdev) +{ + hclge_clear_event_cause(hdev, HCLGE_VECTOR0_EVENT_RST, + BIT(HCLGE_VECTOR0_GLOBALRESET_INT_B) | + BIT(HCLGE_VECTOR0_CORERESET_INT_B) | + BIT(HCLGE_VECTOR0_IMPRESET_INT_B)); + hclge_clear_event_cause(hdev, HCLGE_VECTOR0_EVENT_MBX, 0); +} + static void hclge_enable_vector(struct hclge_misc_vector *vector, bool enable) { writel(enable ? 1 : 0, vector->addr); @@ -5688,6 +5697,8 @@ static int hclge_init_ae_dev(struct hnae3_ae_dev *ae_dev) INIT_WORK(&hdev->rst_service_task, hclge_reset_service_task); INIT_WORK(&hdev->mbx_service_task, hclge_mailbox_service_task); + hclge_clear_all_event_cause(hdev); + /* Enable MISC vector(vector0) */ hclge_enable_vector(&hdev->misc_vector, true); @@ -5817,6 +5828,8 @@ static void hclge_uninit_ae_dev(struct hnae3_ae_dev *ae_dev) /* Disable MISC vector(vector0) */ hclge_enable_vector(&hdev->misc_vector, false); + synchronize_irq(hdev->misc_vector.vector_irq); + hclge_destroy_cmd_queue(&hdev->hw); hclge_misc_irq_uninit(hdev); hclge_pci_uninit(hdev);