All of lore.kernel.org
 help / color / mirror / Atom feed
From: Richard Cochran <richardcochran@gmail.com>
To: Arnd Bergmann <arnd@linaro.org>
Cc: Baolin Wang <baolin.wang@linaro.org>,
	netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
	John Stultz <john.stultz@linaro.com>,
	tglx@linutronix.de
Subject: Re: [PATCH 2/4] ptp/clcok:Introduce the setktime/getktime interfaces with "ktime_t" type
Date: Sat, 21 Mar 2015 17:52:03 +0100	[thread overview]
Message-ID: <20150321165203.GA14320@localhost.localdomain> (raw)
In-Reply-To: <20150321072407.GA4701@netboy>

On Sat, Mar 21, 2015 at 08:24:09AM +0100, Richard Cochran wrote:
> 
> I disagree with the approach presented here.  The problem at hand is
> the 2038 issue.  Let's fix that first, in the easiest way, with the
> least churn, namely by using timespec64 in place of timespec.  Once
> that is done, we can change over to ktime_t, if and when the need
> arises.

Just for laughs, I hacked up the change from timespec to timespec64,
to get an idea of the dimension.  The diffstat:

  drivers/net/ethernet/adi/bfin_mac.c              |    4 ++--
  drivers/net/ethernet/amd/xgbe/xgbe-ptp.c         |    8 ++++----
  drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c |    4 ++--
  drivers/net/ethernet/broadcom/tg3.c              |    6 +++---
  drivers/net/ethernet/freescale/fec_ptp.c         |    4 ++--
  drivers/net/ethernet/freescale/gianfar_ptp.c     |    8 ++++----
  drivers/net/ethernet/intel/e1000e/ptp.c          |   10 +++++-----
  drivers/net/ethernet/intel/fm10k/fm10k_ptp.c     |    8 ++++----
  drivers/net/ethernet/intel/i40e/i40e_ptp.c       |   16 ++++++++++------
  drivers/net/ethernet/intel/igb/igb_ptp.c         |   22 +++++++++++++---------
  drivers/net/ethernet/intel/ixgbe/ixgbe_ptp.c     |    6 +++---
  drivers/net/ethernet/mellanox/mlx4/en_clock.c    |    6 +++---
  drivers/net/ethernet/sfc/ptp.c                   |   18 +++++++++---------
  drivers/net/ethernet/stmicro/stmmac/stmmac_ptp.c |    4 ++--
  drivers/net/ethernet/ti/cpts.c                   |    8 ++++----
  drivers/net/ethernet/tile/tilegx.c               |   11 +++++++----
  drivers/net/phy/dp83640.c                        |    7 ++++---
  drivers/ptp/ptp_chardev.c                        |    6 +++---
  drivers/ptp/ptp_ixp46x.c                         |    4 ++--
  drivers/ptp/ptp_pch.c                            |    4 ++--
  include/linux/ptp_clock_kernel.h                 |    4 ++--
  21 files changed, 90 insertions(+), 78 deletions(-)

compares favorably with Baolin's

  5 files changed, 50 insertions(+), 41 deletions(-)

considering he adapted only two drivers out of nineteen.

This exercise showed me that we really do need to convert the drivers
one by one.  Some of these drivers have 2038 issues at the hardware
level, for example because the register level representation lacks the
needed range.  Fixing the PHC API won't solve those problems.

I want flag these drivers now, so that they can be fixed later on.
Already I had been thinking about how to fix the phyter, which has a
32 seconds counter.  The solution I came up with will also help some
of the other drivers, so it will become part of the core.  However,
for that to work, I really do want to keep the timespec64
representation.

I'll reformat my changes into a proper series, to show what I mean...
 
Thanks,
Richard

  reply	other threads:[~2015-03-21 16:52 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-03-19  5:45 [PATCH 0/4] Introduce another options to set/get time with "ktime_t" type Baolin Wang
2015-03-19  5:45 ` [PATCH 1/4] ptp/chardev:Introduce another option to get/set time in ptp_clock_info structure Baolin Wang
2015-03-19  7:48   ` Richard Cochran
2015-03-19  5:45 ` [PATCH 2/4] ptp/clcok:Introduce the setktime/getktime interfaces with "ktime_t" type Baolin Wang
2015-03-19  7:54   ` Richard Cochran
     [not found]     ` <CAMz4kuKyDFCqd-LfoSKJf+tkXdzzLwtPJdp-nF6NbKU8W5HHpQ@mail.gmail.com>
2015-03-20  6:26       ` Richard Cochran
2015-03-20 13:43         ` Arnd Bergmann
2015-03-20 16:49           ` Richard Cochran
2015-03-21  1:16             ` Arnd Bergmann
2015-03-21  7:24               ` Richard Cochran
2015-03-21 16:52                 ` Richard Cochran [this message]
2015-03-22  2:47                 ` Arnd Bergmann
2015-03-21  9:21             ` Richard Cochran
2015-03-19  5:45 ` [PATCH 3/4] ptp/pch:Replace timespec with ktime_t in ptp_pch.c Baolin Wang
2015-03-19  5:45 ` [PATCH 4/4] ptp/ixp46x:Replace timespec with ktime_t in ptp_ixp46x.c Baolin Wang

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=20150321165203.GA14320@localhost.localdomain \
    --to=richardcochran@gmail.com \
    --cc=arnd@linaro.org \
    --cc=baolin.wang@linaro.org \
    --cc=john.stultz@linaro.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=tglx@linutronix.de \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.