Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp3527273pxb; Mon, 1 Mar 2021 12:21:03 -0800 (PST) X-Google-Smtp-Source: ABdhPJwwrD7rTfr8pXSnh0wtpTSEG1DjAGE/B9GX327IuT3J19b08NrIVgleblAXGAHOQwJsczsQ X-Received: by 2002:a17:906:7797:: with SMTP id s23mr7130628ejm.98.1614630063329; Mon, 01 Mar 2021 12:21:03 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1614630063; cv=none; d=google.com; s=arc-20160816; b=qMQ2zaOwpAsAaR8HitMU6toKG6pgrrjXwz+7JSWDKKFNL8husm1/YNKOvxuW9zh8BT +1A0tyZnbGkYYqAbgNrzZKsrJ2I2/G28TMELtd8q7K9d/zV7efgcJJC29iCUSwaXJMnd g8mUCrUhHETCqGaSZTV45xuW42fJwTlwuS3LC0b5FMrqNZB7v7geHHi5VQNC6xujg5nK c9TVegAsqm9mPfzhsNr8LeoKxzJ5OxBWJkFyfETNpp4MZjUymI/k32NIIookWOr57YEF EyWZXK2UTXHMP/94BZqukmetmvzxANHN/9eMmzKKM55MTuDWvLrdQoCGY/3Idi60bh35 gCVQ== 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=etxIJqj2KLY3SO/VqJfxtRWGypwjbmX5DAkMlOnfv9Y=; b=dCzRe1bdqYHN4FlUFZV6exKrOQNabPoHJWcOz6BZZY5X6AIojPOxHleAEb3lGrSbqZ 8zN/cSRmavkzcL9ldXV+fOaOorG/dL4H/ccAVySqRpVxuYfQ1sQe4F9iufieoVbXFr7m RE77fq56DkAM5x2vCa38luy2FFL7HOL47WwiQwKFSNQCjbCGiectoN++rsN6l5duwWbR s30Mas70sEfhYk4SHVq2dNwO55Ve48gh8b1yGxQCdYCpEoQQTr+8PmHwCdvQfsCYRFwt C+2ltgIroJ5SFoug1A01SahMtsK4BPoNR4vNSnTZ0MPsl4JuKr0loAOCq4lAkUqcwdc4 KT8A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=vb2DXlWg; 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 e11si12075067ejq.624.2021.03.01.12.20.40; Mon, 01 Mar 2021 12:21:03 -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=vb2DXlWg; 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 S242975AbhCAURW (ORCPT + 99 others); Mon, 1 Mar 2021 15:17:22 -0500 Received: from mail.kernel.org ([198.145.29.99]:35320 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236660AbhCAREV (ORCPT ); Mon, 1 Mar 2021 12:04:21 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id BE67B64FF0; Mon, 1 Mar 2021 16:39:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1614616764; bh=TcRIckDQhnkluPVk4WyQeKhdvoOaLf24ear0HNEgQzA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=vb2DXlWgtMzuL1Jwh2/az5e7+XBZC/pAUTdu4Zqs6aH3EVZurhpwULqpNQ4xZ4tO3 Ly476G0lHWZxjFoqYugCX9eSUsHooFRpo8g1mFP5A9xiNu1DE06IV5gNPZFwep2blV Rll3DH8GYbshhxAtg2dgbqiW4sNY2sSD6PzLSuIE= 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 4.19 060/247] xen/netback: fix spurious event detection for common event case Date: Mon, 1 Mar 2021 17:11:20 +0100 Message-Id: <20210301161034.601273235@linuxfoundation.org> X-Mailer: git-send-email 2.30.1 In-Reply-To: <20210301161031.684018251@linuxfoundation.org> References: <20210301161031.684018251@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 c960cb7e3251f..3b5fdb24ef1b9 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