Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp3936273pxj; Mon, 21 Jun 2021 09:44:11 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz0suWPLxHOsQCiGeQ1hD1Bwu9hLeGmEg/jsOfWOOGfQWXJq/c0cDW+zzH1i9eckMAEdWXx X-Received: by 2002:a50:ec16:: with SMTP id g22mr9768001edr.188.1624293851294; Mon, 21 Jun 2021 09:44:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1624293851; cv=none; d=google.com; s=arc-20160816; b=ILwFtTggzVUwlkVOUY5H++XRwsoAx93N+grh8tUnSr+018NkG2Nh4EuSQB2luCages +4t4btK/h2Yp12TwS/DO+/3DGyeJgdA/NWUXTU1DEAtjdHvnri91ed3ANkjxGn66zyiD /yTCdcuz5fwUixy1woGZsHEyhMC4Ujc2Wr18ICif78GD+675+O0rLA5/y+GXcnTY66Ib IYvFl16On+1ciRNHFgMJj8BI/u3Bqqi5hDvr8j+8aznA/G1iyLkdZzGH3221EE26cjlK RI3pHeamlYVMGVuyTyrUSAyVSU42r4umMqYTi67ouYaEN3kdw9Q+o5akXZnP0KYWoJyx YESQ== 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=CBh/LnISAmiboC1Tyvc4oECHQA+qfk2RkWApTNImpjg=; b=LnCYOeDhZE/WGPYFg9Lewu4Lj8HgXQkyb6wsUta05emv2Lq/Z8OUK/Elvi2CTkIzJQ UUeTT6eZxd0+3kZWUvacVPHdIQ+T1DR3QcAiI3wy+O5YJnsFvK7M6QA8e9CgNco4zIqT Jtf9SBc04ak7UkjHeLfLtt0UWMK+6YuGiOzUfdFE8R+buqA38ydKYpWX5yZBdMQkkzI/ GsXtfgbYba9QaCcnKbcy2eEIThsKTocRQhBOgpFmv9aF9TkWcM1NtaZlClXLYRX7QYfL U2+pRVphnGYhUchLnh6OkUyAMROq+x2MUxGOsFvK0rTD1hcSoAkbg8FgXFEP5Eg9JAF7 D9TQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=QvL1zkq+; 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 i11si1848408eds.153.2021.06.21.09.43.48; Mon, 21 Jun 2021 09:44: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; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=QvL1zkq+; 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 S232644AbhFUQlG (ORCPT + 99 others); Mon, 21 Jun 2021 12:41:06 -0400 Received: from mail.kernel.org ([198.145.29.99]:55954 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232705AbhFUQhV (ORCPT ); Mon, 21 Jun 2021 12:37:21 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 437A061429; Mon, 21 Jun 2021 16:28:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1624292928; bh=Ons27rPoPa908i44qsL8CU4TqTNsD/vNBTpfoJqWdlc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=QvL1zkq+nqueRYPg8yI2Qxe8H3Hmin3yW5sBDhfeEZwPYpQ/FUvsVQ5D3rzTj9nSw fi2J9/TvJpgeDj9MoO+cBQmPqwHUnKvmYQZbJN0scSdT8SLudzf9/fY1Z0Vlv42J47 57ePIs1CFDtfulQSLCznhaRv8fe7x57kd46Pi2F4= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Shay Drory , Parav Pandit , Saeed Mahameed , Sasha Levin Subject: [PATCH 5.12 037/178] Revert "net/mlx5: Arm only EQs with EQEs" Date: Mon, 21 Jun 2021 18:14:11 +0200 Message-Id: <20210621154923.331869102@linuxfoundation.org> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210621154921.212599475@linuxfoundation.org> References: <20210621154921.212599475@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: Shay Drory [ Upstream commit 7a545077cb6701957e84c7f158630bb5c984e648 ] In the scenario described below, an EQ can remain in FIRED state which can result in missing an interrupt generation. The scenario: device mlx5_core driver ------ ---------------- EQ1.eqe generated EQ1.MSI-X sent EQ1.state = FIRED EQ2.eqe generated mlx5_irq() polls - eq1_eqes() arm eq1 polls - eq2_eqes() arm eq2 EQ2.MSI-X sent EQ2.state = FIRED mlx5_irq() polls - eq2_eqes() -- no eqes found driver skips EQ arming; ->EQ2 remains fired, misses generating interrupt. Hence, always arm the EQ by reverting the cited commit in fixes tag. Fixes: d894892dda25 ("net/mlx5: Arm only EQs with EQEs") Signed-off-by: Shay Drory Reviewed-by: Parav Pandit Signed-off-by: Saeed Mahameed Signed-off-by: Sasha Levin --- drivers/net/ethernet/mellanox/mlx5/core/eq.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/net/ethernet/mellanox/mlx5/core/eq.c b/drivers/net/ethernet/mellanox/mlx5/core/eq.c index 1fa9c18563da..31c6a3b91f4a 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/eq.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/eq.c @@ -136,7 +136,7 @@ static int mlx5_eq_comp_int(struct notifier_block *nb, eqe = next_eqe_sw(eq); if (!eqe) - return 0; + goto out; do { struct mlx5_core_cq *cq; @@ -161,6 +161,8 @@ static int mlx5_eq_comp_int(struct notifier_block *nb, ++eq->cons_index; } while ((++num_eqes < MLX5_EQ_POLLING_BUDGET) && (eqe = next_eqe_sw(eq))); + +out: eq_update_ci(eq, 1); if (cqn != -1) @@ -248,9 +250,9 @@ static int mlx5_eq_async_int(struct notifier_block *nb, ++eq->cons_index; } while ((++num_eqes < MLX5_EQ_POLLING_BUDGET) && (eqe = next_eqe_sw(eq))); - eq_update_ci(eq, 1); out: + eq_update_ci(eq, 1); mlx5_eq_async_int_unlock(eq_async, recovery, &flags); return unlikely(recovery) ? num_eqes : 0; -- 2.30.2