From nobody Sat Oct 4 22:36:15 2025 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 8A5572D3A86; Tue, 12 Aug 2025 06:08:13 +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=1754978894; cv=none; b=Dz94AAqvdSwsbjUXysYIE1mMD1ZrZDVc5ihRQk8yIG07M0a+BtdNp7ium1vg3coe1JPEJPaleqpD7MdLjYu0WaTIc/pZ2ItZw49u11Mt7LykifSSxqup1zD80FhfHSr+CC9LLtYYSlYEmOzOKskS0H4Erex97Ued0TMJa3iTxM8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1754978894; c=relaxed/simple; bh=cDdskTeMBjfT40lnoI/1lGcD63X/oAcaF7nr3454EvY=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=UlZOCykZajMBHUUSaa3TgDEBEZ+hr9pG5S4s2fxp4Faxt07yARR5ehFZo2ZJOUBdU70P2pnTarX9Q6/S/UdrIvPhAGfbrMpWzfoiHCcreMUbdvWlS7zjcGkzmQnXPilVppKuh2eUx6F/zYSfG6Yrlt4thhFB5a4jkoPJX/4yRHE= 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=Q8rxycew; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=WhpyvOLk; 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="Q8rxycew"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="WhpyvOLk" From: =?utf-8?q?Thomas_Wei=C3=9Fschuh?= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1754978891; h=from:from: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=AY1zmrXMJNlJnrT+Ag2GsBTSwHxd8YFxQV7SfjD3qQE=; b=Q8rxycew8680SdoSUJGV7yloR1XlugUm6B02ZWT6rlGh6sPZPF9ksfUYlgs9DsNXuP8yaE uk1w7UGAUTKFXhSCyQl2Kg4ypeupOkFMcSQsbXTve+9JOf3bZVfCu/nW2tvZY05QD7bG9/ 5UBxpAU14+fkgRqT3rZPU4wFvI7wIGd4/Pt1ccMI3Dye055fc2paz0cQ7DeRgaIvIQXkD7 nD3bLUwAz/Xn3lPyFfNCteEHNzLjbG8Uq7rR6+oode/h/h/Cq6sIyX3UuFkaHnl10Ii6Rh oQ0er7NMwykyqN7mPsUuyDpZF3CD/qKJS9K2jMUwCE4+MPR5OOG7IzFjwrTmQg== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1754978891; h=from:from: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=AY1zmrXMJNlJnrT+Ag2GsBTSwHxd8YFxQV7SfjD3qQE=; b=WhpyvOLkNJer5E9P40aO2PPg2IjEu07jVRKXmaZudiDm2CgJUinN+J7xxvXiA+HuwpRNt/ MYYNgTxeu01e8fBA== Date: Tue, 12 Aug 2025 08:08:09 +0200 Subject: [PATCH 1/8] posix-timers: Avoid direct access to hrtimer clockbase Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20250812-hrtimer-cleanup-get_time-v1-1-b962cd9d9385@linutronix.de> References: <20250812-hrtimer-cleanup-get_time-v1-0-b962cd9d9385@linutronix.de> In-Reply-To: <20250812-hrtimer-cleanup-get_time-v1-0-b962cd9d9385@linutronix.de> To: Anna-Maria Behnsen , Frederic Weisbecker , Thomas Gleixner , Ingo Molnar , Peter Zijlstra , Juri Lelli , Vincent Guittot , Dietmar Eggemann , Steven Rostedt , Ben Segall , Mel Gorman , Valentin Schneider , Matt Wu , Andrew Morton , Jaroslav Kysela , Takashi Iwai , Sean Young , Mauro Carvalho Chehab , Jan Kiszka , Kieran Bingham Cc: linux-kernel@vger.kernel.org, linux-sound@vger.kernel.org, linux-media@vger.kernel.org, =?utf-8?q?Thomas_Wei=C3=9Fschuh?= X-Developer-Signature: v=1; a=ed25519-sha256; t=1754978890; l=1302; i=thomas.weissschuh@linutronix.de; s=20240209; h=from:subject:message-id; bh=cDdskTeMBjfT40lnoI/1lGcD63X/oAcaF7nr3454EvY=; b=s6H2qGIOSHXhMzrMEftAl5LtWNVTZAORhp9JJiXyNqxAzTGNBqaJzHeQTvCN6yUIPq4+QGLwz IxkG+vRhPQuDMpMqDNWI4dPjO7rq6Gv81s20zv/nszNdW+ioStBialZ X-Developer-Key: i=thomas.weissschuh@linutronix.de; a=ed25519; pk=pfvxvpFUDJV2h2nY0FidLUml22uGLSjByFbM6aqQQws= The field timer->base->get_time is a private implementation detail and should not be accessed outside of the hrtimer core. Switch to the equivalent helpers. Signed-off-by: Thomas Wei=C3=9Fschuh Acked-by: Peter Zijlstra (Intel) --- kernel/time/posix-timers.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/kernel/time/posix-timers.c b/kernel/time/posix-timers.c index 8b582174b1f9498a548fc1c214185577f994a647..2741f3725de48ea8f73cc279287= 631f9d5a6e960 100644 --- a/kernel/time/posix-timers.c +++ b/kernel/time/posix-timers.c @@ -299,8 +299,7 @@ static void common_hrtimer_rearm(struct k_itimer *timr) { struct hrtimer *timer =3D &timr->it.real.timer; =20 - timr->it_overrun +=3D hrtimer_forward(timer, timer->base->get_time(), - timr->it_interval); + timr->it_overrun +=3D hrtimer_forward_now(timer, timr->it_interval); hrtimer_restart(timer); } =20 @@ -825,7 +824,7 @@ static void common_hrtimer_arm(struct k_itimer *timr, k= time_t expires, hrtimer_setup(&timr->it.real.timer, posix_timer_fn, timr->it_clock, mode); =20 if (!absolute) - expires =3D ktime_add_safe(expires, timer->base->get_time()); + expires =3D ktime_add_safe(expires, hrtimer_cb_get_time(timer)); hrtimer_set_expires(timer, expires); =20 if (!sigev_none) --=20 2.50.1 From nobody Sat Oct 4 22:36:15 2025 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 C9A16311C31; Tue, 12 Aug 2025 06:08:13 +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=1754978895; cv=none; b=tR3DYV9ZUHhOOj+jZiBK4Fl7Ko2XdDj+q1McQl8Bsg87KvfOoWaOZYP6LcJheBUpdyoeFIxSWRAVAlUstL10CVfweuO7K0B7lznn+YLux7E/E2CVMLJqazj5GJU+QxKllMOySlUMNTh3DviIl37NbdsCTWZDbtHRJtceWWb1Z88= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1754978895; c=relaxed/simple; bh=P/mg/4ffu8Rs3cqai0IgxXOlh0xHW/h5Hvab6hH4Sx8=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=NhEOLzcR4eD9s9doC430N/E3Um4aUHKlBGxAenGDSVcKB6/xWHsddsF0NrJd+134mYeYnrdH+tBwVReNiXhhC83isQLX0+k0NKHtzVAhO1fD/u2DrHUES3I+ttiyaJ07FYiEEyNIYW2w8ClVlZWDSB10FOxIS4gMhGs/6hyEnqA= 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=o3CoT/WL; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=Yi+EyDT5; 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="o3CoT/WL"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="Yi+EyDT5" From: =?utf-8?q?Thomas_Wei=C3=9Fschuh?= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1754978892; h=from:from: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=x0iMxYdw8C0HtEhISgP4y62XdqD1olCpYK33WTJjb8g=; b=o3CoT/WLWZMrlRJJzRVZtu+8QTF66lfKeeMwXCo1r1JTrRHi26zBCkqllLFHTN5yx+vQcq TeEWRnzwzcfz4YqSUhulIdLPSKniTkk2A6iX5FORbt2/CkPsDjzKg5u9sKrCo9Rt6OUG0M 1AZQ8Uvly8NylYE5kB0Ehd7WrAmrOK45qiTpx2gWeTkg97O59nIbiKczmVdc4rTtc/oeEo B/jBF8Tw+bLghNNblojVdmf2Jbj/XYD2vl2sInjqRX0ykO1L53aJIV02xIBeh4yto52trw yaIYnt1oJk5IkT46rMjc/sOr2Mztu4jznSF3LBMC3Na2p1ZVWNRLQQk+lbqN4g== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1754978892; h=from:from: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=x0iMxYdw8C0HtEhISgP4y62XdqD1olCpYK33WTJjb8g=; b=Yi+EyDT5jwK+r+Bl9kuOskYEnRrHIGTATbMpiDjdkj6me7Ol28gcc3FW+3jhShwpUn4TSC rCWxen/SR5i4ibAA== Date: Tue, 12 Aug 2025 08:08:10 +0200 Subject: [PATCH 2/8] timers/itimer: Avoid direct access to hrtimer clockbase Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20250812-hrtimer-cleanup-get_time-v1-2-b962cd9d9385@linutronix.de> References: <20250812-hrtimer-cleanup-get_time-v1-0-b962cd9d9385@linutronix.de> In-Reply-To: <20250812-hrtimer-cleanup-get_time-v1-0-b962cd9d9385@linutronix.de> To: Anna-Maria Behnsen , Frederic Weisbecker , Thomas Gleixner , Ingo Molnar , Peter Zijlstra , Juri Lelli , Vincent Guittot , Dietmar Eggemann , Steven Rostedt , Ben Segall , Mel Gorman , Valentin Schneider , Matt Wu , Andrew Morton , Jaroslav Kysela , Takashi Iwai , Sean Young , Mauro Carvalho Chehab , Jan Kiszka , Kieran Bingham Cc: linux-kernel@vger.kernel.org, linux-sound@vger.kernel.org, linux-media@vger.kernel.org, =?utf-8?q?Thomas_Wei=C3=9Fschuh?= X-Developer-Signature: v=1; a=ed25519-sha256; t=1754978890; l=915; i=thomas.weissschuh@linutronix.de; s=20240209; h=from:subject:message-id; bh=P/mg/4ffu8Rs3cqai0IgxXOlh0xHW/h5Hvab6hH4Sx8=; b=DyIUhu8mN+/71fv6hW+hJ/t3PpDZ0TXs7GxnecKN9EabUhLjLNuDp2q5rulxJi6xi+otSCFlC 52ao7KpOXhaAVGtsiWRnf8dBD+u9cTr9zfM+2KIhkvdi+V0GEmgKgGr X-Developer-Key: i=thomas.weissschuh@linutronix.de; a=ed25519; pk=pfvxvpFUDJV2h2nY0FidLUml22uGLSjByFbM6aqQQws= The field timer->base->get_time is a private implementation detail and should not be accessed outside of the hrtimer core. Switch to the equivalent helper. Signed-off-by: Thomas Wei=C3=9Fschuh Acked-by: Peter Zijlstra (Intel) --- kernel/time/itimer.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/kernel/time/itimer.c b/kernel/time/itimer.c index 876d389b2e219a10c0dbddb6a06dd3252c502e99..7c6110e964e7ecd19ab8c5c9b81= f1b113c1ae7bd 100644 --- a/kernel/time/itimer.c +++ b/kernel/time/itimer.c @@ -163,8 +163,7 @@ void posixtimer_rearm_itimer(struct task_struct *tsk) struct hrtimer *tmr =3D &tsk->signal->real_timer; =20 if (!hrtimer_is_queued(tmr) && tsk->signal->it_real_incr !=3D 0) { - hrtimer_forward(tmr, tmr->base->get_time(), - tsk->signal->it_real_incr); + hrtimer_forward_now(tmr, tsk->signal->it_real_incr); hrtimer_restart(tmr); } } --=20 2.50.1 From nobody Sat Oct 4 22:36:15 2025 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 7DA162D948C; Tue, 12 Aug 2025 06:08:14 +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=1754978895; cv=none; b=kTcMRjG5tARqJWo/zxwZaIDWOnM4z3P2naU8jEDlDP+yV4o3pzO0ajelvhzV/xpJ0QWh9E4JFav5+blRZGhTo5/CClvCy7fwYrNgnRWfvm1qQISotLKHhtTFGgv3+ENfXpnaCgKc7Y5fOu5jy4+ykCC+jrL9Q6Gh8Zd1DvBvfE8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1754978895; c=relaxed/simple; bh=z3HQR43UqG3JSyrM06mxtW8lA1cmGVnE5uffmTfAQFI=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=MlGRJWO1b4WuB5FKhTOboFBX8ndyAdgKWsk8JQ7nwrqkIYZJpemfeLZrbbzfqiRqD0ksNDDj3ZVC+24SJ1m8F9JYzirU/tPsU2dnLot/8HlaAPznvwonQ7OY0QQiCl7yAzJgvSDkM3C2bYxc5d6j6Lxk0ySyQ+wh4dKdSb745nE= 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=VPQV7qAL; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=bzNzbqCH; 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="VPQV7qAL"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="bzNzbqCH" From: =?utf-8?q?Thomas_Wei=C3=9Fschuh?= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1754978892; h=from:from: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=tey58V1tUmxjEhIxGwXATPrEYoF8tOxa4AE85TvKXZc=; b=VPQV7qALVu83oSqawIsSv29GXoM5sJKIog0ekvKdLeSxDpYJ0omFMzGl966uvIDtYQPJ9E lfCTulTtiwQnekMH+zGB/vHaXy9F2dGwKI1jduHdON2V+eFl0Q/S09YyyHua37+u1lYmi3 UjXTzHnGCHVtxjleQrD6N++li6erqrxxP5YTHzhwtkRGNeS5/5Pak4u1kyXTcee+vX2D3Y 1qSeGQ/braKkXW1DsmekYvkKcmRESotaifcCK3/egYUdF8U6UHLAaa1eRdRVZG81tGsaOP EAcYCHt3AJTUgb9H4EfR//TXHeVjxmEa+4cGb6QPWZetQ7uiLd4Dc3EhRiXR5A== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1754978892; h=from:from: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=tey58V1tUmxjEhIxGwXATPrEYoF8tOxa4AE85TvKXZc=; b=bzNzbqCHQMOzvVEs5qkzK19tnbkGnPI4yBGtIIi0Pgp+LPwWzRWJVMVEuhF8e8VBJf7NBz oj/yMg95U6JhIpAQ== Date: Tue, 12 Aug 2025 08:08:11 +0200 Subject: [PATCH 3/8] sched/core: Avoid direct access to hrtimer clockbase Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20250812-hrtimer-cleanup-get_time-v1-3-b962cd9d9385@linutronix.de> References: <20250812-hrtimer-cleanup-get_time-v1-0-b962cd9d9385@linutronix.de> In-Reply-To: <20250812-hrtimer-cleanup-get_time-v1-0-b962cd9d9385@linutronix.de> To: Anna-Maria Behnsen , Frederic Weisbecker , Thomas Gleixner , Ingo Molnar , Peter Zijlstra , Juri Lelli , Vincent Guittot , Dietmar Eggemann , Steven Rostedt , Ben Segall , Mel Gorman , Valentin Schneider , Matt Wu , Andrew Morton , Jaroslav Kysela , Takashi Iwai , Sean Young , Mauro Carvalho Chehab , Jan Kiszka , Kieran Bingham Cc: linux-kernel@vger.kernel.org, linux-sound@vger.kernel.org, linux-media@vger.kernel.org, =?utf-8?q?Thomas_Wei=C3=9Fschuh?= X-Developer-Signature: v=1; a=ed25519-sha256; t=1754978890; l=888; i=thomas.weissschuh@linutronix.de; s=20240209; h=from:subject:message-id; bh=z3HQR43UqG3JSyrM06mxtW8lA1cmGVnE5uffmTfAQFI=; b=N7rZSEcP/IydxFGDv1sBDbMbv9+D8TqlAZly0Gxy2T9Z4PBM6cdTTdUZyGEpNiR14FmFWWjkI IyYLu1gRm8/C7+wcuiabeeXjJkbYjHx0EsTuce5pnkRjCHo25COhse/ X-Developer-Key: i=thomas.weissschuh@linutronix.de; a=ed25519; pk=pfvxvpFUDJV2h2nY0FidLUml22uGLSjByFbM6aqQQws= The field timer->base->get_time is a private implementation detail and should not be accessed outside of the hrtimer core. Switch to the equivalent helper. Signed-off-by: Thomas Wei=C3=9Fschuh Acked-by: Peter Zijlstra (Intel) --- kernel/sched/core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kernel/sched/core.c b/kernel/sched/core.c index be00629f0ba4cc5832189c0052b0b632deb4ea2e..4dc12838ad4fdf086b3f3f11680= 72d6301f51aa3 100644 --- a/kernel/sched/core.c +++ b/kernel/sched/core.c @@ -917,7 +917,7 @@ void hrtick_start(struct rq *rq, u64 delay) * doesn't make sense and can cause timer DoS. */ delta =3D max_t(s64, delay, 10000LL); - rq->hrtick_time =3D ktime_add_ns(timer->base->get_time(), delta); + rq->hrtick_time =3D ktime_add_ns(hrtimer_cb_get_time(timer), delta); =20 if (rq =3D=3D this_rq()) __hrtick_restart(rq); --=20 2.50.1 From nobody Sat Oct 4 22:36:15 2025 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 30E1B2E264F; Tue, 12 Aug 2025 06:08:14 +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=1754978896; cv=none; b=P/jayjQI9GSVgY8vAtKfhMM0nysLA6iA2T/Tafd57WChsUztuM+8cu/94SufgsoSdxe5h0b+sp1fjNaYywFmW/Ep09qs4xAH7UjN/bZsDv/JfyXBYWMc1p6HpykRavXXGnYMI6oebbzJh247gZNWxYlLTFGiAp+d37h867/SDoE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1754978896; c=relaxed/simple; bh=Xv7KxTjtEi5jAVg89oMqNhQ5UjlFaArcAsRKTAMGvUI=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=pdpj8OgBxTanhel7tnF2q2DhRY9mUKfeYmUZbKmSBx0AGYsi5Q/fbTod3lX4XIx2nXYfVV0T1a4vsvTrV6EVhB+4kGJveKr/XpwrcbE2XAsfQk6dXi4GNU3HvPiXNTVaVbdvH/yApwZjPvPq7lxvU6pS8AjTe1BgpDG8d8lDe14= 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=CDIzxiaC; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=x45lZa31; 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="CDIzxiaC"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="x45lZa31" From: =?utf-8?q?Thomas_Wei=C3=9Fschuh?= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1754978893; h=from:from: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=q15Z5Z9Yrtaw3ZAMBw9L5KUC8aL4gmWi8MTTjpGkzXw=; b=CDIzxiaCEf+ao46FYkLERcceUjVZCaXlpt21RKLfbTPVFImrfgN0NArwm/ChdJxtSS/iNF rFQomYKf5oeTmXTBucrCUFdwEHoEzlkQTrgIcwdPaqNmzOxqJJJunS0kC+/tBX/iFhbj5K xxKFdijteRw1/Nrf2cCXH/f+TwK86Br3r8JUTzTsm4AjCafLfwRDdNMOn7O7CKEur1QZfq +K+8dLWmo/PC+7h7LjHcR8l89tVJ4Vm+HD2gG3qd3bOoEfw48gGC3KZeg4eYKpAILJprPE H/98u23oVFTjmV8A4HJhDGql07PXkh5gjZ/T7mS9jPwxYpwVE3Ra7EyXKfAZgg== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1754978893; h=from:from: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=q15Z5Z9Yrtaw3ZAMBw9L5KUC8aL4gmWi8MTTjpGkzXw=; b=x45lZa31zk/v1QnEJAGHTK45QEWt/iN+ywHr632eu+MQahdOcASD2awpkQSahzC8mmZEke 1HKBPQ7tX4Q9DJCg== Date: Tue, 12 Aug 2025 08:08:12 +0200 Subject: [PATCH 4/8] lib: test_objpool: Avoid direct access to hrtimer clockbase Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20250812-hrtimer-cleanup-get_time-v1-4-b962cd9d9385@linutronix.de> References: <20250812-hrtimer-cleanup-get_time-v1-0-b962cd9d9385@linutronix.de> In-Reply-To: <20250812-hrtimer-cleanup-get_time-v1-0-b962cd9d9385@linutronix.de> To: Anna-Maria Behnsen , Frederic Weisbecker , Thomas Gleixner , Ingo Molnar , Peter Zijlstra , Juri Lelli , Vincent Guittot , Dietmar Eggemann , Steven Rostedt , Ben Segall , Mel Gorman , Valentin Schneider , Matt Wu , Andrew Morton , Jaroslav Kysela , Takashi Iwai , Sean Young , Mauro Carvalho Chehab , Jan Kiszka , Kieran Bingham Cc: linux-kernel@vger.kernel.org, linux-sound@vger.kernel.org, linux-media@vger.kernel.org, =?utf-8?q?Thomas_Wei=C3=9Fschuh?= X-Developer-Signature: v=1; a=ed25519-sha256; t=1754978890; l=840; i=thomas.weissschuh@linutronix.de; s=20240209; h=from:subject:message-id; bh=Xv7KxTjtEi5jAVg89oMqNhQ5UjlFaArcAsRKTAMGvUI=; b=s/k1F9athEdznY1/7XY+BjuKK+B9LsmJOfnQ5Z+93eK1CWBZt+5/V7rSfhJzlS4c0S3lPoc3I IHv/uXwRUnXCdyX7aTb4qkzYcxqSiAVp5WmlmLDMczOEcgaQXU+o5DU X-Developer-Key: i=thomas.weissschuh@linutronix.de; a=ed25519; pk=pfvxvpFUDJV2h2nY0FidLUml22uGLSjByFbM6aqQQws= The field timer->base->get_time is a private implementation detail and should not be accessed outside of the hrtimer core. Switch to the equivalent helper. Signed-off-by: Thomas Wei=C3=9Fschuh Acked-by: Peter Zijlstra (Intel) --- lib/test_objpool.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/test_objpool.c b/lib/test_objpool.c index 8f688187fa8727e26d2d065c46e789ee15fd55b5..6a34a7582fdbf50b5632043ec19= e77c8fd4dad78 100644 --- a/lib/test_objpool.c +++ b/lib/test_objpool.c @@ -164,7 +164,7 @@ static enum hrtimer_restart ot_hrtimer_handler(struct h= rtimer *hrt) /* do bulk-testings for objects pop/push */ item->worker(item, 1); =20 - hrtimer_forward(hrt, hrt->base->get_time(), item->hrtcycle); + hrtimer_forward_now(hrt, item->hrtcycle); return HRTIMER_RESTART; } =20 --=20 2.50.1 From nobody Sat Oct 4 22:36:15 2025 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 E68752E3AEF; Tue, 12 Aug 2025 06:08:15 +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=1754978897; cv=none; b=IQER4fMlw+NgEqmpn4EbBMl29WKmZswJ7LKTk/cDzo74aGluAv97ow2mRtD8nmofoa0++enBJkwphyFo0cKPvXrQ5Y4Mr93XikC9H3XA9ifXYvz0dkzqY9hx6lZmeQG6cblLq2iIQ0oiPIKJFj9hIy+1rbwrVOn4Eg0kx5ZlZ0Y= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1754978897; c=relaxed/simple; bh=VRKYPUCHOj1o3uk7vZH1eLfdSiAOjbVhE6hy3N92Zj4=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=mWEi+iQX8lfo0xmz36541u9UYyqBaLANIeFXFfX7lly+/9MxIomNucrj6mSWWi7e5e+lxwuVmtCEUt5Dx5voleYJJ7hm7/6DvOzWGA3HrWUtagiOCUO8DJ05xxrLuBN0CjqdxBuLyVnhTZVT+mqdPgI9E26vy+LArhWa9RQr+Oo= 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=h1kB2Xb2; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=UIqmkJHJ; 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="h1kB2Xb2"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="UIqmkJHJ" From: =?utf-8?q?Thomas_Wei=C3=9Fschuh?= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1754978893; h=from:from: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=Kqr8kmeS74BlHeqTh196jDqSmuVvZJCQ2K9/zwMU41s=; b=h1kB2Xb2sT7mvI9FV2ADPzUp3mHBJyq2UXQtySsENZHSrfcEEa2oMalCnIucFOaM0UmEMl bB3g9MgYjEE49gmQbrGG6e+uzLI2vne8te4YX5CJTctTJy1J/5dIeOkN2ezYv+tU03XyNL eWLG6m+a5TqzJ0f168SqNFZJRUajZTB+t2J5CC6YBxIXfOvI7kJQlT5wIq1EVyv6t8i2Ud +UEXOFXc8w4hNBaSh+ZDH+mDNTqF710Wh0LPE/VwiCz0dAjS+JtVDsJlGJgx2F03bkvYeu I9jqb6jy9oe5/RT857Q5PoM0P/SWLUldzHT3O/YzasNnTpQ6YDP5vsuIA0IHJQ== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1754978893; h=from:from: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=Kqr8kmeS74BlHeqTh196jDqSmuVvZJCQ2K9/zwMU41s=; b=UIqmkJHJChJKem0Pz0rGOMgQXFUIt6+3ZFPETIuHK8ATovWs2eBOPLGLXC/zJkJEfkMw4/ rrP+0SzS56/S/tAg== Date: Tue, 12 Aug 2025 08:08:13 +0200 Subject: [PATCH 5/8] ALSA: hrtimer: Avoid direct access to hrtimer clockbase Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20250812-hrtimer-cleanup-get_time-v1-5-b962cd9d9385@linutronix.de> References: <20250812-hrtimer-cleanup-get_time-v1-0-b962cd9d9385@linutronix.de> In-Reply-To: <20250812-hrtimer-cleanup-get_time-v1-0-b962cd9d9385@linutronix.de> To: Anna-Maria Behnsen , Frederic Weisbecker , Thomas Gleixner , Ingo Molnar , Peter Zijlstra , Juri Lelli , Vincent Guittot , Dietmar Eggemann , Steven Rostedt , Ben Segall , Mel Gorman , Valentin Schneider , Matt Wu , Andrew Morton , Jaroslav Kysela , Takashi Iwai , Sean Young , Mauro Carvalho Chehab , Jan Kiszka , Kieran Bingham Cc: linux-kernel@vger.kernel.org, linux-sound@vger.kernel.org, linux-media@vger.kernel.org, =?utf-8?q?Thomas_Wei=C3=9Fschuh?= X-Developer-Signature: v=1; a=ed25519-sha256; t=1754978890; l=887; i=thomas.weissschuh@linutronix.de; s=20240209; h=from:subject:message-id; bh=VRKYPUCHOj1o3uk7vZH1eLfdSiAOjbVhE6hy3N92Zj4=; b=DIUjYMVo+Dk4K6NT/EE25eInyR21nhdIAp6af0VYj9qalUUh1Sib1zZEgo3By6etxDOe/EphY 26HEGkqNlIGCGfp0Ux/R/ru99EPb1DjucpNmzeaMpxAAAWM1mJSgw/9 X-Developer-Key: i=thomas.weissschuh@linutronix.de; a=ed25519; pk=pfvxvpFUDJV2h2nY0FidLUml22uGLSjByFbM6aqQQws= The field timer->base->get_time is a private implementation detail and should not be accessed outside of the hrtimer core. Switch to the equivalent helper. Signed-off-by: Thomas Wei=C3=9Fschuh Acked-by: Peter Zijlstra (Intel) Acked-by: Takashi Iwai --- sound/core/hrtimer.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sound/core/hrtimer.c b/sound/core/hrtimer.c index c364bd126ac8b311e3ce899e226ff9fd82c4485f..2d5f4d47071f79d7db24c8f004f= 0f4154808fdd8 100644 --- a/sound/core/hrtimer.c +++ b/sound/core/hrtimer.c @@ -44,7 +44,7 @@ static enum hrtimer_restart snd_hrtimer_callback(struct h= rtimer *hrt) } =20 /* calculate the drift */ - delta =3D ktime_sub(hrt->base->get_time(), hrtimer_get_expires(hrt)); + delta =3D ktime_sub(hrtimer_cb_get_time(hrt), hrtimer_get_expires(hrt)); if (delta > 0) ticks +=3D ktime_divns(delta, ticks * resolution); =20 --=20 2.50.1 From nobody Sat Oct 4 22:36:15 2025 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 E67132E370F; Tue, 12 Aug 2025 06:08:15 +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=1754978897; cv=none; b=a3nA8E3N/PGIpgF3YWmjgczHb52qHzQ2vWcbf42hKr+XoSW92IyET2x8tpdxq5ZRJXhPY129JSBvKT0Z1cq3Cp5gQdsSoy3bpr7RexOjTPZ3WGgXJsHdKrzSvv9z+oVc5zWfrkoV/rxAaADHBvJCXH5C/TrCJUlpX9exddh4VrQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1754978897; c=relaxed/simple; bh=tzlPDbI22bFVZnyx/aUubSg1nyN9LP7Z1nRVUBaVZrI=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=Pr33tH++Pc65mFS8KtNGpKlI4GEBKlSHwJcAS/6jd+IEK3lJ/cc4ah8I+7qOS3jE+ne61zQJBNRXKY2kwQ9j2LiG6T0a75Q4liw25R9L6+2doskQDeNlUTg/9mX7lq9ePqwBYK5NhbDJPrTpCFUJNN7Ma5kyy6gP4WKNpp2sqwc= 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=aqX/wyVW; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=6BMazsdy; 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="aqX/wyVW"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="6BMazsdy" From: =?utf-8?q?Thomas_Wei=C3=9Fschuh?= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1754978894; h=from:from: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=vaOYSQe8+r4ASI339nLTErW+Fc/xW8X676P1cpWtPUI=; b=aqX/wyVWMvyej+XbL6nxV+OMmQBVWeFr8v+c0GlCNErNPTQ+DcTwLCbrVXWmo8Qq5+0j+H eGyvqXziywNaj0DUa3Lv6uP5o0nWQk5xrYIj1lvem1RIZufjesFD7Q0Wj0ohYMwyc2Oud3 Z+/+4fu04z+KwA9mcFwn0NLEcVPR9E9p4Wa89kOyOxLR7HhpUZkQ6NkfTJA1wZYwWhdZ4y W3RZmBPZj4vzJqp8spO+TaOu9n9d20dUD9bFHcgBX7HaOiO+H2ZNQgSIH1bv/3ibQa3H1n HyB+ZAHhp6XPgqCbfEZvipl+GFHnR5Jmp4zKGkMHMnUVWz3FZRZQGG533YMgrQ== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1754978894; h=from:from: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=vaOYSQe8+r4ASI339nLTErW+Fc/xW8X676P1cpWtPUI=; b=6BMazsdyZAQN6IHtOnEl2iW4+56hBjTHd+SOOs6YeA9Pcv89FJ/WQPjgBS6Sc8aM6QxhaD 1y2ekj/I/jHZjYDw== Date: Tue, 12 Aug 2025 08:08:14 +0200 Subject: [PATCH 6/8] media: pwm-ir-tx: Avoid direct access to hrtimer clockbase Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20250812-hrtimer-cleanup-get_time-v1-6-b962cd9d9385@linutronix.de> References: <20250812-hrtimer-cleanup-get_time-v1-0-b962cd9d9385@linutronix.de> In-Reply-To: <20250812-hrtimer-cleanup-get_time-v1-0-b962cd9d9385@linutronix.de> To: Anna-Maria Behnsen , Frederic Weisbecker , Thomas Gleixner , Ingo Molnar , Peter Zijlstra , Juri Lelli , Vincent Guittot , Dietmar Eggemann , Steven Rostedt , Ben Segall , Mel Gorman , Valentin Schneider , Matt Wu , Andrew Morton , Jaroslav Kysela , Takashi Iwai , Sean Young , Mauro Carvalho Chehab , Jan Kiszka , Kieran Bingham Cc: linux-kernel@vger.kernel.org, linux-sound@vger.kernel.org, linux-media@vger.kernel.org, =?utf-8?q?Thomas_Wei=C3=9Fschuh?= X-Developer-Signature: v=1; a=ed25519-sha256; t=1754978890; l=1247; i=thomas.weissschuh@linutronix.de; s=20240209; h=from:subject:message-id; bh=tzlPDbI22bFVZnyx/aUubSg1nyN9LP7Z1nRVUBaVZrI=; b=c+GawmMcaez6PbPORddUcVnsUEZyD+mp7mJap4RdqRRDGhN6JA4ZZm73rjeuA1LnjMJn0m51V aHFBJr4db9lB4NdOB0tLi1c2Lhc4+r+mCfwb1E/6KTuBAbP3/K0CZ4k X-Developer-Key: i=thomas.weissschuh@linutronix.de; a=ed25519; pk=pfvxvpFUDJV2h2nY0FidLUml22uGLSjByFbM6aqQQws= The field timer->base->get_time is a private implementation detail and should not be accessed outside of the hrtimer core. Switch to an equivalent higher-level helper. Signed-off-by: Thomas Wei=C3=9Fschuh Acked-by: Peter Zijlstra (Intel) Acked-by: Sean Young --- drivers/media/rc/pwm-ir-tx.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/drivers/media/rc/pwm-ir-tx.c b/drivers/media/rc/pwm-ir-tx.c index 84533fdd61aa6ce3c0f8593aaefe5919fd05c7f9..047472dc9244afe0e56e505be20= f36fd7d9c449a 100644 --- a/drivers/media/rc/pwm-ir-tx.c +++ b/drivers/media/rc/pwm-ir-tx.c @@ -117,7 +117,6 @@ static int pwm_ir_tx_atomic(struct rc_dev *dev, unsigne= d int *txbuf, static enum hrtimer_restart pwm_ir_timer(struct hrtimer *timer) { struct pwm_ir *pwm_ir =3D container_of(timer, struct pwm_ir, timer); - ktime_t now; =20 /* * If we happen to hit an odd latency spike, loop through the @@ -139,9 +138,7 @@ static enum hrtimer_restart pwm_ir_timer(struct hrtimer= *timer) hrtimer_add_expires_ns(timer, ns); =20 pwm_ir->txbuf_index++; - - now =3D timer->base->get_time(); - } while (hrtimer_get_expires_tv64(timer) < now); + } while (hrtimer_expires_remaining(timer) > 0); =20 return HRTIMER_RESTART; } --=20 2.50.1 From nobody Sat Oct 4 22:36:15 2025 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 A5BBE311C31; Tue, 12 Aug 2025 06:08:16 +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=1754978900; cv=none; b=S5eZDbgiXyVXiGmJYrXMQWgXk2tmMhWnFkT3ZORxSYXIV4SH1J91iINNF04V6QvdO6P94lNsCWYS2FC2n3sRXexhOIYw02+swFiSYbD90XaNeOLar+mq0l2D1YK2pADW8nNBiQPub+CkVzo6AVD0Cy4X2Bq3IBewL48M1M5Ujs4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1754978900; c=relaxed/simple; bh=weK04IPBuk7pXV71ZChC/ScFR/2UzE34NC1nf7qNcrA=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=PbRVsd7TnR3h8Pd19wfkyYWLBnZYLFZKg844n3pYXG8PqFSDBsFv7hv5GvrPp7CCsyPs8eyWdSkolpbMq5UCIsvDuL0MCZ5cA2F43DZZVI17UWw3NHsPvHda7b4JBWgi7aUpYvvxwGKKwwKwNZfl9MSt4d/Gg3UJ/ECeGrsDOOA= 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=FRZTBQF+; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=h0/i/iqi; 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="FRZTBQF+"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="h0/i/iqi" From: =?utf-8?q?Thomas_Wei=C3=9Fschuh?= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1754978895; h=from:from: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=65XSwTq1lmsETNc/hSGvGZmapU2l8DMfuplQ8JTrt6k=; b=FRZTBQF+df4BzDvzQUdjnydvsZxB9/q4nUUf4COaxsbm+c4S85MQiOPSqnjSXN2Ym64u+g OTP3kNdJt7wztEAVQP2oeB9mKyFSmqf7li7iza9Wi4sDj5W0zohJhp8DsTO3MZVz5OpjNj ORtv2Ia7qqwZJLH2YVAXG4G3T0EixsMjFgs17nZUJ1zqTI1erQmZn/ce6Jqdpjk6q5fgey Gu+0GIhirYT6R1IMKU1Jo7eYqraueJWIZSMKRY9o7BMpIiyDkBEB+w2LYIqH+gmpKfm46U jEjtVmq/OTVzJp9WTdjW1MW6caqLNZxXxSBG75oGHIMjksie0xXZF3TxkeACQg== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1754978895; h=from:from: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=65XSwTq1lmsETNc/hSGvGZmapU2l8DMfuplQ8JTrt6k=; b=h0/i/iqiNQBjXOPJ+MKq2R+oX8qCqKa0pMBL97g1tU0JE9Pr2ydHNm6tv6Hz/dMKXFYq32 bh6HBAXg6YZH4cCQ== Date: Tue, 12 Aug 2025 08:08:15 +0200 Subject: [PATCH 7/8] hrtimer: Use hrtimer_cb_get_time() helper Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20250812-hrtimer-cleanup-get_time-v1-7-b962cd9d9385@linutronix.de> References: <20250812-hrtimer-cleanup-get_time-v1-0-b962cd9d9385@linutronix.de> In-Reply-To: <20250812-hrtimer-cleanup-get_time-v1-0-b962cd9d9385@linutronix.de> To: Anna-Maria Behnsen , Frederic Weisbecker , Thomas Gleixner , Ingo Molnar , Peter Zijlstra , Juri Lelli , Vincent Guittot , Dietmar Eggemann , Steven Rostedt , Ben Segall , Mel Gorman , Valentin Schneider , Matt Wu , Andrew Morton , Jaroslav Kysela , Takashi Iwai , Sean Young , Mauro Carvalho Chehab , Jan Kiszka , Kieran Bingham Cc: linux-kernel@vger.kernel.org, linux-sound@vger.kernel.org, linux-media@vger.kernel.org, =?utf-8?q?Thomas_Wei=C3=9Fschuh?= X-Developer-Signature: v=1; a=ed25519-sha256; t=1754978890; l=2174; i=thomas.weissschuh@linutronix.de; s=20240209; h=from:subject:message-id; bh=weK04IPBuk7pXV71ZChC/ScFR/2UzE34NC1nf7qNcrA=; b=vLtHypcnvNvq0+i4aIgwtLNrK8vjQdJU9LDI90R/PvWs7ArTAwXeWu9g+2hsDdrjpusZTpJjc +Zezqr4NYxLDxvABEngkI+/FHlLEUHfyyxNQY/uAgXqzLOxKc4e0PyW X-Developer-Key: i=thomas.weissschuh@linutronix.de; a=ed25519; pk=pfvxvpFUDJV2h2nY0FidLUml22uGLSjByFbM6aqQQws= Various other helpers contain open-coded implementations of hrtimer_cb_get_time(). This prevents refactoring the implementation. Reuse the existing helper. For this to work, move hrtimer_cb_get_time() a bit up in the file and also make its argument 'const'. Signed-off-by: Thomas Wei=C3=9Fschuh Acked-by: Peter Zijlstra (Intel) --- include/linux/hrtimer.h | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/include/linux/hrtimer.h b/include/linux/hrtimer.h index 1ef867bb8c44b06812d8552441d4092922bfe170..e655502b14e6c4b1a69b67c9971= 32d628bd1470f 100644 --- a/include/linux/hrtimer.h +++ b/include/linux/hrtimer.h @@ -154,14 +154,14 @@ static inline s64 hrtimer_get_expires_ns(const struct= hrtimer *timer) return ktime_to_ns(timer->node.expires); } =20 -static inline ktime_t hrtimer_expires_remaining(const struct hrtimer *time= r) +static inline ktime_t hrtimer_cb_get_time(const struct hrtimer *timer) { - return ktime_sub(timer->node.expires, timer->base->get_time()); + return timer->base->get_time(); } =20 -static inline ktime_t hrtimer_cb_get_time(struct hrtimer *timer) +static inline ktime_t hrtimer_expires_remaining(const struct hrtimer *time= r) { - return timer->base->get_time(); + return ktime_sub(timer->node.expires, hrtimer_cb_get_time(timer)); } =20 static inline int hrtimer_is_hres_active(struct hrtimer *timer) @@ -200,8 +200,7 @@ __hrtimer_expires_remaining_adjusted(const struct hrtim= er *timer, ktime_t now) static inline ktime_t hrtimer_expires_remaining_adjusted(const struct hrtimer *timer) { - return __hrtimer_expires_remaining_adjusted(timer, - timer->base->get_time()); + return __hrtimer_expires_remaining_adjusted(timer, hrtimer_cb_get_time(ti= mer)); } =20 #ifdef CONFIG_TIMERFD @@ -363,7 +362,7 @@ hrtimer_forward(struct hrtimer *timer, ktime_t now, kti= me_t interval); static inline u64 hrtimer_forward_now(struct hrtimer *timer, ktime_t interval) { - return hrtimer_forward(timer, timer->base->get_time(), interval); + return hrtimer_forward(timer, hrtimer_cb_get_time(timer), interval); } =20 /* Precise sleep: */ --=20 2.50.1 From nobody Sat Oct 4 22:36:15 2025 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 E1DB62E542E; Tue, 12 Aug 2025 06:08:16 +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=1754978898; cv=none; b=jO3ggQOzs7KdyBXp29BaktcmclovJ38mxIVaM2ZmSPaqAxvAL6YMcSku7OIYu5kJCEMOfXulTnubNlafdOxdXDDtSKrp4l99mTjvO5PWpzRhSIr1PACJv/A08xTJyDmXyyCnVfu3urlGEDCZaAOMKxggJqCOq8cxT9uJgXpWPDw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1754978898; c=relaxed/simple; bh=ZlPbVpsXMz8iOW0v9Pz4dNmeBtsR1+46wB+hYErYmyA=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=BhutpuCQrD1Ac8axubANiZHzcWsKAVk5Za8E1TcDvv2sAvwOh1xlYGQCBJpoAoWcjWeEbJO2QEe8X/OLE2nRYWoAhCLV1tXFq0PJSo+eAxgh4A+gcXIbyYPNqZJcfpfJFhLQfpzBZJaJm96h3qdm3DVlwZkCYVAJniD2jryCrCY= 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=15SfcBTq; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=lx741Oho; 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="15SfcBTq"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="lx741Oho" From: =?utf-8?q?Thomas_Wei=C3=9Fschuh?= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1754978895; h=from:from: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=II3r8cLl5IwN5vLIOUrsTh7U9/SK4dZQ+7W5BsTTCsc=; b=15SfcBTqE8tuTphV8Iunai6oR2crtp/BhzvA0Ka2w8VuSSWdjtjwLDgj9vUeeidnOO3CDK BscuHPQ1TcGMteUSD4FvoA2H+pi98LPjFujdv2RpoIcUZtAdaM+5fKVO4ymBXneTdnUu/y 9LJogf1rs0tpLtM1qciNq/5Mi0cguN/m3bfspM6P9AgaKjiLjWVr0fQEQN0h59hmz7gJuS Y2dRK2ZBzIcZXc5p4g3HXQEKKyCw+2TSu902bz+O1Nrsfc0OUStrwzWE5h4x8HB03wFDSC ahagoWJWMFaku0f8ok1oiYYVvUDaCsLAYNIb6WVOoDodOlWnK0PPIRorty/bmA== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1754978895; h=from:from: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=II3r8cLl5IwN5vLIOUrsTh7U9/SK4dZQ+7W5BsTTCsc=; b=lx741Oho5kdPGJs/QbjI0psHdGiQIRPkh4Mk/xS4oD9XixNjxMCvS5CigRbqxYSPEcGNMC b7bb4Jlc/QMuDSAA== Date: Tue, 12 Aug 2025 08:08:16 +0200 Subject: [PATCH 8/8] hrtimer: Remove hrtimer_clock_base::get_time Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20250812-hrtimer-cleanup-get_time-v1-8-b962cd9d9385@linutronix.de> References: <20250812-hrtimer-cleanup-get_time-v1-0-b962cd9d9385@linutronix.de> In-Reply-To: <20250812-hrtimer-cleanup-get_time-v1-0-b962cd9d9385@linutronix.de> To: Anna-Maria Behnsen , Frederic Weisbecker , Thomas Gleixner , Ingo Molnar , Peter Zijlstra , Juri Lelli , Vincent Guittot , Dietmar Eggemann , Steven Rostedt , Ben Segall , Mel Gorman , Valentin Schneider , Matt Wu , Andrew Morton , Jaroslav Kysela , Takashi Iwai , Sean Young , Mauro Carvalho Chehab , Jan Kiszka , Kieran Bingham Cc: linux-kernel@vger.kernel.org, linux-sound@vger.kernel.org, linux-media@vger.kernel.org, =?utf-8?q?Thomas_Wei=C3=9Fschuh?= X-Developer-Signature: v=1; a=ed25519-sha256; t=1754978890; l=5973; i=thomas.weissschuh@linutronix.de; s=20240209; h=from:subject:message-id; bh=ZlPbVpsXMz8iOW0v9Pz4dNmeBtsR1+46wB+hYErYmyA=; b=idL6FNTvTClf7v06AUO6+QglbARnxz6J0YmbV7ivG5dOF33b3ePS4lBwtwxzYZVMV/EzmKszo Lx97cSPdQK1DxjtEcGgGdRCMXxEsre8vDeTTHcoIy1dLRLcOm0BdUfo X-Developer-Key: i=thomas.weissschuh@linutronix.de; a=ed25519; pk=pfvxvpFUDJV2h2nY0FidLUml22uGLSjByFbM6aqQQws= The get_time() callbacks always need to match the bases clockid. Instead of maintaining that association twice in hrtimer_bases, use a helper. Signed-off-by: Thomas Wei=C3=9Fschuh Acked-by: Peter Zijlstra (Intel) --- include/linux/hrtimer.h | 5 +---- include/linux/hrtimer_defs.h | 2 -- kernel/time/hrtimer.c | 34 +++++++++++++++++++++++++--------- kernel/time/timer_list.c | 2 -- scripts/gdb/linux/timerlist.py | 2 -- 5 files changed, 26 insertions(+), 19 deletions(-) diff --git a/include/linux/hrtimer.h b/include/linux/hrtimer.h index e655502b14e6c4b1a69b67c997132d628bd1470f..2cf1bf65b22578499e7de5417db= da1d34cf12fce 100644 --- a/include/linux/hrtimer.h +++ b/include/linux/hrtimer.h @@ -154,10 +154,7 @@ static inline s64 hrtimer_get_expires_ns(const struct = hrtimer *timer) return ktime_to_ns(timer->node.expires); } =20 -static inline ktime_t hrtimer_cb_get_time(const struct hrtimer *timer) -{ - return timer->base->get_time(); -} +ktime_t hrtimer_cb_get_time(const struct hrtimer *timer); =20 static inline ktime_t hrtimer_expires_remaining(const struct hrtimer *time= r) { diff --git a/include/linux/hrtimer_defs.h b/include/linux/hrtimer_defs.h index 84a5045f80f36f88cb47bf23a62a4d0afbd1a2c6..aa49ffa130e57f7278a7d9f96a6= d86e6630c69de 100644 --- a/include/linux/hrtimer_defs.h +++ b/include/linux/hrtimer_defs.h @@ -41,7 +41,6 @@ * @seq: seqcount around __run_hrtimer * @running: pointer to the currently running hrtimer * @active: red black tree root node for the active timers - * @get_time: function to retrieve the current time of the clock * @offset: offset of this clock to the monotonic base */ struct hrtimer_clock_base { @@ -51,7 +50,6 @@ struct hrtimer_clock_base { seqcount_raw_spinlock_t seq; struct hrtimer *running; struct timerqueue_head active; - ktime_t (*get_time)(void); ktime_t offset; } __hrtimer_clock_base_align; =20 diff --git a/kernel/time/hrtimer.c b/kernel/time/hrtimer.c index 30899a8cc52c0a9203ce0216fe47f5f19a7bf6ec..4ce754a76ece537570a9a569dbd= d95f51b575d78 100644 --- a/kernel/time/hrtimer.c +++ b/kernel/time/hrtimer.c @@ -59,6 +59,7 @@ #define HRTIMER_ACTIVE_ALL (HRTIMER_ACTIVE_SOFT | HRTIMER_ACTIVE_HARD) =20 static void retrigger_next_event(void *arg); +static ktime_t __hrtimer_cb_get_time(clockid_t clock_id); =20 /* * The timer bases: @@ -76,42 +77,34 @@ DEFINE_PER_CPU(struct hrtimer_cpu_base, hrtimer_bases) = =3D { .index =3D HRTIMER_BASE_MONOTONIC, .clockid =3D CLOCK_MONOTONIC, - .get_time =3D &ktime_get, }, { .index =3D HRTIMER_BASE_REALTIME, .clockid =3D CLOCK_REALTIME, - .get_time =3D &ktime_get_real, }, { .index =3D HRTIMER_BASE_BOOTTIME, .clockid =3D CLOCK_BOOTTIME, - .get_time =3D &ktime_get_boottime, }, { .index =3D HRTIMER_BASE_TAI, .clockid =3D CLOCK_TAI, - .get_time =3D &ktime_get_clocktai, }, { .index =3D HRTIMER_BASE_MONOTONIC_SOFT, .clockid =3D CLOCK_MONOTONIC, - .get_time =3D &ktime_get, }, { .index =3D HRTIMER_BASE_REALTIME_SOFT, .clockid =3D CLOCK_REALTIME, - .get_time =3D &ktime_get_real, }, { .index =3D HRTIMER_BASE_BOOTTIME_SOFT, .clockid =3D CLOCK_BOOTTIME, - .get_time =3D &ktime_get_boottime, }, { .index =3D HRTIMER_BASE_TAI_SOFT, .clockid =3D CLOCK_TAI, - .get_time =3D &ktime_get_clocktai, }, }, .csd =3D CSD_INIT(retrigger_next_event, NULL) @@ -1253,7 +1246,7 @@ static int __hrtimer_start_range_ns(struct hrtimer *t= imer, ktime_t tim, remove_hrtimer(timer, base, true, force_local); =20 if (mode & HRTIMER_MODE_REL) - tim =3D ktime_add_safe(tim, base->get_time()); + tim =3D ktime_add_safe(tim, __hrtimer_cb_get_time(base->clockid)); =20 tim =3D hrtimer_update_lowres(timer, tim, mode); =20 @@ -1588,6 +1581,29 @@ static inline int hrtimer_clockid_to_base(clockid_t = clock_id) } } =20 +static ktime_t __hrtimer_cb_get_time(clockid_t clock_id) +{ + switch (clock_id) { + case CLOCK_REALTIME: + return ktime_get_real(); + case CLOCK_MONOTONIC: + return ktime_get(); + case CLOCK_BOOTTIME: + return ktime_get_boottime(); + case CLOCK_TAI: + return ktime_get_clocktai(); + default: + WARN(1, "Invalid clockid %d. Using MONOTONIC\n", clock_id); + return ktime_get(); + } +} + +ktime_t hrtimer_cb_get_time(const struct hrtimer *timer) +{ + return __hrtimer_cb_get_time(timer->base->clockid); +} +EXPORT_SYMBOL_GPL(hrtimer_cb_get_time); + static void __hrtimer_setup(struct hrtimer *timer, enum hrtimer_restart (*function)(struct hrtimer *), clockid_t clock_id, enum hrtimer_mode mode) diff --git a/kernel/time/timer_list.c b/kernel/time/timer_list.c index b03d0ada64695058d4c57f3e29d546ba18bff591..488e47e96e93f96a5a18c0f72b8= f4df36270943f 100644 --- a/kernel/time/timer_list.c +++ b/kernel/time/timer_list.c @@ -102,8 +102,6 @@ print_base(struct seq_file *m, struct hrtimer_clock_bas= e *base, u64 now) SEQ_printf(m, " .index: %d\n", base->index); =20 SEQ_printf(m, " .resolution: %u nsecs\n", hrtimer_resolution); - - SEQ_printf(m, " .get_time: %ps\n", base->get_time); #ifdef CONFIG_HIGH_RES_TIMERS SEQ_printf(m, " .offset: %Lu nsecs\n", (unsigned long long) ktime_to_ns(base->offset)); diff --git a/scripts/gdb/linux/timerlist.py b/scripts/gdb/linux/timerlist.py index 98445671fe83897d50187f302f844919729388dc..ccc24d30de8063b28e0a3068416= af341f8951876 100644 --- a/scripts/gdb/linux/timerlist.py +++ b/scripts/gdb/linux/timerlist.py @@ -56,8 +56,6 @@ def print_base(base): text +=3D " .index: {}\n".format(base['index']) =20 text +=3D " .resolution: {} nsecs\n".format(constants.LX_hrtimer_resol= ution) - - text +=3D " .get_time: {}\n".format(base['get_time']) if constants.LX_CONFIG_HIGH_RES_TIMERS: text +=3D " .offset: {} nsecs\n".format(base['offset']) text +=3D "active timers:\n" --=20 2.50.1