Received: by 2002:a5b:505:0:0:0:0:0 with SMTP id o5csp4346276ybp; Mon, 7 Oct 2019 07:10:57 -0700 (PDT) X-Google-Smtp-Source: APXvYqxhcY8Qgcz421ZHH+qUOshebIjE9rfRNTgsZJlaawWhuk8lN4L9d6VadE7rs4fXjR3Mq1GV X-Received: by 2002:a17:906:6c8:: with SMTP id v8mr24546589ejb.252.1570457457131; 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=EP83PJujgOnbqnaO+P3IiaLpCzb/Kvpot6mL/U5Au4jg2vNT+GLPyNNnGzfpT3EmnK GtQi89/xCXwPFP9h9U8px0u/c+cziepp5By+EF5EphVlWfIRuLfXQ1hz+RSVqq0BEo9o rsMLpu+gCXR+ssqD1Q2hnFXtXK/vB8CWczEqtKnd31D/DAmpAqCko8m+XmbPEPjn3J+f Hv7HzEBm/SbRmwWdvwg700oKml+4FdtLMl5y6Fr4PMinyYua1HYKDKqUuvpuzMFeJdji nZqwtaGdqbbWwarNgeaLyBW1+v+iT8sTU7yLXr5pjZvPhKQUVrnY5VOntfavQZi+AlV3 U8tQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:to:from :dkim-signature; bh=SzMS/xNH5yS9K5OiOz59Z65xWoHUa7vNVY+jV5vKe18=; b=qnjRB2BsoS/+r5vhG2Rzxr+9acDFE1Id3HaV42g/ZIW4sQ7UR8KgH1+YziXyHjbnIC kULrXaDpnL2TQndb7WMXLXwUb8PjEywHrKdzNd22Nad71PxOzAi4CjI8WOMVC6/+YrqX zAukFlnCi3kUzkbO7IvqEK7wl26hL22z+Q8AaaHwcfx9DgSqSPXzUQcDz+lIq91naBMX DbgCnTDzFNv7zU1EBVn7pxyTGue6rxv5WY2rDgwspmavfuarMmRpFv3cUJSk7LqWP6s2 m69PbI5LvoSSf5hNi9AIqqVkJ4OvHBsXiPQaLbb3x55hl/+0MMC4/k40HMFuHgoAnuu6 eJRw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@nbd.name header.s=20160729 header.b=OpkeW5Y0; 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 p23si5947578eju.423.2019.10.07.07.10.26; 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=OpkeW5Y0; 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 S1728088AbfJGOKY (ORCPT + 99 others); Mon, 7 Oct 2019 10:10:24 -0400 Received: from nbd.name ([46.4.11.11]:59052 "EHLO nbd.name" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727904AbfJGOKY (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=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:In-Reply-To:References:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=SzMS/xNH5yS9K5OiOz59Z65xWoHUa7vNVY+jV5vKe18=; b=OpkeW5Y0OJJXNbKE4dX13aAQDd aqgQ9hdLUzlELjmuLSwKWoILZUgMBqIaASFht6q1yWJVmzvfJ1MYcoitH7u6H64qirap07LR1mbU5 MSYRXAc6ayaV/9kTpDtmssFuZN1wUfvcioOaVyjcoydg9WrWe6yN4WHpX4b2ovkZrRMg=; 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-0002Wq-Un for linux-wireless@vger.kernel.org; Mon, 07 Oct 2019 16:10:23 +0200 Received: by maeck.lan (Postfix, from userid 501) id 5B1AC6AB2C98; Mon, 7 Oct 2019 16:10:22 +0200 (CEST) From: Felix Fietkau To: linux-wireless@vger.kernel.org Subject: [PATCH 1/4] mt76: add missing locking around ampdu action Date: Mon, 7 Oct 2019 16:10:19 +0200 Message-Id: <20191007141022.75184-1-nbd@nbd.name> X-Mailer: git-send-email 2.17.0 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org This is needed primarily to avoid races in dealing with rx aggregation related data structures Signed-off-by: Felix Fietkau --- drivers/net/wireless/mediatek/mt76/mt7603/main.c | 2 ++ drivers/net/wireless/mediatek/mt76/mt7615/main.c | 2 ++ drivers/net/wireless/mediatek/mt76/mt76x02_util.c | 2 ++ 3 files changed, 6 insertions(+) diff --git a/drivers/net/wireless/mediatek/mt76/mt7603/main.c b/drivers/net/wireless/mediatek/mt76/mt7603/main.c index 180eb6bb781a..c4dac556fb2e 100644 --- a/drivers/net/wireless/mediatek/mt76/mt7603/main.c +++ b/drivers/net/wireless/mediatek/mt76/mt7603/main.c @@ -569,6 +569,7 @@ mt7603_ampdu_action(struct ieee80211_hw *hw, struct ieee80211_vif *vif, mtxq = (struct mt76_txq *)txq->drv_priv; + mutex_lock(&dev->mt76.mutex); switch (action) { case IEEE80211_AMPDU_RX_START: mt76_rx_aggr_start(&dev->mt76, &msta->wcid, tid, ssn, @@ -598,6 +599,7 @@ mt7603_ampdu_action(struct ieee80211_hw *hw, struct ieee80211_vif *vif, ieee80211_stop_tx_ba_cb_irqsafe(vif, sta->addr, tid); break; } + mutex_unlock(&dev->mt76.mutex); return 0; } diff --git a/drivers/net/wireless/mediatek/mt76/mt7615/main.c b/drivers/net/wireless/mediatek/mt76/mt7615/main.c index 942076b6d1ad..d9f4d425424c 100644 --- a/drivers/net/wireless/mediatek/mt76/mt7615/main.c +++ b/drivers/net/wireless/mediatek/mt76/mt7615/main.c @@ -483,6 +483,7 @@ mt7615_ampdu_action(struct ieee80211_hw *hw, struct ieee80211_vif *vif, mtxq = (struct mt76_txq *)txq->drv_priv; + mutex_lock(&dev->mt76.mutex); switch (action) { case IEEE80211_AMPDU_RX_START: mt76_rx_aggr_start(&dev->mt76, &msta->wcid, tid, ssn, @@ -513,6 +514,7 @@ mt7615_ampdu_action(struct ieee80211_hw *hw, struct ieee80211_vif *vif, ieee80211_stop_tx_ba_cb_irqsafe(vif, sta->addr, tid); break; } + mutex_unlock(&dev->mt76.mutex); return 0; } diff --git a/drivers/net/wireless/mediatek/mt76/mt76x02_util.c b/drivers/net/wireless/mediatek/mt76/mt76x02_util.c index f5695ebdb225..bb7edf288597 100644 --- a/drivers/net/wireless/mediatek/mt76/mt76x02_util.c +++ b/drivers/net/wireless/mediatek/mt76/mt76x02_util.c @@ -372,6 +372,7 @@ int mt76x02_ampdu_action(struct ieee80211_hw *hw, struct ieee80211_vif *vif, mtxq = (struct mt76_txq *)txq->drv_priv; + mutex_lock(&dev->mt76.mutex); switch (action) { case IEEE80211_AMPDU_RX_START: mt76_rx_aggr_start(&dev->mt76, &msta->wcid, tid, @@ -401,6 +402,7 @@ int mt76x02_ampdu_action(struct ieee80211_hw *hw, struct ieee80211_vif *vif, ieee80211_stop_tx_ba_cb_irqsafe(vif, sta->addr, tid); break; } + mutex_unlock(&dev->mt76.mutex); return 0; } -- 2.17.0