Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp2353733pxb; Mon, 20 Sep 2021 19:52:27 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzKK7BwOrz29qA1kC06Y/CCLm1c8bscYAdCR882W2C61YuUe3c6beeUvCl8/rbrVzJtEA+d X-Received: by 2002:a17:906:520b:: with SMTP id g11mr32265779ejm.502.1632192747102; Mon, 20 Sep 2021 19:52:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1632192747; cv=none; d=google.com; s=arc-20160816; b=oHU1k8QTGxpbTHHNMDhpmcl8w55hJexrHii/QnANsFAAfv9AKmPHU0IcKWd3HtbXZj Gm6HPDVlwBFcQ0uP095CBnpQjKR5XwUfJfmrCgL8DiHb1klffSno5wDs3q1407B5PxcI ZTaTDpLE2zevyXZKCpzcQwM/L2jE27Ti3emCtAZ8rQcHYJfUeeQbQE+19gbQgEdrfEX4 6n9S12/6evdfjBPQUPivSvOyt5EsQ6tPyUJIyQJOkz+LkFttEdUX1JBTvT9BJPjec9Oh J2j7LblGDYJih6pzD0Csnbp7WNPNd0QcDkrWMqmOZW7zZeVb2JEOhc/biM9NSMM6YpZf POuQ== 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 :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=EKZA1tUum0pcTnSHkxV2Hr8OcibacOqnY8M6I/0K33o=; b=PisqMxVF1F8dW8lilPS+PtvhtlyN2s5yLC8/sVfCTgrd1FtQVUFmVx1Ipz/EMzZ7+O zI0lhAI7MG6Fqz5TI3elXI9YW5Jgw4XiKtHd44qEk6VAVp8zSHgzygzQLTHlVFVe2ySz MYOzemEvwwpw6ktg0n/uwLqgxELH7UL2XmE5um3PalWWANivkba14vSbj2TL5/phj6Dr ucc/jJIi2XCx3RVWhClEr99hUwe7GD3DEC+9YUJqOCvRi3XweSXk44OjRanzY4uJA8u+ Vm0T7rilIKF/DmUikOE+yC495+f9fWZ4RP+EGqNh2En5ntWR1hj0PPe3Zx/qOKeToV+5 GnXQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=tarP7GGJ; 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=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id b1si23218211ejb.600.2021.09.20.19.52.03; Mon, 20 Sep 2021 19:52:27 -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; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=tarP7GGJ; 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=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1382982AbhITSps (ORCPT + 99 others); Mon, 20 Sep 2021 14:45:48 -0400 Received: from mail.kernel.org ([198.145.29.99]:58210 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1382713AbhITSmR (ORCPT ); Mon, 20 Sep 2021 14:42:17 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 86EA463340; Mon, 20 Sep 2021 17:31:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1632159103; bh=Ev9Lx901S77ZulY1/mUH+PoCSSC9LLJeb+JQYTmvljM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=tarP7GGJQ/T5m6DWBOP2ImJkSInAGUe96XrpN5uJEH0XmgKiXF1VodFHHQAzKHlc2 CVbNnWMV7h6YKv4HiDMwODmv5TLsK5ZJPcBXNE/b5WSpMHGmOmrvyJqBIUubY9P4MZ inVkIKKe+jqt0FcLxpR/JsZL+zNpeF8bl5m+P9Eg= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Jiaran Zhang , Guangbin Huang , "David S. Miller" Subject: [PATCH 5.14 078/168] net: hns3: fix the timing issue of VF clearing interrupt sources Date: Mon, 20 Sep 2021 18:43:36 +0200 Message-Id: <20210920163924.205981475@linuxfoundation.org> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20210920163921.633181900@linuxfoundation.org> References: <20210920163921.633181900@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Jiaran Zhang commit 427900d27d86b820c559037a984bd403f910860f upstream. 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 Signed-off-by: David S. Miller Signed-off-by: Greg Kroah-Hartman --- drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) --- a/drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c +++ b/drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c @@ -2463,6 +2463,8 @@ static irqreturn_t hclgevf_misc_irq_hand 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: @@ -2475,10 +2477,8 @@ static irqreturn_t hclgevf_misc_irq_hand 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; }