From nobody Fri Mar 27 01:30:55 2026 Received: from out-181.mta0.migadu.com (out-181.mta0.migadu.com [91.218.175.181]) (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 E3F7237AA7A for ; Mon, 23 Feb 2026 22:02:53 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=91.218.175.181 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1771884175; cv=none; b=mc5sTC0EFEW26+HvL6bxhvr6hTQrC6k6qFcyb3QTcUu2K0hsEsr8++zSV1OeNU24sETHS4/cqYlSnBZcwbm2DX8egLhqeZbV9DYEinGHHwmLszr8fQArhbpXgdPtpDdYQ7YhsKYphPY+GPEzhIJLZwfshoilg1i5YHWC3R3mS84= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1771884175; c=relaxed/simple; bh=3jSmph4A2N7yQxL96ij/BM7i+tiya0NcUMO9PHQotGA=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=Ia9+rcXCkYJ+sj5++dRBpFWQtdFMJ//wTj/jatJQfXfroIM5vbUxEzxUULkt076InR6wddmOpAhgqmpEmpARMQy9rKACeB/gRpWAsMjy5rK9Ocnl94LaGQN6m1bZ3d6jj7Hy5+x0mRpqW8QflhKqtPhBZklKXxdBf/axA4t33Kc= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev; spf=pass smtp.mailfrom=linux.dev; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b=GrMo0j4z; arc=none smtp.client-ip=91.218.175.181 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.dev Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b="GrMo0j4z" X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1771884172; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=EFLwmUr1cuLe9yVyWv2UD2BhxyCon9uyCsuitNP8gHs=; b=GrMo0j4zdk4QjIIJVcYUowrwpFi9lFIHlcLklxCUEJqJ67KaG4D5P9rETKGagoUzxLlyYA MOLJNRJj85TlMqxE1SUG5khkc2p4hdBHXfage0Uosl4qxaAueUWXh/GCscAR8DppYC+jxk oPw+DXJ53Sh8szgUlNta/ySaIn1gMnU= From: Bart Van Assche To: Peter Zijlstra Cc: Ingo Molnar , Will Deacon , Boqun Feng , Waiman Long , linux-kernel@vger.kernel.org, Marco Elver , Christoph Hellwig , Steven Rostedt , Nick Desaulniers , Nathan Chancellor , Kees Cook , Jann Horn , Bart Van Assche , Johannes Berg , Eyal Reizer , Tony Lindgren , Kalle Valo , linux-wireless@vger.kernel.org Subject: [PATCH 25/62] wlcore: Fix a locking bug Date: Mon, 23 Feb 2026 14:00:25 -0800 Message-ID: <20260223220102.2158611-26-bart.vanassche@linux.dev> In-Reply-To: <20260223220102.2158611-1-bart.vanassche@linux.dev> References: <20260223220102.2158611-1-bart.vanassche@linux.dev> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Migadu-Flow: FLOW_OUT Content-Type: text/plain; charset="utf-8" From: Bart Van Assche Make sure that wl->mutex is locked before it is unlocked. This has been detected by the Clang thread-safety analyzer. Cc: Johannes Berg Cc: Eyal Reizer Cc: Tony Lindgren Cc: Kalle Valo Cc: linux-wireless@vger.kernel.org Fixes: 45aa7f071b06 ("wlcore: Use generic runtime pm calls for wowlan elp c= onfiguration") Signed-off-by: Bart Van Assche --- drivers/net/wireless/ti/wlcore/main.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/net/wireless/ti/wlcore/main.c b/drivers/net/wireless/t= i/wlcore/main.c index 17dd417756f2..1c340a4a0930 100644 --- a/drivers/net/wireless/ti/wlcore/main.c +++ b/drivers/net/wireless/ti/wlcore/main.c @@ -1875,6 +1875,8 @@ static int __maybe_unused wl1271_op_resume(struct iee= e80211_hw *hw) wl->wow_enabled); WARN_ON(!wl->wow_enabled); =20 + mutex_lock(&wl->mutex); + ret =3D pm_runtime_force_resume(wl->dev); if (ret < 0) { wl1271_error("ELP wakeup failure!"); @@ -1891,8 +1893,6 @@ static int __maybe_unused wl1271_op_resume(struct iee= e80211_hw *hw) run_irq_work =3D true; spin_unlock_irqrestore(&wl->wl_lock, flags); =20 - mutex_lock(&wl->mutex); - /* test the recovery flag before calling any SDIO functions */ pending_recovery =3D test_bit(WL1271_FLAG_RECOVERY_IN_PROGRESS, &wl->flags);