Received: by 2002:a5b:505:0:0:0:0:0 with SMTP id o5csp4346289ybp; Mon, 7 Oct 2019 07:10:57 -0700 (PDT) X-Google-Smtp-Source: APXvYqx12M+6+7Ljp/UvZtsXTpMk8YHS6zvZnIHMWIhyhYqpzScqUkMH0CbIngDhHKY/v5RSlQvG X-Received: by 2002:a17:906:9498:: with SMTP id t24mr123162ejx.88.1570457457767; Mon, 07 Oct 2019 07:10:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1570457457; cv=none; d=google.com; s=arc-20160816; b=ZzY6rhOBLnzo0t0AuMNZXvsqp3ZoE/O2spc3Ews6wezt7vLpndVGuS6koLQBcD6klR meq8HvYSYns15i+Rpp0t7LOVcorV2+J+eq8ECqNKDkkKzHJ5dGbVZG8XK3g/7WeWoijd AR1LiYlnScmN5L7xYid4nYBh3Ht6Y0S+87KoUeCFXfYAXEakMjoZn6cPw1EqlKv59xXb 0nXsKqnTE2qWYV3ykwkiWxAFwz5wMw/iMS7JLcrCYoWGFDNN0rFKLrm+VwX0NwAs//C5 AV/8RaVoYPJT5ZQ7pixRZTh8Yq5tddkTdtgDG6KpuMuTBPBom302C7664mKuGB9d+GQn yslg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:to:from:dkim-signature; bh=xF3Flvsmfw/oheWhqWYhUjltW7JsyPWc5Jh3nHC7f90=; b=cSrwY+y3zh8mShI0Hhb8ByzFr6O1oRYtQ4B3jPKC/SDLrGH+G6lLNLEkEt43H9B2X/ mj6GP5YlN0errozRwOTrfJh7TCT3NWWQvt6Y3M3vy2uaKxzVD5rijpXy4FtIakDM944K 9U2qzd9Q53hTOOMYzVzTjPL/U35sTS72pCGszvbz4eeWptkMm63YrpEC/h/DgyBwx/9M lahncefqkTXnunM6OH0YJB8Q+y7Z0907iyrf+Ar6IW2nWc9AHF66mFNZxELa+hxcORJh 9gUoY4A+x/sRHzxTgkcW2vfok8bZBDxDKBdhLQ/V9gjOc/7ffijrU8pGc5nNQzXX9Ei/ cxRw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@nbd.name header.s=20160729 header.b="J/aqNp1w"; spf=pass (google.com: best guess record for domain of linux-wireless-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id n6si6950411eju.100.2019.10.07.07.10.33; Mon, 07 Oct 2019 07:10:57 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-wireless-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=fail header.i=@nbd.name header.s=20160729 header.b="J/aqNp1w"; spf=pass (google.com: best guess record for domain of linux-wireless-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727744AbfJGOKY (ORCPT + 99 others); Mon, 7 Oct 2019 10:10:24 -0400 Received: from nbd.name ([46.4.11.11]:59048 "EHLO nbd.name" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727753AbfJGOKY (ORCPT ); Mon, 7 Oct 2019 10:10:24 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=nbd.name; s=20160729; h=References:In-Reply-To:Message-Id:Date:Subject:To:From:Sender: Reply-To:Cc:MIME-Version:Content-Type:Content-Transfer-Encoding:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=xF3Flvsmfw/oheWhqWYhUjltW7JsyPWc5Jh3nHC7f90=; b=J/aqNp1wtSL740BPLGcCISEZAg 27Xw870HFC84T3mOrFsOFMttHeB2rxXw8YjqX9X51q4bSB48vH7r5IPyX6a8qlj0v7W5DJh+6JfI9 iRgpJp/fAo2CoZLcsdVDb4j3bC+wkfWqUKD8fjvBgSJ+rmbrI8rvqtON4ZK/ChiVzRZI=; Received: from p54ae9582.dip0.t-ipconnect.de ([84.174.149.130] helo=maeck.lan) by ds12 with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1iHTiQ-0002Wp-Tq for linux-wireless@vger.kernel.org; Mon, 07 Oct 2019 16:10:22 +0200 Received: by maeck.lan (Postfix, from userid 501) id 5AB906AB2C97; Mon, 7 Oct 2019 16:10:22 +0200 (CEST) From: Felix Fietkau To: linux-wireless@vger.kernel.org Subject: [PATCH 4/4] mt76: avoid enabling interrupt if NAPI poll is still pending Date: Mon, 7 Oct 2019 16:10:22 +0200 Message-Id: <20191007141022.75184-4-nbd@nbd.name> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20191007141022.75184-1-nbd@nbd.name> References: <20191007141022.75184-1-nbd@nbd.name> Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org if napi_complete() returns false, it means that polling is still pending. Interrupts should not fire until the polling is no longer scheduled Signed-off-by: Felix Fietkau --- drivers/net/wireless/mediatek/mt76/dma.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/net/wireless/mediatek/mt76/dma.c b/drivers/net/wireless/mediatek/mt76/dma.c index e2ce59b260c1..4da7cffbab29 100644 --- a/drivers/net/wireless/mediatek/mt76/dma.c +++ b/drivers/net/wireless/mediatek/mt76/dma.c @@ -537,10 +537,8 @@ mt76_dma_rx_poll(struct napi_struct *napi, int budget) rcu_read_unlock(); - if (done < budget) { - napi_complete(napi); + if (done < budget && napi_complete(napi)) dev->drv->rx_poll_complete(dev, qid); - } return done; } -- 2.17.0