Linux s390 Architecture development
 help / color / mirror / Atom feed
From: Sven Schnelle <svens@linux.ibm.com>
To: Heiko Carstens <hca@linux.ibm.com>,
	Vasily Gorbik <gor@linux.ibm.com>,
	Alexander Gordeev <agordeev@linux.ibm.com>
Cc: borntraeger@linux.ibm.com, linux-s390@vger.kernel.org
Subject: [PATCH] s390/stp: Drop CLOCK_SYNC_STP
Date: Fri, 14 Aug 2026 09:22:23 +0200	[thread overview]
Message-ID: <20260814072223.2218864-1-svens@linux.ibm.com> (raw)

CLOCK_SYNC_STP is never set when the stp=1 kernel command line option
is used, or stp is enabled by default. This cause get_phys_clock to
return -EACCES. Fix this by testing stp_online and remove
CLOCK_SYNC_STP.

Signed-off-by: Sven Schnelle <svens@linux.ibm.com>
---
 arch/s390/kernel/time.c | 11 +++--------
 1 file changed, 3 insertions(+), 8 deletions(-)

diff --git a/arch/s390/kernel/time.c b/arch/s390/kernel/time.c
index 2b989bebd220..de80e2a316ba 100644
--- a/arch/s390/kernel/time.c
+++ b/arch/s390/kernel/time.c
@@ -69,6 +69,7 @@ EXPORT_SYMBOL(ptff_function_mask);
 
 static unsigned long lpar_offset;
 static unsigned long initial_leap_seconds;
+static bool stp_online = true;
 
 /*
  * Get time offsets with PTFF
@@ -274,8 +275,7 @@ static DEFINE_MUTEX(stp_mutex);
 static unsigned long clock_sync_flags;
 
 #define CLOCK_SYNC_HAS_STP		0
-#define CLOCK_SYNC_STP			1
-#define CLOCK_SYNC_STPINFO_VALID	2
+#define CLOCK_SYNC_STPINFO_VALID	1
 
 /*
  * The get_clock function for the physical clock. It will get the current
@@ -299,7 +299,7 @@ int get_phys_clock(unsigned long *clock)
 		return 0;
 	if (!test_bit(CLOCK_SYNC_HAS_STP, &clock_sync_flags))
 		return -EOPNOTSUPP;
-	if (!test_bit(CLOCK_SYNC_STP, &clock_sync_flags))
+	if (!stp_online)
 		return -EACCES;
 	return -EAGAIN;
 }
@@ -397,7 +397,6 @@ struct clock_sync_data {
 /*
  * Server Time Protocol (STP) code.
  */
-static bool stp_online = true;
 static struct stp_sstpi stp_info;
 static void *stp_page;
 
@@ -795,10 +794,6 @@ static ssize_t online_store(struct device *dev,
 		return -EOPNOTSUPP;
 	mutex_lock(&stp_mutex);
 	stp_online = value;
-	if (stp_online)
-		set_bit(CLOCK_SYNC_STP, &clock_sync_flags);
-	else
-		clear_bit(CLOCK_SYNC_STP, &clock_sync_flags);
 	queue_work(time_sync_wq, &stp_work);
 	mutex_unlock(&stp_mutex);
 	return count;
-- 
2.53.0


             reply	other threads:[~2026-08-14  7:22 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-14  7:22 Sven Schnelle [this message]
2026-08-14  7:34 ` [PATCH] s390/stp: Drop CLOCK_SYNC_STP sashiko-bot

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260814072223.2218864-1-svens@linux.ibm.com \
    --to=svens@linux.ibm.com \
    --cc=agordeev@linux.ibm.com \
    --cc=borntraeger@linux.ibm.com \
    --cc=gor@linux.ibm.com \
    --cc=hca@linux.ibm.com \
    --cc=linux-s390@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox