Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp522257pxb; Wed, 3 Mar 2021 08:49:20 -0800 (PST) X-Google-Smtp-Source: ABdhPJx6DTlnoeqjOIs+6+xAy6WzVUEOn/RdoHjfwO5zFuEyEYkWNLPVbCPSfpFlupClfrdCuz5C X-Received: by 2002:a17:906:79c7:: with SMTP id m7mr10796060ejo.337.1614790160659; Wed, 03 Mar 2021 08:49:20 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1614790160; cv=none; d=google.com; s=arc-20160816; b=Bzy9VgY2kKCnJsvNXIdUeGE4HcqN3tafMdtySyPqTl2Zp7kHtAzqY2Akt9osjYwMDs wWnyxZLJmd/C9hnFig0ijHUjO7A0t0eOlgWK6JyGosbbTMtKfpSRGRjp1kEJ3Y8GjJVa gDhBTbe2ZlhR8T3jIZdPE3OnYRB+yLIFbtGpWSQjBYMkLKoQ+BHMGf0DgjPbV/FJQdZn z2WEYbWc1K1Zbuhhl3JN30kx4y5L9QSCK7wGT7mFO2hehnxq8+SliMIf0wcQlZBD6YFV Lv11kulZS4WFxTbRPAm7E+lzOwpPkOkqfeFF3J0r7TK7FHz8uClFdTv9VYTgb55ZfzKb pCVQ== 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=SKH6jgX4reBWnolxhw1uZDKEZggMGHdNWoRlg0ZpN0Y=; b=lH7FPziOhtaggizocKzDZkfRLl+nDjx4wEJxlB6xiQhenP9XEr1dM6kPhHWjWV+Er5 EySXUJmWRh4r0GyozX3oVkH9b5TAGuiJsoKO8XplyDreFsSK76Gpa83xNFVbaS4CDz76 WLNsCg2qMUdKfXn+FmMX5fSOcIAKL1wVH/VpaqlVG46rHvDawXa6mVpy49CVvvKSR8HB CHjlrSSs8zXm9hcEA4DN6NCsLr4jbGoVFdWn4sD8dNTas1BaXrPg1XuCnjP5d8QF+jak 4FxWgaPspwgzjlXAl3fdIDvTDID2ZBis6OODkGSMKJSWrsPLmnWKkJ3PZ9tgpgPU10PS f1CQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=moqusyl0; 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 y1si4262100edc.388.2021.03.03.08.48.45; Wed, 03 Mar 2021 08:49:20 -0800 (PST) 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=moqusyl0; 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 S1347829AbhCBAMb (ORCPT + 99 others); Mon, 1 Mar 2021 19:12:31 -0500 Received: from mail.kernel.org ([198.145.29.99]:39694 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239773AbhCASWv (ORCPT ); Mon, 1 Mar 2021 13:22:51 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id 4228A64F8C; Mon, 1 Mar 2021 17:09:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1614618557; bh=0VANA2Bb9w5YJmWcg6ewVDYYRFi03Vx9u1SsHPN0vLc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=moqusyl0i0JGZkAwiY8wpNW1hC9GQGieSt1K+sOqXCzq9gx8VYPidV7bo+lD+d3QG DI6s9N4Gr0fbEi7zZKheJZkoe9cU0J1VGwy7/1J84WG9o5/57/RrvkZdk/uqJ1Fyha nTigUMwhrtp7OEnvO7urWIP1ezD/etHDoJ4cgPFQ= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Juergen Gross , Jan Beulich , Paul Durrant , Wei Liu , "David S. Miller" , Sasha Levin Subject: [PATCH 5.10 100/663] xen/netback: fix spurious event detection for common event case Date: Mon, 1 Mar 2021 17:05:48 +0100 Message-Id: <20210301161146.677782135@linuxfoundation.org> X-Mailer: git-send-email 2.30.1 In-Reply-To: <20210301161141.760350206@linuxfoundation.org> References: <20210301161141.760350206@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: Juergen Gross [ Upstream commit a3daf3d39132b405781be8d9ede0c449b244b64e ] In case of a common event for rx and tx queue the event should be regarded to be spurious if no rx and no tx requests are pending. Unfortunately the condition for testing that is wrong causing to decide a event being spurious if no rx OR no tx requests are pending. Fix that plus using local variables for rx/tx pending indicators in order to split function calls and if condition. Fixes: 23025393dbeb3b ("xen/netback: use lateeoi irq binding") Signed-off-by: Juergen Gross Reviewed-by: Jan Beulich Reviewed-by: Paul Durrant Reviewed-by: Wei Liu Signed-off-by: David S. Miller Signed-off-by: Sasha Levin --- drivers/net/xen-netback/interface.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/drivers/net/xen-netback/interface.c b/drivers/net/xen-netback/interface.c index acb786d8b1d8f..e02a4fbb74de5 100644 --- a/drivers/net/xen-netback/interface.c +++ b/drivers/net/xen-netback/interface.c @@ -162,13 +162,15 @@ irqreturn_t xenvif_interrupt(int irq, void *dev_id) { struct xenvif_queue *queue = dev_id; int old; + bool has_rx, has_tx; old = atomic_fetch_or(NETBK_COMMON_EOI, &queue->eoi_pending); WARN(old, "Interrupt while EOI pending\n"); - /* Use bitwise or as we need to call both functions. */ - if ((!xenvif_handle_tx_interrupt(queue) | - !xenvif_handle_rx_interrupt(queue))) { + has_tx = xenvif_handle_tx_interrupt(queue); + has_rx = xenvif_handle_rx_interrupt(queue); + + if (!has_rx && !has_tx) { atomic_andnot(NETBK_COMMON_EOI, &queue->eoi_pending); xen_irq_lateeoi(irq, XEN_EOI_FLAG_SPURIOUS); } -- 2.27.0