Merge branch 'add-missing-facility-check-to-ptp_s390-driver'

Sven Schnelle says:

====================
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.
====================

Link: https://patch.msgid.link/20260714130342.1971700-1-svens@linux.ibm.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
This commit is contained in:
Jakub Kicinski 2026-07-23 07:02:36 -07:00
commit 4579866a7d
2 changed files with 6 additions and 1 deletions

View File

@ -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;

View File

@ -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);
}