Add missing facility check to ptp_s390 driver
Subsystems (5)
Sven Schnelle
maintainerv2 cover Add missing facility check to ptp_s390 driver
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
Sven Schnelle
maintainerPATCH v2 1/2 s390/ptff: Export ptff_function_mask[]
Export the ptff_function_mask to make ptff_query() usable in modules.
--- arch/s390/kernel/time.c | 1 + 1 file changed, 1 insertion(+)
arch/s390/kernel/time.c +1 -0
@@ -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;
Signature · 1 line
2.55.0
Re: [PATCH v2 1/2] s390/ptff: Export ptff_function_mask[]
Quoted 6 lines · Sven Schnelle
Export the
ptff_function_maskto makeptff_query()usable in modules.Signed-off-by Sven Schnelle <[email protected]>--- arch/s390/kernel/time.c | 1 + 1 file changed, 1 insertion(+)
Sven Schnelle
maintainerPATCH v2 2/2 ptp: ptp_s390: Add missing facility check
In reply to Sven SchnelleOnly register the physical clock when facility 28 is installed and PTFF QAF returns that PTFF QPT is available.
--- drivers/ptp/ptp_s390.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)
drivers/ptp/ptp_s390.c +5 -1
@@ -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); }
Signature · 1 line
2.55.0
Re: [PATCH v2 2/2] ptp: ptp_s390: Add missing facility check
Quoted 9 lines · Sven Schnelle
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 <[email protected]>--- drivers/ptp/ptp_s390.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)
This series was applied to netdev/net.git (main) by Jakub Kicinski <[email protected]>:
Hello:
This series was applied to netdev/net.git (main)
by Jakub Kicinski <[email protected]>:
Quoted 6 lines · On Tue, 14 Jul 2026 15:03:40 +0200 you wrote:
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 aEXPORT_SYMBOL()to exportptff_function_mask.
Quoted 6 lines
Changes in v2:
- drop CC check
- add PTFF QAF check
- add patch to exportptff_function_mask[...]
Here is the summary with links:
- [v2,1/2] s390/ptff: Export ptff_function_mask[]
https://git.kernel.org/netdev/net/c/9de445d8296a - [v2,2/2] ptp: ptp_s390: Add missing facility check https://git.kernel.org/netdev/net/c/e78f1ac37afc
You are awesome, thank you!
Signature · 2 lines
Deet-doot-dot, I am a bot. https://korg.docs.kernel.org/patchwork/pwbot.html