From nobody Mon Jun 8 09:49:27 2026 Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) (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 72A473EFD13; Thu, 4 Jun 2026 08:56:51 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=193.142.43.55 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1780563412; cv=none; b=Sv0us3tZzbTF4qARSb//OCzF5hjhaNIFT4cvo3YbIpjOpS4NbN7WD/QgfJ8Zi6yJwclgZoqTmH/1n+mDx6VNA6z1iLvRIGBN4TsVod+IemUiSOg14d3a5XoRC+t3CsHY1MiBl+eHDPT13S2hCn9zKyJ+HZ+T51blUB3LHOzPbVc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1780563412; c=relaxed/simple; bh=svg1tTMtMRdSDVyfRusbWJEqAkA6YWOaOhTq62v3Luo=; h=Date:From:To:Subject:Cc:In-Reply-To:References:MIME-Version: Message-ID:Content-Type; b=oBQprA+4n8aHwX2JSD1K3gDFr/7CNU6KxcnTIG9gSWxsfQffq6KLmXGLbOjHILIyOWVySh1UO41CB54wLOcjsrPUZN7kAwZ3rY6bq5HnEV+LGTRjaHQIpkS2IS/svWG+UoXTvKdGlsyxv0r+ale44VjeItqeaidfNC3XqFmy37E= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de; spf=pass smtp.mailfrom=linutronix.de; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=UV3hkJ44; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=g5z30zWx; arc=none smtp.client-ip=193.142.43.55 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linutronix.de Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="UV3hkJ44"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="g5z30zWx" Date: Thu, 04 Jun 2026 08:56:42 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1780563403; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=37nnoCsodiOYmZ8/Mx94KZ2zZksunOJCMo6SjQfLcm4=; b=UV3hkJ44b42wm4TsPYFrcFYcfzmQXiMtNf94SNeWo7Jzwge2te3oiRLM8StgSzI79AT2aF S5nXIXE/F04yxvttylElSbVduPiJrBs60f3sksTv3AYMMC6mQMuS3bWtp75YTg9954WUb0 GSob/M4OGsA0eNLU9b94hdwpik9mkwBRxQQMjXWvHWXI/dT+ND3PW31ANq/M7bmVOh5WaL ue2Pcfyfy3YVQZ5V5rIJmXy8NT+RfFnFkka+0QlbGTBf5CUdjG5O7gAgyvPZkoxquFALzt mf1NkBtrL9Bd+YfrjkIsxa2Y5mdwTnigr5/JF390uRS7Ts/LQL1ZuCJ/7BHRCg== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1780563403; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=37nnoCsodiOYmZ8/Mx94KZ2zZksunOJCMo6SjQfLcm4=; b=g5z30zWxJ0NVChlCHn/R819E7fGDv9jy+xjONfUNaVeA1IUmUokCl783hB5ejZHCIgpUQ+ 92lhYr1PyepTnpBg== From: "tip-bot2 for Reinette Chatre" Sender: tip-bot2@linutronix.de Reply-to: linux-kernel@vger.kernel.org To: linux-tip-commits@vger.kernel.org Subject: [tip: smp/core] cpu: Add lockdep_is_cpus_held()/lockdep_is_cpus_write_held() stubs for !CONFIG_HOTPLUG_CPU Cc: Sashiko , Reinette Chatre , Thomas Gleixner , x86@kernel.org, linux-kernel@vger.kernel.org In-Reply-To: =?utf-8?q?=3C7484f0b58fd86153d445819cc4e172adba16cff9=2E1780543?= =?utf-8?q?665=2Egit=2Ereinette=2Echatre=40intel=2Ecom=3E?= References: =?utf-8?q?=3C7484f0b58fd86153d445819cc4e172adba16cff9=2E17805436?= =?utf-8?q?65=2Egit=2Ereinette=2Echatre=40intel=2Ecom=3E?= Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-ID: <178056340214.710.13346449175207659640.tip-bot2@tip-bot2> Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails Precedence: bulk Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable The following commit has been merged into the smp/core branch of tip: Commit-ID: 9c91efd1d63e995bb0577fc1c5e909613dfe671d Gitweb: https://git.kernel.org/tip/9c91efd1d63e995bb0577fc1c5e909613= dfe671d Author: Reinette Chatre AuthorDate: Wed, 03 Jun 2026 20:38:47 -07:00 Committer: Thomas Gleixner CommitterDate: Thu, 04 Jun 2026 10:55:27 +02:00 cpu: Add lockdep_is_cpus_held()/lockdep_is_cpus_write_held() stubs for !CON= FIG_HOTPLUG_CPU lockdep_is_cpus_held() and lockdep_is_cpus_write_held() are undefined when !CONFIG_HOTPLUG_CPU. This is ok because their few callers protect the calls with a "if (IS_ENABLED(CONFIG_HOTPLUG_CPU) ..." check. It is error prone to require callers to protect lockdep_is_cpus_held() and lockdep_is_cpus_write_held() with an IS_ENABLED(CONFIG_HOTPLUG_CPU) check while the custom for equivalent functions, for example the more prevalent lockdep_is_held(), is to not require similar protection. It is also inconsistent with CPU hotplug lockdep code self since related call lockdep_assert_cpus_held() does not require protection. Create stubs for lockdep_is_cpus_held() and lockdep_is_cpus_write_held() that returns 1 (LOCK_STATE_UNKNOWN/LOCK_STATE_HELD) when !CONFIG_HOTPLUG_CP= U. This makes the CPU hotplug lockdep checks consistent while following existing lockdep custom. Drop the "extern" from the function declaration as part of the move to match kernel coding style. Keep the IS_ENABLED(CONFIG_HOTPLUG_CPU) checks in existing users since removing them would change the logic of these expressions. Reported-by: Sashiko Signed-off-by: Reinette Chatre Signed-off-by: Thomas Gleixner Link: https://patch.msgid.link/7484f0b58fd86153d445819cc4e172adba16cff9.178= 0543665.git.reinette.chatre@intel.com Closes: https://sashiko.dev/#/patchset/cover.1780456704.git.reinette.chatre= %40intel.com?part=3D1 --- include/linux/cpuhplock.h | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/include/linux/cpuhplock.h b/include/linux/cpuhplock.h index 286b3ab..42f6a09 100644 --- a/include/linux/cpuhplock.h +++ b/include/linux/cpuhplock.h @@ -12,9 +12,6 @@ =20 struct device; =20 -extern int lockdep_is_cpus_held(void); -extern int lockdep_is_cpus_write_held(void); - #ifdef CONFIG_HOTPLUG_CPU void cpus_write_lock(void); void cpus_write_unlock(void); @@ -22,6 +19,8 @@ void cpus_read_lock(void); void cpus_read_unlock(void); int cpus_read_trylock(void); void lockdep_assert_cpus_held(void); +int lockdep_is_cpus_held(void); +int lockdep_is_cpus_write_held(void); void cpu_hotplug_disable_offlining(void); void cpu_hotplug_disable(void); void cpu_hotplug_enable(void); @@ -38,6 +37,8 @@ static inline void cpus_read_lock(void) { } static inline void cpus_read_unlock(void) { } static inline int cpus_read_trylock(void) { return true; } static inline void lockdep_assert_cpus_held(void) { } +static inline int lockdep_is_cpus_held(void) { return 1; } +static inline int lockdep_is_cpus_write_held(void) { return 1; } static inline void cpu_hotplug_disable_offlining(void) { } static inline void cpu_hotplug_disable(void) { } static inline void cpu_hotplug_enable(void) { }