Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp1535925pxb; Sun, 7 Mar 2021 23:12:15 -0800 (PST) X-Google-Smtp-Source: ABdhPJyAkYo5hSo2dTrfGjIsH4Ns01gj6x+lxDe0x4ACb59KE2fMaTbe1cy0bCcYsq14Y6IGpZ+W X-Received: by 2002:a17:906:1448:: with SMTP id q8mr13626178ejc.449.1615187535098; Sun, 07 Mar 2021 23:12:15 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1615187535; cv=none; d=google.com; s=arc-20160816; b=UV6kaHF3aPbwNRVgIm68rb9i/1NbWPb+wZHgl4KjuWtkbIo7NNS4wE4W/MChDtpJNt MhL15H3QsLY4jdg4fS1UWTm7fdlyRQQJnaPaya0F5SACZT2AAJGizZXE4T5f4q/I9fg4 DCo2kXq+CQjZigt9F4LejRqki1u7FpnRtkICZzFuHxaug+mkXvlCYl75OzfYvY9oxs+N 81kqqxdgg81IypY47qsK0SWmEYaitOt1KQvaNzSStxNG35AxshL+WHYew6GBZohrA1fV JC4rvnlAdceHixvLjbnDcBHzYZn9TvK41NI/s4ufcFig9Yxj7CoHyXESHUkCkl2vTSzR EzDg== 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 :message-id:date:subject:cc:to:from:dkim-signature; bh=RmUjxQnODqe5jasIe6oMCp3vNbaFn4XsizOjVSQ4M40=; b=c7pNPRxDXotQU45TXkeENmm0gC4EqOCr90UjW3U7aMqEQ3w1+K+Gxd0Ie3SMyoUMS0 7ImjRRZoyBwYgnJXlH4eDk3VpZNCbnnu4iyhgOWu8RMxRvJGTAGloVqjQoNtH7EI93eK Rbu7d2Lx9Ri4ZVrQ0ZwIv1acIg0JBBLLPKwkiiIE+dAHG3lHA/fPuk/TNViNvjzRhjVX 8Nb4EZqk/IDbsuYaoKspubkGS2DYSFCbktut7Kc/Odg6zMoM+ovJyvziLneYq75bTNrB WgnjxdaSWaHf4TKscq53hSuR8exf1PwsgQmCMF7IwqG2hDq+e2ejv9U/+sIxa29ybG9i JZMw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=EgRL+h1B; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id f27si6464359ejf.555.2021.03.07.23.11.44; Sun, 07 Mar 2021 23:12:15 -0800 (PST) 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=pass header.i=@kernel.org header.s=k20201202 header.b=EgRL+h1B; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230111AbhCGR7j (ORCPT + 99 others); Sun, 7 Mar 2021 12:59:39 -0500 Received: from mail.kernel.org ([198.145.29.99]:59968 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232065AbhCGR7O (ORCPT ); Sun, 7 Mar 2021 12:59:14 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id 26A5F650F5; Sun, 7 Mar 2021 17:59:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1615139954; bh=pkUXhAepp54hgcKyVXZ/4o7VGcce5SlP3XWGz0JIr7s=; h=From:To:Cc:Subject:Date:From; b=EgRL+h1B1zhIbQ9kIa3vg8Z3R/ByoGXXbVmltRzoCepE8Jj835RxwKRpDMo1EFDby sp4xH8LAwMbwJbedB7DVWYvscAKeBznVBt+7DV4yjuYAnQLjr1sv046CXgI6EE/Lvq nd68o+ofj03k/QLJdY8HpPYXhdC0n5iBIxY8QDc0bEV3RcN+fes6WwhD4RRWzePBMo TVbfoZIcSkgVd2SVTMJDwgt0v4kQXirhbKZ2wYsw6PpIBy83tLWQ7fLJ4Z21Y5sIep +TNTVzq2kZ/dcsS+OcAijRi9fy6UKbAFNxxbFNtqSSCUYI1HTFp3fEABL5cTLO/Tl1 s/i9A2HPQgWeg== From: Lorenzo Bianconi To: nbd@nbd.name Cc: linux-wireless@vger.kernel.org, lorenzo.bianconi@redhat.com, ryder.lee@mediatek.com Subject: [PATCH] mt76: mt7915: simplify mt7915_mac_sta_poll routine Date: Sun, 7 Mar 2021 18:59:08 +0100 Message-Id: X-Mailer: git-send-email 2.29.2 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org Drop unnecessary lock around sta_poll_list list in mt7915_mac_sta_poll routine. Signed-off-by: Lorenzo Bianconi --- drivers/net/wireless/mediatek/mt76/mt7915/mac.c | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/drivers/net/wireless/mediatek/mt76/mt7915/mac.c b/drivers/net/wireless/mediatek/mt76/mt7915/mac.c index b3168dd3baed..cde98b86e2bb 100644 --- a/drivers/net/wireless/mediatek/mt76/mt7915/mac.c +++ b/drivers/net/wireless/mediatek/mt76/mt7915/mac.c @@ -117,23 +117,15 @@ static void mt7915_mac_sta_poll(struct mt7915_dev *dev) rcu_read_lock(); - while (true) { + while (!list_empty(&sta_poll_list)) { bool clear = false; u32 addr; - u16 idx; - spin_lock_bh(&dev->sta_poll_lock); - if (list_empty(&sta_poll_list)) { - spin_unlock_bh(&dev->sta_poll_lock); - break; - } msta = list_first_entry(&sta_poll_list, struct mt7915_sta, poll_list); list_del_init(&msta->poll_list); - spin_unlock_bh(&dev->sta_poll_lock); - idx = msta->wcid.idx; - addr = mt7915_mac_wtbl_lmac_addr(dev, idx) + 20 * 4; + addr = mt7915_mac_wtbl_lmac_addr(dev, msta->wcid.idx) + 20 * 4; for (i = 0; i < IEEE80211_NUM_ACS; i++) { u32 tx_last = msta->airtime_ac[i]; @@ -152,7 +144,7 @@ static void mt7915_mac_sta_poll(struct mt7915_dev *dev) } if (clear) { - mt7915_mac_wtbl_update(dev, idx, + mt7915_mac_wtbl_update(dev, msta->wcid.idx, MT_WTBL_UPDATE_ADM_COUNT_CLEAR); memset(msta->airtime_ac, 0, sizeof(msta->airtime_ac)); } -- 2.29.2