From nobody Sun Dec 14 21:31:08 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 E702B22DFB8 for ; Wed, 5 Feb 2025 10:55: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=1738752933; cv=none; b=SPemDFTYHuXDAFKOxXDe3o8AakWVaCsCvDWSwqXZ66PEV1DoI3NaCc4m34AphZIWI75+GCkjG0SjQiLmPIbtzBU4bTNsrksQCuvVQG/t3Sw9sKqYR7BFdiFEGwkHquGRJTdLtgZmq+V98iCSSur6t1EyAWgp1Rt4sFzi2IXNum4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1738752933; c=relaxed/simple; bh=na/hAjFzsnokXQEg3PPS8K8Edd6YzoqjId3VpKJZ4Po=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=rk4R8tZa/IURoA9WXJuvi/ClgZgEC33NXkO6FG9mob8Xvr40FjcQR9ljvv/tssmqBED0aX8MEfQX+/l3q74fIniTi/1mcsIaJMTRwSKJSdf2kuEjyK+tLjF8hHliDydY0n8yJ+Pn5+6ccOhCfYp2HAyUILGy1XXym3br4tZyBGM= 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=QkYZrOLC; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=rAxa5c4D; 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="QkYZrOLC"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="rAxa5c4D" From: Nam Cao DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1738752930; 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=9XFCM4ar/K2wsddwlv7Q77BZa3Td4S1z6hjWXcL8W2c=; b=QkYZrOLCeMfPA+P/PdsKVHp0aVK3AcxNQSvjMMCUGEB0kMAUHmhdUOKv/wCBtzFXwKL05e aZuBu81YevRHtMTCmP6FRC253CJR+Gz/nwndqo+DbpMffpC4TMyFj+jSy9uIC+hB4X5VXr buvDv3RzTsMaDLFqhDgM8PQZ0T7GCtxrx0vR78y5Sjpj4ozva3Qa+ZszCdudtbDFkaVt1A k0tYy4yH0P0e3CDRZh08rrnBVwlIQc5AFA0lM9XeVy1x9n5eZuObUlDRDLC2m540RXW8PU TYGUTJ39jfgvV5P7I/pE65iu0+f643iD5xMD3Q1OgS23XweDz0Em/RsW9CdxFw== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1738752930; 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=9XFCM4ar/K2wsddwlv7Q77BZa3Td4S1z6hjWXcL8W2c=; b=rAxa5c4DhyAp7V0Dr6xJLVjHG7uwMQVvr3bkKvJfl3lMExNPdFoEDBsalnzWQaYQEUiRAh aRxxzCr9HUO/0yBQ== To: Anna-Maria Behnsen , Frederic Weisbecker , Thomas Gleixner , linux-kernel@vger.kernel.org Cc: Nam Cao Subject: [PATCH v2 01/12] hrtimers: Delete hrtimer_init() Date: Wed, 5 Feb 2025 11:55:10 +0100 Message-Id: <003722f60c7a2a4f8d4ed24fb741aa313b7e5136.1738746927.git.namcao@linutronix.de> In-Reply-To: References: 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" hrtimer_init() is unused. Delete it. Signed-off-by: Nam Cao --- include/linux/hrtimer.h | 2 -- include/linux/hrtimer_types.h | 2 +- kernel/time/hrtimer.c | 20 -------------------- 3 files changed, 1 insertion(+), 23 deletions(-) diff --git a/include/linux/hrtimer.h b/include/linux/hrtimer.h index acae379541c5..242ceafecde5 100644 --- a/include/linux/hrtimer.h +++ b/include/linux/hrtimer.h @@ -231,8 +231,6 @@ static inline enum hrtimer_restart hrtimer_dummy_timeou= t(struct hrtimer *unused) /* Exported timer functions: */ =20 /* Initialize timers: */ -extern void hrtimer_init(struct hrtimer *timer, clockid_t which_clock, - enum hrtimer_mode mode); extern void hrtimer_setup(struct hrtimer *timer, enum hrtimer_restart (*fu= nction)(struct hrtimer *), clockid_t clock_id, enum hrtimer_mode mode); extern void hrtimer_setup_on_stack(struct hrtimer *timer, diff --git a/include/linux/hrtimer_types.h b/include/linux/hrtimer_types.h index ad66a3081735..7c5b27daa89d 100644 --- a/include/linux/hrtimer_types.h +++ b/include/linux/hrtimer_types.h @@ -34,7 +34,7 @@ enum hrtimer_restart { * @is_hard: Set if hrtimer will be expired in hard interrupt context * even on RT. * - * The hrtimer structure must be initialized by hrtimer_init() + * The hrtimer structure must be initialized by hrtimer_setup() */ struct hrtimer { struct timerqueue_node node; diff --git a/kernel/time/hrtimer.c b/kernel/time/hrtimer.c index 47df6f50e12c..6474089f65fb 100644 --- a/kernel/time/hrtimer.c +++ b/kernel/time/hrtimer.c @@ -1645,26 +1645,6 @@ static void __hrtimer_setup(struct hrtimer *timer, timer->function =3D function; } =20 -/** - * hrtimer_init - initialize a timer to the given clock - * @timer: the timer to be initialized - * @clock_id: the clock to be used - * @mode: The modes which are relevant for initialization: - * HRTIMER_MODE_ABS, HRTIMER_MODE_REL, HRTIMER_MODE_ABS_SOFT, - * HRTIMER_MODE_REL_SOFT - * - * The PINNED variants of the above can be handed in, - * but the PINNED bit is ignored as pinning happens - * when the hrtimer is started - */ -void hrtimer_init(struct hrtimer *timer, clockid_t clock_id, - enum hrtimer_mode mode) -{ - debug_init(timer, clock_id, mode); - __hrtimer_init(timer, clock_id, mode); -} -EXPORT_SYMBOL_GPL(hrtimer_init); - /** * hrtimer_setup - initialize a timer to the given clock * @timer: the timer to be initialized --=20 2.39.5 From nobody Sun Dec 14 21:31:08 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 E709122DFBA for ; Wed, 5 Feb 2025 10:55: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=1738752933; cv=none; b=l6ZyESI1uoIWpCFJWX1QyIc7+m0WaDAwPEgvr1F6gv6eBTnAurrMJq9+YHtvnRqVghbdUUR+hNI1tJ502X8e3qAD0AgUXG6QmY8IdXmEWCCmc8o0K1xJpgxUHxVv/0zpxQms88dMAX+kaRs7GLmHcByem6ovW+f+NjxQDMU5Wmk= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1738752933; c=relaxed/simple; bh=+BQ0KwyiPKvaJ9UAVGGIhitG05ADENZrMDkUT3gVugk=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=j9KsKPDViXri5THg878/z+RlZqIH8vX9+NZDSnEDW0n22pW5qk5Br8Quhml8t3lBURCKThV6rp14PJrIXVoXfEHb7YZKDiEbofK1ndNz/iq6KbPvbEuq+wTLrRadtxwaSFt7Yi1NHh+uPzTepDn2eT1EXGU41DUR4SqnD+gCoyo= 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=iZEWG5To; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=kEgJncZh; 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="iZEWG5To"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="kEgJncZh" From: Nam Cao DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1738752930; 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=HWfoZkSisdqMRbj+fTmgh5Ti8j758+enCkqKof8DO70=; b=iZEWG5TocI1YAYLCGRwz8OBrsW4U96K+8eWWyFxgfQa5lNba1QDQmNcSE33b8PSXk66KeP sDGReng1iWdqYlDejBXRqZI5eLDne6brq0gvM5cpbPL0PCDk72P6DBVWjbDcH8a9npr3ko VhTX6DGmG7nYiTM7LTEs08v92OWTmbJP5jT4EMz932ky0tgy68fCvPJcDbkuI0BN5EvNCj iJLKeqglB+ObRRkJZXlCWLVGRoP4ZrUsOsKe5doKS5hSYzgAmCNMOcaGq5hyaPbiiWPuDl kADGMLOO30d0vzyZW1/tg77BGTkYEcuU3J6u1HElCvHyxHu5GwyHdd+6+Ze84w== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1738752930; 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=HWfoZkSisdqMRbj+fTmgh5Ti8j758+enCkqKof8DO70=; b=kEgJncZhPK6ZwqlwU/A86iCCs/SquYFMafeh3sxsNu+IXQiBYflC1GQEw9H2cKsSUYnRGa QyB4r57pdULKhzBA== To: Anna-Maria Behnsen , Frederic Weisbecker , Thomas Gleixner , linux-kernel@vger.kernel.org Cc: Nam Cao Subject: [PATCH v2 02/12] hrtimers: Switch to use __htimer_setup() Date: Wed, 5 Feb 2025 11:55:11 +0100 Message-Id: In-Reply-To: References: 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" __hrtimer_init_sleeper() calls __hrtimer_init() and also setups the callback function. But there is already __hrtimer_setup() which does both actions. Switch to use __hrtimer_setup() to simplify the code. Signed-off-by: Nam Cao --- kernel/time/hrtimer.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/kernel/time/hrtimer.c b/kernel/time/hrtimer.c index 6474089f65fb..d3e02c771b39 100644 --- a/kernel/time/hrtimer.c +++ b/kernel/time/hrtimer.c @@ -2066,8 +2066,7 @@ static void __hrtimer_init_sleeper(struct hrtimer_sle= eper *sl, mode |=3D HRTIMER_MODE_HARD; } =20 - __hrtimer_init(&sl->timer, clock_id, mode); - sl->timer.function =3D hrtimer_wakeup; + __hrtimer_setup(&sl->timer, hrtimer_wakeup, clock_id, mode); sl->task =3D current; } =20 --=20 2.39.5 From nobody Sun Dec 14 21:31:08 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 6C5D322E407 for ; Wed, 5 Feb 2025 10:55:32 +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=1738752933; cv=none; b=abvGR2Qdr8iVgLQncaexXz8jEGNi9zF7u7Z+9E0PS3UFvikUGxX4u/ir05tm+VB+gDMphvWki/JA19NCNXEVCZ33QiO4ag8a1iiJ20yOfrhuESt8k5ZTus4SbfTTFm03avs2cmd03qo9v8Thvn1cAnl2Q9+JEK0R24S1lj8d2Tg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1738752933; c=relaxed/simple; bh=jNJyj0CmjgIZBxhm8UGgodqFgnXApNi+GwIdxlp03/k=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=djyIZyzeGs6o0Z8R46Wvm2/jJIGg3dr5GzHG3Cr8YJIHGTgPORyEy9Lt8TsXE3Lq1OsFKq4zmlMR7c4uyGQBElKZRn9wSUufz6jonyD/DSf8NeBdERt2bEKGfleqk3tdV7Wh7GQvAFfkczCt0UdOL3tBceP43ULncwnGrFl+s4k= 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=dADXBaFn; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=bFa2z+s2; 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="dADXBaFn"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="bFa2z+s2" From: Nam Cao DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1738752930; 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=6xafKbg34kTin3ke+HGxG7rhs8q8J+u9c5I1wTLCtxg=; b=dADXBaFnwIKKMg3AvupJewb3FjEKfliEZxjqphKhLu3XPC6beZ9cOKtE84Z+r09wUOZxMA MZw6DYde56of1135BxTMCy19bRkj7NkgSqP9cCGGy4+RlgyZWCVlEB8emf8MwihYXJeAc8 HAn1nE3cA5F+ZnmyRyc6/J4C3mv2Juok1yau49TDaK7cWIaAQRqcLCZE7VsG3CLKVhJkTb H5XuCfuZfBY/n9FlxEFuxAeZvWnOeeqSLJtp/vEDszb4pWwgzsNqdMaOa6xkDQp4PczIso EAAW73Vv2MNkFGoyXTcx39A/oc8Th+sVGmqLeEhaVAAYY8d9rr6QvIyIxHdmQw== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1738752930; 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=6xafKbg34kTin3ke+HGxG7rhs8q8J+u9c5I1wTLCtxg=; b=bFa2z+s2/10aOhKDmpPD2fG44vydBL3IO71n611giKAp4Z8uVlORVWKcRGNqKF0cBNZ+yo v1IKWW929LlRoTDA== To: Anna-Maria Behnsen , Frederic Weisbecker , Thomas Gleixner , linux-kernel@vger.kernel.org Cc: Nam Cao Subject: [PATCH v2 03/12] hrtimers: Merge __hrtimer_init() into __hrtimer_setup() Date: Wed, 5 Feb 2025 11:55:12 +0100 Message-Id: <8a0a847a35f711f66b2d05b57255aa44e7e61279.1738746927.git.namcao@linutronix.de> In-Reply-To: References: 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" __hrtimer_init() is only called by __hrtimer_setup(). Simplify by merging __hrtimer_init() into __hrtimer_setup(). Signed-off-by: Nam Cao --- kernel/time/hrtimer.c | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/kernel/time/hrtimer.c b/kernel/time/hrtimer.c index d3e02c771b39..728075f5c9c6 100644 --- a/kernel/time/hrtimer.c +++ b/kernel/time/hrtimer.c @@ -1597,8 +1597,9 @@ static inline int hrtimer_clockid_to_base(clockid_t c= lock_id) return HRTIMER_BASE_MONOTONIC; } =20 -static void __hrtimer_init(struct hrtimer *timer, clockid_t clock_id, - enum hrtimer_mode mode) +static void __hrtimer_setup(struct hrtimer *timer, + enum hrtimer_restart (*function)(struct hrtimer *), + clockid_t clock_id, enum hrtimer_mode mode) { bool softtimer =3D !!(mode & HRTIMER_MODE_SOFT); struct hrtimer_cpu_base *cpu_base; @@ -1631,13 +1632,6 @@ static void __hrtimer_init(struct hrtimer *timer, cl= ockid_t clock_id, timer->is_hard =3D !!(mode & HRTIMER_MODE_HARD); timer->base =3D &cpu_base->clock_base[base]; timerqueue_init(&timer->node); -} - -static void __hrtimer_setup(struct hrtimer *timer, - enum hrtimer_restart (*function)(struct hrtimer *), - clockid_t clock_id, enum hrtimer_mode mode) -{ - __hrtimer_init(timer, clock_id, mode); =20 if (WARN_ON_ONCE(!function)) timer->function =3D hrtimer_dummy_timeout; --=20 2.39.5 From nobody Sun Dec 14 21:31:08 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 C289122CBFD for ; Wed, 5 Feb 2025 10:55:32 +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=1738752934; cv=none; b=biiNKHWlU2VzBiZYvxD+moI8p8b+UUvNnOmN2EY1nPc/dHdcDp87SSLCDrh0cRWpf5xzZGmLyy+XR7UE/4Bw1pCyQSze3HAZqT6TqgnbDGehZeJLmTPFVZ8pnZz9vznL69CfOSxzBmJkEGhz9Ayw9V0oN/OBT3udR2rVI+XUDCs= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1738752934; c=relaxed/simple; bh=uougq3/FUtqV1XHwUKvJ/joSKsfLnLLJbKj8mBdKhjY=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=Vu9nQZ1vOdncptZOCvN3yN+xgcpFSeROISDyZf1r5TxRfCTn9yMnOLxkVa34x8ExWZhf3DxmUFvm3pr4qXEv4U0UyPPkKHU2DVfAeSuHCch0sMEOlmMGIfivZKhYscCFkxfVlaOQ9ypMo9fMmxcTHLf2UUIZRSz2n8OYTEb0UTs= 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=1/drSwpC; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=P8iWmkSa; 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="1/drSwpC"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="P8iWmkSa" From: Nam Cao DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1738752931; 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=y6ZVgDThNK2QaoDis7kdyvcQ2GvPmE3KD8IQvqO4Axo=; b=1/drSwpCBHg7uqfkVJwDi6tWQ70xIshv92hUXGpjOK403TT7aplHZP60lx78o6IiGqgFU5 tjP+N1C5riunzhYkcU4h5avykDz7qsuXBfYGj8DNpha8vT8kATlSTFIHPXVyhDeaQPFV5N SEoGApysc6eDMRFksgxfvZ3WYsGsyqIOv+98BM+rDnEXWM4FAxkvRVyhxhZU//CkhQRnsY WaViW+pyV9D07nAhGQWya2kl8m72P16VHewiKix0Ett1DD/EuxVj3aYDkHy2dDKnNieegY xm+/nMkITrAeOO/H62VgNwPHibtNUBqm9OPAT8I6z117NYiTU7jYy0XsbAILEQ== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1738752931; 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=y6ZVgDThNK2QaoDis7kdyvcQ2GvPmE3KD8IQvqO4Axo=; b=P8iWmkSarjF2avKmzZq1xuHRctmeBSx/44VE3L9JkdDR+14vK1OKYU0QCnb/JJbzp5VHXo OgP6fNxDGnqrcjCw== To: Anna-Maria Behnsen , Frederic Weisbecker , Thomas Gleixner , linux-kernel@vger.kernel.org Cc: Nam Cao , Greg Kroah-Hartman Subject: [PATCH v2 04/12] serial: xilinx_uartps: Use helper function hrtimer_update_function() Date: Wed, 5 Feb 2025 11:55:13 +0100 Message-Id: In-Reply-To: References: 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 field 'function' of struct hrtimer should not be changed directly, as the write is lockless and a concurrent timer expiry might end up using the wrong function pointer. Switch to use hrtimer_update_function() which also performs runtime checks that it is safe to modify the callback. Signed-off-by: Nam Cao Cc: Greg Kroah-Hartman --- drivers/tty/serial/xilinx_uartps.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/tty/serial/xilinx_uartps.c b/drivers/tty/serial/xilinx= _uartps.c index efb124a19c01..fe457bf1e15b 100644 --- a/drivers/tty/serial/xilinx_uartps.c +++ b/drivers/tty/serial/xilinx_uartps.c @@ -454,7 +454,7 @@ static void cdns_uart_handle_tx(void *dev_id) =20 if (cdns_uart->port->rs485.flags & SER_RS485_ENABLED && (kfifo_is_empty(&tport->xmit_fifo) || uart_tx_stopped(port))) { - cdns_uart->tx_timer.function =3D &cdns_rs485_rx_callback; + hrtimer_update_function(&cdns_uart->tx_timer, cdns_rs485_rx_callback); hrtimer_start(&cdns_uart->tx_timer, ns_to_ktime(cdns_calc_after_tx_delay(cdns_uart)), HRTIMER_MODE_RE= L); } @@ -734,7 +734,7 @@ static void cdns_uart_start_tx(struct uart_port *port) =20 if (cdns_uart->port->rs485.flags & SER_RS485_ENABLED) { if (!cdns_uart->rs485_tx_started) { - cdns_uart->tx_timer.function =3D &cdns_rs485_tx_callback; + hrtimer_update_function(&cdns_uart->tx_timer, cdns_rs485_tx_callback); cdns_rs485_tx_setup(cdns_uart); return hrtimer_start(&cdns_uart->tx_timer, ms_to_ktime(port->rs485.delay_rts_before_send), --=20 2.39.5 From nobody Sun Dec 14 21:31:08 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 A7CB022FDE3 for ; Wed, 5 Feb 2025 10:55:34 +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=1738752936; cv=none; b=QTRfFrHxW1AWCRdtkoNEgkpHFJDzccMiCOw0LS3d+dbK7iWTs2VGezQyQ16lwmXIePVb5VQeBc1H5BEX09uzmIRMGN3T821CaqsQxpSmPrtwD2yQQHFA4TLnOCBPrumHrq3Hyx9Z6kttnuXXeun6kmeXXMY0iC4y7gj2B7LB9RI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1738752936; c=relaxed/simple; bh=hV2OVty6T8JpGJbk80pZc8kKWSJ5y/s242EHcqK3Mng=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=RXquKpNy+ROOI72E++oz4GyVJFs0fd2eViEFCUfEGRCHWjpq8SqsKwHvGGE747gk23ixrJCvms4krtYU6CZIGT3esqfY8ge8VaoaXuVVQ43GOxPQytxncsyONLR9ZaJLg2+J+fUxmW63erZ5383O6DhkviJVpMSTKWzeOlIJLsY= 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=RYjANvzO; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=vJW5NiXm; 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="RYjANvzO"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="vJW5NiXm" From: Nam Cao DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1738752931; 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=GS438I1KkkYYbfmv3T8S42vDtz8635M+U6FrnsOAbKU=; b=RYjANvzOf3wojFKhyYgNzFc+myf9O2y2iusqSDXAZ4CYDyT9s7zeqbutRF6UiOX84PSg8q 2gXjAC9xUyX/TaQWNX5Y66FET74LsaUtiDrq2VQWJvHiHzrNipJsG8Q1OHvvUhPQ70OIBK ezcI9n9yCub1L0x5UwkI92BfFA0aH5G+bJHvv+GVO/SDfMU2qrRSd2HFgfccEVNp6AlXLM 8QD1LEE6Y26K4qhZOqqxyyy1ZMHPJMm75GHdBeCDKVQEkCFqE2pEM0qFsAqmUUx9QWdUrD 9tQBnHPacyd/quFTJ2GizJGkwAFUp+zUgQZOX3go6NC8rPmy5oJsCEv0MOjkQA== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1738752931; 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=GS438I1KkkYYbfmv3T8S42vDtz8635M+U6FrnsOAbKU=; b=vJW5NiXmpVTm4qtX5E7TjuNMzoUKvFXkZeeJWIY2zXqNVt0eWdqMgvHf2vCRjhpSJd9vci UgRbrKjTma+Xq0DQ== To: Anna-Maria Behnsen , Frederic Weisbecker , Thomas Gleixner , linux-kernel@vger.kernel.org Cc: Nam Cao , Jens Axboe Subject: [PATCH v2 05/12] io_uring: Use helper function hrtimer_update_function() Date: Wed, 5 Feb 2025 11:55:14 +0100 Message-Id: <9b33f490fb1d207d3918ef5e116dc3412ae35c1e.1738746927.git.namcao@linutronix.de> In-Reply-To: References: 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 field 'function' of struct hrtimer should not be changed directly, as the write is lockless and a concurrent timer expiry might end up using the wrong function pointer. Switch to use hrtimer_update_function() which also performs runtime checks that it is safe to modify the callback. Signed-off-by: Nam Cao Cc: Jens Axboe --- io_uring/io_uring.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/io_uring/io_uring.c b/io_uring/io_uring.c index ceacf6230e34..936f8b4106cf 100644 --- a/io_uring/io_uring.c +++ b/io_uring/io_uring.c @@ -2421,7 +2421,7 @@ static enum hrtimer_restart io_cqring_min_timer_wakeu= p(struct hrtimer *timer) goto out_wake; } =20 - iowq->t.function =3D io_cqring_timer_wakeup; + hrtimer_update_function(&iowq->t, io_cqring_timer_wakeup); hrtimer_set_expires(timer, iowq->timeout); return HRTIMER_RESTART; out_wake: --=20 2.39.5 From nobody Sun Dec 14 21:31:08 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 A7D1222FDE4 for ; Wed, 5 Feb 2025 10:55:34 +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=1738752936; cv=none; b=YEX+B1hmePm+j9bqL5mJMGGM7vKd4TsFOoTE9D0xUs13LMPi46eZuzRgskNfFalysmavhgom7wg98Zj4pgrpSJUoG6EMGIWo+agumWz2JVgNUdKHmrsCrzb8+MDHdaOedI/ScuAqV081+Tb4V5Vt5HMdXlxpgNUpjg9LoI4oUqY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1738752936; c=relaxed/simple; bh=RjbpogFdLJcDSkanyWGj//f3T4IMG/BU7mqOSbY3vv0=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=HbRIlurwuaiIz2BB41rkVxNIIx6AvSVqryWJF70ICRdSUOcNzyFP2H4ibFQ/5PBDZJs5dv0/C8x5kuEfveRSZphqR9RQYyPtdUeV/hDxdqVDOsr0yOWvWF3B1YvKp5bXgP39sVQqeBCGdjJOEBkF4DXkTKZZ3ttHzYrKMnrT7VE= 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=ey8B1fCY; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=94XhC32K; 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="ey8B1fCY"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="94XhC32K" From: Nam Cao DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1738752931; 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=8hv9YQ69TGHywnjbhjpwX6eQKc6GKMw1j4P26Rj4nJE=; b=ey8B1fCY/ghNU9Z+JpeW9nw/H1dpo7ecz0oNFXGM5hiHrQU8rSEWMORSV1OK6te/WL7/fK EwLW2IRXAQ1aAANz9St8h1ItIC26jJ8Hs/X0tm+VS86i2Cq07xOLbh644RRweAyCOCRBNc vbaa7gRqcQsY6M+cYnTCabTpe/QooAF2JVAXEp284qiZww+xnhForh7p+wa6MmyglhEyQa 9ML6/1DK7J4Wyc5yCVOTN1VNcObBkwHqOn6BIg7kotzLxp1q9YDkKyNVwwrBefmqMXVlxd 2TqHI9oh45kNmIFpUo+/Ikvg5bkzBfp+bVMdrr46fRAR3TnFRiX6/ymMlcrYwA== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1738752931; 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=8hv9YQ69TGHywnjbhjpwX6eQKc6GKMw1j4P26Rj4nJE=; b=94XhC32KX5SRn+rLKpnzb2va8UoaThnoyg8P+gDq//4jmlueKZLObqbt4tFvkmsB1h0jJ4 7OKQMeTBy7S4VMDg== To: Anna-Maria Behnsen , Frederic Weisbecker , Thomas Gleixner , linux-kernel@vger.kernel.org Cc: Nam Cao , Kalle Valo Subject: [PATCH v2 06/12] wifi: rt2x00: Switch to use hrtimer_update_function() Date: Wed, 5 Feb 2025 11:55:15 +0100 Message-Id: <82dcc0eae40bb84e6452f242751c0650e79bd87e.1738746927.git.namcao@linutronix.de> In-Reply-To: References: 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 field 'function' of struct hrtimer should not be changed directly, as the write is lockless and a concurrent timer expiry might end up using the wrong function pointer. Switch to use hrtimer_update_function() which also performs runtime checks that it is safe to modify the callback. Signed-off-by: Nam Cao Cc: Kalle Valo --- drivers/net/wireless/ralink/rt2x00/rt2800mmio.c | 2 +- drivers/net/wireless/ralink/rt2x00/rt2800usb.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/net/wireless/ralink/rt2x00/rt2800mmio.c b/drivers/net/= wireless/ralink/rt2x00/rt2800mmio.c index 5323acff962a..45775ecdf221 100644 --- a/drivers/net/wireless/ralink/rt2x00/rt2800mmio.c +++ b/drivers/net/wireless/ralink/rt2x00/rt2800mmio.c @@ -842,7 +842,7 @@ int rt2800mmio_probe_hw(struct rt2x00_dev *rt2x00dev) /* * Set txstatus timer function. */ - rt2x00dev->txstatus_timer.function =3D rt2800mmio_tx_sta_fifo_timeout; + hrtimer_update_function(&rt2x00dev->txstatus_timer, rt2800mmio_tx_sta_fif= o_timeout); =20 /* * Overwrite TX done handler diff --git a/drivers/net/wireless/ralink/rt2x00/rt2800usb.c b/drivers/net/w= ireless/ralink/rt2x00/rt2800usb.c index 160bef79acdb..b51a23300ba2 100644 --- a/drivers/net/wireless/ralink/rt2x00/rt2800usb.c +++ b/drivers/net/wireless/ralink/rt2x00/rt2800usb.c @@ -618,7 +618,7 @@ static int rt2800usb_probe_hw(struct rt2x00_dev *rt2x00= dev) /* * Set txstatus timer function. */ - rt2x00dev->txstatus_timer.function =3D rt2800usb_tx_sta_fifo_timeout; + hrtimer_update_function(&rt2x00dev->txstatus_timer, rt2800usb_tx_sta_fifo= _timeout); =20 /* * Overwrite TX done handler --=20 2.39.5 From nobody Sun Dec 14 21:31:08 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 EE80922FDEF for ; Wed, 5 Feb 2025 10:55:34 +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=1738752936; cv=none; b=l5sE6Qj9Lm2Qq4ptl4LAADkYlTvu6P64TSrvJ14L4jIgs1TEugg23F40EjfEiHF4OiPBvnbq2gNIA5HpD0G2w6+FL3n5b0jk8epK2f8qMH4zBS3qmq2NOd7j694XUzrCqUMwJnhcASerjp1ebUnlgwnwDpCvaTut92cJJ/X/LMk= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1738752936; c=relaxed/simple; bh=2aN9XdrGhLLUgcHQKFP4B76bnQNsqs56aszb2ZX5lqw=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=mcFOt88/5os1lilzZUB8dZnX6acg6J1CexWZGyDgQuqy0HhCnItnhMEtojWNOBN7gy4Kw1kHMM5xb6bDV6ZuRE3U07dXAdp1zt2psQD1Cf4AjlJUtbMQEOzpWQZq/vovC1wdUBoHmk6kZIDO/LOgRHp8Yv47qUImqiUDJ6ValPE= 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=DTA8yL/x; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=pv9ns82H; 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="DTA8yL/x"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="pv9ns82H" From: Nam Cao DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1738752931; 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=/RJeMcsPkAEmhA27s3sLTssPdK+WsbgJL72T6GUFIBU=; b=DTA8yL/xkiMfX+SF6zQpAH2lId7bEscvBoSzTXPM/xVjEa8pq7901W/NkuG/SrzcHmEA73 A9Awg1bOWiKlFfac8cV1Ny//+TMKE6FajFfHX1mSmZJv6I4hOmg2lNW3t/OOQ0MvYO1u86 D8b7Ze/WN0wsSvAYQaWCmOTVWO4ICnEJccyuBSga2A2W77fprR4wLVV5/BYbr09TbS7e2R aQcFDFBT66/Klbo0z+S3gtrrDEi3e7L4NSo2Pu3U4HMvEuA2iwXkrIR9BbLsma0BW/7V8Q AqvA3VXGZjP66ZI6U9+ODDkLOefCGbU57IjfwtX+3XPco97MDrMCRZJhiuMAlg== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1738752931; 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=/RJeMcsPkAEmhA27s3sLTssPdK+WsbgJL72T6GUFIBU=; b=pv9ns82H6ozGAbgyZkC79/EWxA2hUlTF7J428yAo0vcWHhxZv/9pEGW+zUJ9HBsLF0XQUg z7prGsNDzPIOeKDw== To: Anna-Maria Behnsen , Frederic Weisbecker , Thomas Gleixner , linux-kernel@vger.kernel.org Cc: Nam Cao , Steven Rostedt Subject: [PATCH v2 07/12] hrtimers: Make callback function pointer private Date: Wed, 5 Feb 2025 11:55:16 +0100 Message-Id: <7d0e6e0c5c59a64a9bea940051aac05d750bc0c2.1738746927.git.namcao@linutronix.de> In-Reply-To: References: 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" Make the field 'function' of struct hrtimer private, to prevent users from changing this field in an unsafe way. hrtimer_update_function() should be used if the callback function needs to be changed. Signed-off-by: Nam Cao Cc: Steven Rostedt --- include/linux/hrtimer.h | 2 +- include/linux/hrtimer_types.h | 2 +- include/trace/events/timer.h | 4 ++-- kernel/time/hrtimer.c | 8 ++++---- kernel/time/timer_list.c | 2 +- 5 files changed, 9 insertions(+), 9 deletions(-) diff --git a/include/linux/hrtimer.h b/include/linux/hrtimer.h index 242ceafecde5..5facee69b7e2 100644 --- a/include/linux/hrtimer.h +++ b/include/linux/hrtimer.h @@ -344,7 +344,7 @@ static inline void hrtimer_update_function(struct hrtim= er *timer, if (WARN_ON_ONCE(!function)) return; =20 - timer->function =3D function; + ACCESS_PRIVATE(timer, function) =3D function; } =20 /* Forward a hrtimer so it expires after now: */ diff --git a/include/linux/hrtimer_types.h b/include/linux/hrtimer_types.h index 7c5b27daa89d..8fbbb6bdf7a1 100644 --- a/include/linux/hrtimer_types.h +++ b/include/linux/hrtimer_types.h @@ -39,7 +39,7 @@ enum hrtimer_restart { struct hrtimer { struct timerqueue_node node; ktime_t _softexpires; - enum hrtimer_restart (*function)(struct hrtimer *); + enum hrtimer_restart (*__private function)(struct hrtimer *); struct hrtimer_clock_base *base; u8 state; u8 is_rel; diff --git a/include/trace/events/timer.h b/include/trace/events/timer.h index 1ef58a04fc57..f8c906be4cd0 100644 --- a/include/trace/events/timer.h +++ b/include/trace/events/timer.h @@ -235,7 +235,7 @@ TRACE_EVENT(hrtimer_start, =20 TP_fast_assign( __entry->hrtimer =3D hrtimer; - __entry->function =3D hrtimer->function; + __entry->function =3D ACCESS_PRIVATE(hrtimer, function); __entry->expires =3D hrtimer_get_expires(hrtimer); __entry->softexpires =3D hrtimer_get_softexpires(hrtimer); __entry->mode =3D mode; @@ -271,7 +271,7 @@ TRACE_EVENT(hrtimer_expire_entry, TP_fast_assign( __entry->hrtimer =3D hrtimer; __entry->now =3D *now; - __entry->function =3D hrtimer->function; + __entry->function =3D ACCESS_PRIVATE(hrtimer, function); ), =20 TP_printk("hrtimer=3D%p function=3D%ps now=3D%llu", diff --git a/kernel/time/hrtimer.c b/kernel/time/hrtimer.c index 728075f5c9c6..027a63344259 100644 --- a/kernel/time/hrtimer.c +++ b/kernel/time/hrtimer.c @@ -1326,7 +1326,7 @@ void hrtimer_start_range_ns(struct hrtimer *timer, kt= ime_t tim, struct hrtimer_clock_base *base; unsigned long flags; =20 - if (WARN_ON_ONCE(!timer->function)) + if (WARN_ON_ONCE(!ACCESS_PRIVATE(timer, function))) return; /* * Check whether the HRTIMER_MODE_SOFT bit and hrtimer.is_soft @@ -1634,9 +1634,9 @@ static void __hrtimer_setup(struct hrtimer *timer, timerqueue_init(&timer->node); =20 if (WARN_ON_ONCE(!function)) - timer->function =3D hrtimer_dummy_timeout; + ACCESS_PRIVATE(timer, function) =3D hrtimer_dummy_timeout; else - timer->function =3D function; + ACCESS_PRIVATE(timer, function) =3D function; } =20 /** @@ -1748,7 +1748,7 @@ static void __run_hrtimer(struct hrtimer_cpu_base *cp= u_base, raw_write_seqcount_barrier(&base->seq); =20 __remove_hrtimer(timer, base, HRTIMER_STATE_INACTIVE, 0); - fn =3D timer->function; + fn =3D ACCESS_PRIVATE(timer, function); =20 /* * Clear the 'is relative' flag for the TIME_LOW_RES case. If the diff --git a/kernel/time/timer_list.c b/kernel/time/timer_list.c index 1c311c46da50..958dd4194684 100644 --- a/kernel/time/timer_list.c +++ b/kernel/time/timer_list.c @@ -46,7 +46,7 @@ static void print_timer(struct seq_file *m, struct hrtimer *taddr, struct hrtimer *tim= er, int idx, u64 now) { - SEQ_printf(m, " #%d: <%pK>, %ps", idx, taddr, timer->function); + SEQ_printf(m, " #%d: <%pK>, %ps", idx, taddr, ACCESS_PRIVATE(timer, funct= ion)); SEQ_printf(m, ", S:%02x", timer->state); SEQ_printf(m, "\n"); SEQ_printf(m, " # expires at %Lu-%Lu nsecs [in %Ld to %Ld nsecs]\n", --=20 2.39.5 From nobody Sun Dec 14 21:31:08 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 EE86A22FDF0 for ; Wed, 5 Feb 2025 10:55:34 +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=1738752938; cv=none; b=R9F+sUvo9oCo2IdMozmEtrVIujVLXoDHr8cO0WT/PNxSCSwUf/AJlBpDYgCd7CJqnY6izDOtBUWNS5xnQTqkOhvnwf5STYABCNs6vVNm5fm09ej+2NGwSErUtJiq6OCkUjwnPck0NE66QDGoL+OfDNO4ZIDy+zFGt/1uJpoMDxg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1738752938; c=relaxed/simple; bh=y8M9/BZEn2q3Q3Jm44mRv5B/wgWP/X2uuSox1YmNweg=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=PNhPrxLuJs1Sn2ySebW4mZV44RrjXEiLUxfcuA+66jpwu6iMn9Wra+IZfiQZtf3O9f5X5j/+tl07XpSUT4qN/Osjjgh/pXJACnEvEY2O4es869CUG/zMzTMS5N+9Iy3wTrlEznGhMuov+H86LtIi1cTMRBB/wz/x0KTFYAEwrtk= 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=iUwNfdxj; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=IQtQL8qT; 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="iUwNfdxj"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="IQtQL8qT" From: Nam Cao DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1738752932; 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=lui8ebrqPuhrOmMORPYpepkiLJrIN9RVn8IiBGoIqeY=; b=iUwNfdxjW0PlMtVmTl5Bpa000apUh9SoX4ViirzQ+dpJluspikR7ol9TJgW1kyfGxD4tu5 ///86QKR4mBXWAs8Y1+uet9MGttxk/Ow3Z+zD2dmdFehwZ8zMpOlPOccQmX5MqcbiKq/5Q suEHVSJxSk9FxEzb4hxmvpramSqJ/RkHRV4hovA/CdUVMpPdkaQEy62WjUr7PPR2CEaQ17 7Cqq/rDOdEgARUXUGnvzukGlzZigdwOzeTUjZCmH057ZxfNzcsb0His2kmK4MYQ9ZP7ciA CaJr+ArDrZ+Z6391c8ll/abo2OUFn37M4L89xP9mNim66EIzODf45lFqe/78Cw== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1738752932; 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=lui8ebrqPuhrOmMORPYpepkiLJrIN9RVn8IiBGoIqeY=; b=IQtQL8qTmHpxhusrpD8FJ4DG+IW3qKW9wdfdbQtso5/62NjOh6uwesJANo7MA41CBvgq2g p+ut9AlDfiV/HRBA== To: Anna-Maria Behnsen , Frederic Weisbecker , Thomas Gleixner , linux-kernel@vger.kernel.org Cc: Nam Cao Subject: [PATCH v2 08/12] hrtimers: Remove unnecessary NULL check in hrtimer_start_range_ns() Date: Wed, 5 Feb 2025 11:55:17 +0100 Message-Id: <4661c571ee87980c340ccc318fc1a473c0c8f6bc.1738746927.git.namcao@linutronix.de> In-Reply-To: References: 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 'function' field of struct hrtimer can only be changed using hrtimer_setup*() or hrtimer_update_function(), and both already null-check 'function'. Therefore, null-checking 'function' in hrtimer_start_range_ns() is not necessary. Signed-off-by: Nam Cao --- kernel/time/hrtimer.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/kernel/time/hrtimer.c b/kernel/time/hrtimer.c index 027a63344259..4878a2c7e4bd 100644 --- a/kernel/time/hrtimer.c +++ b/kernel/time/hrtimer.c @@ -1326,8 +1326,6 @@ void hrtimer_start_range_ns(struct hrtimer *timer, kt= ime_t tim, struct hrtimer_clock_base *base; unsigned long flags; =20 - if (WARN_ON_ONCE(!ACCESS_PRIVATE(timer, function))) - return; /* * Check whether the HRTIMER_MODE_SOFT bit and hrtimer.is_soft * match on CONFIG_PREEMPT_RT =3D n. With PREEMPT_RT check the hard --=20 2.39.5 From nobody Sun Dec 14 21:31:08 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 C906522FDEA for ; Wed, 5 Feb 2025 10:55:34 +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=1738752936; cv=none; b=lLhh4UOMDaSLkTIj7+YJM2qwKfe5it0iS1zOkbPHghq+/2cWP6HdAU7k5/fgQjDyL/0MUCvXING6NFW5nL0sIanyRVsfAHgkR6Bg1wemMu2+KmiasyLQmYmGpmcOvb6ELyfZNBnv3ZGu709Fu1LswselcC2p/fYpbjOBVkceXQY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1738752936; c=relaxed/simple; bh=NRsQMtHAxux8mUFb266+cSZAvDQmkpLFuni3XbFcN48=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=BLfucbqCL6oGJooWPhMUioavAb+PXYgxNtRiL0F/VRxZPhWxSAQasIRULm3r62y1swoeekcCxlpAdlfCz1ACkuZqic352fzGgoBXubszmP87WoPTBZZArzw8QrKrFw3/fkPbHhflHh0ccZXCuu6z+D0JlrajImw165FCdiw0U4Q= 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=XVsCiou7; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=r2hQzJfT; 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="XVsCiou7"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="r2hQzJfT" From: Nam Cao DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1738752932; 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=OZRPl2WjO34dkEQpdwFayeYtHrAzaKEJ+22yEExGnk0=; b=XVsCiou7qNRno2V41PFKn6Dy2l0UPhzBHjx2mzuZy3wiFNXHF0QQIRGakpx59VrtNOL6Vw WqQwo1BCqoy8HMYFb3ghiw9t4rAaK3mgcPqqsyWyj/S5FmhN7MGrvtXHfxrTTPqojPIdYW znrKKugLHyLqIkJVLDfc8X2Fz1KhJQegQDCD0rpVYmg0bQEUDzOqwp6ZdkuUgDXGSgeEIw T1crhGEf11x3iojg8bHSY6wn2DRzU/u1nKXxykSQuXsjuQ00YFHBtQOsjXiIy6KXi9xXFK aMTFyeDCAqJB3bJAXN+WKI/m1oswfdr8XI0OCcBTsSAVW83yUDEdtCZsv3E2cQ== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1738752932; 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=OZRPl2WjO34dkEQpdwFayeYtHrAzaKEJ+22yEExGnk0=; b=r2hQzJfTgYIgn5Qdd7GbIhioQNdSep+ojXl8Cj0ghODZCFUEGuZwOqpPu2KlKTLsaTsox/ ex9PKttB4Oocq2DQ== To: Anna-Maria Behnsen , Frederic Weisbecker , Thomas Gleixner , linux-kernel@vger.kernel.org Cc: Nam Cao Subject: [PATCH v2 09/12] hrtimers: Rename __hrtimer_init_sleeper() to __hrtimer_setup_sleeper() Date: Wed, 5 Feb 2025 11:55:18 +0100 Message-Id: <807694aedad9353421c4a7347629a30c5c31026f.1738746927.git.namcao@linutronix.de> In-Reply-To: References: 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" All the hrtimer_init*() functions have been renamed to hrtimer_setup*(). Rename __hrtimer_init_sleeper() to __hrtimer_setup_sleeper() as well, to keep the names consistent. Signed-off-by: Nam Cao --- kernel/time/hrtimer.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/kernel/time/hrtimer.c b/kernel/time/hrtimer.c index 4878a2c7e4bd..41133ee1e2b3 100644 --- a/kernel/time/hrtimer.c +++ b/kernel/time/hrtimer.c @@ -2021,7 +2021,7 @@ void hrtimer_sleeper_start_expires(struct hrtimer_sle= eper *sl, * Make the enqueue delivery mode check work on RT. If the sleeper * was initialized for hard interrupt delivery, force the mode bit. * This is a special case for hrtimer_sleepers because - * __hrtimer_init_sleeper() determines the delivery mode on RT so the + * __hrtimer_setup_sleeper() determines the delivery mode on RT so the * fiddling with this decision is avoided at the call sites. */ if (IS_ENABLED(CONFIG_PREEMPT_RT) && sl->timer.is_hard) @@ -2031,8 +2031,8 @@ void hrtimer_sleeper_start_expires(struct hrtimer_sle= eper *sl, } EXPORT_SYMBOL_GPL(hrtimer_sleeper_start_expires); =20 -static void __hrtimer_init_sleeper(struct hrtimer_sleeper *sl, - clockid_t clock_id, enum hrtimer_mode mode) +static void __hrtimer_setup_sleeper(struct hrtimer_sleeper *sl, + clockid_t clock_id, enum hrtimer_mode mode) { /* * On PREEMPT_RT enabled kernels hrtimers which are not explicitly @@ -2072,7 +2072,7 @@ void hrtimer_setup_sleeper_on_stack(struct hrtimer_sl= eeper *sl, clockid_t clock_id, enum hrtimer_mode mode) { debug_init_on_stack(&sl->timer, clock_id, mode); - __hrtimer_init_sleeper(sl, clock_id, mode); + __hrtimer_setup_sleeper(sl, clock_id, mode); } EXPORT_SYMBOL_GPL(hrtimer_setup_sleeper_on_stack); =20 --=20 2.39.5 From nobody Sun Dec 14 21:31:08 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 3DB5922FDFC for ; Wed, 5 Feb 2025 10:55:34 +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=1738752936; cv=none; b=BlBIH3fJvthrFZoy7zSb+/VjPWSLi1EbgG8Bsw8FeA5ojHs6vh8YR5B7QNWDzbh6GZV20EiUi2ZnrOnGJwopc0W/q6o847y9WCiL4qIsE/Vg0zLynOCf7iCAS4TBRd+s3s/FYtYjcXm1WGINz8/7jntJ4adpljVNh3oeFNS40d8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1738752936; c=relaxed/simple; bh=fDcBmhqZ/qrJidzZiRoquUXnM2Q7XO2VOwJOytwwuts=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=ntrB0WdE9I1xOGTH7wzrBoDY6TlET9KGB9B9++4PmHboX//0GFkOiD8zn0b3OZeM+Hhpga0+WCC6VcCTUhSQPxousUubRhGq4x64TA0nqbPpsRgbJnuNGS9k4yUzzx7aieHJu26ruikvJFSM66LXC0/HXMdbdQP4n2sMZ2lPBGc= 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=UkmeM/Ka; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=wR2fL2Ag; 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="UkmeM/Ka"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="wR2fL2Ag" From: Nam Cao DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1738752932; 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=oZFjvYgFZdOyqpk4Dz3sDM4Dy3SD7fTUgVgvsmGTNWw=; b=UkmeM/KaL+tKtXqIaIPqVNMNCMNZve/cg61KvgeXwv+1m6zsDRB21nOM0E8yefXScqnCs/ +Cmv06eIjFuFFFr2kRopAEGLG3RbNrBJYKK4xDMit41Ou3bTgYNEM0HF4mbRTqgXkTlC2Y UOf3e8REPK7/GaEqeiZaHvdYlHAlQmTYw+y2NIWHd1BBMcGU0/xG9KDemVtRv06JiQK7ca hMoMK3sH7TPNlVL/yDtVhYwH7q2RBwRsvELw3cED2oCtUGiFsKEVgA2iXxfQrgoO4ZzvvL 4qCZvAQqLwN//jOJNjd2W4y/KruHcyxAa3Q+c16LjfjaXcgu/E1of92pXwmuDw== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1738752932; 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=oZFjvYgFZdOyqpk4Dz3sDM4Dy3SD7fTUgVgvsmGTNWw=; b=wR2fL2Ag4B8S94HARDd3BVQxuEM0gp2sIK7m14t9+GoL4Iiofz8ux0TPiGKrwmaCZZuLgz md7X8wNGkGunLuDQ== To: Anna-Maria Behnsen , Frederic Weisbecker , Thomas Gleixner , linux-kernel@vger.kernel.org Cc: Nam Cao Subject: [PATCH v2 10/12] hrtimers: Rename debug_init() to debug_setup() Date: Wed, 5 Feb 2025 11:55:19 +0100 Message-Id: <4b730c1f79648b16a1c5413f928fdc2e138dfc43.1738746927.git.namcao@linutronix.de> In-Reply-To: References: 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" All the hrtimer_init*() functions have been renamed to hrtimer_setup*(). Rename debug_init() to debug_setup() as well, to keep the names consistent. Signed-off-by: Nam Cao --- kernel/time/hrtimer.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/kernel/time/hrtimer.c b/kernel/time/hrtimer.c index 41133ee1e2b3..0d1b8bb66aeb 100644 --- a/kernel/time/hrtimer.c +++ b/kernel/time/hrtimer.c @@ -475,9 +475,7 @@ static inline void debug_hrtimer_activate(struct hrtime= r *timer, static inline void debug_hrtimer_deactivate(struct hrtimer *timer) { } #endif =20 -static inline void -debug_init(struct hrtimer *timer, clockid_t clockid, - enum hrtimer_mode mode) +static inline void debug_setup(struct hrtimer *timer, clockid_t clockid, e= num hrtimer_mode mode) { debug_hrtimer_init(timer); trace_hrtimer_init(timer, clockid, mode); @@ -1653,7 +1651,7 @@ static void __hrtimer_setup(struct hrtimer *timer, void hrtimer_setup(struct hrtimer *timer, enum hrtimer_restart (*function)= (struct hrtimer *), clockid_t clock_id, enum hrtimer_mode mode) { - debug_init(timer, clock_id, mode); + debug_setup(timer, clock_id, mode); __hrtimer_setup(timer, function, clock_id, mode); } EXPORT_SYMBOL_GPL(hrtimer_setup); --=20 2.39.5 From nobody Sun Dec 14 21:31:08 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 9346822FE0C for ; Wed, 5 Feb 2025 10:55:35 +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=1738752937; cv=none; b=g97ERlICbUTNNfnPCvUYfWmFkSYN4BKIaciPID5taH9FGtPVVxgVSL+vDL8/Gt2W26PtoQ+1a+fIuXfyhUwkVzdjbBV0NzJsHfGuysKX0hb6TW3v98wxbIlPwX/2M5/2TzDrhwvLpRXfw5JaxV7W1Q0jUc+Gxj2YKRZwsIye+Gg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1738752937; c=relaxed/simple; bh=5GhDU9sN6v3cbe2XG4hbFbDBC3f258/TOZBI9Xj+tvM=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=upeTzRxvA0hdUMYrBIxOfn2On8Q7dk6Q8Z2oUTIHnW0HR0e0hdwU76fgFb2TvysEGTagKG1YeqxelY4P4jEbClNMi5+oErevjK/pDDvPdyNQjJdI+GDoKavoEm8fsj4KtIx2mfL1F44lkaDWfkDkLOogtzgUr9cKhUHgxXt7hR4= 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=uY0kNcqK; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=8faqYeNs; 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="uY0kNcqK"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="8faqYeNs" From: Nam Cao DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1738752933; 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=Uwa+9n6bh+N30yU/aApOFiTNPXTBa6EgzTEiJlGXx1c=; b=uY0kNcqKoxkyYhGcSy0BRKY3KDl+C5O93/1BsGX35O2fzRMMJ4t9xAJn0xzzaeBUko39IO ECXcFbGCHByvV6JLa4+7raovxyCgnqXvrPIQM/GOjhACtfo7qtdTjJIC2kWkiCW4ISGQZt 4Hv/oHFnXOi1YJEat0v2V1saJ/sjIZdgU1X0gV+KC9qONAXgIWLT2KRyZwkndZJfvnU08X LrgaJyTKH12vnD8MD2az72clreYnRlYajgxBBg4P+3y5nre8WEuftKQNQ9jfswm+XD7dxy 9OCJcK10DXoUA5st1R8aJ82/44q4YsO3S51/5lD9bf+eB1sJ8hP1jVnAKiDMrg== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1738752933; 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=Uwa+9n6bh+N30yU/aApOFiTNPXTBa6EgzTEiJlGXx1c=; b=8faqYeNsBYRmbfZMAHyRL2dRIFWg6a6SMsOBDZxlSr/N3ZpX6LTgS+c/acfuHVVLLOfWfc LmDepJ9ehTOZFZCw== To: Anna-Maria Behnsen , Frederic Weisbecker , Thomas Gleixner , linux-kernel@vger.kernel.org Cc: Nam Cao Subject: [PATCH v2 11/12] hrtimers: Rename debug_init_on_stack() to debug_setup_on_stack() Date: Wed, 5 Feb 2025 11:55:20 +0100 Message-Id: <073cf6162779a2f5b12624677d4c49ee7eccc1ed.1738746927.git.namcao@linutronix.de> In-Reply-To: References: 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" All the hrtimer_init*() functions have been renamed to hrtimer_setup*(). Rename debug_init_on_stack() to debug_setup_on_stack() as well, to keep the names consistent. Signed-off-by: Nam Cao --- kernel/time/hrtimer.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/kernel/time/hrtimer.c b/kernel/time/hrtimer.c index 0d1b8bb66aeb..a0727a45e8e3 100644 --- a/kernel/time/hrtimer.c +++ b/kernel/time/hrtimer.c @@ -481,8 +481,8 @@ static inline void debug_setup(struct hrtimer *timer, c= lockid_t clockid, enum hr trace_hrtimer_init(timer, clockid, mode); } =20 -static inline void debug_init_on_stack(struct hrtimer *timer, clockid_t cl= ockid, - enum hrtimer_mode mode) +static inline void debug_setup_on_stack(struct hrtimer *timer, clockid_t c= lockid, + enum hrtimer_mode mode) { debug_hrtimer_init_on_stack(timer); trace_hrtimer_init(timer, clockid, mode); @@ -1670,7 +1670,7 @@ void hrtimer_setup_on_stack(struct hrtimer *timer, enum hrtimer_restart (*function)(struct hrtimer *), clockid_t clock_id, enum hrtimer_mode mode) { - debug_init_on_stack(timer, clock_id, mode); + debug_setup_on_stack(timer, clock_id, mode); __hrtimer_setup(timer, function, clock_id, mode); } EXPORT_SYMBOL_GPL(hrtimer_setup_on_stack); @@ -2069,7 +2069,7 @@ static void __hrtimer_setup_sleeper(struct hrtimer_sl= eeper *sl, void hrtimer_setup_sleeper_on_stack(struct hrtimer_sleeper *sl, clockid_t clock_id, enum hrtimer_mode mode) { - debug_init_on_stack(&sl->timer, clock_id, mode); + debug_setup_on_stack(&sl->timer, clock_id, mode); __hrtimer_setup_sleeper(sl, clock_id, mode); } EXPORT_SYMBOL_GPL(hrtimer_setup_sleeper_on_stack); --=20 2.39.5 From nobody Sun Dec 14 21:31:08 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 4300A22FDFF for ; Wed, 5 Feb 2025 10:55:35 +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=1738752937; cv=none; b=lLG9FVSw0SbbVWrL7ea7zYvcQWfLEre6uapOJk6YxoSrvI68TLDKT+ohW1lMQPbstG9Q7G/vzqHGBWLFHtH18VnJfIUaap4/ncYF0SeryVnhYD2Mc4Ub/M4vj5ZzcT5lSzbu0bJOCPuVp8TNoNytpztgl6O66E3sw7DK8m8cUiU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1738752937; c=relaxed/simple; bh=OmIlPGYCDCYeDqIb4Dfqqj2wtPfR7xVqkLu3w72/+Gw=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=Gefyk0NmdHmn+NcOstN+YHSvT7LIDjbv6cOD8mC7lzC5+LwjNEgBRaKWqKV3BVDSJ5TnPMdznhiYDZ/YHK5/VZEYowhJt0sW/zI6PwD48Xmwl/UVGC4VJ9eKVop0VuArAdP/a6s1U5GtrGCwdiWkLddbHMWBlV4soJmRLZS07xk= 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=BbyzYvxz; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=5jdyIdia; 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="BbyzYvxz"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="5jdyIdia" From: Nam Cao DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1738752933; 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=jNYrWFFk5eB1KCTWCnS6jvP/ys5vwAloHCdt+pWXr4E=; b=BbyzYvxzEfNVYnynZl2LOsYTobjmQzUDX0tfFFjF/KCqzCfpTswiwaKncNg0gqrIjbJ3vj 1q2hDQHsofF1wCQak/+f0nsP5I+eJrpY2YQvxSRwR2YxPtUuJdvI7dD90AfYnyXDvUV/zE 5In+xjcmULCAuIbV20Ds/2fkNv1N8NG4bNI7zFHb+qubNplcU3gCTK3CzAbjXso3fYiw0j wYqU2LKltJFg9+ZM6qnTDlPBi5YaZdV1QekWbXUmIgm6x/PtOLnWjnEfgI08k92DEHGJwp v7gnA2fQmg+JFCbQg1dC15Zk+EiOzJltnAWDv0oQ+ZmxzL+66Qwe46iR9hOyxA== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1738752933; 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=jNYrWFFk5eB1KCTWCnS6jvP/ys5vwAloHCdt+pWXr4E=; b=5jdyIdia8qRnYY4osYnvUuJGHWIufNGUBPCdPuUzIOraCRurI9wcZ7bSltpElznaKLb3YJ fxlzfI5VaZJjU/CA== To: Anna-Maria Behnsen , Frederic Weisbecker , Thomas Gleixner , linux-kernel@vger.kernel.org Cc: Nam Cao , Steven Rostedt Subject: [PATCH v2 12/12] tracing/timers: Rename hrtimer_init event to hrtimer_setup Date: Wed, 5 Feb 2025 11:55:21 +0100 Message-Id: In-Reply-To: References: 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 function hrtimer_init() doesn't exist anymore. It was replaced by hrtimer_setup(). Thus, rename the hrtimer_init trace event to hrtimer_setup to keep it consistent. Signed-off-by: Nam Cao Cc: Steven Rostedt --- Documentation/trace/ftrace.rst | 4 ++-- include/trace/events/timer.h | 4 ++-- kernel/time/hrtimer.c | 4 ++-- tools/perf/tests/shell/trace_btf_enum.sh | 2 +- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/Documentation/trace/ftrace.rst b/Documentation/trace/ftrace.rst index 2b74f96d09d5..c9e88bf65709 100644 --- a/Documentation/trace/ftrace.rst +++ b/Documentation/trace/ftrace.rst @@ -3077,7 +3077,7 @@ Notice that we lost the sys_nanosleep. # cat set_ftrace_filter hrtimer_run_queues hrtimer_run_pending - hrtimer_init + hrtimer_setup hrtimer_cancel hrtimer_try_to_cancel hrtimer_forward @@ -3115,7 +3115,7 @@ Again, now we want to append. # cat set_ftrace_filter hrtimer_run_queues hrtimer_run_pending - hrtimer_init + hrtimer_setup hrtimer_cancel hrtimer_try_to_cancel hrtimer_forward diff --git a/include/trace/events/timer.h b/include/trace/events/timer.h index f8c906be4cd0..1641ae3e6ca0 100644 --- a/include/trace/events/timer.h +++ b/include/trace/events/timer.h @@ -185,12 +185,12 @@ TRACE_EVENT(timer_base_idle, { HRTIMER_MODE_REL_PINNED_HARD, "REL|PINNED|HARD" }) =20 /** - * hrtimer_init - called when the hrtimer is initialized + * hrtimer_setup - called when the hrtimer is initialized * @hrtimer: pointer to struct hrtimer * @clockid: the hrtimers clock * @mode: the hrtimers mode */ -TRACE_EVENT(hrtimer_init, +TRACE_EVENT(hrtimer_setup, =20 TP_PROTO(struct hrtimer *hrtimer, clockid_t clockid, enum hrtimer_mode mode), diff --git a/kernel/time/hrtimer.c b/kernel/time/hrtimer.c index a0727a45e8e3..1fba75f076d0 100644 --- a/kernel/time/hrtimer.c +++ b/kernel/time/hrtimer.c @@ -478,14 +478,14 @@ static inline void debug_hrtimer_deactivate(struct hr= timer *timer) { } static inline void debug_setup(struct hrtimer *timer, clockid_t clockid, e= num hrtimer_mode mode) { debug_hrtimer_init(timer); - trace_hrtimer_init(timer, clockid, mode); + trace_hrtimer_setup(timer, clockid, mode); } =20 static inline void debug_setup_on_stack(struct hrtimer *timer, clockid_t c= lockid, enum hrtimer_mode mode) { debug_hrtimer_init_on_stack(timer); - trace_hrtimer_init(timer, clockid, mode); + trace_hrtimer_setup(timer, clockid, mode); } =20 static inline void debug_activate(struct hrtimer *timer, diff --git a/tools/perf/tests/shell/trace_btf_enum.sh b/tools/perf/tests/sh= ell/trace_btf_enum.sh index 8d1e6bbeac90..3b2a82e08807 100755 --- a/tools/perf/tests/shell/trace_btf_enum.sh +++ b/tools/perf/tests/shell/trace_btf_enum.sh @@ -6,7 +6,7 @@ err=3D0 set -e =20 syscall=3D"landlock_add_rule" -non_syscall=3D"timer:hrtimer_init,timer:hrtimer_start" +non_syscall=3D"timer:hrtimer_setup,timer:hrtimer_start" =20 TESTPROG=3D"perf test -w landlock" =20 --=20 2.39.5