All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 0/2] Add missing facility check to ptp_s390 driver
@ 2026-07-14 13:03 Sven Schnelle
  2026-07-14 13:03 ` [PATCH v2 1/2] s390/ptff: Export ptff_function_mask[] Sven Schnelle
  2026-07-14 13:03 ` [PATCH v2 2/2] ptp: ptp_s390: Add missing facility check Sven Schnelle
  0 siblings, 2 replies; 5+ messages in thread
From: Sven Schnelle @ 2026-07-14 13:03 UTC (permalink / raw)
  To: Richard Cochran
  Cc: netdev, linux-s390, linux-kernel, David S. Miller, Eric Dumazet,
	Jakub Kicinski, Paolo Abeni, Heiko Carstens, Vasily Gorbik,
	Alexander Gordeev

This patchset adds a missing facility check and a check that the 'query
physical clock' (PTFF QPT) function is actually available. If it's not
present, no qpt ptp device will be registered. In order to use ptff_query()
in a module, the first patch adds a EXPORT_SYMBOL() to export
ptff_function_mask.

Changes in v2:
- drop CC check
- add PTFF QAF check
- add patch to export ptff_function_mask

Sven Schnelle (2):
  s390/ptff: Export ptff_function_mask[]
  ptp: ptp_s390: Add missing facility check

 arch/s390/kernel/time.c | 1 +
 drivers/ptp/ptp_s390.c  | 6 +++++-
 2 files changed, 6 insertions(+), 1 deletion(-)

--
2.55.0

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH v2 1/2] s390/ptff: Export ptff_function_mask[]
  2026-07-14 13:03 [PATCH v2 0/2] Add missing facility check to ptp_s390 driver Sven Schnelle
@ 2026-07-14 13:03 ` Sven Schnelle
  2026-07-14 13:36   ` Heiko Carstens
  2026-07-14 13:03 ` [PATCH v2 2/2] ptp: ptp_s390: Add missing facility check Sven Schnelle
  1 sibling, 1 reply; 5+ messages in thread
From: Sven Schnelle @ 2026-07-14 13:03 UTC (permalink / raw)
  To: Richard Cochran
  Cc: netdev, linux-s390, linux-kernel, David S. Miller, Eric Dumazet,
	Jakub Kicinski, Paolo Abeni, Heiko Carstens, Vasily Gorbik,
	Alexander Gordeev

Export the ptff_function_mask to make ptff_query() usable in modules.

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

diff --git a/arch/s390/kernel/time.c b/arch/s390/kernel/time.c
index bd0df61d1907..2b989bebd220 100644
--- a/arch/s390/kernel/time.c
+++ b/arch/s390/kernel/time.c
@@ -65,6 +65,7 @@ ATOMIC_NOTIFIER_HEAD(s390_epoch_delta_notifier);
 EXPORT_SYMBOL(s390_epoch_delta_notifier);
 
 unsigned char ptff_function_mask[16];
+EXPORT_SYMBOL(ptff_function_mask);
 
 static unsigned long lpar_offset;
 static unsigned long initial_leap_seconds;
-- 
2.55.0


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [PATCH v2 2/2] ptp: ptp_s390: Add missing facility check
  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:03 ` Sven Schnelle
  2026-07-14 13:38   ` Heiko Carstens
  1 sibling, 1 reply; 5+ messages in thread
From: Sven Schnelle @ 2026-07-14 13:03 UTC (permalink / raw)
  To: Richard Cochran
  Cc: netdev, linux-s390, linux-kernel, David S. Miller, Eric Dumazet,
	Jakub Kicinski, Paolo Abeni, Heiko Carstens, Vasily Gorbik,
	Alexander Gordeev

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


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH v2 1/2] s390/ptff: Export ptff_function_mask[]
  2026-07-14 13:03 ` [PATCH v2 1/2] s390/ptff: Export ptff_function_mask[] Sven Schnelle
@ 2026-07-14 13:36   ` Heiko Carstens
  0 siblings, 0 replies; 5+ messages in thread
From: Heiko Carstens @ 2026-07-14 13:36 UTC (permalink / raw)
  To: Sven Schnelle
  Cc: Richard Cochran, netdev, linux-s390, linux-kernel,
	David S. Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni,
	Vasily Gorbik, Alexander Gordeev

On Tue, Jul 14, 2026 at 03:03:41PM +0200, Sven Schnelle wrote:
> Export the ptff_function_mask to make ptff_query() usable in modules.
> 
> Signed-off-by: Sven Schnelle <svens@linux.ibm.com>
> ---
>  arch/s390/kernel/time.c | 1 +
>  1 file changed, 1 insertion(+)

Acked-by: Heiko Carstens <hca@linux.ibm.com>

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH v2 2/2] ptp: ptp_s390: Add missing facility check
  2026-07-14 13:03 ` [PATCH v2 2/2] ptp: ptp_s390: Add missing facility check Sven Schnelle
@ 2026-07-14 13:38   ` Heiko Carstens
  0 siblings, 0 replies; 5+ messages in thread
From: Heiko Carstens @ 2026-07-14 13:38 UTC (permalink / raw)
  To: Sven Schnelle
  Cc: Richard Cochran, netdev, linux-s390, linux-kernel,
	David S. Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni,
	Vasily Gorbik, Alexander Gordeev

On Tue, Jul 14, 2026 at 03:03:42PM +0200, Sven Schnelle wrote:
> 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(-)

Reviewed-by: Heiko Carstens <hca@linux.ibm.com>

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2026-07-14 13:38 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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 ` [PATCH v2 2/2] ptp: ptp_s390: Add missing facility check Sven Schnelle
2026-07-14 13:38   ` Heiko Carstens

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.