From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (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 59A5A4CCDC7; Fri, 4 Sep 2026 05:36:54 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1788500215; cv=none; b=WRUab15jOOkd3hl7VuVjC4DAhYwNy+1dy7zjJSOP0Sf2kq7KjOcU60AyrY+aRTfC+YRNR1OHL6/tfKrdVGHicceXO/tNoN/ygNLA8ww3kLf5L1N8Ki7cHsx/yx46ddVnZl1m8HvMCZTzruKdDgiLo3nLwdlOPMWdLKuOfqAksGY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1788500215; c=relaxed/simple; bh=AhFz53DZuefwxb6RONOIUaT6HrVpMMZ7KdNR96IYP+4=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=dCluT9Wj6OpKPjNQIx/n9mHECtU1YDp/ZR0DKNMsPnmdZiCGmr6S9EEEluxCjn8JCZ8E4qRbwLJY1WYUeAJd14hJo5jcd6xWGeCc/HhVR1dqHZWAsCOHe4J0Bo3hgw5gDVXDCZcX7evitEfwPENylX4thDZf0afEqnNb5JcFXWQ= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=F80qUNWk; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="F80qUNWk" Received: by smtp.kernel.org (Postfix) with ESMTPSA id B29A21F00A3D; Fri, 4 Sep 2026 05:36:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1788500214; bh=zORZT/0YQYZekuxgn1QnzPuSPT/h50HvN6QH3SpajzA=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=F80qUNWk3aA1t5Bi0yMx0VsG1nRRWruPJnxSql9Rz3tQ1nuWzjBibg2Rm2HvRFHfq 6ALnjuCSrEHMJQOpiIoQbN8vg0VUaKQJxW7M46q+r86/A2TnugjaqSm0fmrLoBGDTk sSsBWYq5fReNCppDJ51zWf5MIDVdondJI3eLxu7E= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Runyu Xiao , Felix Fietkau Subject: [PATCH 7.2 692/713] wifi: mt76: mt7615: avoid waiting for mac work under the mt76 mutex Date: Fri, 4 Sep 2026 07:01:00 +0200 Message-ID: <20260904045819.353878026@linuxfoundation.org> X-Mailer: git-send-email 2.55.0 In-Reply-To: <20260904045803.810145556@linuxfoundation.org> References: <20260904045803.810145556@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: stable@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 7.2-stable review patch. If anyone has any objections, please let me know. ------------------ From: Runyu Xiao commit bda8324270b1ac91bfba1df8928e0570e29759e8 upstream. mt7615_suspend() acquired the mt76 mutex and then called cancel_delayed_work_sync() on mac_work. mt7615_mac_work() acquires the same mutex via mt7615_mutex_acquire() at the top of the worker, so if mac_work is already running and blocked on the mutex, the suspend path deadlocks waiting for the work it holds the mutex against. Flush scan_work and mac_work before taking the mutex, matching the suspend paths in mt7921 and mt7925. scan_work only takes the mt76 spinlock, but moving it keeps the sequence consistent. This also keeps mac_work from running over an already suspended HIF, which the previous split (async cancel under the lock, sync cancel after release) would have allowed. Fixes: c6bf20109a3f ("mt76: mt7615: add WoW support") Cc: stable@vger.kernel.org Signed-off-by: Runyu Xiao Link: https://patch.msgid.link/20260612041331.2596331-1-runyu.xiao@seu.edu.cn Signed-off-by: Felix Fietkau Signed-off-by: Greg Kroah-Hartman --- drivers/net/wireless/mediatek/mt76/mt7615/main.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) --- a/drivers/net/wireless/mediatek/mt76/mt7615/main.c +++ b/drivers/net/wireless/mediatek/mt76/mt7615/main.c @@ -1239,11 +1239,12 @@ static int mt7615_suspend(struct ieee802 cancel_delayed_work_sync(&dev->pm.ps_work); mt76_connac_free_pending_tx_skbs(&dev->pm, NULL); + cancel_delayed_work_sync(&phy->scan_work); + cancel_delayed_work_sync(&phy->mt76->mac_work); + mt7615_mutex_acquire(dev); clear_bit(MT76_STATE_RUNNING, &phy->mt76->state); - cancel_delayed_work_sync(&phy->scan_work); - cancel_delayed_work_sync(&phy->mt76->mac_work); set_bit(MT76_STATE_SUSPEND, &phy->mt76->state); ieee80211_iterate_active_interfaces(hw,