Linux s390 Architecture development
 help / color / mirror / Atom feed
From: Heiko Carstens <hca@linux.ibm.com>
To: Sven Schnelle <svens@linux.ibm.com>
Cc: Richard Cochran <richardcochran@gmail.com>,
	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>,
	Vasily Gorbik <gor@linux.ibm.com>,
	Alexander Gordeev <agordeev@linux.ibm.com>
Subject: Re: [PATCH 2/2] ptp: ptp_s390: Add missing facility check
Date: Tue, 14 Jul 2026 11:39:04 +0200	[thread overview]
Message-ID: <20260714093904.31731Ab0-hca@linux.ibm.com> (raw)
In-Reply-To: <20260714084921.3926697-3-svens@linux.ibm.com>

On Tue, Jul 14, 2026 at 10:49:21AM +0200, Sven Schnelle wrote:
> Only register the physical clock when facility 28 is installed.
> 
> 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 7299c3aae65f..3ea94648cdde 100644
> --- a/drivers/ptp/ptp_s390.c
> +++ b/drivers/ptp/ptp_s390.c
> @@ -108,6 +108,9 @@ static __init int ptp_s390_init(void)
>  	if (IS_ERR(ptp_stcke_clock))
>  		return PTR_ERR(ptp_stcke_clock);
>  
> +	if (!test_facility(28))
> +		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);

Wouldn't it make more sense to check if PTFF-QPT is available via PTFF-QAF
before registering the clock? This would also avoid the need of the first
patch - since then it is guaranteed that PTFF-QPT will always return with
condition code zero.

And... we wouldn't have the potential oddity to have a clock registered which
doesn't work.

      reply	other threads:[~2026-07-14  9:39 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-14  8:49 [PATCH 0/2] Fix two issues in ptp_s390 driver Sven Schnelle
2026-07-14  8:49 ` [PATCH 1/2] ptp: ptp_s390: Add missing CC check for ptff() Sven Schnelle
2026-07-14  8:49 ` [PATCH 2/2] ptp: ptp_s390: Add missing facility check Sven Schnelle
2026-07-14  9:39   ` Heiko Carstens [this message]

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=20260714093904.31731Ab0-hca@linux.ibm.com \
    --to=hca@linux.ibm.com \
    --cc=agordeev@linux.ibm.com \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=gor@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 \
    --cc=svens@linux.ibm.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