From: Thomas Gleixner <tglx@linutronix.de>
To: Vitaly Kuznetsov <vkuznets@redhat.com>
Cc: Stephen Hemminger <stephen@networkplumber.org>,
devel@linuxdriverproject.org, linux-kernel@vger.kernel.org,
Haiyang Zhang <haiyangz@microsoft.com>,
"K. Y. Srinivasan" <kys@microsoft.com>,
John Stultz <john.stultz@linaro.org>,
Alex Ng <alexng@microsoft.com>, Olaf Hering <olaf@aepfle.de>,
Richard Cochran <richardcochran@gmail.com>
Subject: Re: [PATCH v3 2/2] hv_utils: implement Hyper-V PTP source
Date: Tue, 17 Jan 2017 20:17:43 +0100 (CET) [thread overview]
Message-ID: <alpine.DEB.2.20.1701172016190.3645@nanos> (raw)
In-Reply-To: <87o9z5zk5h.fsf@vitty.brq.redhat.com>
On Tue, 17 Jan 2017, Vitaly Kuznetsov wrote:
> Stephen Hemminger <stephen@networkplumber.org> writes:
> >> static int hv_timesync_init(struct hv_util_service *srv)
> >> {
> >> INIT_WORK(&wrk.work, hv_set_host_time);
> >> +
> >> + hv_ptp_clock = ptp_clock_register(&ptp_hyperv_info, NULL);
> >> + if (IS_ERR_OR_NULL(hv_ptp_clock)) {
> >> + pr_err("cannot register PTP clock: %ld\n",
> >> + PTR_ERR(hv_ptp_clock));
> >
> > Why not return error to init routine in case of failure.
> >
> >> + hv_ptp_clock = NULL;
> >
> > Why not return error to init routine? Rather than having user
> > scan log.
> >
>
> The idea here was to not depend on CONFIG_PTP_1588_CLOCK. In case
> CONFIG_PTP_1588_CLOCK is disabled ptp_clock_register() will return NULL
> but the Hyper-V timesync driver remains functional - it still handles
> the ICTIMESYNCFLAG_SYNC case, just the ptp device will be missing.
> We can:
> 1) Put PTP-related code under #ifdef CONFIG_PTP_1588_CLOCK
> 2) Handle errors and NULL returned from ptp_clock_register() differently,
> fail init in case we get an error and continue in case we see NULL.
> 3) Leave things as they are.
> 4) Always require CONFIG_PTP_1588_CLOCK.
>
> My personal preference would be 2 or 3. What do you think?
Keep the current implementation and add a comment explaining the logic of
keeping the driver functional for the the ICTIMESYNC case.
Thanks,
tglx
next prev parent reply other threads:[~2017-01-17 19:19 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-01-17 15:27 [PATCH v3 0/2] hv_util: adjust system time smoothly Vitaly Kuznetsov
2017-01-17 15:27 ` [PATCH v3 1/2] hv_util: switch to using timespec64 Vitaly Kuznetsov
2017-01-17 17:37 ` Thomas Gleixner
2017-01-17 15:27 ` [PATCH v3 2/2] hv_utils: implement Hyper-V PTP source Vitaly Kuznetsov
2017-01-17 16:35 ` Stephen Hemminger
2017-01-17 17:11 ` Vitaly Kuznetsov
2017-01-17 19:17 ` Thomas Gleixner [this message]
2017-01-17 16:37 ` [PATCH v3 0/2] hv_util: adjust system time smoothly Stephen Hemminger
2017-01-17 17:15 ` Vitaly Kuznetsov
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=alpine.DEB.2.20.1701172016190.3645@nanos \
--to=tglx@linutronix.de \
--cc=alexng@microsoft.com \
--cc=devel@linuxdriverproject.org \
--cc=haiyangz@microsoft.com \
--cc=john.stultz@linaro.org \
--cc=kys@microsoft.com \
--cc=linux-kernel@vger.kernel.org \
--cc=olaf@aepfle.de \
--cc=richardcochran@gmail.com \
--cc=stephen@networkplumber.org \
--cc=vkuznets@redhat.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