From nobody Sun Feb 8 19:25:31 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 BAFCF166F29 for ; Mon, 12 Aug 2024 10:53:31 +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=1723460013; cv=none; b=gyEvuBC04CxQyVXz0elDlqKWCOT93V4YhAXrHrskB7eMGhbxsecyl7H8dyXQbsE1622IA9/PZNNyJR+4cXZKtgGyQdcLaeu3LXAKgHvDZboM+Ooca7wP50qVVv7mNMMRA203Mai9/LTubiwUEwvV5+Cy/dKH18mhJquLqDz4IwM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1723460013; c=relaxed/simple; bh=Vvo65eBZ3fApHBgj8mgkZYRoUX6eV/raJvBbZmdKM6c=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=NZmcKXUfXV2zJu7WnyELbOHkELOXFs823WN5CQupl+otMPpKuBuHg85IuYuxl/5EcB5EPGBLlnhuu5hc+POC/3Fch80W5vhU3gOXldd2UtmSYmhLF2i6g4btT2Py5A7xoAHE/Rpfwk47YPwxI0YPGHl+eC5Ry/YfsmHwl9Ve2+M= 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=E5EcQnsR; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=D3qOc1st; 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="E5EcQnsR"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="D3qOc1st" From: Sebastian Andrzej Siewior DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1723460010; 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=gcL+zNGIx3Ivr8BjLOnyNxuRZmmfsnShYAT6NnWXJq4=; b=E5EcQnsR1sirmSNqMi0LGRx+Cu5e/4zHbnY1xE2EtotPaf84WRvMsdcKh6oWuX5CLPGx7L jFZMoiPuSMbaIjNzjKhCfbMcSj4Tu+QkAd3DMsbsFzl3CKF59QPdVyed5MU/BtFMPVa2Z7 HOpxNbH1kjEqH8z7k6An19xjNEFJ1Y+NuTwtCk22VpP+qq3fDVjL666BJZfNE1S0RI16jW tRer9ZQCqGJRdOd/fVQjIopSAjdIsVeqmOYt0tfegUt3/76cc1O9O4LRYTMm1ObrZ57J/j lA2hbUqEAkVYNGVK7aOsAohDJl6Hj2A3QWDajra1wBz453Be7e5ggPaAbHxnkg== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1723460010; 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=gcL+zNGIx3Ivr8BjLOnyNxuRZmmfsnShYAT6NnWXJq4=; b=D3qOc1stzinaCf5qAp5bTNPMLUy5oEqsnhzLeP4/lrFBN+KJ69zEMrBCQBNN9q8itUnKMj Y8cbDlANSpBUt/DQ== To: linux-kernel@vger.kernel.org Cc: Anna-Maria Behnsen , Frederic Weisbecker , Thomas Gleixner , Sebastian Andrzej Siewior Subject: [PATCH 1/2] timers: Add sparse annotation for timer_sync_wait_running(). Date: Mon, 12 Aug 2024 12:51:04 +0200 Message-ID: <20240812105326.2240000-2-bigeasy@linutronix.de> In-Reply-To: <20240812105326.2240000-1-bigeasy@linutronix.de> References: <20240812105326.2240000-1-bigeasy@linutronix.de> 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 Content-Type: text/plain; charset="utf-8" timer_sync_wait_running() first releases two locks and then acquires them again. This is unexpected and sparse complains about it. Add sparse annotation for timer_sync_wait_running() to note that the locking is expected. Signed-off-by: Sebastian Andrzej Siewior --- kernel/time/timer.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/kernel/time/timer.c b/kernel/time/timer.c index 64b0d8a0aa0f1..429232d8659a3 100644 --- a/kernel/time/timer.c +++ b/kernel/time/timer.c @@ -1561,6 +1561,8 @@ static inline void timer_base_unlock_expiry(struct ti= mer_base *base) * the waiter to acquire the lock and make progress. */ static void timer_sync_wait_running(struct timer_base *base) + __releases(&base->lock) __releases(&base->expiry_lock) + __acquires(&base->expiry_lock) __acquires(&base->lock) { if (atomic_read(&base->timer_waiters)) { raw_spin_unlock_irq(&base->lock); --=20 2.45.2 From nobody Sun Feb 8 19:25:31 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 2AEC6170A0B for ; Mon, 12 Aug 2024 10:53:31 +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=1723460014; cv=none; b=YU/CaBDsRYJrd0yt5KQ2HpDD9X8sZ6VeCm8Detc7JbNGNvndZfQI7T0V0IiMHui98i0qdnf6U020AbsIggylPXVrs6NcZaqE28RvU4FAqeYcpv624eJdr0Myd8cNfeBeeJLCbGJ59lx6OBmJPtvCDvF12R1MDlsE88vKwtj+TKI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1723460014; c=relaxed/simple; bh=VKiIt1cw1TGdGgBj49i0dm9y2zD7jsGlYQ9bZ41p7C8=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=cRC96MWkZoUtTVT05PhnSbBX92bHrujkNxWMuY0WHrqeIwZhoBIE2gTomWq4NcmVfgKPitU2/D7UaCdK4YH8KXZmAxF2LHdE1qYslYbUWDLkdZiGLfYbz1bdDdA8YMqSUY3CyVJ+f+fk9VWxMl1NVmK551tnaMH3qidt3JlHarM= 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=q71xkR3T; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=oDzZ/IpV; 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="q71xkR3T"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="oDzZ/IpV" From: Sebastian Andrzej Siewior DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1723460010; 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=qNehWMeYt1ZrGOgLXiaU/DzVkqIQBQkzqxpsIkD5InU=; b=q71xkR3TGpk0X5746BZTo5PJc2IjL6Z2nUKrznTe+57T283WAeVpHbRARfm2/ftaJFVve1 1hSGP9WlHqzLrNlMlx5vFUty/X/KBYcQ5c3H3dGG8fzF2WH19sEpNNfuvsVmxMR69qhE0/ v/ClGFNhXJP/sK6pSZpQAlIqPD5AgBeU5u6EZ41hZWG7XMGIjp37CWutY5s27Mdr0Q5V7G xb+txmkuRTvAq1HHJQUc2TBLFmGtilMj+5F5w0SdaE4UoE3AycRUDCnCrsXDyHzkWSnSZZ jCr6z5x+89YV92GA18SUicYftHP9Zti+PSdms7it97DU9tec4t62AtUC/9+1qg== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1723460010; 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=qNehWMeYt1ZrGOgLXiaU/DzVkqIQBQkzqxpsIkD5InU=; b=oDzZ/IpVmajgRCg0NbxqG6aFuV/tSKfbH7jNaRFkyO6BhBRBlinUzzc9RWsYotvd9t7lN3 2u8vjQ6ZLxwhm0DA== To: linux-kernel@vger.kernel.org Cc: Anna-Maria Behnsen , Frederic Weisbecker , Thomas Gleixner , Sebastian Andrzej Siewior Subject: [PATCH 2/2] hrtimer: Annotate hrtimer_cpu_base_.*_expiry() for sparse. Date: Mon, 12 Aug 2024 12:51:05 +0200 Message-ID: <20240812105326.2240000-3-bigeasy@linutronix.de> In-Reply-To: <20240812105326.2240000-1-bigeasy@linutronix.de> References: <20240812105326.2240000-1-bigeasy@linutronix.de> 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 Content-Type: text/plain; charset="utf-8" The two hrtimer_cpu_base_.*_expiry() functions are wrapper around the locking functions and sparse complains about the missing counterpart. Add sparse annotation to denote that this bevaviour is expected. Signed-off-by: Sebastian Andrzej Siewior --- kernel/time/hrtimer.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/kernel/time/hrtimer.c b/kernel/time/hrtimer.c index b8ee320208d41..f56ef23aad903 100644 --- a/kernel/time/hrtimer.c +++ b/kernel/time/hrtimer.c @@ -1351,11 +1351,13 @@ static void hrtimer_cpu_base_init_expiry_lock(struc= t hrtimer_cpu_base *base) } =20 static void hrtimer_cpu_base_lock_expiry(struct hrtimer_cpu_base *base) + __acquires(&base->softirq_expiry_lock) { spin_lock(&base->softirq_expiry_lock); } =20 static void hrtimer_cpu_base_unlock_expiry(struct hrtimer_cpu_base *base) + __releases(&base->softirq_expiry_lock) { spin_unlock(&base->softirq_expiry_lock); } --=20 2.45.2