From patchwork Tue Aug 27 09:30:04 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Felix Fietkau X-Patchwork-Id: 823088 Received: from nbd.name (nbd.name [46.4.11.11]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 480BE19D075 for ; Tue, 27 Aug 2024 09:55:31 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=46.4.11.11 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724752533; cv=none; b=m5UPN+zDzTkq0oqunCUd5b9CZyjK1necNt+aRMRw4/Ve5pEOj1KP04lH91v/4v2DWwiPTAMoV2eRc9jx5WCRI7TF5NBcwS2QjJj3I3cWmaU8it+HEssfzbHq3hfBSi1bxbLWgBTRYA3pIu8cV+eDmY+7oj4ZwG++MW6J6q49fAY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724752533; c=relaxed/simple; bh=xpcTg8M5GQyCPgaeC1KzHbfsq8vQSe1mjoqqfFWLwfc=; h=From:To:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=N8Eo/KPI9JTj2dlI87US3KU/1HE9rup5MbIQnIqGvjgR3f4Ubwtph/yWeVUdfX/kVc8GrznUErs52fRJpoSHWeMbTV+OnrNbig/uBqe0fr4D4580PGYNIu+UpsxuUlU12ZhQk+9Ec9JaE568iuA1GVBgWwDJks1xnhEA+96yjwc= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=nbd.name; spf=none smtp.mailfrom=nbd.name; dkim=pass (1024-bit key) header.d=nbd.name header.i=@nbd.name header.b=qr3n5G/m; arc=none smtp.client-ip=46.4.11.11 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=nbd.name Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=nbd.name Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=nbd.name header.i=@nbd.name header.b="qr3n5G/m" 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=tyVL70HI4ftarzbSPxEWGxpFCuZ5W4aekGXaTxFOkNo=; b=qr3n5G/mOU0U4i8c1PJdV6rwpj DQ7o9/F9IIPC1B4XLoKpPyl59NGlnmhcrXzmAkB6WousSHV/yfqyQSWbDhppFCOxWsB94OqSGCygW RVVKmwCrBAktNDNpk71pi2AtgaXokcSjqj558hLdq9ftN4rqc8WLLxK/6NWeogWH+7Dw=; Received: from p57a6f9a5.dip0.t-ipconnect.de ([87.166.249.165] helo=localhost.localdomain) by ds12 with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305_SHA256 (Exim 4.96) (envelope-from ) id 1sisWn-004Ww8-0P for linux-wireless@vger.kernel.org; Tue, 27 Aug 2024 11:30:17 +0200 From: Felix Fietkau To: linux-wireless@vger.kernel.org Subject: [PATCH v2 17/24] wifi: mt76: mt7915: hold dev->mt76.mutex while disabling tx worker Date: Tue, 27 Aug 2024 11:30:04 +0200 Message-ID: <20240827093011.18621-17-nbd@nbd.name> X-Mailer: git-send-email 2.46.0 In-Reply-To: <20240827093011.18621-1-nbd@nbd.name> References: <20240827093011.18621-1-nbd@nbd.name> Precedence: bulk X-Mailing-List: linux-wireless@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Prevent racing against other functions disabling the same worker Signed-off-by: Felix Fietkau --- drivers/net/wireless/mediatek/mt76/mt7915/mac.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/net/wireless/mediatek/mt76/mt7915/mac.c b/drivers/net/wireless/mediatek/mt76/mt7915/mac.c index dcec27be5a40..fc03cb499e71 100644 --- a/drivers/net/wireless/mediatek/mt76/mt7915/mac.c +++ b/drivers/net/wireless/mediatek/mt76/mt7915/mac.c @@ -1538,12 +1538,14 @@ void mt7915_mac_reset_work(struct work_struct *work) set_bit(MT76_RESET, &phy2->mt76->state); cancel_delayed_work_sync(&phy2->mt76->mac_work); } + + mutex_lock(&dev->mt76.mutex); + mt76_worker_disable(&dev->mt76.tx_worker); mt76_for_each_q_rx(&dev->mt76, i) napi_disable(&dev->mt76.napi[i]); napi_disable(&dev->mt76.tx_napi); - mutex_lock(&dev->mt76.mutex); if (mtk_wed_device_active(&dev->mt76.mmio.wed)) mtk_wed_device_stop(&dev->mt76.mmio.wed);