From: Heiko Carstens <hca@linux.ibm.com>
To: Sven Schnelle <svens@linux.ibm.com>
Cc: Vasily Gorbik <gor@linux.ibm.com>,
Alexander Gordeev <agordeev@linux.ibm.com>,
Christian Borntraeger <borntraeger@linux.ibm.com>,
Richard Cochran <richardcochran@gmail.com>,
"Ricardo B. Marliere" <ricardo@marliere.net>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
linux-kernel@vger.kernel.org, linux-s390@vger.kernel.org,
netdev@vger.kernel.org
Subject: Re: [PATCH v2 2/2] s390/time: Add PtP driver
Date: Wed, 16 Oct 2024 20:37:46 +0200 [thread overview]
Message-ID: <20241016183746.25478-A-hca@linux.ibm.com> (raw)
In-Reply-To: <20241016115300.2657771-3-svens@linux.ibm.com>
On Wed, Oct 16, 2024 at 01:53:00PM +0200, Sven Schnelle wrote:
> Add a small PtP driver which allows user space to get
> the values of the physical and tod clock. This allows
> programs like chrony to use STP as clock source and
> steer the kernel clock. The physical clock can be used
> as a debugging aid to get the clock without any additional
> offsets like STP steering or LPAR offset.
>
> Signed-off-by: Sven Schnelle <svens@linux.ibm.com>
> ---
> MAINTAINERS | 6 ++
> arch/s390/include/asm/stp.h | 1 +
> arch/s390/include/asm/timex.h | 6 ++
> arch/s390/kernel/time.c | 6 ++
> drivers/ptp/Kconfig | 11 +++
> drivers/ptp/Makefile | 1 +
> drivers/ptp/ptp_s390.c | 129 ++++++++++++++++++++++++++++++++++
> 7 files changed, 160 insertions(+)
> create mode 100644 drivers/ptp/ptp_s390.c
...
> +static __always_inline unsigned long eitod_to_ns(u128 todval)
> +{
> + return (todval * 125) >> 9;
> +}
This should return u128 so the caller gets a non-truncated return value.
> +static struct timespec64 eitod_to_timespec64(union tod_clock *clk)
> +{
> + return ns_to_timespec64(eitod_to_ns(clk->eitod) - TOD_UNIX_EPOCH);
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Misplaced braces. I guess you want:
return ns_to_timespec64(eitod_to_ns(clk->eitod - TOD_UNIX_EPOCH));
> +static struct ptp_clock_info ptp_s390_stcke_info = {
> + .owner = THIS_MODULE,
> + .name = "IBM s390 STCKE Clock",
Please, as written before make this simply "s390 STCKE Clock".
> +static struct ptp_clock_info ptp_s390_qpt_info = {
> + .owner = THIS_MODULE,
> + .name = "IBM s390 Physical Clock",
"s390 Physical Clock"
> +MODULE_AUTHOR("Sven Schnelle <svens@linux.ibm.com>");
> +MODULE_DESCRIPTION("S390 Physical/STCKE Clock PtP Driver");
"s390 Physical/STCKE Clock PtP Driver"
prev parent reply other threads:[~2024-10-16 18:37 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-10-16 11:52 [PATCH v2 0/2] PtP driver for s390 clocks Sven Schnelle
2024-10-16 11:52 ` [PATCH v2 1/2] s390/time: Add clocksource id to TOD clock Sven Schnelle
2024-10-16 11:53 ` [PATCH v2 2/2] s390/time: Add PtP driver Sven Schnelle
2024-10-16 18:37 ` 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=20241016183746.25478-A-hca@linux.ibm.com \
--to=hca@linux.ibm.com \
--cc=agordeev@linux.ibm.com \
--cc=borntraeger@linux.ibm.com \
--cc=gor@linux.ibm.com \
--cc=gregkh@linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-s390@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=ricardo@marliere.net \
--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