Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp4150527pxa; Mon, 10 Aug 2020 01:59:20 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz7HN7Jh2dAJ5PXBClBrZKDYapaLcJ8q2BWVbxtO2+XVRXfacrptupe4Khny5RXFAXmxYt+ X-Received: by 2002:a05:6402:304b:: with SMTP id bu11mr19564982edb.106.1597049960660; Mon, 10 Aug 2020 01:59:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1597049960; cv=none; d=google.com; s=arc-20160816; b=ChIIW6G/VFOTvdab+6WD+j2eSUvp773WeRwmjjBe/JKuDQuzHwxT7A3mE6x+qso7aZ OyOyuiN8Q3wYv4SIzoWTxMGhCPNk1BBdJW4xg6TpJ1VF9XyGTGw/Nih292ZofiWukCWt mAj9u4upTJpPZRIInsjgdNUjV9BvMVnEEUUmPsSN0RiY5mDKOVzHfXNwQVFrnbyNNfU2 ugyLMx3dbu/l4domSo3TGGGukdmfjLWnaf089k/S/4/EYE/kKWJ9KjuWkPuyHg30SvS8 VCWuKzeJ7he6Tq6xuxjL86jQs5CUaubjAz1dBvSWT+W3LsbWvWiOeQVZxHFxMK5NenRs 6zFA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=jqTJmqYtGq7UFVYJHyyBDTGEjW+nY1UNd5tYP3/AU5g=; b=EBGJz4gkWfsI391bUXOtAZ6GRxympOS8PpMZAPyXLVMBB7QFibnlSKnvT7JNRirA0D yMYefETw4us/bFKq+ZsP0SC8fqzuhzTh25B51o+I+5MC2qsiORcuE0BuPf//GBwvlvPq ndHab6jDmQ5/Ha8l9UDPCfZOZ6mzOS9s8WIyJzLVQPXTE4A7z+h/lISdWzRrp+LRs+DB TV0VwgyetzNJc/EOBaXGGAs3/xfFJgVUP2WoXuPKSZz4FVaCIzRcggcoZuajRuIXge86 O+sZ3LIZa+S2FlaMLAi4bq57IrbSuwi2mbNiAK6b1t+71xu/+KCTL9xQTdCHSurxNDQ1 8CCA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@nbd.name header.s=20160729 header.b=MPqjpy8s; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id fx19si10164760ejb.691.2020.08.10.01.58.55; Mon, 10 Aug 2020 01:59:20 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=fail header.i=@nbd.name header.s=20160729 header.b=MPqjpy8s; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726644AbgHJI6j (ORCPT + 99 others); Mon, 10 Aug 2020 04:58:39 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:32970 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726259AbgHJI6h (ORCPT ); Mon, 10 Aug 2020 04:58:37 -0400 Received: from nbd.name (nbd.name [IPv6:2a01:4f8:221:3d45::2]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1B610C061786 for ; Mon, 10 Aug 2020 01:58:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=nbd.name; s=20160729; h=Content-Transfer-Encoding:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:To:From:Sender:Reply-To:Cc:Content-Type: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=jqTJmqYtGq7UFVYJHyyBDTGEjW+nY1UNd5tYP3/AU5g=; b=MPqjpy8skQa5Zv727sphxRipmG cjSbQNHo172Q5mM1iDtp7Dn2cbo2nAapNANv2ZTwk4uh7Z9Fs+hzKjgRRqYB8ofbp4dKxq4Raapvv A3CkrgQBDUPzEMzGi3W2iwvHkY1HIq+mCdXHm+zG6RccyTqrHh2rCwV2jtFUyQNgcFXY=; Received: from p54ae996c.dip0.t-ipconnect.de ([84.174.153.108] helo=localhost.localdomain) by ds12 with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_CBC_SHA1:128) (Exim 4.89) (envelope-from ) id 1k53da-0003XJ-Jz for linux-wireless@vger.kernel.org; Mon, 10 Aug 2020 10:58:34 +0200 From: Felix Fietkau To: linux-wireless@vger.kernel.org Subject: [PATCH 5/6] mt76: mt7615: do not do any work in napi poll after calling napi_complete_done() Date: Mon, 10 Aug 2020 10:58:31 +0200 Message-Id: <20200810085832.65662-5-nbd@nbd.name> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200810085832.65662-1-nbd@nbd.name> References: <20200810085832.65662-1-nbd@nbd.name> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org Fixes a race condition where multiple tx cleanup tasks could run in parallel Signed-off-by: Felix Fietkau --- drivers/net/wireless/mediatek/mt76/mt7615/dma.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/drivers/net/wireless/mediatek/mt76/mt7615/dma.c b/drivers/net/wireless/mediatek/mt76/mt7615/dma.c index c876eb1e1681..3b375fdf31b8 100644 --- a/drivers/net/wireless/mediatek/mt76/mt7615/dma.c +++ b/drivers/net/wireless/mediatek/mt76/mt7615/dma.c @@ -117,14 +117,12 @@ static int mt7615_poll_tx(struct napi_struct *napi, int budget) mt7615_tx_cleanup(dev); - if (napi_complete_done(napi, 0)) - mt7615_irq_enable(dev, MT_INT_TX_DONE_ALL); - - mt7615_tx_cleanup(dev); - mt7615_pm_power_save_sched(dev); tasklet_schedule(&dev->mt76.tx_tasklet); + if (napi_complete_done(napi, 0)) + mt7615_irq_enable(dev, MT_INT_TX_DONE_ALL); + return 0; } -- 2.28.0