From nobody Wed Nov 27 18:41:15 2024 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 8A4CC18DF64; Wed, 9 Oct 2024 08:29:20 +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=1728462562; cv=none; b=qwV/5U4uarxfq7MIr37xzGbi4BdmWSYc2yqA6deouEwXHEUWIlxRanYiM9TddWx9eCNbXrKDLDSdFAQcaiRzD6zAkfJv7NC07XSj7vZJoJMBqJrHAen/oVB3j7wkeAownhvh1jvAPNp8GpocUioGhCLsYPiyXjkBwGHWFll3YuM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728462562; c=relaxed/simple; bh=bRWBXGzdASFmvDLqh3OdneAcymX6b/eaXSsanouUKn8=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=GzrcO/i7SGVlXzEb01uBB2wWtOONGTMThPP3RPyHyuXj6zvhWeGA/WXPB2aW8P4X4eBSja3ESZvQTCMLMrKOT+D5DuTcuuNXV6/Eee9BlEyoo/3xjcqsbatYGH5TKeujLthYgBKeOG4qvqh8C83aeGNDVNaOhtePAcD1yCZlopQ= 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=MFnrhvZ4; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=DuK3xOtn; 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="MFnrhvZ4"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="DuK3xOtn" From: Anna-Maria Behnsen DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1728462558; 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=T8iNDmVaqSsH9dpFWjGVt85012RSAhD8fVD7Om8YFQs=; b=MFnrhvZ4Sh5ipH9HHN/wAMmkfu8uoX0L0vO8sNogaYRkc9IXDkxUqifPjxXRgevdnXGnsy ztpR0syIwqSTZYsQyMnrNRjhB67q9eyeSzfdheEWnZzwE7S3px9dMUpWjWGbDfa93Hm5d2 3SpxYzvE2xVtvXMDsL0UoPMbP9rl89OF3cBk4BapHjd534Unc++FCAmGfFe9zBsn8kaVwC UkogcoTMmBlmDr9lb1v+O09FtV/NX6VBYJI2ddV/mGtJw9E3jqQgoFahaMRpCM3ggmP76h AIcDFiRavTORJ8k4GBorq7uTC0yfCrzD/HS+pedvOfPptYA+OCCr0YTK18NI5A== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1728462558; 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=T8iNDmVaqSsH9dpFWjGVt85012RSAhD8fVD7Om8YFQs=; b=DuK3xOtnPddfIE1Zqtm2ymatOqqB3LvijIF91YUNhVwt1ecebfrM7Vc8FVXDdcz088FPuO B2QQfg+KDXKmmRBQ== Date: Wed, 09 Oct 2024 10:29:07 +0200 Subject: [PATCH v2 14/25] timekeeping: Introduce combined timekeeping action flag 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: <20241009-devel-anna-maria-b4-timers-ptp-timekeeping-v2-14-554456a44a15@linutronix.de> References: <20241009-devel-anna-maria-b4-timers-ptp-timekeeping-v2-0-554456a44a15@linutronix.de> In-Reply-To: <20241009-devel-anna-maria-b4-timers-ptp-timekeeping-v2-0-554456a44a15@linutronix.de> To: John Stultz , Frederic Weisbecker , Thomas Gleixner Cc: linux-kernel@vger.kernel.org, netdev@vger.kernel.org, Miroslav Lichvar , Richard Cochran , Christopher S Hall , Anna-Maria Behnsen Instead of explicitly listing all the separate timekeeping actions flags, introduce a new one which covers all actions except TK_MIRROR action. No functional change. Signed-off-by: Anna-Maria Behnsen --- kernel/time/timekeeping.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/kernel/time/timekeeping.c b/kernel/time/timekeeping.c index fcb2b8b232d2..5a747afe64b4 100644 --- a/kernel/time/timekeeping.c +++ b/kernel/time/timekeeping.c @@ -33,6 +33,8 @@ #define TK_MIRROR (1 << 1) #define TK_CLOCK_WAS_SET (1 << 2) =20 +#define TK_UPDATE_ALL (TK_CLEAR_NTP | TK_CLOCK_WAS_SET) + enum timekeeping_adv_mode { /* Update timekeeper when a tick has passed */ TK_ADV_TICK, @@ -1493,7 +1495,7 @@ int do_settimeofday64(const struct timespec64 *ts) =20 tk_set_xtime(tk, ts); out: - timekeeping_update(&tk_core, tk, TK_CLEAR_NTP | TK_MIRROR | TK_CLOCK_WAS_= SET); + timekeeping_update(&tk_core, tk, TK_UPDATE_ALL | TK_MIRROR); =20 write_seqcount_end(&tk_core.seq); raw_spin_unlock_irqrestore(&tk_core.lock, flags); @@ -1543,7 +1545,7 @@ static int timekeeping_inject_offset(const struct tim= espec64 *ts) tk_set_wall_to_mono(tk, timespec64_sub(tk->wall_to_monotonic, *ts)); =20 error: /* even if we error out, we forwarded the time, so call update */ - timekeeping_update(&tk_core, tk, TK_CLEAR_NTP | TK_MIRROR | TK_CLOCK_WAS_= SET); + timekeeping_update(&tk_core, tk, TK_UPDATE_ALL | TK_MIRROR); =20 write_seqcount_end(&tk_core.seq); raw_spin_unlock_irqrestore(&tk_core.lock, flags); @@ -1628,7 +1630,7 @@ static int change_clocksource(void *data) timekeeping_forward_now(tk); old =3D tk->tkr_mono.clock; tk_setup_internals(tk, new); - timekeeping_update(&tk_core, tk, TK_CLEAR_NTP | TK_MIRROR | TK_CLOCK_WAS_= SET); + timekeeping_update(&tk_core, tk, TK_UPDATE_ALL | TK_MIRROR); =20 write_seqcount_end(&tk_core.seq); raw_spin_unlock_irqrestore(&tk_core.lock, flags); @@ -1919,7 +1921,7 @@ void timekeeping_inject_sleeptime64(const struct time= spec64 *delta) =20 __timekeeping_inject_sleeptime(tk, delta); =20 - timekeeping_update(&tk_core, tk, TK_CLEAR_NTP | TK_MIRROR | TK_CLOCK_WAS_= SET); + timekeeping_update(&tk_core, tk, TK_UPDATE_ALL | TK_MIRROR); =20 write_seqcount_end(&tk_core.seq); raw_spin_unlock_irqrestore(&tk_core.lock, flags); --=20 2.39.5