Received: by 2002:a05:6a10:6d25:0:0:0:0 with SMTP id gq37csp1818383pxb; Mon, 13 Sep 2021 06:16:11 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwOYSfxUFVEJVboEZkT/NTM0mFP/nB/jDD9K2izGTtSBkSvrcRWCxNzRr8X6smQ1REB96/f X-Received: by 2002:a17:906:6a0f:: with SMTP id qw15mr2646943ejc.406.1631538971327; Mon, 13 Sep 2021 06:16:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1631538971; cv=none; d=google.com; s=arc-20160816; b=vxIg3eUaPqX7S2ti6ue3ZvxyQUMNzjTRm6TCxduLXZKHhZ+Bv8j4SG8FaemWoHQVnU sbVNbp3DDpSUoaRXXUhv+nlCKwpQTbNHa+zFZbTHFwDjMJ6ZnPpnpevLCdzPDlVVAHeh vVCMSw5xr7OYkf9kshppRtPDIjPvhPnTMfsPj+Qma8v0GJy1S7mL7QjrccHR6gRxtyJ8 F620AJAlmEuCUBz8EIa3XFT1wrHXeyps/Gx67JXX3/Knwc9VJ8t91B83VEaUC8t7hM6f 6PnkZwnxOjh4zr+wGfu3d8O7t0JgBP+m56Iz7PVgZcWrLFeuN8Qwx6xE5M6Ty3FTacoG B+jQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=TasJLIjkCAXMWg3ndZ+xxYjRxgoflH6+IUL3VtQI8E0=; b=Y9Ih0vNiZBUVKGOfRpBry1xsqd71wj+OYyqx/G/7T7uw780RHwTkZDkQ6HNgkrtSJN U0qwh9LAYDJBmEO8QjpAbBLcmMTb33vIhekHY1m1aeL5sYSaL5nZbdxAiQmyilq+uKzJ cCOqeohXpZXH3oJcSwicGEraqYVxNI8CYF/DgaICB3NyfAACLrhWuiyKn7AcU7XxZpOe shSgleR7+7fOdO58ZzZfsAT/Z//RYb/9RajbneeOsqwb6E68UxryKHRqwbc00SpbWE0Z wGgs71tiVmky4/xcyxmIkN0nfHdo4+XmdQr9xKGt5raiwr9exEFlWnwfAG6MlFQmsjjn 1i6Q== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=huawei.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id dm10si7519493ejc.402.2021.09.13.06.15.43; Mon, 13 Sep 2021 06:16:11 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=huawei.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239916AbhIMNOC (ORCPT + 99 others); Mon, 13 Sep 2021 09:14:02 -0400 Received: from szxga02-in.huawei.com ([45.249.212.188]:9861 "EHLO szxga02-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238633AbhIMNNu (ORCPT ); Mon, 13 Sep 2021 09:13:50 -0400 Received: from dggemv704-chm.china.huawei.com (unknown [172.30.72.53]) by szxga02-in.huawei.com (SkyGuard) with ESMTP id 4H7Rc52pTNz8xry; Mon, 13 Sep 2021 21:08:05 +0800 (CST) Received: from kwepemm600016.china.huawei.com (7.193.23.20) by dggemv704-chm.china.huawei.com (10.3.19.47) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.8; Mon, 13 Sep 2021 21:12:30 +0800 Received: from localhost.localdomain (10.67.165.24) by kwepemm600016.china.huawei.com (7.193.23.20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.8; Mon, 13 Sep 2021 21:12:29 +0800 From: Guangbin Huang To: , CC: , , , Subject: [PATCH net 6/6] net: hns3: fix the timing issue of VF clearing interrupt sources Date: Mon, 13 Sep 2021 21:08:25 +0800 Message-ID: <20210913130825.27025-7-huangguangbin2@huawei.com> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20210913130825.27025-1-huangguangbin2@huawei.com> References: <20210913130825.27025-1-huangguangbin2@huawei.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7BIT Content-Type: text/plain; charset=US-ASCII X-Originating-IP: [10.67.165.24] X-ClientProxiedBy: dggems705-chm.china.huawei.com (10.3.19.182) To kwepemm600016.china.huawei.com (7.193.23.20) X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Jiaran Zhang Currently, the VF does not clear the interrupt source immediately after receiving the interrupt. As a result, if the second interrupt task is triggered when processing the first interrupt task, clearing the interrupt source before exiting will clear the interrupt sources of the two tasks at the same time. As a result, no interrupt is triggered for the second task. The VF detects the missed message only when the next interrupt is generated. Clearing it immediately after executing check_evt_cause ensures that: 1. Even if two interrupt tasks are triggered at the same time, they can be processed. 2. If the second task is triggered during the processing of the first task and the interrupt source is not cleared, the interrupt is reported after vector0 is enabled. Fixes: b90fcc5bd904 ("net: hns3: add reset handling for VF when doing Core/Global/IMP reset") Signed-off-by: Jiaran Zhang Signed-off-by: Guangbin Huang --- drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c b/drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c index 82e727020120..a69e892277b3 100644 --- a/drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c +++ b/drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c @@ -2465,6 +2465,8 @@ static irqreturn_t hclgevf_misc_irq_handle(int irq, void *data) hclgevf_enable_vector(&hdev->misc_vector, false); event_cause = hclgevf_check_evt_cause(hdev, &clearval); + if (event_cause != HCLGEVF_VECTOR0_EVENT_OTHER) + hclgevf_clear_event_cause(hdev, clearval); switch (event_cause) { case HCLGEVF_VECTOR0_EVENT_RST: @@ -2477,10 +2479,8 @@ static irqreturn_t hclgevf_misc_irq_handle(int irq, void *data) break; } - if (event_cause != HCLGEVF_VECTOR0_EVENT_OTHER) { - hclgevf_clear_event_cause(hdev, clearval); + if (event_cause != HCLGEVF_VECTOR0_EVENT_OTHER) hclgevf_enable_vector(&hdev->misc_vector, true); - } return IRQ_HANDLED; } -- 2.33.0