From: Sven Schnelle <svens@linux.ibm.com>
To: Richard Cochran <richardcochran@gmail.com>
Cc: netdev@vger.kernel.org, linux-s390@vger.kernel.org,
linux-kernel@vger.kernel.org,
"David S. Miller" <davem@davemloft.net>,
Eric Dumazet <edumazet@google.com>,
Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
Heiko Carstens <hca@linux.ibm.com>,
Vasily Gorbik <gor@linux.ibm.com>,
Alexander Gordeev <agordeev@linux.ibm.com>
Subject: [PATCH v2 2/2] ptp: ptp_s390: Add missing facility check
Date: Tue, 14 Jul 2026 15:03:42 +0200 [thread overview]
Message-ID: <20260714130342.1971700-3-svens@linux.ibm.com> (raw)
In-Reply-To: <20260714130342.1971700-1-svens@linux.ibm.com>
Only register the physical clock when facility 28 is installed
and PTFF QAF returns that PTFF QPT is available.
Fixes: 2d7de7a3010d ("s390/time: Add PtP driver")
Signed-off-by: Sven Schnelle <svens@linux.ibm.com>
Cc: stable@kernel.org
---
drivers/ptp/ptp_s390.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/drivers/ptp/ptp_s390.c b/drivers/ptp/ptp_s390.c
index 29618eb9bf44..02d624d89a0a 100644
--- a/drivers/ptp/ptp_s390.c
+++ b/drivers/ptp/ptp_s390.c
@@ -107,6 +107,9 @@ static __init int ptp_s390_init(void)
if (IS_ERR(ptp_stcke_clock))
return PTR_ERR(ptp_stcke_clock);
+ if (!test_facility(28) || !ptff_query(PTFF_QPT))
+ return 0;
+
ptp_qpt_clock = ptp_clock_register(&ptp_s390_qpt_info, NULL);
if (IS_ERR(ptp_qpt_clock)) {
ptp_clock_unregister(ptp_stcke_clock);
@@ -117,7 +120,8 @@ static __init int ptp_s390_init(void)
static __exit void ptp_s390_exit(void)
{
- ptp_clock_unregister(ptp_qpt_clock);
+ if (ptp_qpt_clock)
+ ptp_clock_unregister(ptp_qpt_clock);
ptp_clock_unregister(ptp_stcke_clock);
}
--
2.55.0
next prev parent reply other threads:[~2026-07-14 13:04 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-14 13:03 [PATCH v2 0/2] Add missing facility check to ptp_s390 driver Sven Schnelle
2026-07-14 13:03 ` [PATCH v2 1/2] s390/ptff: Export ptff_function_mask[] Sven Schnelle
2026-07-14 13:36 ` Heiko Carstens
2026-07-14 13:03 ` Sven Schnelle [this message]
2026-07-14 13:38 ` [PATCH v2 2/2] ptp: ptp_s390: Add missing facility check Heiko Carstens
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=20260714130342.1971700-3-svens@linux.ibm.com \
--to=svens@linux.ibm.com \
--cc=agordeev@linux.ibm.com \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=gor@linux.ibm.com \
--cc=hca@linux.ibm.com \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-s390@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=richardcochran@gmail.com \
/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