LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
* [PATCH net-next V3 00/23] ptp: get ready for 2038
@ 2015-03-29 21:11 Richard Cochran
  2015-03-29 21:11 ` [PATCH net-next V3 01/23] ptp: introduce get/set time methods with explicit 64 bit seconds Richard Cochran
                   ` (23 more replies)
  0 siblings, 24 replies; 35+ messages in thread
From: Richard Cochran @ 2015-03-29 21:11 UTC (permalink / raw)
  To: netdev
  Cc: linux-kernel, Amir Vadai, Ariel Elior, Arnd Bergmann,
	Baolin Wang, Ben Hutchings, Bruce Allan, Carolyn Wyborny,
	Chris Metcalf, David Miller, Frank Li, Giuseppe Cavallaro,
	Jacob Keller, Jeff Kirsher, John Stultz, Luwei Zhou,
	Matthew Vick, Michael Chan, Prashant Sreedharan, Rayagond K,
	Shradha Shah, Solarflare linux maintainers, Sonic Zhang,
	Stefan Sørensen, Thomas Gleixner, Tom Lendacky

This series converts the core driver methods of the PTP Hardware Clock
(PHC) subsystem to use the 64 bit version of the timespec structure,
making the core API ready for the year 2038.

In addition, I reviewed how each driver and device represents the time
value at the hardware register level.  Most of the drivers are ready,
but a few will need some work before the year 2038, as shown:

   Patch   Driver
   ------------------------------------------------
   12      drivers/net/ethernet/intel/igb/igb_ptp.c
   15 ?    drivers/net/ethernet/sfc/ptp.c
   16      drivers/net/ethernet/stmicro/stmmac/stmmac_ptp.c

The commit log messages document how each driver is ready or why it is
not ready.  For patch 15, I could not easily find out the hardware
representation of the time value, and so the SFC maintainers will have
to review their low level code in order to resolve any remaining
issues.

Thanks,
Richard

* ChangeLog
** V3
   - dp83640: use timespec64 throughout per Arnd's suggestion
   - tilegx: use timespec64 throughout per Chris' suggestion
   - add Jeff's acked-bys
** V2
   - use the new methods in the posix clock code right away (patch #3)

Richard Cochran (23):
  ptp: introduce get/set time methods with explicit 64 bit seconds.
  ptp: use the 64 bit gettime method for the SYS_OFFSET ioctl.
  ptp: use the 64 bit get/set time methods for the posix clock.
  ptp: blackfin: convert to the 64 bit get/set time methods.
  ptp: xgbe: convert to the 64 bit get/set time methods.
  ptp: bnx2x: convert to the 64 bit get/set time methods.
  ptp: tg3: convert to the 64 bit get/set time methods.
  ptp: fec: convert to the 64 bit get/set time methods.
  ptp: gianfar: convert to the 64 bit get/set time methods.
  ptp: e1000e: convert to the 64 bit get/set time methods.
  ptp: fm10k: convert to the 64 bit get/set time methods.
  ptp: i40e: convert to the 64 bit get/set time methods.
  ptp: igb: convert to the 64 bit get/set time methods.
  ptp: ixgbe: convert to the 64 bit get/set time methods.
  ptp: mlx4: convert to the 64 bit get/set time methods.
  ptp: sfc: convert to the 64 bit get/set time methods.
  ptp: stmmac: convert to the 64 bit get/set time methods.
  ptp: cpts: convert to the 64 bit get/set time methods.
  ptp: tilegx: convert to the 64 bit get/set time methods.
  ptp: dp83640: convert to the 64 bit get/set time methods.
  ptp: ixp46x: convert to the 64 bit get/set time methods.
  ptp: pch: convert to the 64 bit get/set time methods.
  ptp: remove 32 bit get/set methods.

 arch/tile/gxio/mpipe.c                           |    4 +--
 arch/tile/include/gxio/mpipe.h                   |    4 +--
 drivers/net/ethernet/adi/bfin_mac.c              |    8 ++---
 drivers/net/ethernet/amd/xgbe/xgbe-ptp.c         |   13 +++----
 drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c |    8 ++---
 drivers/net/ethernet/broadcom/tg3.c              |   10 +++---
 drivers/net/ethernet/freescale/fec_ptp.c         |    8 ++---
 drivers/net/ethernet/freescale/gianfar_ptp.c     |   13 +++----
 drivers/net/ethernet/intel/e1000e/ptp.c          |   16 ++++-----
 drivers/net/ethernet/intel/fm10k/fm10k_ptp.c     |   12 +++----
 drivers/net/ethernet/intel/i40e/i40e_ptp.c       |   26 +++++++-------
 drivers/net/ethernet/intel/igb/igb_ptp.c         |   41 +++++++++++-----------
 drivers/net/ethernet/intel/ixgbe/ixgbe_ptp.c     |   14 ++++----
 drivers/net/ethernet/mellanox/mlx4/en_clock.c    |   11 +++---
 drivers/net/ethernet/sfc/ptp.c                   |   22 ++++++------
 drivers/net/ethernet/stmicro/stmmac/stmmac_ptp.c |    8 ++---
 drivers/net/ethernet/ti/cpts.c                   |   12 +++----
 drivers/net/ethernet/tile/tilegx.c               |    9 ++---
 drivers/net/phy/dp83640.c                        |   19 +++++-----
 drivers/ptp/ptp_chardev.c                        |    8 ++---
 drivers/ptp/ptp_clock.c                          |   12 +++++--
 drivers/ptp/ptp_ixp46x.c                         |    8 ++---
 drivers/ptp/ptp_pch.c                            |    8 ++---
 include/linux/ptp_clock_kernel.h                 |   12 +++----
 24 files changed, 160 insertions(+), 146 deletions(-)

-- 
1.7.10.4


^ permalink raw reply	[flat|nested] 35+ messages in thread

* [PATCH net-next V3 01/23] ptp: introduce get/set time methods with explicit 64 bit seconds.
  2015-03-29 21:11 [PATCH net-next V3 00/23] ptp: get ready for 2038 Richard Cochran
@ 2015-03-29 21:11 ` Richard Cochran
  2015-03-29 21:11 ` [PATCH net-next V3 02/23] ptp: use the 64 bit gettime method for the SYS_OFFSET ioctl Richard Cochran
                   ` (22 subsequent siblings)
  23 siblings, 0 replies; 35+ messages in thread
From: Richard Cochran @ 2015-03-29 21:11 UTC (permalink / raw)
  To: netdev
  Cc: linux-kernel, Amir Vadai, Ariel Elior, Arnd Bergmann,
	Baolin Wang, Ben Hutchings, Bruce Allan, Carolyn Wyborny,
	Chris Metcalf, David Miller, Frank Li, Giuseppe Cavallaro,
	Jacob Keller, Jeff Kirsher, John Stultz, Luwei Zhou,
	Matthew Vick, Michael Chan, Prashant Sreedharan, Rayagond K,
	Shradha Shah, Solarflare linux maintainers, Sonic Zhang,
	Stefan Sørensen, Thomas Gleixner, Tom Lendacky

Converting the PHC drivers over to the new methods is one step along the
way to making them ready for 2038.  Once all the drivers are up to date,
then the old methods will be removed.

Signed-off-by: Richard Cochran <richardcochran@gmail.com>
---
 include/linux/ptp_clock_kernel.h |   12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)

diff --git a/include/linux/ptp_clock_kernel.h b/include/linux/ptp_clock_kernel.h
index 0d8ff3f..7d6f8e6 100644
--- a/include/linux/ptp_clock_kernel.h
+++ b/include/linux/ptp_clock_kernel.h
@@ -64,12 +64,18 @@ struct ptp_clock_request {
  * @adjtime:  Shifts the time of the hardware clock.
  *            parameter delta: Desired change in nanoseconds.
  *
- * @gettime:  Reads the current time from the hardware clock.
+ * @gettime:  Reads the current time from the hardware clock. (deprecated)
  *            parameter ts: Holds the result.
  *
- * @settime:  Set the current time on the hardware clock.
+ * @settime:  Set the current time on the hardware clock. (deprecated)
  *            parameter ts: Time value to set.
  *
+ * @gettime64:  Reads the current time from the hardware clock.
+ *              parameter ts: Holds the result.
+ *
+ * @settime64:  Set the current time on the hardware clock.
+ *              parameter ts: Time value to set.
+ *
  * @enable:   Request driver to enable or disable an ancillary feature.
  *            parameter request: Desired resource to enable or disable.
  *            parameter on: Caller passes one to enable or zero to disable.
@@ -106,6 +112,8 @@ struct ptp_clock_info {
 	int (*adjtime)(struct ptp_clock_info *ptp, s64 delta);
 	int (*gettime)(struct ptp_clock_info *ptp, struct timespec *ts);
 	int (*settime)(struct ptp_clock_info *ptp, const struct timespec *ts);
+	int (*gettime64)(struct ptp_clock_info *ptp, struct timespec64 *ts);
+	int (*settime64)(struct ptp_clock_info *p, const struct timespec64 *ts);
 	int (*enable)(struct ptp_clock_info *ptp,
 		      struct ptp_clock_request *request, int on);
 	int (*verify)(struct ptp_clock_info *ptp, unsigned int pin,
-- 
1.7.10.4


^ permalink raw reply	[flat|nested] 35+ messages in thread

* [PATCH net-next V3 02/23] ptp: use the 64 bit gettime method for the SYS_OFFSET ioctl.
  2015-03-29 21:11 [PATCH net-next V3 00/23] ptp: get ready for 2038 Richard Cochran
  2015-03-29 21:11 ` [PATCH net-next V3 01/23] ptp: introduce get/set time methods with explicit 64 bit seconds Richard Cochran
@ 2015-03-29 21:11 ` Richard Cochran
  2015-03-29 21:11 ` [PATCH net-next V3 03/23] ptp: use the 64 bit get/set time methods for the posix clock Richard Cochran
                   ` (21 subsequent siblings)
  23 siblings, 0 replies; 35+ messages in thread
From: Richard Cochran @ 2015-03-29 21:11 UTC (permalink / raw)
  To: netdev
  Cc: linux-kernel, Amir Vadai, Ariel Elior, Arnd Bergmann,
	Baolin Wang, Ben Hutchings, Bruce Allan, Carolyn Wyborny,
	Chris Metcalf, David Miller, Frank Li, Giuseppe Cavallaro,
	Jacob Keller, Jeff Kirsher, John Stultz, Luwei Zhou,
	Matthew Vick, Michael Chan, Prashant Sreedharan, Rayagond K,
	Shradha Shah, Solarflare linux maintainers, Sonic Zhang,
	Stefan Sørensen, Thomas Gleixner, Tom Lendacky

This patch changes the code to use the new method whenever implemented by
the PHC driver.

Signed-off-by: Richard Cochran <richardcochran@gmail.com>
---
 drivers/ptp/ptp_chardev.c |   14 ++++++++++----
 1 file changed, 10 insertions(+), 4 deletions(-)

diff --git a/drivers/ptp/ptp_chardev.c b/drivers/ptp/ptp_chardev.c
index f8a7609..95bcf15 100644
--- a/drivers/ptp/ptp_chardev.c
+++ b/drivers/ptp/ptp_chardev.c
@@ -124,7 +124,8 @@ long ptp_ioctl(struct posix_clock *pc, unsigned int cmd, unsigned long arg)
 	struct ptp_clock *ptp = container_of(pc, struct ptp_clock, clock);
 	struct ptp_clock_info *ops = ptp->info;
 	struct ptp_clock_time *pct;
-	struct timespec ts;
+	struct timespec64 ts;
+	struct timespec t2;
 	int enable, err = 0;
 	unsigned int i, pin_index;
 
@@ -197,16 +198,21 @@ long ptp_ioctl(struct posix_clock *pc, unsigned int cmd, unsigned long arg)
 		}
 		pct = &sysoff->ts[0];
 		for (i = 0; i < sysoff->n_samples; i++) {
-			getnstimeofday(&ts);
+			getnstimeofday64(&ts);
 			pct->sec = ts.tv_sec;
 			pct->nsec = ts.tv_nsec;
 			pct++;
-			ptp->info->gettime(ptp->info, &ts);
+			if (ptp->info->gettime64) {
+				ptp->info->gettime64(ptp->info, &ts);
+			} else {
+				ptp->info->gettime(ptp->info, &t2);
+				ts = timespec_to_timespec64(t2);
+			}
 			pct->sec = ts.tv_sec;
 			pct->nsec = ts.tv_nsec;
 			pct++;
 		}
-		getnstimeofday(&ts);
+		getnstimeofday64(&ts);
 		pct->sec = ts.tv_sec;
 		pct->nsec = ts.tv_nsec;
 		if (copy_to_user((void __user *)arg, sysoff, sizeof(*sysoff)))
-- 
1.7.10.4


^ permalink raw reply	[flat|nested] 35+ messages in thread

* [PATCH net-next V3 03/23] ptp: use the 64 bit get/set time methods for the posix clock.
  2015-03-29 21:11 [PATCH net-next V3 00/23] ptp: get ready for 2038 Richard Cochran
  2015-03-29 21:11 ` [PATCH net-next V3 01/23] ptp: introduce get/set time methods with explicit 64 bit seconds Richard Cochran
  2015-03-29 21:11 ` [PATCH net-next V3 02/23] ptp: use the 64 bit gettime method for the SYS_OFFSET ioctl Richard Cochran
@ 2015-03-29 21:11 ` Richard Cochran
  2015-03-29 21:11 ` [PATCH net-next V3 04/23] ptp: blackfin: convert to the 64 bit get/set time methods Richard Cochran
                   ` (20 subsequent siblings)
  23 siblings, 0 replies; 35+ messages in thread
From: Richard Cochran @ 2015-03-29 21:11 UTC (permalink / raw)
  To: netdev
  Cc: linux-kernel, Amir Vadai, Ariel Elior, Arnd Bergmann,
	Baolin Wang, Ben Hutchings, Bruce Allan, Carolyn Wyborny,
	Chris Metcalf, David Miller, Frank Li, Giuseppe Cavallaro,
	Jacob Keller, Jeff Kirsher, John Stultz, Luwei Zhou,
	Matthew Vick, Michael Chan, Prashant Sreedharan, Rayagond K,
	Shradha Shah, Solarflare linux maintainers, Sonic Zhang,
	Stefan Sørensen, Thomas Gleixner, Tom Lendacky

This patch changes the posix clock code to prefer the new methods
whenever they are implemented by the PHC drivers.

Signed-off-by: Richard Cochran <richardcochran@gmail.com>
---
 drivers/ptp/ptp_clock.c |   19 +++++++++++++++++--
 1 file changed, 17 insertions(+), 2 deletions(-)

diff --git a/drivers/ptp/ptp_clock.c b/drivers/ptp/ptp_clock.c
index 296b0ec..df50d5e 100644
--- a/drivers/ptp/ptp_clock.c
+++ b/drivers/ptp/ptp_clock.c
@@ -107,13 +107,28 @@ static int ptp_clock_getres(struct posix_clock *pc, struct timespec *tp)
 static int ptp_clock_settime(struct posix_clock *pc, const struct timespec *tp)
 {
 	struct ptp_clock *ptp = container_of(pc, struct ptp_clock, clock);
-	return ptp->info->settime(ptp->info, tp);
+	struct timespec64 ts = timespec_to_timespec64(*tp);
+
+	return  ptp->info->settime64 ?
+		ptp->info->settime64(ptp->info, &ts) :
+		ptp->info->settime(ptp->info, tp);
 }
 
 static int ptp_clock_gettime(struct posix_clock *pc, struct timespec *tp)
 {
 	struct ptp_clock *ptp = container_of(pc, struct ptp_clock, clock);
-	return ptp->info->gettime(ptp->info, tp);
+	struct timespec64 ts;
+	int err;
+
+	if (ptp->info->gettime64) {
+		err = ptp->info->gettime64(ptp->info, &ts);
+		if (!err)
+			*tp = timespec64_to_timespec(ts);
+	} else {
+		err = ptp->info->gettime(ptp->info, tp);
+	}
+
+	return err;
 }
 
 static int ptp_clock_adjtime(struct posix_clock *pc, struct timex *tx)
-- 
1.7.10.4


^ permalink raw reply	[flat|nested] 35+ messages in thread

* [PATCH net-next V3 04/23] ptp: blackfin: convert to the 64 bit get/set time methods.
  2015-03-29 21:11 [PATCH net-next V3 00/23] ptp: get ready for 2038 Richard Cochran
                   ` (2 preceding siblings ...)
  2015-03-29 21:11 ` [PATCH net-next V3 03/23] ptp: use the 64 bit get/set time methods for the posix clock Richard Cochran
@ 2015-03-29 21:11 ` Richard Cochran
  2015-03-29 21:11 ` [PATCH net-next V3 05/23] ptp: xgbe: " Richard Cochran
                   ` (19 subsequent siblings)
  23 siblings, 0 replies; 35+ messages in thread
From: Richard Cochran @ 2015-03-29 21:11 UTC (permalink / raw)
  To: netdev
  Cc: linux-kernel, Amir Vadai, Ariel Elior, Arnd Bergmann,
	Baolin Wang, Ben Hutchings, Bruce Allan, Carolyn Wyborny,
	Chris Metcalf, David Miller, Frank Li, Giuseppe Cavallaro,
	Jacob Keller, Jeff Kirsher, John Stultz, Luwei Zhou,
	Matthew Vick, Michael Chan, Prashant Sreedharan, Rayagond K,
	Shradha Shah, Solarflare linux maintainers, Sonic Zhang,
	Stefan Sørensen, Thomas Gleixner, Tom Lendacky

The device uses 64 bit nanoseconds register, and so with this patch the
driver is ready for the year 2038.

Signed-off-by: Richard Cochran <richardcochran@gmail.com>
---
 drivers/net/ethernet/adi/bfin_mac.c |    8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/net/ethernet/adi/bfin_mac.c b/drivers/net/ethernet/adi/bfin_mac.c
index ec20611..0c37aef 100644
--- a/drivers/net/ethernet/adi/bfin_mac.c
+++ b/drivers/net/ethernet/adi/bfin_mac.c
@@ -983,7 +983,7 @@ static int bfin_ptp_adjtime(struct ptp_clock_info *ptp, s64 delta)
 	return 0;
 }
 
-static int bfin_ptp_gettime(struct ptp_clock_info *ptp, struct timespec *ts)
+static int bfin_ptp_gettime(struct ptp_clock_info *ptp, struct timespec64 *ts)
 {
 	u64 ns;
 	u32 remainder;
@@ -1003,7 +1003,7 @@ static int bfin_ptp_gettime(struct ptp_clock_info *ptp, struct timespec *ts)
 }
 
 static int bfin_ptp_settime(struct ptp_clock_info *ptp,
-			   const struct timespec *ts)
+			   const struct timespec64 *ts)
 {
 	u64 ns;
 	unsigned long flags;
@@ -1039,8 +1039,8 @@ static struct ptp_clock_info bfin_ptp_caps = {
 	.pps		= 0,
 	.adjfreq	= bfin_ptp_adjfreq,
 	.adjtime	= bfin_ptp_adjtime,
-	.gettime	= bfin_ptp_gettime,
-	.settime	= bfin_ptp_settime,
+	.gettime64	= bfin_ptp_gettime,
+	.settime64	= bfin_ptp_settime,
 	.enable		= bfin_ptp_enable,
 };
 
-- 
1.7.10.4


^ permalink raw reply	[flat|nested] 35+ messages in thread

* [PATCH net-next V3 05/23] ptp: xgbe: convert to the 64 bit get/set time methods.
  2015-03-29 21:11 [PATCH net-next V3 00/23] ptp: get ready for 2038 Richard Cochran
                   ` (3 preceding siblings ...)
  2015-03-29 21:11 ` [PATCH net-next V3 04/23] ptp: blackfin: convert to the 64 bit get/set time methods Richard Cochran
@ 2015-03-29 21:11 ` Richard Cochran
  2015-03-29 21:11 ` [PATCH net-next V3 06/23] ptp: bnx2x: " Richard Cochran
                   ` (18 subsequent siblings)
  23 siblings, 0 replies; 35+ messages in thread
From: Richard Cochran @ 2015-03-29 21:11 UTC (permalink / raw)
  To: netdev
  Cc: linux-kernel, Amir Vadai, Ariel Elior, Arnd Bergmann,
	Baolin Wang, Ben Hutchings, Bruce Allan, Carolyn Wyborny,
	Chris Metcalf, David Miller, Frank Li, Giuseppe Cavallaro,
	Jacob Keller, Jeff Kirsher, John Stultz, Luwei Zhou,
	Matthew Vick, Michael Chan, Prashant Sreedharan, Rayagond K,
	Shradha Shah, Solarflare linux maintainers, Sonic Zhang,
	Stefan Sørensen, Thomas Gleixner, Tom Lendacky

This driver's clock is implemented using a timecounter, and so with
this patch the driver is ready for the year 2038.

Compile tested only.

Signed-off-by: Richard Cochran <richardcochran@gmail.com>
---
 drivers/net/ethernet/amd/xgbe/xgbe-ptp.c |   13 +++++++------
 1 file changed, 7 insertions(+), 6 deletions(-)

diff --git a/drivers/net/ethernet/amd/xgbe/xgbe-ptp.c b/drivers/net/ethernet/amd/xgbe/xgbe-ptp.c
index f326178..b03e4f5 100644
--- a/drivers/net/ethernet/amd/xgbe/xgbe-ptp.c
+++ b/drivers/net/ethernet/amd/xgbe/xgbe-ptp.c
@@ -179,7 +179,7 @@ static int xgbe_adjtime(struct ptp_clock_info *info, s64 delta)
 	return 0;
 }
 
-static int xgbe_gettime(struct ptp_clock_info *info, struct timespec *ts)
+static int xgbe_gettime(struct ptp_clock_info *info, struct timespec64 *ts)
 {
 	struct xgbe_prv_data *pdata = container_of(info,
 						   struct xgbe_prv_data,
@@ -193,12 +193,13 @@ static int xgbe_gettime(struct ptp_clock_info *info, struct timespec *ts)
 
 	spin_unlock_irqrestore(&pdata->tstamp_lock, flags);
 
-	*ts = ns_to_timespec(nsec);
+	*ts = ns_to_timespec64(nsec);
 
 	return 0;
 }
 
-static int xgbe_settime(struct ptp_clock_info *info, const struct timespec *ts)
+static int xgbe_settime(struct ptp_clock_info *info,
+			const struct timespec64 *ts)
 {
 	struct xgbe_prv_data *pdata = container_of(info,
 						   struct xgbe_prv_data,
@@ -206,7 +207,7 @@ static int xgbe_settime(struct ptp_clock_info *info, const struct timespec *ts)
 	unsigned long flags;
 	u64 nsec;
 
-	nsec = timespec_to_ns(ts);
+	nsec = timespec64_to_ns(ts);
 
 	spin_lock_irqsave(&pdata->tstamp_lock, flags);
 
@@ -236,8 +237,8 @@ void xgbe_ptp_register(struct xgbe_prv_data *pdata)
 	info->max_adj = pdata->ptpclk_rate;
 	info->adjfreq = xgbe_adjfreq;
 	info->adjtime = xgbe_adjtime;
-	info->gettime = xgbe_gettime;
-	info->settime = xgbe_settime;
+	info->gettime64 = xgbe_gettime;
+	info->settime64 = xgbe_settime;
 	info->enable = xgbe_enable;
 
 	clock = ptp_clock_register(info, pdata->dev);
-- 
1.7.10.4


^ permalink raw reply	[flat|nested] 35+ messages in thread

* [PATCH net-next V3 06/23] ptp: bnx2x: convert to the 64 bit get/set time methods.
  2015-03-29 21:11 [PATCH net-next V3 00/23] ptp: get ready for 2038 Richard Cochran
                   ` (4 preceding siblings ...)
  2015-03-29 21:11 ` [PATCH net-next V3 05/23] ptp: xgbe: " Richard Cochran
@ 2015-03-29 21:11 ` Richard Cochran
  2015-03-30 21:13   ` Sony Chacko
  2015-03-29 21:11 ` [PATCH net-next V3 07/23] ptp: tg3: " Richard Cochran
                   ` (17 subsequent siblings)
  23 siblings, 1 reply; 35+ messages in thread
From: Richard Cochran @ 2015-03-29 21:11 UTC (permalink / raw)
  To: netdev
  Cc: linux-kernel, Amir Vadai, Ariel Elior, Arnd Bergmann,
	Baolin Wang, Ben Hutchings, Bruce Allan, Carolyn Wyborny,
	Chris Metcalf, David Miller, Frank Li, Giuseppe Cavallaro,
	Jacob Keller, Jeff Kirsher, John Stultz, Luwei Zhou,
	Matthew Vick, Michael Chan, Prashant Sreedharan, Rayagond K,
	Shradha Shah, Solarflare linux maintainers, Sonic Zhang,
	Stefan Sørensen, Thomas Gleixner, Tom Lendacky

This driver's clock is implemented using a timecounter, and so with
this patch the driver is ready for the year 2038.

Compile tested only.

Signed-off-by: Richard Cochran <richardcochran@gmail.com>
---
 drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c |    8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c
index 9677431..765667c 100644
--- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c
+++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c
@@ -13278,7 +13278,7 @@ static int bnx2x_ptp_adjtime(struct ptp_clock_info *ptp, s64 delta)
 	return 0;
 }
 
-static int bnx2x_ptp_gettime(struct ptp_clock_info *ptp, struct timespec *ts)
+static int bnx2x_ptp_gettime(struct ptp_clock_info *ptp, struct timespec64 *ts)
 {
 	struct bnx2x *bp = container_of(ptp, struct bnx2x, ptp_clock_info);
 	u64 ns;
@@ -13295,7 +13295,7 @@ static int bnx2x_ptp_gettime(struct ptp_clock_info *ptp, struct timespec *ts)
 }
 
 static int bnx2x_ptp_settime(struct ptp_clock_info *ptp,
-			     const struct timespec *ts)
+			     const struct timespec64 *ts)
 {
 	struct bnx2x *bp = container_of(ptp, struct bnx2x, ptp_clock_info);
 	u64 ns;
@@ -13333,8 +13333,8 @@ static void bnx2x_register_phc(struct bnx2x *bp)
 	bp->ptp_clock_info.pps = 0;
 	bp->ptp_clock_info.adjfreq = bnx2x_ptp_adjfreq;
 	bp->ptp_clock_info.adjtime = bnx2x_ptp_adjtime;
-	bp->ptp_clock_info.gettime = bnx2x_ptp_gettime;
-	bp->ptp_clock_info.settime = bnx2x_ptp_settime;
+	bp->ptp_clock_info.gettime64 = bnx2x_ptp_gettime;
+	bp->ptp_clock_info.settime64 = bnx2x_ptp_settime;
 	bp->ptp_clock_info.enable = bnx2x_ptp_enable;
 
 	bp->ptp_clock = ptp_clock_register(&bp->ptp_clock_info, &bp->pdev->dev);
-- 
1.7.10.4


^ permalink raw reply	[flat|nested] 35+ messages in thread

* [PATCH net-next V3 07/23] ptp: tg3: convert to the 64 bit get/set time methods.
  2015-03-29 21:11 [PATCH net-next V3 00/23] ptp: get ready for 2038 Richard Cochran
                   ` (5 preceding siblings ...)
  2015-03-29 21:11 ` [PATCH net-next V3 06/23] ptp: bnx2x: " Richard Cochran
@ 2015-03-29 21:11 ` Richard Cochran
  2015-03-29 21:11 ` [PATCH net-next V3 08/23] ptp: fec: " Richard Cochran
                   ` (16 subsequent siblings)
  23 siblings, 0 replies; 35+ messages in thread
From: Richard Cochran @ 2015-03-29 21:11 UTC (permalink / raw)
  To: netdev
  Cc: linux-kernel, Amir Vadai, Ariel Elior, Arnd Bergmann,
	Baolin Wang, Ben Hutchings, Bruce Allan, Carolyn Wyborny,
	Chris Metcalf, David Miller, Frank Li, Giuseppe Cavallaro,
	Jacob Keller, Jeff Kirsher, John Stultz, Luwei Zhou,
	Matthew Vick, Michael Chan, Prashant Sreedharan, Rayagond K,
	Shradha Shah, Solarflare linux maintainers, Sonic Zhang,
	Stefan Sørensen, Thomas Gleixner, Tom Lendacky

The device appears to use a 64 bit nanoseconds register, and so with
this patch the driver should be ready for the year 2038.

Compile tested only.

Signed-off-by: Richard Cochran <richardcochran@gmail.com>
---
 drivers/net/ethernet/broadcom/tg3.c |   10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/net/ethernet/broadcom/tg3.c b/drivers/net/ethernet/broadcom/tg3.c
index 22b33da..d02d19b 100644
--- a/drivers/net/ethernet/broadcom/tg3.c
+++ b/drivers/net/ethernet/broadcom/tg3.c
@@ -6217,7 +6217,7 @@ static int tg3_ptp_adjtime(struct ptp_clock_info *ptp, s64 delta)
 	return 0;
 }
 
-static int tg3_ptp_gettime(struct ptp_clock_info *ptp, struct timespec *ts)
+static int tg3_ptp_gettime(struct ptp_clock_info *ptp, struct timespec64 *ts)
 {
 	u64 ns;
 	u32 remainder;
@@ -6235,12 +6235,12 @@ static int tg3_ptp_gettime(struct ptp_clock_info *ptp, struct timespec *ts)
 }
 
 static int tg3_ptp_settime(struct ptp_clock_info *ptp,
-			   const struct timespec *ts)
+			   const struct timespec64 *ts)
 {
 	u64 ns;
 	struct tg3 *tp = container_of(ptp, struct tg3, ptp_info);
 
-	ns = timespec_to_ns(ts);
+	ns = timespec64_to_ns(ts);
 
 	tg3_full_lock(tp, 0);
 	tg3_refclk_write(tp, ns);
@@ -6320,8 +6320,8 @@ static const struct ptp_clock_info tg3_ptp_caps = {
 	.pps		= 0,
 	.adjfreq	= tg3_ptp_adjfreq,
 	.adjtime	= tg3_ptp_adjtime,
-	.gettime	= tg3_ptp_gettime,
-	.settime	= tg3_ptp_settime,
+	.gettime64	= tg3_ptp_gettime,
+	.settime64	= tg3_ptp_settime,
 	.enable		= tg3_ptp_enable,
 };
 
-- 
1.7.10.4


^ permalink raw reply	[flat|nested] 35+ messages in thread

* [PATCH net-next V3 08/23] ptp: fec: convert to the 64 bit get/set time methods.
  2015-03-29 21:11 [PATCH net-next V3 00/23] ptp: get ready for 2038 Richard Cochran
                   ` (6 preceding siblings ...)
  2015-03-29 21:11 ` [PATCH net-next V3 07/23] ptp: tg3: " Richard Cochran
@ 2015-03-29 21:11 ` Richard Cochran
  2015-03-29 21:11 ` [PATCH net-next V3 09/23] ptp: gianfar: " Richard Cochran
                   ` (15 subsequent siblings)
  23 siblings, 0 replies; 35+ messages in thread
From: Richard Cochran @ 2015-03-29 21:11 UTC (permalink / raw)
  To: netdev
  Cc: linux-kernel, Amir Vadai, Ariel Elior, Arnd Bergmann,
	Baolin Wang, Ben Hutchings, Bruce Allan, Carolyn Wyborny,
	Chris Metcalf, David Miller, Frank Li, Giuseppe Cavallaro,
	Jacob Keller, Jeff Kirsher, John Stultz, Luwei Zhou,
	Matthew Vick, Michael Chan, Prashant Sreedharan, Rayagond K,
	Shradha Shah, Solarflare linux maintainers, Sonic Zhang,
	Stefan Sørensen, Thomas Gleixner, Tom Lendacky

This driver's clock is implemented using a timecounter, and so with
this patch the driver is ready for the year 2038.

Compile tested only.

Signed-off-by: Richard Cochran <richardcochran@gmail.com>
---
 drivers/net/ethernet/freescale/fec_ptp.c |    8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/net/ethernet/freescale/fec_ptp.c b/drivers/net/ethernet/freescale/fec_ptp.c
index 4585895..b833993 100644
--- a/drivers/net/ethernet/freescale/fec_ptp.c
+++ b/drivers/net/ethernet/freescale/fec_ptp.c
@@ -390,7 +390,7 @@ static int fec_ptp_adjtime(struct ptp_clock_info *ptp, s64 delta)
  * read the timecounter and return the correct value on ns,
  * after converting it into a struct timespec.
  */
-static int fec_ptp_gettime(struct ptp_clock_info *ptp, struct timespec *ts)
+static int fec_ptp_gettime(struct ptp_clock_info *ptp, struct timespec64 *ts)
 {
 	struct fec_enet_private *adapter =
 	    container_of(ptp, struct fec_enet_private, ptp_caps);
@@ -417,7 +417,7 @@ static int fec_ptp_gettime(struct ptp_clock_info *ptp, struct timespec *ts)
  * wall timer value.
  */
 static int fec_ptp_settime(struct ptp_clock_info *ptp,
-			   const struct timespec *ts)
+			   const struct timespec64 *ts)
 {
 	struct fec_enet_private *fep =
 	    container_of(ptp, struct fec_enet_private, ptp_caps);
@@ -584,8 +584,8 @@ void fec_ptp_init(struct platform_device *pdev)
 	fep->ptp_caps.pps = 1;
 	fep->ptp_caps.adjfreq = fec_ptp_adjfreq;
 	fep->ptp_caps.adjtime = fec_ptp_adjtime;
-	fep->ptp_caps.gettime = fec_ptp_gettime;
-	fep->ptp_caps.settime = fec_ptp_settime;
+	fep->ptp_caps.gettime64 = fec_ptp_gettime;
+	fep->ptp_caps.settime64 = fec_ptp_settime;
 	fep->ptp_caps.enable = fec_ptp_enable;
 
 	fep->cycle_speed = clk_get_rate(fep->clk_ptp);
-- 
1.7.10.4


^ permalink raw reply	[flat|nested] 35+ messages in thread

* [PATCH net-next V3 09/23] ptp: gianfar: convert to the 64 bit get/set time methods.
  2015-03-29 21:11 [PATCH net-next V3 00/23] ptp: get ready for 2038 Richard Cochran
                   ` (7 preceding siblings ...)
  2015-03-29 21:11 ` [PATCH net-next V3 08/23] ptp: fec: " Richard Cochran
@ 2015-03-29 21:11 ` Richard Cochran
  2015-03-29 21:12 ` [PATCH net-next V3 10/23] ptp: e1000e: " Richard Cochran
                   ` (14 subsequent siblings)
  23 siblings, 0 replies; 35+ messages in thread
From: Richard Cochran @ 2015-03-29 21:11 UTC (permalink / raw)
  To: netdev
  Cc: linux-kernel, Amir Vadai, Ariel Elior, Arnd Bergmann,
	Baolin Wang, Ben Hutchings, Bruce Allan, Carolyn Wyborny,
	Chris Metcalf, David Miller, Frank Li, Giuseppe Cavallaro,
	Jacob Keller, Jeff Kirsher, John Stultz, Luwei Zhou,
	Matthew Vick, Michael Chan, Prashant Sreedharan, Rayagond K,
	Shradha Shah, Solarflare linux maintainers, Sonic Zhang,
	Stefan Sørensen, Thomas Gleixner, Tom Lendacky

The device features a 64 bit nanoseconds register, and so with this
patch the driver is ready for the year 2038.

Signed-off-by: Richard Cochran <richardcochran@gmail.com>
---
 drivers/net/ethernet/freescale/gianfar_ptp.c |   13 +++++++------
 1 file changed, 7 insertions(+), 6 deletions(-)

diff --git a/drivers/net/ethernet/freescale/gianfar_ptp.c b/drivers/net/ethernet/freescale/gianfar_ptp.c
index 77353366..04265a7 100644
--- a/drivers/net/ethernet/freescale/gianfar_ptp.c
+++ b/drivers/net/ethernet/freescale/gianfar_ptp.c
@@ -322,7 +322,8 @@ static int ptp_gianfar_adjtime(struct ptp_clock_info *ptp, s64 delta)
 	return 0;
 }
 
-static int ptp_gianfar_gettime(struct ptp_clock_info *ptp, struct timespec *ts)
+static int ptp_gianfar_gettime(struct ptp_clock_info *ptp,
+			       struct timespec64 *ts)
 {
 	u64 ns;
 	u32 remainder;
@@ -341,7 +342,7 @@ static int ptp_gianfar_gettime(struct ptp_clock_info *ptp, struct timespec *ts)
 }
 
 static int ptp_gianfar_settime(struct ptp_clock_info *ptp,
-			       const struct timespec *ts)
+			       const struct timespec64 *ts)
 {
 	u64 ns;
 	unsigned long flags;
@@ -418,8 +419,8 @@ static struct ptp_clock_info ptp_gianfar_caps = {
 	.pps		= 1,
 	.adjfreq	= ptp_gianfar_adjfreq,
 	.adjtime	= ptp_gianfar_adjtime,
-	.gettime	= ptp_gianfar_gettime,
-	.settime	= ptp_gianfar_settime,
+	.gettime64	= ptp_gianfar_gettime,
+	.settime64	= ptp_gianfar_settime,
 	.enable		= ptp_gianfar_enable,
 };
 
@@ -440,7 +441,7 @@ static int gianfar_ptp_probe(struct platform_device *dev)
 {
 	struct device_node *node = dev->dev.of_node;
 	struct etsects *etsects;
-	struct timespec now;
+	struct timespec64 now;
 	int err = -ENOMEM;
 	u32 tmr_ctrl;
 	unsigned long flags;
@@ -495,7 +496,7 @@ static int gianfar_ptp_probe(struct platform_device *dev)
 		pr_err("ioremap ptp registers failed\n");
 		goto no_ioremap;
 	}
-	getnstimeofday(&now);
+	getnstimeofday64(&now);
 	ptp_gianfar_settime(&etsects->caps, &now);
 
 	tmr_ctrl =
-- 
1.7.10.4


^ permalink raw reply	[flat|nested] 35+ messages in thread

* [PATCH net-next V3 10/23] ptp: e1000e: convert to the 64 bit get/set time methods.
  2015-03-29 21:11 [PATCH net-next V3 00/23] ptp: get ready for 2038 Richard Cochran
                   ` (8 preceding siblings ...)
  2015-03-29 21:11 ` [PATCH net-next V3 09/23] ptp: gianfar: " Richard Cochran
@ 2015-03-29 21:12 ` Richard Cochran
  2015-03-31 21:48   ` Richard Cochran
  2015-03-29 21:12 ` [PATCH net-next V3 11/23] ptp: fm10k: " Richard Cochran
                   ` (13 subsequent siblings)
  23 siblings, 1 reply; 35+ messages in thread
From: Richard Cochran @ 2015-03-29 21:12 UTC (permalink / raw)
  To: netdev
  Cc: linux-kernel, Amir Vadai, Ariel Elior, Arnd Bergmann,
	Baolin Wang, Ben Hutchings, Bruce Allan, Carolyn Wyborny,
	Chris Metcalf, David Miller, Frank Li, Giuseppe Cavallaro,
	Jacob Keller, Jeff Kirsher, John Stultz, Luwei Zhou,
	Matthew Vick, Michael Chan, Prashant Sreedharan, Rayagond K,
	Shradha Shah, Solarflare linux maintainers, Sonic Zhang,
	Stefan Sørensen, Thomas Gleixner, Tom Lendacky

This driver's clock is implemented using a timecounter, and so with
this patch the driver is ready for the year 2038.

Compile tested only.

Signed-off-by: Richard Cochran <richardcochran@gmail.com>
Acked-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
---
 drivers/net/ethernet/intel/e1000e/ptp.c |   16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/drivers/net/ethernet/intel/e1000e/ptp.c b/drivers/net/ethernet/intel/e1000e/ptp.c
index 1490f1e..b747a3e 100644
--- a/drivers/net/ethernet/intel/e1000e/ptp.c
+++ b/drivers/net/ethernet/intel/e1000e/ptp.c
@@ -106,7 +106,7 @@ static int e1000e_phc_adjtime(struct ptp_clock_info *ptp, s64 delta)
  * Read the timecounter and return the correct value in ns after converting
  * it into a struct timespec.
  **/
-static int e1000e_phc_gettime(struct ptp_clock_info *ptp, struct timespec *ts)
+static int e1000e_phc_gettime(struct ptp_clock_info *ptp, struct timespec64 *ts)
 {
 	struct e1000_adapter *adapter = container_of(ptp, struct e1000_adapter,
 						     ptp_clock_info);
@@ -133,14 +133,14 @@ static int e1000e_phc_gettime(struct ptp_clock_info *ptp, struct timespec *ts)
  * wall timer value.
  **/
 static int e1000e_phc_settime(struct ptp_clock_info *ptp,
-			      const struct timespec *ts)
+			      const struct timespec64 *ts)
 {
 	struct e1000_adapter *adapter = container_of(ptp, struct e1000_adapter,
 						     ptp_clock_info);
 	unsigned long flags;
 	u64 ns;
 
-	ns = timespec_to_ns(ts);
+	ns = timespec64_to_ns(ts);
 
 	/* reset the timecounter */
 	spin_lock_irqsave(&adapter->systim_lock, flags);
@@ -171,11 +171,11 @@ static void e1000e_systim_overflow_work(struct work_struct *work)
 	struct e1000_adapter *adapter = container_of(work, struct e1000_adapter,
 						     systim_overflow_work.work);
 	struct e1000_hw *hw = &adapter->hw;
-	struct timespec ts;
+	struct timespec64 ts;
 
-	adapter->ptp_clock_info.gettime(&adapter->ptp_clock_info, &ts);
+	adapter->ptp_clock_info.gettime64(&adapter->ptp_clock_info, &ts);
 
-	e_dbg("SYSTIM overflow check at %ld.%09lu\n", ts.tv_sec, ts.tv_nsec);
+	e_dbg("SYSTIM overflow check at %lld.%09lu\n", ts.tv_sec, ts.tv_nsec);
 
 	schedule_delayed_work(&adapter->systim_overflow_work,
 			      E1000_SYSTIM_OVERFLOW_PERIOD);
@@ -190,8 +190,8 @@ static const struct ptp_clock_info e1000e_ptp_clock_info = {
 	.pps		= 0,
 	.adjfreq	= e1000e_phc_adjfreq,
 	.adjtime	= e1000e_phc_adjtime,
-	.gettime	= e1000e_phc_gettime,
-	.settime	= e1000e_phc_settime,
+	.gettime64	= e1000e_phc_gettime,
+	.settime64	= e1000e_phc_settime,
 	.enable		= e1000e_phc_enable,
 };
 
-- 
1.7.10.4


^ permalink raw reply	[flat|nested] 35+ messages in thread

* [PATCH net-next V3 11/23] ptp: fm10k: convert to the 64 bit get/set time methods.
  2015-03-29 21:11 [PATCH net-next V3 00/23] ptp: get ready for 2038 Richard Cochran
                   ` (9 preceding siblings ...)
  2015-03-29 21:12 ` [PATCH net-next V3 10/23] ptp: e1000e: " Richard Cochran
@ 2015-03-29 21:12 ` Richard Cochran
  2015-03-29 21:12 ` [PATCH net-next V3 12/23] ptp: i40e: " Richard Cochran
                   ` (12 subsequent siblings)
  23 siblings, 0 replies; 35+ messages in thread
From: Richard Cochran @ 2015-03-29 21:12 UTC (permalink / raw)
  To: netdev
  Cc: linux-kernel, Amir Vadai, Ariel Elior, Arnd Bergmann,
	Baolin Wang, Ben Hutchings, Bruce Allan, Carolyn Wyborny,
	Chris Metcalf, David Miller, Frank Li, Giuseppe Cavallaro,
	Jacob Keller, Jeff Kirsher, John Stultz, Luwei Zhou,
	Matthew Vick, Michael Chan, Prashant Sreedharan, Rayagond K,
	Shradha Shah, Solarflare linux maintainers, Sonic Zhang,
	Stefan Sørensen, Thomas Gleixner, Tom Lendacky

The device appears to use a 64 bit nanoseconds register, and so with
this patch the driver should be ready for the year 2038.

Compile tested only.

Signed-off-by: Richard Cochran <richardcochran@gmail.com>
Acked-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
---
 drivers/net/ethernet/intel/fm10k/fm10k_ptp.c |   12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/drivers/net/ethernet/intel/fm10k/fm10k_ptp.c b/drivers/net/ethernet/intel/fm10k/fm10k_ptp.c
index d966044..02008e9 100644
--- a/drivers/net/ethernet/intel/fm10k/fm10k_ptp.c
+++ b/drivers/net/ethernet/intel/fm10k/fm10k_ptp.c
@@ -285,7 +285,7 @@ static int fm10k_ptp_adjtime(struct ptp_clock_info *ptp, s64 delta)
 	return 0;
 }
 
-static int fm10k_ptp_gettime(struct ptp_clock_info *ptp, struct timespec *ts)
+static int fm10k_ptp_gettime(struct ptp_clock_info *ptp, struct timespec64 *ts)
 {
 	struct fm10k_intfc *interface;
 	unsigned long flags;
@@ -297,17 +297,17 @@ static int fm10k_ptp_gettime(struct ptp_clock_info *ptp, struct timespec *ts)
 	now = fm10k_systime_read(interface) + interface->ptp_adjust;
 	read_unlock_irqrestore(&interface->systime_lock, flags);
 
-	*ts = ns_to_timespec(now);
+	*ts = ns_to_timespec64(now);
 
 	return 0;
 }
 
 static int fm10k_ptp_settime(struct ptp_clock_info *ptp,
-			     const struct timespec *ts)
+			     const struct timespec64 *ts)
 {
 	struct fm10k_intfc *interface;
 	unsigned long flags;
-	u64 ns = timespec_to_ns(ts);
+	u64 ns = timespec64_to_ns(ts);
 
 	interface = container_of(ptp, struct fm10k_intfc, ptp_caps);
 
@@ -419,8 +419,8 @@ void fm10k_ptp_register(struct fm10k_intfc *interface)
 	ptp_caps->max_adj	= 976562;
 	ptp_caps->adjfreq	= fm10k_ptp_adjfreq;
 	ptp_caps->adjtime	= fm10k_ptp_adjtime;
-	ptp_caps->gettime	= fm10k_ptp_gettime;
-	ptp_caps->settime	= fm10k_ptp_settime;
+	ptp_caps->gettime64	= fm10k_ptp_gettime;
+	ptp_caps->settime64	= fm10k_ptp_settime;
 
 	/* provide pins if BAR4 is accessible */
 	if (interface->sw_addr) {
-- 
1.7.10.4


^ permalink raw reply	[flat|nested] 35+ messages in thread

* [PATCH net-next V3 12/23] ptp: i40e: convert to the 64 bit get/set time methods.
  2015-03-29 21:11 [PATCH net-next V3 00/23] ptp: get ready for 2038 Richard Cochran
                   ` (10 preceding siblings ...)
  2015-03-29 21:12 ` [PATCH net-next V3 11/23] ptp: fm10k: " Richard Cochran
@ 2015-03-29 21:12 ` Richard Cochran
  2015-03-29 21:12 ` [PATCH net-next V3 13/23] ptp: igb: " Richard Cochran
                   ` (11 subsequent siblings)
  23 siblings, 0 replies; 35+ messages in thread
From: Richard Cochran @ 2015-03-29 21:12 UTC (permalink / raw)
  To: netdev
  Cc: linux-kernel, Amir Vadai, Ariel Elior, Arnd Bergmann,
	Baolin Wang, Ben Hutchings, Bruce Allan, Carolyn Wyborny,
	Chris Metcalf, David Miller, Frank Li, Giuseppe Cavallaro,
	Jacob Keller, Jeff Kirsher, John Stultz, Luwei Zhou,
	Matthew Vick, Michael Chan, Prashant Sreedharan, Rayagond K,
	Shradha Shah, Solarflare linux maintainers, Sonic Zhang,
	Stefan Sørensen, Thomas Gleixner, Tom Lendacky

The device appears to use a 64 bit nanoseconds register, and so with
this patch the driver should be ready for the year 2038.

Compile tested only.

Signed-off-by: Richard Cochran <richardcochran@gmail.com>
Acked-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
---
 drivers/net/ethernet/intel/i40e/i40e_ptp.c |   26 +++++++++++++-------------
 1 file changed, 13 insertions(+), 13 deletions(-)

diff --git a/drivers/net/ethernet/intel/i40e/i40e_ptp.c b/drivers/net/ethernet/intel/i40e/i40e_ptp.c
index fabcfa1..a92b772 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_ptp.c
+++ b/drivers/net/ethernet/intel/i40e/i40e_ptp.c
@@ -57,7 +57,7 @@
  * timespec. However, since the registers are 64 bits of nanoseconds, we must
  * convert the result to a timespec before we can return.
  **/
-static void i40e_ptp_read(struct i40e_pf *pf, struct timespec *ts)
+static void i40e_ptp_read(struct i40e_pf *pf, struct timespec64 *ts)
 {
 	struct i40e_hw *hw = &pf->hw;
 	u32 hi, lo;
@@ -69,7 +69,7 @@ static void i40e_ptp_read(struct i40e_pf *pf, struct timespec *ts)
 
 	ns = (((u64)hi) << 32) | lo;
 
-	*ts = ns_to_timespec(ns);
+	*ts = ns_to_timespec64(ns);
 }
 
 /**
@@ -81,10 +81,10 @@ static void i40e_ptp_read(struct i40e_pf *pf, struct timespec *ts)
  * we receive a timespec from the stack, we must convert that timespec into
  * nanoseconds before programming the registers.
  **/
-static void i40e_ptp_write(struct i40e_pf *pf, const struct timespec *ts)
+static void i40e_ptp_write(struct i40e_pf *pf, const struct timespec64 *ts)
 {
 	struct i40e_hw *hw = &pf->hw;
-	u64 ns = timespec_to_ns(ts);
+	u64 ns = timespec64_to_ns(ts);
 
 	/* The timer will not update until the high register is written, so
 	 * write the low register first.
@@ -159,14 +159,14 @@ static int i40e_ptp_adjfreq(struct ptp_clock_info *ptp, s32 ppb)
 static int i40e_ptp_adjtime(struct ptp_clock_info *ptp, s64 delta)
 {
 	struct i40e_pf *pf = container_of(ptp, struct i40e_pf, ptp_caps);
-	struct timespec now, then = ns_to_timespec(delta);
+	struct timespec64 now, then = ns_to_timespec64(delta);
 	unsigned long flags;
 
 	spin_lock_irqsave(&pf->tmreg_lock, flags);
 
 	i40e_ptp_read(pf, &now);
-	now = timespec_add(now, then);
-	i40e_ptp_write(pf, (const struct timespec *)&now);
+	now = timespec64_add(now, then);
+	i40e_ptp_write(pf, (const struct timespec64 *)&now);
 
 	spin_unlock_irqrestore(&pf->tmreg_lock, flags);
 
@@ -181,7 +181,7 @@ static int i40e_ptp_adjtime(struct ptp_clock_info *ptp, s64 delta)
  * Read the device clock and return the correct value on ns, after converting it
  * into a timespec struct.
  **/
-static int i40e_ptp_gettime(struct ptp_clock_info *ptp, struct timespec *ts)
+static int i40e_ptp_gettime(struct ptp_clock_info *ptp, struct timespec64 *ts)
 {
 	struct i40e_pf *pf = container_of(ptp, struct i40e_pf, ptp_caps);
 	unsigned long flags;
@@ -202,7 +202,7 @@ static int i40e_ptp_gettime(struct ptp_clock_info *ptp, struct timespec *ts)
  * to ns happens in the write function.
  **/
 static int i40e_ptp_settime(struct ptp_clock_info *ptp,
-			    const struct timespec *ts)
+			    const struct timespec64 *ts)
 {
 	struct i40e_pf *pf = container_of(ptp, struct i40e_pf, ptp_caps);
 	unsigned long flags;
@@ -613,8 +613,8 @@ static long i40e_ptp_create_clock(struct i40e_pf *pf)
 	pf->ptp_caps.pps = 0;
 	pf->ptp_caps.adjfreq = i40e_ptp_adjfreq;
 	pf->ptp_caps.adjtime = i40e_ptp_adjtime;
-	pf->ptp_caps.gettime = i40e_ptp_gettime;
-	pf->ptp_caps.settime = i40e_ptp_settime;
+	pf->ptp_caps.gettime64 = i40e_ptp_gettime;
+	pf->ptp_caps.settime64 = i40e_ptp_settime;
 	pf->ptp_caps.enable = i40e_ptp_feature_enable;
 
 	/* Attempt to register the clock before enabling the hardware. */
@@ -673,7 +673,7 @@ void i40e_ptp_init(struct i40e_pf *pf)
 		dev_err(&pf->pdev->dev, "%s: ptp_clock_register failed\n",
 			__func__);
 	} else {
-		struct timespec ts;
+		struct timespec64 ts;
 		u32 regval;
 
 		dev_info(&pf->pdev->dev, "%s: added PHC on %s\n", __func__,
@@ -695,7 +695,7 @@ void i40e_ptp_init(struct i40e_pf *pf)
 		i40e_ptp_set_timestamp_mode(pf, &pf->tstamp_config);
 
 		/* Set the clock value. */
-		ts = ktime_to_timespec(ktime_get_real());
+		ts = ktime_to_timespec64(ktime_get_real());
 		i40e_ptp_settime(&pf->ptp_caps, &ts);
 	}
 }
-- 
1.7.10.4


^ permalink raw reply	[flat|nested] 35+ messages in thread

* [PATCH net-next V3 13/23] ptp: igb: convert to the 64 bit get/set time methods.
  2015-03-29 21:11 [PATCH net-next V3 00/23] ptp: get ready for 2038 Richard Cochran
                   ` (11 preceding siblings ...)
  2015-03-29 21:12 ` [PATCH net-next V3 12/23] ptp: i40e: " Richard Cochran
@ 2015-03-29 21:12 ` Richard Cochran
  2015-03-31 21:08   ` Keller, Jacob E
  2015-03-31 21:53   ` Richard Cochran
  2015-03-29 21:12 ` [PATCH net-next V3 14/23] ptp: ixgbe: " Richard Cochran
                   ` (10 subsequent siblings)
  23 siblings, 2 replies; 35+ messages in thread
From: Richard Cochran @ 2015-03-29 21:12 UTC (permalink / raw)
  To: netdev
  Cc: linux-kernel, Amir Vadai, Ariel Elior, Arnd Bergmann,
	Baolin Wang, Ben Hutchings, Bruce Allan, Carolyn Wyborny,
	Chris Metcalf, David Miller, Frank Li, Giuseppe Cavallaro,
	Jacob Keller, Jeff Kirsher, John Stultz, Luwei Zhou,
	Matthew Vick, Michael Chan, Prashant Sreedharan, Rayagond K,
	Shradha Shah, Solarflare linux maintainers, Sonic Zhang,
	Stefan Sørensen, Thomas Gleixner, Tom Lendacky

For the 82576, the driver's clock is implemented using a timecounter,
and so with this patch that device is ready for the year 2038.

However, in the case of the i210, the device stores the number of
seconds in a 32 bit register.  Therefore, more work is needed on this
driver before the year 2038 comes around.

Compile tested only.

Signed-off-by: Richard Cochran <richardcochran@gmail.com>
Acked-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
---
 drivers/net/ethernet/intel/igb/igb_ptp.c |   41 +++++++++++++++---------------
 1 file changed, 21 insertions(+), 20 deletions(-)

diff --git a/drivers/net/ethernet/intel/igb/igb_ptp.c b/drivers/net/ethernet/intel/igb/igb_ptp.c
index 52d01b8..0348b7e 100644
--- a/drivers/net/ethernet/intel/igb/igb_ptp.c
+++ b/drivers/net/ethernet/intel/igb/igb_ptp.c
@@ -116,7 +116,8 @@ static cycle_t igb_ptp_read_82580(const struct cyclecounter *cc)
 }
 
 /* SYSTIM read access for I210/I211 */
-static void igb_ptp_read_i210(struct igb_adapter *adapter, struct timespec *ts)
+static void igb_ptp_read_i210(struct igb_adapter *adapter,
+			      struct timespec64 *ts)
 {
 	struct e1000_hw *hw = &adapter->hw;
 	u32 sec, nsec;
@@ -134,7 +135,7 @@ static void igb_ptp_read_i210(struct igb_adapter *adapter, struct timespec *ts)
 }
 
 static void igb_ptp_write_i210(struct igb_adapter *adapter,
-			       const struct timespec *ts)
+			       const struct timespec64 *ts)
 {
 	struct e1000_hw *hw = &adapter->hw;
 
@@ -269,13 +270,13 @@ static int igb_ptp_adjtime_i210(struct ptp_clock_info *ptp, s64 delta)
 	struct igb_adapter *igb = container_of(ptp, struct igb_adapter,
 					       ptp_caps);
 	unsigned long flags;
-	struct timespec now, then = ns_to_timespec(delta);
+	struct timespec64 now, then = ns_to_timespec64(delta);
 
 	spin_lock_irqsave(&igb->tmreg_lock, flags);
 
 	igb_ptp_read_i210(igb, &now);
-	now = timespec_add(now, then);
-	igb_ptp_write_i210(igb, (const struct timespec *)&now);
+	now = timespec64_add(now, then);
+	igb_ptp_write_i210(igb, (const struct timespec64 *)&now);
 
 	spin_unlock_irqrestore(&igb->tmreg_lock, flags);
 
@@ -283,7 +284,7 @@ static int igb_ptp_adjtime_i210(struct ptp_clock_info *ptp, s64 delta)
 }
 
 static int igb_ptp_gettime_82576(struct ptp_clock_info *ptp,
-				 struct timespec *ts)
+				 struct timespec64 *ts)
 {
 	struct igb_adapter *igb = container_of(ptp, struct igb_adapter,
 					       ptp_caps);
@@ -304,7 +305,7 @@ static int igb_ptp_gettime_82576(struct ptp_clock_info *ptp,
 }
 
 static int igb_ptp_gettime_i210(struct ptp_clock_info *ptp,
-				struct timespec *ts)
+				struct timespec64 *ts)
 {
 	struct igb_adapter *igb = container_of(ptp, struct igb_adapter,
 					       ptp_caps);
@@ -320,7 +321,7 @@ static int igb_ptp_gettime_i210(struct ptp_clock_info *ptp,
 }
 
 static int igb_ptp_settime_82576(struct ptp_clock_info *ptp,
-				 const struct timespec *ts)
+				 const struct timespec64 *ts)
 {
 	struct igb_adapter *igb = container_of(ptp, struct igb_adapter,
 					       ptp_caps);
@@ -340,7 +341,7 @@ static int igb_ptp_settime_82576(struct ptp_clock_info *ptp,
 }
 
 static int igb_ptp_settime_i210(struct ptp_clock_info *ptp,
-				const struct timespec *ts)
+				const struct timespec64 *ts)
 {
 	struct igb_adapter *igb = container_of(ptp, struct igb_adapter,
 					       ptp_caps);
@@ -627,11 +628,11 @@ static void igb_ptp_overflow_check(struct work_struct *work)
 {
 	struct igb_adapter *igb =
 		container_of(work, struct igb_adapter, ptp_overflow_work.work);
-	struct timespec ts;
+	struct timespec64 ts;
 
-	igb->ptp_caps.gettime(&igb->ptp_caps, &ts);
+	igb->ptp_caps.gettime64(&igb->ptp_caps, &ts);
 
-	pr_debug("igb overflow check at %ld.%09lu\n", ts.tv_sec, ts.tv_nsec);
+	pr_debug("igb overflow check at %lld.%09lu\n", ts.tv_sec, ts.tv_nsec);
 
 	schedule_delayed_work(&igb->ptp_overflow_work,
 			      IGB_SYSTIM_OVERFLOW_PERIOD);
@@ -989,8 +990,8 @@ void igb_ptp_init(struct igb_adapter *adapter)
 		adapter->ptp_caps.pps = 0;
 		adapter->ptp_caps.adjfreq = igb_ptp_adjfreq_82576;
 		adapter->ptp_caps.adjtime = igb_ptp_adjtime_82576;
-		adapter->ptp_caps.gettime = igb_ptp_gettime_82576;
-		adapter->ptp_caps.settime = igb_ptp_settime_82576;
+		adapter->ptp_caps.gettime64 = igb_ptp_gettime_82576;
+		adapter->ptp_caps.settime64 = igb_ptp_settime_82576;
 		adapter->ptp_caps.enable = igb_ptp_feature_enable;
 		adapter->cc.read = igb_ptp_read_82576;
 		adapter->cc.mask = CYCLECOUNTER_MASK(64);
@@ -1009,8 +1010,8 @@ void igb_ptp_init(struct igb_adapter *adapter)
 		adapter->ptp_caps.pps = 0;
 		adapter->ptp_caps.adjfreq = igb_ptp_adjfreq_82580;
 		adapter->ptp_caps.adjtime = igb_ptp_adjtime_82576;
-		adapter->ptp_caps.gettime = igb_ptp_gettime_82576;
-		adapter->ptp_caps.settime = igb_ptp_settime_82576;
+		adapter->ptp_caps.gettime64 = igb_ptp_gettime_82576;
+		adapter->ptp_caps.settime64 = igb_ptp_settime_82576;
 		adapter->ptp_caps.enable = igb_ptp_feature_enable;
 		adapter->cc.read = igb_ptp_read_82580;
 		adapter->cc.mask = CYCLECOUNTER_MASK(IGB_NBITS_82580);
@@ -1038,8 +1039,8 @@ void igb_ptp_init(struct igb_adapter *adapter)
 		adapter->ptp_caps.pin_config = adapter->sdp_config;
 		adapter->ptp_caps.adjfreq = igb_ptp_adjfreq_82580;
 		adapter->ptp_caps.adjtime = igb_ptp_adjtime_i210;
-		adapter->ptp_caps.gettime = igb_ptp_gettime_i210;
-		adapter->ptp_caps.settime = igb_ptp_settime_i210;
+		adapter->ptp_caps.gettime64 = igb_ptp_gettime_i210;
+		adapter->ptp_caps.settime64 = igb_ptp_settime_i210;
 		adapter->ptp_caps.enable = igb_ptp_feature_enable_i210;
 		adapter->ptp_caps.verify = igb_ptp_verify_pin;
 		/* Enable the timer functions by clearing bit 31. */
@@ -1057,7 +1058,7 @@ void igb_ptp_init(struct igb_adapter *adapter)
 
 	/* Initialize the clock and overflow work for devices that need it. */
 	if ((hw->mac.type == e1000_i210) || (hw->mac.type == e1000_i211)) {
-		struct timespec ts = ktime_to_timespec(ktime_get_real());
+		struct timespec64 ts = ktime_to_timespec64(ktime_get_real());
 
 		igb_ptp_settime_i210(&adapter->ptp_caps, &ts);
 	} else {
@@ -1171,7 +1172,7 @@ void igb_ptp_reset(struct igb_adapter *adapter)
 
 	/* Re-initialize the timer. */
 	if ((hw->mac.type == e1000_i210) || (hw->mac.type == e1000_i211)) {
-		struct timespec ts = ktime_to_timespec(ktime_get_real());
+		struct timespec64 ts = ktime_to_timespec64(ktime_get_real());
 
 		igb_ptp_write_i210(adapter, &ts);
 	} else {
-- 
1.7.10.4


^ permalink raw reply	[flat|nested] 35+ messages in thread

* [PATCH net-next V3 14/23] ptp: ixgbe: convert to the 64 bit get/set time methods.
  2015-03-29 21:11 [PATCH net-next V3 00/23] ptp: get ready for 2038 Richard Cochran
                   ` (12 preceding siblings ...)
  2015-03-29 21:12 ` [PATCH net-next V3 13/23] ptp: igb: " Richard Cochran
@ 2015-03-29 21:12 ` Richard Cochran
  2015-03-29 21:12 ` [PATCH net-next V3 15/23] ptp: mlx4: " Richard Cochran
                   ` (9 subsequent siblings)
  23 siblings, 0 replies; 35+ messages in thread
From: Richard Cochran @ 2015-03-29 21:12 UTC (permalink / raw)
  To: netdev
  Cc: linux-kernel, Amir Vadai, Ariel Elior, Arnd Bergmann,
	Baolin Wang, Ben Hutchings, Bruce Allan, Carolyn Wyborny,
	Chris Metcalf, David Miller, Frank Li, Giuseppe Cavallaro,
	Jacob Keller, Jeff Kirsher, John Stultz, Luwei Zhou,
	Matthew Vick, Michael Chan, Prashant Sreedharan, Rayagond K,
	Shradha Shah, Solarflare linux maintainers, Sonic Zhang,
	Stefan Sørensen, Thomas Gleixner, Tom Lendacky

This driver's clock is implemented using a timecounter, and so with
this patch the driver is ready for the year 2038.

Compile tested only.

Signed-off-by: Richard Cochran <richardcochran@gmail.com>
Acked-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
---
 drivers/net/ethernet/intel/ixgbe/ixgbe_ptp.c |   14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_ptp.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_ptp.c
index bd46f5d..75b9e93 100644
--- a/drivers/net/ethernet/intel/ixgbe/ixgbe_ptp.c
+++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_ptp.c
@@ -279,7 +279,7 @@ static int ixgbe_ptp_adjtime(struct ptp_clock_info *ptp, s64 delta)
  * read the timecounter and return the correct value on ns,
  * after converting it into a struct timespec.
  */
-static int ixgbe_ptp_gettime(struct ptp_clock_info *ptp, struct timespec *ts)
+static int ixgbe_ptp_gettime(struct ptp_clock_info *ptp, struct timespec64 *ts)
 {
 	struct ixgbe_adapter *adapter =
 		container_of(ptp, struct ixgbe_adapter, ptp_caps);
@@ -306,7 +306,7 @@ static int ixgbe_ptp_gettime(struct ptp_clock_info *ptp, struct timespec *ts)
  * wall timer value.
  */
 static int ixgbe_ptp_settime(struct ptp_clock_info *ptp,
-			     const struct timespec *ts)
+			     const struct timespec64 *ts)
 {
 	struct ixgbe_adapter *adapter =
 		container_of(ptp, struct ixgbe_adapter, ptp_caps);
@@ -407,7 +407,7 @@ void ixgbe_ptp_overflow_check(struct ixgbe_adapter *adapter)
 {
 	bool timeout = time_is_before_jiffies(adapter->last_overflow_check +
 					     IXGBE_OVERFLOW_PERIOD);
-	struct timespec ts;
+	struct timespec64 ts;
 
 	if (timeout) {
 		ixgbe_ptp_gettime(&adapter->ptp_caps, &ts);
@@ -874,8 +874,8 @@ static int ixgbe_ptp_create_clock(struct ixgbe_adapter *adapter)
 		adapter->ptp_caps.pps = 1;
 		adapter->ptp_caps.adjfreq = ixgbe_ptp_adjfreq;
 		adapter->ptp_caps.adjtime = ixgbe_ptp_adjtime;
-		adapter->ptp_caps.gettime = ixgbe_ptp_gettime;
-		adapter->ptp_caps.settime = ixgbe_ptp_settime;
+		adapter->ptp_caps.gettime64 = ixgbe_ptp_gettime;
+		adapter->ptp_caps.settime64 = ixgbe_ptp_settime;
 		adapter->ptp_caps.enable = ixgbe_ptp_feature_enable;
 		break;
 	case ixgbe_mac_82599EB:
@@ -890,8 +890,8 @@ static int ixgbe_ptp_create_clock(struct ixgbe_adapter *adapter)
 		adapter->ptp_caps.pps = 0;
 		adapter->ptp_caps.adjfreq = ixgbe_ptp_adjfreq;
 		adapter->ptp_caps.adjtime = ixgbe_ptp_adjtime;
-		adapter->ptp_caps.gettime = ixgbe_ptp_gettime;
-		adapter->ptp_caps.settime = ixgbe_ptp_settime;
+		adapter->ptp_caps.gettime64 = ixgbe_ptp_gettime;
+		adapter->ptp_caps.settime64 = ixgbe_ptp_settime;
 		adapter->ptp_caps.enable = ixgbe_ptp_feature_enable;
 		break;
 	default:
-- 
1.7.10.4


^ permalink raw reply	[flat|nested] 35+ messages in thread

* [PATCH net-next V3 15/23] ptp: mlx4: convert to the 64 bit get/set time methods.
  2015-03-29 21:11 [PATCH net-next V3 00/23] ptp: get ready for 2038 Richard Cochran
                   ` (13 preceding siblings ...)
  2015-03-29 21:12 ` [PATCH net-next V3 14/23] ptp: ixgbe: " Richard Cochran
@ 2015-03-29 21:12 ` Richard Cochran
  2015-03-29 21:12 ` [PATCH net-next V3 16/23] ptp: sfc: " Richard Cochran
                   ` (8 subsequent siblings)
  23 siblings, 0 replies; 35+ messages in thread
From: Richard Cochran @ 2015-03-29 21:12 UTC (permalink / raw)
  To: netdev
  Cc: linux-kernel, Amir Vadai, Ariel Elior, Arnd Bergmann,
	Baolin Wang, Ben Hutchings, Bruce Allan, Carolyn Wyborny,
	Chris Metcalf, David Miller, Frank Li, Giuseppe Cavallaro,
	Jacob Keller, Jeff Kirsher, John Stultz, Luwei Zhou,
	Matthew Vick, Michael Chan, Prashant Sreedharan, Rayagond K,
	Shradha Shah, Solarflare linux maintainers, Sonic Zhang,
	Stefan Sørensen, Thomas Gleixner, Tom Lendacky

This driver's clock is implemented using a timecounter, and so with
this patch the driver is ready for the year 2038.

Compile tested only.

Signed-off-by: Richard Cochran <richardcochran@gmail.com>
---
 drivers/net/ethernet/mellanox/mlx4/en_clock.c |   11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)

diff --git a/drivers/net/ethernet/mellanox/mlx4/en_clock.c b/drivers/net/ethernet/mellanox/mlx4/en_clock.c
index 90b5309..666e7bd 100644
--- a/drivers/net/ethernet/mellanox/mlx4/en_clock.c
+++ b/drivers/net/ethernet/mellanox/mlx4/en_clock.c
@@ -164,7 +164,8 @@ static int mlx4_en_phc_adjtime(struct ptp_clock_info *ptp, s64 delta)
  * Read the timecounter and return the correct value in ns after converting
  * it into a struct timespec.
  **/
-static int mlx4_en_phc_gettime(struct ptp_clock_info *ptp, struct timespec *ts)
+static int mlx4_en_phc_gettime(struct ptp_clock_info *ptp,
+			       struct timespec64 *ts)
 {
 	struct mlx4_en_dev *mdev = container_of(ptp, struct mlx4_en_dev,
 						ptp_clock_info);
@@ -191,11 +192,11 @@ static int mlx4_en_phc_gettime(struct ptp_clock_info *ptp, struct timespec *ts)
  * wall timer value.
  **/
 static int mlx4_en_phc_settime(struct ptp_clock_info *ptp,
-			       const struct timespec *ts)
+			       const struct timespec64 *ts)
 {
 	struct mlx4_en_dev *mdev = container_of(ptp, struct mlx4_en_dev,
 						ptp_clock_info);
-	u64 ns = timespec_to_ns(ts);
+	u64 ns = timespec64_to_ns(ts);
 	unsigned long flags;
 
 	/* reset the timecounter */
@@ -232,8 +233,8 @@ static const struct ptp_clock_info mlx4_en_ptp_clock_info = {
 	.pps		= 0,
 	.adjfreq	= mlx4_en_phc_adjfreq,
 	.adjtime	= mlx4_en_phc_adjtime,
-	.gettime	= mlx4_en_phc_gettime,
-	.settime	= mlx4_en_phc_settime,
+	.gettime64	= mlx4_en_phc_gettime,
+	.settime64	= mlx4_en_phc_settime,
 	.enable		= mlx4_en_phc_enable,
 };
 
-- 
1.7.10.4


^ permalink raw reply	[flat|nested] 35+ messages in thread

* [PATCH net-next V3 16/23] ptp: sfc: convert to the 64 bit get/set time methods.
  2015-03-29 21:11 [PATCH net-next V3 00/23] ptp: get ready for 2038 Richard Cochran
                   ` (14 preceding siblings ...)
  2015-03-29 21:12 ` [PATCH net-next V3 15/23] ptp: mlx4: " Richard Cochran
@ 2015-03-29 21:12 ` Richard Cochran
  2015-03-29 21:12 ` [PATCH net-next V3 17/23] ptp: stmmac: " Richard Cochran
                   ` (7 subsequent siblings)
  23 siblings, 0 replies; 35+ messages in thread
From: Richard Cochran @ 2015-03-29 21:12 UTC (permalink / raw)
  To: netdev
  Cc: linux-kernel, Amir Vadai, Ariel Elior, Arnd Bergmann,
	Baolin Wang, Ben Hutchings, Bruce Allan, Carolyn Wyborny,
	Chris Metcalf, David Miller, Frank Li, Giuseppe Cavallaro,
	Jacob Keller, Jeff Kirsher, John Stultz, Luwei Zhou,
	Matthew Vick, Michael Chan, Prashant Sreedharan, Rayagond K,
	Shradha Shah, Solarflare linux maintainers, Sonic Zhang,
	Stefan Sørensen, Thomas Gleixner, Tom Lendacky

This patch changes the driver to use the newer API.

Depending on how the hardware represents a time value, this driver may
or may not yet be ready for the year 2038.

Compile tested only.

Signed-off-by: Richard Cochran <richardcochran@gmail.com>
---
 drivers/net/ethernet/sfc/ptp.c |   22 +++++++++++-----------
 1 file changed, 11 insertions(+), 11 deletions(-)

diff --git a/drivers/net/ethernet/sfc/ptp.c b/drivers/net/ethernet/sfc/ptp.c
index 6b861e3..a2e9aee 100644
--- a/drivers/net/ethernet/sfc/ptp.c
+++ b/drivers/net/ethernet/sfc/ptp.c
@@ -323,9 +323,9 @@ struct efx_ptp_data {
 
 static int efx_phc_adjfreq(struct ptp_clock_info *ptp, s32 delta);
 static int efx_phc_adjtime(struct ptp_clock_info *ptp, s64 delta);
-static int efx_phc_gettime(struct ptp_clock_info *ptp, struct timespec *ts);
+static int efx_phc_gettime(struct ptp_clock_info *ptp, struct timespec64 *ts);
 static int efx_phc_settime(struct ptp_clock_info *ptp,
-			   const struct timespec *e_ts);
+			   const struct timespec64 *e_ts);
 static int efx_phc_enable(struct ptp_clock_info *ptp,
 			  struct ptp_clock_request *request, int on);
 
@@ -1198,8 +1198,8 @@ static const struct ptp_clock_info efx_phc_clock_info = {
 	.pps		= 1,
 	.adjfreq	= efx_phc_adjfreq,
 	.adjtime	= efx_phc_adjtime,
-	.gettime	= efx_phc_gettime,
-	.settime	= efx_phc_settime,
+	.gettime64	= efx_phc_gettime,
+	.settime64	= efx_phc_settime,
 	.enable		= efx_phc_enable,
 };
 
@@ -1837,7 +1837,7 @@ static int efx_phc_adjtime(struct ptp_clock_info *ptp, s64 delta)
 			    NULL, 0, NULL);
 }
 
-static int efx_phc_gettime(struct ptp_clock_info *ptp, struct timespec *ts)
+static int efx_phc_gettime(struct ptp_clock_info *ptp, struct timespec64 *ts)
 {
 	struct efx_ptp_data *ptp_data = container_of(ptp,
 						     struct efx_ptp_data,
@@ -1859,28 +1859,28 @@ static int efx_phc_gettime(struct ptp_clock_info *ptp, struct timespec *ts)
 	kt = ptp_data->nic_to_kernel_time(
 		MCDI_DWORD(outbuf, PTP_OUT_READ_NIC_TIME_MAJOR),
 		MCDI_DWORD(outbuf, PTP_OUT_READ_NIC_TIME_MINOR), 0);
-	*ts = ktime_to_timespec(kt);
+	*ts = ktime_to_timespec64(kt);
 	return 0;
 }
 
 static int efx_phc_settime(struct ptp_clock_info *ptp,
-			   const struct timespec *e_ts)
+			   const struct timespec64 *e_ts)
 {
 	/* Get the current NIC time, efx_phc_gettime.
 	 * Subtract from the desired time to get the offset
 	 * call efx_phc_adjtime with the offset
 	 */
 	int rc;
-	struct timespec time_now;
-	struct timespec delta;
+	struct timespec64 time_now;
+	struct timespec64 delta;
 
 	rc = efx_phc_gettime(ptp, &time_now);
 	if (rc != 0)
 		return rc;
 
-	delta = timespec_sub(*e_ts, time_now);
+	delta = timespec64_sub(*e_ts, time_now);
 
-	rc = efx_phc_adjtime(ptp, timespec_to_ns(&delta));
+	rc = efx_phc_adjtime(ptp, timespec64_to_ns(&delta));
 	if (rc != 0)
 		return rc;
 
-- 
1.7.10.4


^ permalink raw reply	[flat|nested] 35+ messages in thread

* [PATCH net-next V3 17/23] ptp: stmmac: convert to the 64 bit get/set time methods.
  2015-03-29 21:11 [PATCH net-next V3 00/23] ptp: get ready for 2038 Richard Cochran
                   ` (15 preceding siblings ...)
  2015-03-29 21:12 ` [PATCH net-next V3 16/23] ptp: sfc: " Richard Cochran
@ 2015-03-29 21:12 ` Richard Cochran
  2015-03-29 21:12 ` [PATCH net-next V3 18/23] ptp: cpts: " Richard Cochran
                   ` (6 subsequent siblings)
  23 siblings, 0 replies; 35+ messages in thread
From: Richard Cochran @ 2015-03-29 21:12 UTC (permalink / raw)
  To: netdev
  Cc: linux-kernel, Amir Vadai, Ariel Elior, Arnd Bergmann,
	Baolin Wang, Ben Hutchings, Bruce Allan, Carolyn Wyborny,
	Chris Metcalf, David Miller, Frank Li, Giuseppe Cavallaro,
	Jacob Keller, Jeff Kirsher, John Stultz, Luwei Zhou,
	Matthew Vick, Michael Chan, Prashant Sreedharan, Rayagond K,
	Shradha Shah, Solarflare linux maintainers, Sonic Zhang,
	Stefan Sørensen, Thomas Gleixner, Tom Lendacky

This device stores the number of seconds in a 32 bit register.  So
more work is needed on this driver before the year 2038 comes around.

Compile tested only.

Signed-off-by: Richard Cochran <richardcochran@gmail.com>
---
 drivers/net/ethernet/stmicro/stmmac/stmmac_ptp.c |    8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_ptp.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_ptp.c
index c5ee79d8..172f318 100644
--- a/drivers/net/ethernet/stmicro/stmmac/stmmac_ptp.c
+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_ptp.c
@@ -105,7 +105,7 @@ static int stmmac_adjust_time(struct ptp_clock_info *ptp, s64 delta)
  * Description: this function will read the current time from the
  * hardware clock and store it in @ts.
  */
-static int stmmac_get_time(struct ptp_clock_info *ptp, struct timespec *ts)
+static int stmmac_get_time(struct ptp_clock_info *ptp, struct timespec64 *ts)
 {
 	struct stmmac_priv *priv =
 	    container_of(ptp, struct stmmac_priv, ptp_clock_ops);
@@ -135,7 +135,7 @@ static int stmmac_get_time(struct ptp_clock_info *ptp, struct timespec *ts)
  * hardware clock.
  */
 static int stmmac_set_time(struct ptp_clock_info *ptp,
-			   const struct timespec *ts)
+			   const struct timespec64 *ts)
 {
 	struct stmmac_priv *priv =
 	    container_of(ptp, struct stmmac_priv, ptp_clock_ops);
@@ -168,8 +168,8 @@ static struct ptp_clock_info stmmac_ptp_clock_ops = {
 	.pps = 0,
 	.adjfreq = stmmac_adjust_freq,
 	.adjtime = stmmac_adjust_time,
-	.gettime = stmmac_get_time,
-	.settime = stmmac_set_time,
+	.gettime64 = stmmac_get_time,
+	.settime64 = stmmac_set_time,
 	.enable = stmmac_enable,
 };
 
-- 
1.7.10.4


^ permalink raw reply	[flat|nested] 35+ messages in thread

* [PATCH net-next V3 18/23] ptp: cpts: convert to the 64 bit get/set time methods.
  2015-03-29 21:11 [PATCH net-next V3 00/23] ptp: get ready for 2038 Richard Cochran
                   ` (16 preceding siblings ...)
  2015-03-29 21:12 ` [PATCH net-next V3 17/23] ptp: stmmac: " Richard Cochran
@ 2015-03-29 21:12 ` Richard Cochran
  2015-03-29 21:12 ` [PATCH net-next V3 19/23] ptp: tilegx: " Richard Cochran
                   ` (5 subsequent siblings)
  23 siblings, 0 replies; 35+ messages in thread
From: Richard Cochran @ 2015-03-29 21:12 UTC (permalink / raw)
  To: netdev
  Cc: linux-kernel, Amir Vadai, Ariel Elior, Arnd Bergmann,
	Baolin Wang, Ben Hutchings, Bruce Allan, Carolyn Wyborny,
	Chris Metcalf, David Miller, Frank Li, Giuseppe Cavallaro,
	Jacob Keller, Jeff Kirsher, John Stultz, Luwei Zhou,
	Matthew Vick, Michael Chan, Prashant Sreedharan, Rayagond K,
	Shradha Shah, Solarflare linux maintainers, Sonic Zhang,
	Stefan Sørensen, Thomas Gleixner, Tom Lendacky

This driver's clock is implemented using a timecounter, and so with
this patch the driver is ready for the year 2038.

Compile tested only.

Signed-off-by: Richard Cochran <richardcochran@gmail.com>
---
 drivers/net/ethernet/ti/cpts.c |   12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/drivers/net/ethernet/ti/cpts.c b/drivers/net/ethernet/ti/cpts.c
index fbe42cb..074b636 100644
--- a/drivers/net/ethernet/ti/cpts.c
+++ b/drivers/net/ethernet/ti/cpts.c
@@ -167,7 +167,7 @@ static int cpts_ptp_adjtime(struct ptp_clock_info *ptp, s64 delta)
 	return 0;
 }
 
-static int cpts_ptp_gettime(struct ptp_clock_info *ptp, struct timespec *ts)
+static int cpts_ptp_gettime(struct ptp_clock_info *ptp, struct timespec64 *ts)
 {
 	u64 ns;
 	u32 remainder;
@@ -185,7 +185,7 @@ static int cpts_ptp_gettime(struct ptp_clock_info *ptp, struct timespec *ts)
 }
 
 static int cpts_ptp_settime(struct ptp_clock_info *ptp,
-			    const struct timespec *ts)
+			    const struct timespec64 *ts)
 {
 	u64 ns;
 	unsigned long flags;
@@ -216,20 +216,20 @@ static struct ptp_clock_info cpts_info = {
 	.pps		= 0,
 	.adjfreq	= cpts_ptp_adjfreq,
 	.adjtime	= cpts_ptp_adjtime,
-	.gettime	= cpts_ptp_gettime,
-	.settime	= cpts_ptp_settime,
+	.gettime64	= cpts_ptp_gettime,
+	.settime64	= cpts_ptp_settime,
 	.enable		= cpts_ptp_enable,
 };
 
 static void cpts_overflow_check(struct work_struct *work)
 {
-	struct timespec ts;
+	struct timespec64 ts;
 	struct cpts *cpts = container_of(work, struct cpts, overflow_work.work);
 
 	cpts_write32(cpts, CPTS_EN, control);
 	cpts_write32(cpts, TS_PEND_EN, int_enable);
 	cpts_ptp_gettime(&cpts->info, &ts);
-	pr_debug("cpts overflow check at %ld.%09lu\n", ts.tv_sec, ts.tv_nsec);
+	pr_debug("cpts overflow check at %lld.%09lu\n", ts.tv_sec, ts.tv_nsec);
 	schedule_delayed_work(&cpts->overflow_work, CPTS_OVERFLOW_PERIOD);
 }
 
-- 
1.7.10.4


^ permalink raw reply	[flat|nested] 35+ messages in thread

* [PATCH net-next V3 19/23] ptp: tilegx: convert to the 64 bit get/set time methods.
  2015-03-29 21:11 [PATCH net-next V3 00/23] ptp: get ready for 2038 Richard Cochran
                   ` (17 preceding siblings ...)
  2015-03-29 21:12 ` [PATCH net-next V3 18/23] ptp: cpts: " Richard Cochran
@ 2015-03-29 21:12 ` Richard Cochran
  2015-03-29 21:32   ` Chris Metcalf
  2015-03-29 21:12 ` [PATCH net-next V3 20/23] ptp: dp83640: " Richard Cochran
                   ` (4 subsequent siblings)
  23 siblings, 1 reply; 35+ messages in thread
From: Richard Cochran @ 2015-03-29 21:12 UTC (permalink / raw)
  To: netdev
  Cc: linux-kernel, Amir Vadai, Ariel Elior, Arnd Bergmann,
	Baolin Wang, Ben Hutchings, Bruce Allan, Carolyn Wyborny,
	Chris Metcalf, David Miller, Frank Li, Giuseppe Cavallaro,
	Jacob Keller, Jeff Kirsher, John Stultz, Luwei Zhou,
	Matthew Vick, Michael Chan, Prashant Sreedharan, Rayagond K,
	Shradha Shah, Solarflare linux maintainers, Sonic Zhang,
	Stefan Sørensen, Thomas Gleixner, Tom Lendacky

This driver is 64 bit only, and so this driver and device are ready
for 2038.  This patch changes the driver to the new PHC and also
carries the timespec64 parameter on out to the gxio_mpipe_get-
set_timestamp functions, making explicit the fact that the tv_sec
field is 64 bits wide.

Not even compile tested.

Signed-off-by: Richard Cochran <richardcochran@gmail.com>
---
 arch/tile/gxio/mpipe.c             |    4 ++--
 arch/tile/include/gxio/mpipe.h     |    4 ++--
 drivers/net/ethernet/tile/tilegx.c |    9 +++++----
 3 files changed, 9 insertions(+), 8 deletions(-)

diff --git a/arch/tile/gxio/mpipe.c b/arch/tile/gxio/mpipe.c
index 6f00e985..ee186e1 100644
--- a/arch/tile/gxio/mpipe.c
+++ b/arch/tile/gxio/mpipe.c
@@ -456,7 +456,7 @@ int gxio_mpipe_equeue_init(gxio_mpipe_equeue_t *equeue,
 EXPORT_SYMBOL_GPL(gxio_mpipe_equeue_init);
 
 int gxio_mpipe_set_timestamp(gxio_mpipe_context_t *context,
-			     const struct timespec *ts)
+			     const struct timespec64 *ts)
 {
 	cycles_t cycles = get_cycles();
 	return gxio_mpipe_set_timestamp_aux(context, (uint64_t)ts->tv_sec,
@@ -466,7 +466,7 @@ int gxio_mpipe_set_timestamp(gxio_mpipe_context_t *context,
 EXPORT_SYMBOL_GPL(gxio_mpipe_set_timestamp);
 
 int gxio_mpipe_get_timestamp(gxio_mpipe_context_t *context,
-			     struct timespec *ts)
+			     struct timespec64 *ts)
 {
 	int ret;
 	cycles_t cycles_prev, cycles_now, clock_rate;
diff --git a/arch/tile/include/gxio/mpipe.h b/arch/tile/include/gxio/mpipe.h
index e37cf4f..73e83a1 100644
--- a/arch/tile/include/gxio/mpipe.h
+++ b/arch/tile/include/gxio/mpipe.h
@@ -1830,7 +1830,7 @@ extern int gxio_mpipe_link_set_attr(gxio_mpipe_link_t *link, uint32_t attr,
  *  code.
  */
 extern int gxio_mpipe_get_timestamp(gxio_mpipe_context_t *context,
-				    struct timespec *ts);
+				    struct timespec64 *ts);
 
 /* Set the timestamp of mPIPE.
  *
@@ -1840,7 +1840,7 @@ extern int gxio_mpipe_get_timestamp(gxio_mpipe_context_t *context,
  *  code.
  */
 extern int gxio_mpipe_set_timestamp(gxio_mpipe_context_t *context,
-				    const struct timespec *ts);
+				    const struct timespec64 *ts);
 
 /* Adjust the timestamp of mPIPE.
  *
diff --git a/drivers/net/ethernet/tile/tilegx.c b/drivers/net/ethernet/tile/tilegx.c
index bea8cd2..a789a20 100644
--- a/drivers/net/ethernet/tile/tilegx.c
+++ b/drivers/net/ethernet/tile/tilegx.c
@@ -838,7 +838,8 @@ static int ptp_mpipe_adjtime(struct ptp_clock_info *ptp, s64 delta)
 	return ret;
 }
 
-static int ptp_mpipe_gettime(struct ptp_clock_info *ptp, struct timespec *ts)
+static int ptp_mpipe_gettime(struct ptp_clock_info *ptp,
+			     struct timespec64 *ts)
 {
 	int ret = 0;
 	struct mpipe_data *md = container_of(ptp, struct mpipe_data, caps);
@@ -850,7 +851,7 @@ static int ptp_mpipe_gettime(struct ptp_clock_info *ptp, struct timespec *ts)
 }
 
 static int ptp_mpipe_settime(struct ptp_clock_info *ptp,
-			     const struct timespec *ts)
+			     const struct timespec64 *ts)
 {
 	int ret = 0;
 	struct mpipe_data *md = container_of(ptp, struct mpipe_data, caps);
@@ -876,8 +877,8 @@ static struct ptp_clock_info ptp_mpipe_caps = {
 	.pps		= 0,
 	.adjfreq	= ptp_mpipe_adjfreq,
 	.adjtime	= ptp_mpipe_adjtime,
-	.gettime	= ptp_mpipe_gettime,
-	.settime	= ptp_mpipe_settime,
+	.gettime64	= ptp_mpipe_gettime,
+	.settime64	= ptp_mpipe_settime,
 	.enable		= ptp_mpipe_enable,
 };
 
-- 
1.7.10.4


^ permalink raw reply	[flat|nested] 35+ messages in thread

* [PATCH net-next V3 20/23] ptp: dp83640: convert to the 64 bit get/set time methods.
  2015-03-29 21:11 [PATCH net-next V3 00/23] ptp: get ready for 2038 Richard Cochran
                   ` (18 preceding siblings ...)
  2015-03-29 21:12 ` [PATCH net-next V3 19/23] ptp: tilegx: " Richard Cochran
@ 2015-03-29 21:12 ` Richard Cochran
  2015-03-29 21:12 ` [PATCH net-next V3 21/23] ptp: ixp46x: " Richard Cochran
                   ` (3 subsequent siblings)
  23 siblings, 0 replies; 35+ messages in thread
From: Richard Cochran @ 2015-03-29 21:12 UTC (permalink / raw)
  To: netdev
  Cc: linux-kernel, Amir Vadai, Ariel Elior, Arnd Bergmann,
	Baolin Wang, Ben Hutchings, Bruce Allan, Carolyn Wyborny,
	Chris Metcalf, David Miller, Frank Li, Giuseppe Cavallaro,
	Jacob Keller, Jeff Kirsher, John Stultz, Luwei Zhou,
	Matthew Vick, Michael Chan, Prashant Sreedharan, Rayagond K,
	Shradha Shah, Solarflare linux maintainers, Sonic Zhang,
	Stefan Sørensen, Thomas Gleixner, Tom Lendacky

This device stores the number of seconds in a 32 bit register, and the
stored value is unsigned.  Therefore this driver and device are ready
for the year 2038.  However, more work will be needed prior to 2106.

Compile tested only.

Signed-off-by: Richard Cochran <richardcochran@gmail.com>
---
 drivers/net/phy/dp83640.c |   19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/drivers/net/phy/dp83640.c b/drivers/net/phy/dp83640.c
index e22e602..a83f8e5 100644
--- a/drivers/net/phy/dp83640.c
+++ b/drivers/net/phy/dp83640.c
@@ -257,7 +257,7 @@ static void ext_write(int broadcast, struct phy_device *phydev,
 
 /* Caller must hold extreg_lock. */
 static int tdr_write(int bc, struct phy_device *dev,
-		     const struct timespec *ts, u16 cmd)
+		     const struct timespec64 *ts, u16 cmd)
 {
 	ext_write(bc, dev, PAGE4, PTP_TDR, ts->tv_nsec & 0xffff);/* ns[15:0]  */
 	ext_write(bc, dev, PAGE4, PTP_TDR, ts->tv_nsec >> 16);   /* ns[31:16] */
@@ -411,12 +411,12 @@ static int ptp_dp83640_adjtime(struct ptp_clock_info *ptp, s64 delta)
 	struct dp83640_clock *clock =
 		container_of(ptp, struct dp83640_clock, caps);
 	struct phy_device *phydev = clock->chosen->phydev;
-	struct timespec ts;
+	struct timespec64 ts;
 	int err;
 
 	delta += ADJTIME_FIX;
 
-	ts = ns_to_timespec(delta);
+	ts = ns_to_timespec64(delta);
 
 	mutex_lock(&clock->extreg_lock);
 
@@ -427,7 +427,8 @@ static int ptp_dp83640_adjtime(struct ptp_clock_info *ptp, s64 delta)
 	return err;
 }
 
-static int ptp_dp83640_gettime(struct ptp_clock_info *ptp, struct timespec *ts)
+static int ptp_dp83640_gettime(struct ptp_clock_info *ptp,
+			       struct timespec64 *ts)
 {
 	struct dp83640_clock *clock =
 		container_of(ptp, struct dp83640_clock, caps);
@@ -452,7 +453,7 @@ static int ptp_dp83640_gettime(struct ptp_clock_info *ptp, struct timespec *ts)
 }
 
 static int ptp_dp83640_settime(struct ptp_clock_info *ptp,
-			       const struct timespec *ts)
+			       const struct timespec64 *ts)
 {
 	struct dp83640_clock *clock =
 		container_of(ptp, struct dp83640_clock, caps);
@@ -605,7 +606,7 @@ static void recalibrate(struct dp83640_clock *clock)
 {
 	s64 now, diff;
 	struct phy_txts event_ts;
-	struct timespec ts;
+	struct timespec64 ts;
 	struct list_head *this;
 	struct dp83640_private *tmp;
 	struct phy_device *master = clock->chosen->phydev;
@@ -697,7 +698,7 @@ static void recalibrate(struct dp83640_clock *clock)
 		diff = now - (s64) phy2txts(&event_ts);
 		pr_info("slave offset %lld nanoseconds\n", diff);
 		diff += ADJTIME_FIX;
-		ts = ns_to_timespec(diff);
+		ts = ns_to_timespec64(diff);
 		tdr_write(0, tmp->phydev, &ts, PTP_STEP_CLK);
 	}
 
@@ -998,8 +999,8 @@ static void dp83640_clock_init(struct dp83640_clock *clock, struct mii_bus *bus)
 	clock->caps.pps		= 0;
 	clock->caps.adjfreq	= ptp_dp83640_adjfreq;
 	clock->caps.adjtime	= ptp_dp83640_adjtime;
-	clock->caps.gettime	= ptp_dp83640_gettime;
-	clock->caps.settime	= ptp_dp83640_settime;
+	clock->caps.gettime64	= ptp_dp83640_gettime;
+	clock->caps.settime64	= ptp_dp83640_settime;
 	clock->caps.enable	= ptp_dp83640_enable;
 	clock->caps.verify	= ptp_dp83640_verify;
 	/*
-- 
1.7.10.4


^ permalink raw reply	[flat|nested] 35+ messages in thread

* [PATCH net-next V3 21/23] ptp: ixp46x: convert to the 64 bit get/set time methods.
  2015-03-29 21:11 [PATCH net-next V3 00/23] ptp: get ready for 2038 Richard Cochran
                   ` (19 preceding siblings ...)
  2015-03-29 21:12 ` [PATCH net-next V3 20/23] ptp: dp83640: " Richard Cochran
@ 2015-03-29 21:12 ` Richard Cochran
  2015-03-29 21:12 ` [PATCH net-next V3 22/23] ptp: pch: " Richard Cochran
                   ` (2 subsequent siblings)
  23 siblings, 0 replies; 35+ messages in thread
From: Richard Cochran @ 2015-03-29 21:12 UTC (permalink / raw)
  To: netdev
  Cc: linux-kernel, Amir Vadai, Ariel Elior, Arnd Bergmann,
	Baolin Wang, Ben Hutchings, Bruce Allan, Carolyn Wyborny,
	Chris Metcalf, David Miller, Frank Li, Giuseppe Cavallaro,
	Jacob Keller, Jeff Kirsher, John Stultz, Luwei Zhou,
	Matthew Vick, Michael Chan, Prashant Sreedharan, Rayagond K,
	Shradha Shah, Solarflare linux maintainers, Sonic Zhang,
	Stefan Sørensen, Thomas Gleixner, Tom Lendacky

The device has a 64 bit clock register, where each clock tick is 16
nanoseconds, and so with this patch the driver is ready for the year
2038.

Signed-off-by: Richard Cochran <richardcochran@gmail.com>
---
 drivers/ptp/ptp_ixp46x.c |    8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/ptp/ptp_ixp46x.c b/drivers/ptp/ptp_ixp46x.c
index 604d340..934c139 100644
--- a/drivers/ptp/ptp_ixp46x.c
+++ b/drivers/ptp/ptp_ixp46x.c
@@ -175,7 +175,7 @@ static int ptp_ixp_adjtime(struct ptp_clock_info *ptp, s64 delta)
 	return 0;
 }
 
-static int ptp_ixp_gettime(struct ptp_clock_info *ptp, struct timespec *ts)
+static int ptp_ixp_gettime(struct ptp_clock_info *ptp, struct timespec64 *ts)
 {
 	u64 ns;
 	u32 remainder;
@@ -195,7 +195,7 @@ static int ptp_ixp_gettime(struct ptp_clock_info *ptp, struct timespec *ts)
 }
 
 static int ptp_ixp_settime(struct ptp_clock_info *ptp,
-			   const struct timespec *ts)
+			   const struct timespec64 *ts)
 {
 	u64 ns;
 	unsigned long flags;
@@ -248,8 +248,8 @@ static struct ptp_clock_info ptp_ixp_caps = {
 	.pps		= 0,
 	.adjfreq	= ptp_ixp_adjfreq,
 	.adjtime	= ptp_ixp_adjtime,
-	.gettime	= ptp_ixp_gettime,
-	.settime	= ptp_ixp_settime,
+	.gettime64	= ptp_ixp_gettime,
+	.settime64	= ptp_ixp_settime,
 	.enable		= ptp_ixp_enable,
 };
 
-- 
1.7.10.4


^ permalink raw reply	[flat|nested] 35+ messages in thread

* [PATCH net-next V3 22/23] ptp: pch: convert to the 64 bit get/set time methods.
  2015-03-29 21:11 [PATCH net-next V3 00/23] ptp: get ready for 2038 Richard Cochran
                   ` (20 preceding siblings ...)
  2015-03-29 21:12 ` [PATCH net-next V3 21/23] ptp: ixp46x: " Richard Cochran
@ 2015-03-29 21:12 ` Richard Cochran
  2015-03-29 21:12 ` [PATCH net-next V3 23/23] ptp: remove 32 bit get/set methods Richard Cochran
  2015-03-31 16:01 ` [PATCH net-next V3 00/23] ptp: get ready for 2038 David Miller
  23 siblings, 0 replies; 35+ messages in thread
From: Richard Cochran @ 2015-03-29 21:12 UTC (permalink / raw)
  To: netdev
  Cc: linux-kernel, Amir Vadai, Ariel Elior, Arnd Bergmann,
	Baolin Wang, Ben Hutchings, Bruce Allan, Carolyn Wyborny,
	Chris Metcalf, David Miller, Frank Li, Giuseppe Cavallaro,
	Jacob Keller, Jeff Kirsher, John Stultz, Luwei Zhou,
	Matthew Vick, Michael Chan, Prashant Sreedharan, Rayagond K,
	Shradha Shah, Solarflare linux maintainers, Sonic Zhang,
	Stefan Sørensen, Thomas Gleixner, Tom Lendacky

The device has a 64 bit clock register, where each clock tick is 32
nanoseconds, and so with this patch the driver is ready for the year
2038.

Compile tested only.

Signed-off-by: Richard Cochran <richardcochran@gmail.com>
---
 drivers/ptp/ptp_pch.c |    8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/ptp/ptp_pch.c b/drivers/ptp/ptp_pch.c
index 2554872..3aa22ae 100644
--- a/drivers/ptp/ptp_pch.c
+++ b/drivers/ptp/ptp_pch.c
@@ -449,7 +449,7 @@ static int ptp_pch_adjtime(struct ptp_clock_info *ptp, s64 delta)
 	return 0;
 }
 
-static int ptp_pch_gettime(struct ptp_clock_info *ptp, struct timespec *ts)
+static int ptp_pch_gettime(struct ptp_clock_info *ptp, struct timespec64 *ts)
 {
 	u64 ns;
 	u32 remainder;
@@ -467,7 +467,7 @@ static int ptp_pch_gettime(struct ptp_clock_info *ptp, struct timespec *ts)
 }
 
 static int ptp_pch_settime(struct ptp_clock_info *ptp,
-			   const struct timespec *ts)
+			   const struct timespec64 *ts)
 {
 	u64 ns;
 	unsigned long flags;
@@ -518,8 +518,8 @@ static struct ptp_clock_info ptp_pch_caps = {
 	.pps		= 0,
 	.adjfreq	= ptp_pch_adjfreq,
 	.adjtime	= ptp_pch_adjtime,
-	.gettime	= ptp_pch_gettime,
-	.settime	= ptp_pch_settime,
+	.gettime64	= ptp_pch_gettime,
+	.settime64	= ptp_pch_settime,
 	.enable		= ptp_pch_enable,
 };
 
-- 
1.7.10.4


^ permalink raw reply	[flat|nested] 35+ messages in thread

* [PATCH net-next V3 23/23] ptp: remove 32 bit get/set methods.
  2015-03-29 21:11 [PATCH net-next V3 00/23] ptp: get ready for 2038 Richard Cochran
                   ` (21 preceding siblings ...)
  2015-03-29 21:12 ` [PATCH net-next V3 22/23] ptp: pch: " Richard Cochran
@ 2015-03-29 21:12 ` Richard Cochran
  2015-03-31 16:01 ` [PATCH net-next V3 00/23] ptp: get ready for 2038 David Miller
  23 siblings, 0 replies; 35+ messages in thread
From: Richard Cochran @ 2015-03-29 21:12 UTC (permalink / raw)
  To: netdev
  Cc: linux-kernel, Amir Vadai, Ariel Elior, Arnd Bergmann,
	Baolin Wang, Ben Hutchings, Bruce Allan, Carolyn Wyborny,
	Chris Metcalf, David Miller, Frank Li, Giuseppe Cavallaro,
	Jacob Keller, Jeff Kirsher, John Stultz, Luwei Zhou,
	Matthew Vick, Michael Chan, Prashant Sreedharan, Rayagond K,
	Shradha Shah, Solarflare linux maintainers, Sonic Zhang,
	Stefan Sørensen, Thomas Gleixner, Tom Lendacky

All of the PHC drivers have been converted to the new methods.  This patch
converts the three remaining callers within the core code and removes the
older methods for good.  As a result, the core PHC code is ready for the
year 2038.  However, some of the PHC drivers are not quite ready yet.

Signed-off-by: Richard Cochran <richardcochran@gmail.com>
---
 drivers/ptp/ptp_chardev.c        |    8 +-------
 drivers/ptp/ptp_clock.c          |   15 ++++-----------
 include/linux/ptp_clock_kernel.h |    8 --------
 3 files changed, 5 insertions(+), 26 deletions(-)

diff --git a/drivers/ptp/ptp_chardev.c b/drivers/ptp/ptp_chardev.c
index 95bcf15..da7bae9 100644
--- a/drivers/ptp/ptp_chardev.c
+++ b/drivers/ptp/ptp_chardev.c
@@ -125,7 +125,6 @@ long ptp_ioctl(struct posix_clock *pc, unsigned int cmd, unsigned long arg)
 	struct ptp_clock_info *ops = ptp->info;
 	struct ptp_clock_time *pct;
 	struct timespec64 ts;
-	struct timespec t2;
 	int enable, err = 0;
 	unsigned int i, pin_index;
 
@@ -202,12 +201,7 @@ long ptp_ioctl(struct posix_clock *pc, unsigned int cmd, unsigned long arg)
 			pct->sec = ts.tv_sec;
 			pct->nsec = ts.tv_nsec;
 			pct++;
-			if (ptp->info->gettime64) {
-				ptp->info->gettime64(ptp->info, &ts);
-			} else {
-				ptp->info->gettime(ptp->info, &t2);
-				ts = timespec_to_timespec64(t2);
-			}
+			ptp->info->gettime64(ptp->info, &ts);
 			pct->sec = ts.tv_sec;
 			pct->nsec = ts.tv_nsec;
 			pct++;
diff --git a/drivers/ptp/ptp_clock.c b/drivers/ptp/ptp_clock.c
index df50d5e..2e481b9 100644
--- a/drivers/ptp/ptp_clock.c
+++ b/drivers/ptp/ptp_clock.c
@@ -109,9 +109,7 @@ static int ptp_clock_settime(struct posix_clock *pc, const struct timespec *tp)
 	struct ptp_clock *ptp = container_of(pc, struct ptp_clock, clock);
 	struct timespec64 ts = timespec_to_timespec64(*tp);
 
-	return  ptp->info->settime64 ?
-		ptp->info->settime64(ptp->info, &ts) :
-		ptp->info->settime(ptp->info, tp);
+	return  ptp->info->settime64(ptp->info, &ts);
 }
 
 static int ptp_clock_gettime(struct posix_clock *pc, struct timespec *tp)
@@ -120,14 +118,9 @@ static int ptp_clock_gettime(struct posix_clock *pc, struct timespec *tp)
 	struct timespec64 ts;
 	int err;
 
-	if (ptp->info->gettime64) {
-		err = ptp->info->gettime64(ptp->info, &ts);
-		if (!err)
-			*tp = timespec64_to_timespec(ts);
-	} else {
-		err = ptp->info->gettime(ptp->info, tp);
-	}
-
+	err = ptp->info->gettime64(ptp->info, &ts);
+	if (!err)
+		*tp = timespec64_to_timespec(ts);
 	return err;
 }
 
diff --git a/include/linux/ptp_clock_kernel.h b/include/linux/ptp_clock_kernel.h
index 7d6f8e6..b8b7306 100644
--- a/include/linux/ptp_clock_kernel.h
+++ b/include/linux/ptp_clock_kernel.h
@@ -64,12 +64,6 @@ struct ptp_clock_request {
  * @adjtime:  Shifts the time of the hardware clock.
  *            parameter delta: Desired change in nanoseconds.
  *
- * @gettime:  Reads the current time from the hardware clock. (deprecated)
- *            parameter ts: Holds the result.
- *
- * @settime:  Set the current time on the hardware clock. (deprecated)
- *            parameter ts: Time value to set.
- *
  * @gettime64:  Reads the current time from the hardware clock.
  *              parameter ts: Holds the result.
  *
@@ -110,8 +104,6 @@ struct ptp_clock_info {
 	struct ptp_pin_desc *pin_config;
 	int (*adjfreq)(struct ptp_clock_info *ptp, s32 delta);
 	int (*adjtime)(struct ptp_clock_info *ptp, s64 delta);
-	int (*gettime)(struct ptp_clock_info *ptp, struct timespec *ts);
-	int (*settime)(struct ptp_clock_info *ptp, const struct timespec *ts);
 	int (*gettime64)(struct ptp_clock_info *ptp, struct timespec64 *ts);
 	int (*settime64)(struct ptp_clock_info *p, const struct timespec64 *ts);
 	int (*enable)(struct ptp_clock_info *ptp,
-- 
1.7.10.4


^ permalink raw reply	[flat|nested] 35+ messages in thread

* Re: [PATCH net-next V3 19/23] ptp: tilegx: convert to the 64 bit get/set time methods.
  2015-03-29 21:12 ` [PATCH net-next V3 19/23] ptp: tilegx: " Richard Cochran
@ 2015-03-29 21:32   ` Chris Metcalf
  0 siblings, 0 replies; 35+ messages in thread
From: Chris Metcalf @ 2015-03-29 21:32 UTC (permalink / raw)
  To: Richard Cochran, netdev
  Cc: linux-kernel, Amir Vadai, Ariel Elior, Arnd Bergmann,
	Baolin Wang, Ben Hutchings, Bruce Allan, Carolyn Wyborny,
	David Miller, Frank Li, Giuseppe Cavallaro, Jacob Keller,
	Jeff Kirsher, John Stultz, Luwei Zhou, Matthew Vick,
	Michael Chan, Prashant Sreedharan, Rayagond K, Shradha Shah,
	Solarflare linux maintainers, Sonic Zhang, Stefan Sørensen,
	Thomas Gleixner, Tom Lendacky

On 3/29/2015 5:12 PM, Richard Cochran wrote:
> This driver is 64 bit only, and so this driver and device are ready
> for 2038.  This patch changes the driver to the new PHC and also
> carries the timespec64 parameter on out to the gxio_mpipe_get-
> set_timestamp functions, making explicit the fact that the tv_sec
> field is 64 bits wide.
>
> Not even compile tested.
>
> Signed-off-by: Richard Cochran<richardcochran@gmail.com>
> ---
>   arch/tile/gxio/mpipe.c             |    4 ++--
>   arch/tile/include/gxio/mpipe.h     |    4 ++--
>   drivers/net/ethernet/tile/tilegx.c |    9 +++++----
>   3 files changed, 9 insertions(+), 8 deletions(-)

Acked-by: Chris Metcalf <cmetcalf@ezchip.com>

-- 
Chris Metcalf, EZChip Semiconductor
http://www.ezchip.com


^ permalink raw reply	[flat|nested] 35+ messages in thread

* RE: [PATCH net-next V3 06/23] ptp: bnx2x: convert to the 64 bit get/set time methods.
  2015-03-29 21:11 ` [PATCH net-next V3 06/23] ptp: bnx2x: " Richard Cochran
@ 2015-03-30 21:13   ` Sony Chacko
  0 siblings, 0 replies; 35+ messages in thread
From: Sony Chacko @ 2015-03-30 21:13 UTC (permalink / raw)
  To: Richard Cochran, netdev
  Cc: linux-kernel, Amir Vadai, Ariel Elior, Arnd Bergmann,
	Baolin Wang, Ben Hutchings, Bruce Allan, Carolyn Wyborny,
	Chris Metcalf, David Miller, Frank Li, Giuseppe Cavallaro,
	Jacob Keller, Jeff Kirsher, John Stultz, Luwei Zhou,
	Matthew Vick, Michael Chan, Prashant Sreedharan, Rayagond K,
	Shradha Shah, Solarflare linux maintainers, Sonic Zhang,
	Stefan Sørensen, Thomas Gleixner, Tom Lendacky

> From: linux-kernel-owner@vger.kernel.org [mailto:linux-kernel-
> owner@vger.kernel.org] On Behalf Of Richard Cochran
> Sent: Sunday, March 29, 2015 2:12 PM
> To: netdev
> Cc: linux-kernel; Amir Vadai; Ariel Elior; Arnd Bergmann; Baolin
> Wang; Ben Hutchings; Bruce Allan; Carolyn Wyborny; Chris
> Metcalf; David Miller; Frank Li; Giuseppe Cavallaro; Jacob Keller;
> Jeff Kirsher; John Stultz; Luwei Zhou; Matthew Vick; Michael
> Chan; Prashant Sreedharan; Rayagond K; Shradha Shah;
> Solarflare linux maintainers; Sonic Zhang; Stefan Sørensen;
> Thomas Gleixner; Tom Lendacky
> Subject: [PATCH net-next V3 06/23] ptp: bnx2x: convert to the 64
> bit get/set time methods.
> 
> This driver's clock is implemented using a timecounter, and so
> with this patch the driver is ready for the year 2038.
> 
> Compile tested only.
> 
> Signed-off-by: Richard Cochran <richardcochran@gmail.com>
> ---
>  drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c |    8
> ++++----
>  1 file changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c
> b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c
> index 9677431..765667c 100644
> --- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c
> +++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c
> @@ -13278,7 +13278,7 @@ static int bnx2x_ptp_adjtime(struct
> ptp_clock_info *ptp, s64 delta)
>  	return 0;
>  }
> 
> -static int bnx2x_ptp_gettime(struct ptp_clock_info *ptp, struct
> timespec *ts)
> +static int bnx2x_ptp_gettime(struct ptp_clock_info *ptp, struct
> +timespec64 *ts)
>  {
>  	struct bnx2x *bp = container_of(ptp, struct bnx2x,
> ptp_clock_info);
>  	u64 ns;
> @@ -13295,7 +13295,7 @@ static int bnx2x_ptp_gettime(struct
> ptp_clock_info *ptp, struct timespec *ts)  }
> 
>  static int bnx2x_ptp_settime(struct ptp_clock_info *ptp,
> -			     const struct timespec *ts)
> +			     const struct timespec64 *ts)
>  {
>  	struct bnx2x *bp = container_of(ptp, struct bnx2x,
> ptp_clock_info);
>  	u64 ns;
> @@ -13333,8 +13333,8 @@ static void
> bnx2x_register_phc(struct bnx2x *bp)
>  	bp->ptp_clock_info.pps = 0;
>  	bp->ptp_clock_info.adjfreq = bnx2x_ptp_adjfreq;
>  	bp->ptp_clock_info.adjtime = bnx2x_ptp_adjtime;
> -	bp->ptp_clock_info.gettime = bnx2x_ptp_gettime;
> -	bp->ptp_clock_info.settime = bnx2x_ptp_settime;
> +	bp->ptp_clock_info.gettime64 = bnx2x_ptp_gettime;
> +	bp->ptp_clock_info.settime64 = bnx2x_ptp_settime;
>  	bp->ptp_clock_info.enable = bnx2x_ptp_enable;

Acked-by: Sony Chacko <sony.chacko@qlogic.com>

Thanks,
Sony

^ permalink raw reply	[flat|nested] 35+ messages in thread

* Re: [PATCH net-next V3 00/23] ptp: get ready for 2038
  2015-03-29 21:11 [PATCH net-next V3 00/23] ptp: get ready for 2038 Richard Cochran
                   ` (22 preceding siblings ...)
  2015-03-29 21:12 ` [PATCH net-next V3 23/23] ptp: remove 32 bit get/set methods Richard Cochran
@ 2015-03-31 16:01 ` David Miller
  23 siblings, 0 replies; 35+ messages in thread
From: David Miller @ 2015-03-31 16:01 UTC (permalink / raw)
  To: richardcochran
  Cc: netdev, linux-kernel, amirv, ariel.elior, arnd, baolin.wang, ben,
	bruce.w.allan, carolyn.wyborny, cmetcalf, Frank.Li,
	peppe.cavallaro, jacob.e.keller, jeffrey.t.kirsher, john.stultz,
	b45643, matthew.vick, mchan, prashant, rayagond, sshah,
	linux-net-drivers, sonic.zhang, stefan.sorensen, tglx,
	thomas.lendacky

From: Richard Cochran <richardcochran@gmail.com>
Date: Sun, 29 Mar 2015 23:11:50 +0200

> This series converts the core driver methods of the PTP Hardware Clock
> (PHC) subsystem to use the 64 bit version of the timespec structure,
> making the core API ready for the year 2038.

Looks great, series applied, thanks Richard.

^ permalink raw reply	[flat|nested] 35+ messages in thread

* Re: [PATCH net-next V3 13/23] ptp: igb: convert to the 64 bit get/set time methods.
  2015-03-29 21:12 ` [PATCH net-next V3 13/23] ptp: igb: " Richard Cochran
@ 2015-03-31 21:08   ` Keller, Jacob E
  2015-03-31 21:37     ` Richard Cochran
  2015-03-31 21:53   ` Richard Cochran
  1 sibling, 1 reply; 35+ messages in thread
From: Keller, Jacob E @ 2015-03-31 21:08 UTC (permalink / raw)
  To: richardcochran
  Cc: thomas.lendacky, linux-kernel, baolin.wang, b45643, sshah, amirv,
	ben, sonic.zhang, peppe.cavallaro, Allan, Bruce W, rayagond,
	tglx, ariel.elior, cmetcalf, Vick, Matthew, linux-net-drivers,
	arnd, Frank.Li, netdev, mchan, Wyborny, Carolyn, prashant, davem,
	Kirsher, Jeffrey T, stefan.sorensen, john.stultz

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset="utf-8", Size: 7010 bytes --]

On Sun, 2015-03-29 at 23:12 +0200, Richard Cochran wrote:
> For the 82576, the driver's clock is implemented using a timecounter,
> and so with this patch that device is ready for the year 2038.
> 
> However, in the case of the i210, the device stores the number of
> seconds in a 32 bit register.  Therefore, more work is needed on this
> driver before the year 2038 comes around.
> 
> Compile tested only.

I assume we would want to use a time counter wrapper here to resolve
this issue?

Regards,
Jake

> 
> Signed-off-by: Richard Cochran <richardcochran@gmail.com>
> Acked-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
> ---
>  drivers/net/ethernet/intel/igb/igb_ptp.c |   41 +++++++++++++++---------------
>  1 file changed, 21 insertions(+), 20 deletions(-)
> 
> diff --git a/drivers/net/ethernet/intel/igb/igb_ptp.c b/drivers/net/ethernet/intel/igb/igb_ptp.c
> index 52d01b8..0348b7e 100644
> --- a/drivers/net/ethernet/intel/igb/igb_ptp.c
> +++ b/drivers/net/ethernet/intel/igb/igb_ptp.c
> @@ -116,7 +116,8 @@ static cycle_t igb_ptp_read_82580(const struct cyclecounter *cc)
>  }
>  
>  /* SYSTIM read access for I210/I211 */
> -static void igb_ptp_read_i210(struct igb_adapter *adapter, struct timespec *ts)
> +static void igb_ptp_read_i210(struct igb_adapter *adapter,
> +			      struct timespec64 *ts)
>  {
>  	struct e1000_hw *hw = &adapter->hw;
>  	u32 sec, nsec;
> @@ -134,7 +135,7 @@ static void igb_ptp_read_i210(struct igb_adapter *adapter, struct timespec *ts)
>  }
>  
>  static void igb_ptp_write_i210(struct igb_adapter *adapter,
> -			       const struct timespec *ts)
> +			       const struct timespec64 *ts)
>  {
>  	struct e1000_hw *hw = &adapter->hw;
>  
> @@ -269,13 +270,13 @@ static int igb_ptp_adjtime_i210(struct ptp_clock_info *ptp, s64 delta)
>  	struct igb_adapter *igb = container_of(ptp, struct igb_adapter,
>  					       ptp_caps);
>  	unsigned long flags;
> -	struct timespec now, then = ns_to_timespec(delta);
> +	struct timespec64 now, then = ns_to_timespec64(delta);
>  
>  	spin_lock_irqsave(&igb->tmreg_lock, flags);
>  
>  	igb_ptp_read_i210(igb, &now);
> -	now = timespec_add(now, then);
> -	igb_ptp_write_i210(igb, (const struct timespec *)&now);
> +	now = timespec64_add(now, then);
> +	igb_ptp_write_i210(igb, (const struct timespec64 *)&now);
>  
>  	spin_unlock_irqrestore(&igb->tmreg_lock, flags);
>  
> @@ -283,7 +284,7 @@ static int igb_ptp_adjtime_i210(struct ptp_clock_info *ptp, s64 delta)
>  }
>  
>  static int igb_ptp_gettime_82576(struct ptp_clock_info *ptp,
> -				 struct timespec *ts)
> +				 struct timespec64 *ts)
>  {
>  	struct igb_adapter *igb = container_of(ptp, struct igb_adapter,
>  					       ptp_caps);
> @@ -304,7 +305,7 @@ static int igb_ptp_gettime_82576(struct ptp_clock_info *ptp,
>  }
>  
>  static int igb_ptp_gettime_i210(struct ptp_clock_info *ptp,
> -				struct timespec *ts)
> +				struct timespec64 *ts)
>  {
>  	struct igb_adapter *igb = container_of(ptp, struct igb_adapter,
>  					       ptp_caps);
> @@ -320,7 +321,7 @@ static int igb_ptp_gettime_i210(struct ptp_clock_info *ptp,
>  }
>  
>  static int igb_ptp_settime_82576(struct ptp_clock_info *ptp,
> -				 const struct timespec *ts)
> +				 const struct timespec64 *ts)
>  {
>  	struct igb_adapter *igb = container_of(ptp, struct igb_adapter,
>  					       ptp_caps);
> @@ -340,7 +341,7 @@ static int igb_ptp_settime_82576(struct ptp_clock_info *ptp,
>  }
>  
>  static int igb_ptp_settime_i210(struct ptp_clock_info *ptp,
> -				const struct timespec *ts)
> +				const struct timespec64 *ts)
>  {
>  	struct igb_adapter *igb = container_of(ptp, struct igb_adapter,
>  					       ptp_caps);
> @@ -627,11 +628,11 @@ static void igb_ptp_overflow_check(struct work_struct *work)
>  {
>  	struct igb_adapter *igb =
>  		container_of(work, struct igb_adapter, ptp_overflow_work.work);
> -	struct timespec ts;
> +	struct timespec64 ts;
>  
> -	igb->ptp_caps.gettime(&igb->ptp_caps, &ts);
> +	igb->ptp_caps.gettime64(&igb->ptp_caps, &ts);
>  
> -	pr_debug("igb overflow check at %ld.%09lu\n", ts.tv_sec, ts.tv_nsec);
> +	pr_debug("igb overflow check at %lld.%09lu\n", ts.tv_sec, ts.tv_nsec);
>  
>  	schedule_delayed_work(&igb->ptp_overflow_work,
>  			      IGB_SYSTIM_OVERFLOW_PERIOD);
> @@ -989,8 +990,8 @@ void igb_ptp_init(struct igb_adapter *adapter)
>  		adapter->ptp_caps.pps = 0;
>  		adapter->ptp_caps.adjfreq = igb_ptp_adjfreq_82576;
>  		adapter->ptp_caps.adjtime = igb_ptp_adjtime_82576;
> -		adapter->ptp_caps.gettime = igb_ptp_gettime_82576;
> -		adapter->ptp_caps.settime = igb_ptp_settime_82576;
> +		adapter->ptp_caps.gettime64 = igb_ptp_gettime_82576;
> +		adapter->ptp_caps.settime64 = igb_ptp_settime_82576;
>  		adapter->ptp_caps.enable = igb_ptp_feature_enable;
>  		adapter->cc.read = igb_ptp_read_82576;
>  		adapter->cc.mask = CYCLECOUNTER_MASK(64);
> @@ -1009,8 +1010,8 @@ void igb_ptp_init(struct igb_adapter *adapter)
>  		adapter->ptp_caps.pps = 0;
>  		adapter->ptp_caps.adjfreq = igb_ptp_adjfreq_82580;
>  		adapter->ptp_caps.adjtime = igb_ptp_adjtime_82576;
> -		adapter->ptp_caps.gettime = igb_ptp_gettime_82576;
> -		adapter->ptp_caps.settime = igb_ptp_settime_82576;
> +		adapter->ptp_caps.gettime64 = igb_ptp_gettime_82576;
> +		adapter->ptp_caps.settime64 = igb_ptp_settime_82576;
>  		adapter->ptp_caps.enable = igb_ptp_feature_enable;
>  		adapter->cc.read = igb_ptp_read_82580;
>  		adapter->cc.mask = CYCLECOUNTER_MASK(IGB_NBITS_82580);
> @@ -1038,8 +1039,8 @@ void igb_ptp_init(struct igb_adapter *adapter)
>  		adapter->ptp_caps.pin_config = adapter->sdp_config;
>  		adapter->ptp_caps.adjfreq = igb_ptp_adjfreq_82580;
>  		adapter->ptp_caps.adjtime = igb_ptp_adjtime_i210;
> -		adapter->ptp_caps.gettime = igb_ptp_gettime_i210;
> -		adapter->ptp_caps.settime = igb_ptp_settime_i210;
> +		adapter->ptp_caps.gettime64 = igb_ptp_gettime_i210;
> +		adapter->ptp_caps.settime64 = igb_ptp_settime_i210;
>  		adapter->ptp_caps.enable = igb_ptp_feature_enable_i210;
>  		adapter->ptp_caps.verify = igb_ptp_verify_pin;
>  		/* Enable the timer functions by clearing bit 31. */
> @@ -1057,7 +1058,7 @@ void igb_ptp_init(struct igb_adapter *adapter)
>  
>  	/* Initialize the clock and overflow work for devices that need it. */
>  	if ((hw->mac.type == e1000_i210) || (hw->mac.type == e1000_i211)) {
> -		struct timespec ts = ktime_to_timespec(ktime_get_real());
> +		struct timespec64 ts = ktime_to_timespec64(ktime_get_real());
>  
>  		igb_ptp_settime_i210(&adapter->ptp_caps, &ts);
>  	} else {
> @@ -1171,7 +1172,7 @@ void igb_ptp_reset(struct igb_adapter *adapter)
>  
>  	/* Re-initialize the timer. */
>  	if ((hw->mac.type == e1000_i210) || (hw->mac.type == e1000_i211)) {
> -		struct timespec ts = ktime_to_timespec(ktime_get_real());
> +		struct timespec64 ts = ktime_to_timespec64(ktime_get_real());
>  
>  		igb_ptp_write_i210(adapter, &ts);
>  	} else {

ÿôèº{.nÇ+‰·Ÿ®‰­†+%ŠËÿ±éݶ\x17¥Šwÿº{.nÇ+‰·¥Š{±þG«éÿŠ{ayº\x1dʇڙë,j\a­¢f£¢·hšïêÿ‘êçz_è®\x03(­éšŽŠÝ¢j"ú\x1a¶^[m§ÿÿ¾\a«þG«éÿ¢¸?™¨è­Ú&£ø§~á¶iO•æ¬z·švØ^\x14\x04\x1a¶^[m§ÿÿÃ\fÿ¶ìÿ¢¸?–I¥

^ permalink raw reply	[flat|nested] 35+ messages in thread

* Re: [PATCH net-next V3 13/23] ptp: igb: convert to the 64 bit get/set time methods.
  2015-03-31 21:08   ` Keller, Jacob E
@ 2015-03-31 21:37     ` Richard Cochran
  2015-04-02  0:08       ` Keller, Jacob E
  0 siblings, 1 reply; 35+ messages in thread
From: Richard Cochran @ 2015-03-31 21:37 UTC (permalink / raw)
  To: Keller, Jacob E
  Cc: thomas.lendacky, linux-kernel, baolin.wang, b45643, sshah, amirv,
	ben, sonic.zhang, peppe.cavallaro, Allan, Bruce W, rayagond,
	tglx, ariel.elior, cmetcalf, Vick, Matthew, linux-net-drivers,
	arnd, Frank.Li, netdev, mchan, Wyborny, Carolyn, prashant, davem,
	Kirsher, Jeffrey T, stefan.sorensen, john.stultz

On Tue, Mar 31, 2015 at 09:08:10PM +0000, Keller, Jacob E wrote:
> On Sun, 2015-03-29 at 23:12 +0200, Richard Cochran wrote:
> > For the 82576, the driver's clock is implemented using a timecounter,
> > and so with this patch that device is ready for the year 2038.
> > 
> > However, in the case of the i210, the device stores the number of
> > seconds in a 32 bit register.  Therefore, more work is needed on this
> > driver before the year 2038 comes around.
> > 
> > Compile tested only.
> 
> I assume we would want to use a time counter wrapper here to resolve
> this issue?

I would just keep the seconds in software for settime() and adjtime(),
but let the nanoseconds field go to the hardware.  Then, the gettime()
result, the periodic outputs, the external time stamps, and the skb
time stamps will need to be corrected by that many seconds.

Thanks,
Richard

^ permalink raw reply	[flat|nested] 35+ messages in thread

* Re: [PATCH net-next V3 10/23] ptp: e1000e: convert to the 64 bit get/set time methods.
  2015-03-29 21:12 ` [PATCH net-next V3 10/23] ptp: e1000e: " Richard Cochran
@ 2015-03-31 21:48   ` Richard Cochran
  2015-03-31 23:26     ` David Miller
  0 siblings, 1 reply; 35+ messages in thread
From: Richard Cochran @ 2015-03-31 21:48 UTC (permalink / raw)
  To: netdev
  Cc: linux-kernel, Amir Vadai, Ariel Elior, Arnd Bergmann,
	Baolin Wang, Ben Hutchings, Bruce Allan, Carolyn Wyborny,
	Chris Metcalf, David Miller, Frank Li, Giuseppe Cavallaro,
	Jacob Keller, Jeff Kirsher, John Stultz, Luwei Zhou,
	Matthew Vick, Michael Chan, Prashant Sreedharan, Rayagond K,
	Shradha Shah, Solarflare linux maintainers, Sonic Zhang,
	Stefan Sørensen, Thomas Gleixner, Tom Lendacky

On Sun, Mar 29, 2015 at 11:12:00PM +0200, Richard Cochran wrote:

> @@ -171,11 +171,11 @@ static void e1000e_systim_overflow_work(struct work_struct *work)
>  	struct e1000_adapter *adapter = container_of(work, struct e1000_adapter,
>  						     systim_overflow_work.work);
>  	struct e1000_hw *hw = &adapter->hw;
> -	struct timespec ts;
> +	struct timespec64 ts;
>  
> -	adapter->ptp_clock_info.gettime(&adapter->ptp_clock_info, &ts);
> +	adapter->ptp_clock_info.gettime64(&adapter->ptp_clock_info, &ts);
>  
> -	e_dbg("SYSTIM overflow check at %ld.%09lu\n", ts.tv_sec, ts.tv_nsec);
> +	e_dbg("SYSTIM overflow check at %lld.%09lu\n", ts.tv_sec, ts.tv_nsec);

On a 64 bit build, this triggers a new warning.

drivers/net/ethernet/intel/e1000e/ptp.c: In function ‘e1000e_systim_overflow_work’:
drivers/net/ethernet/intel/e1000e/ptp.c:176:2: warning: format ‘%lld’ expects argument of type ‘long long int’, but argument 4 has type ‘__kernel_time_t’ [-Wformat]

On 32 bit, timespec64.tv_sec is of type 'time64_t' or '__s64'.

On 64 bit, timespec64.tv_sec is of type '__kernel_time_t' or
'__kernel_long_t' or 'long'.

How are we supposed to print that field?  With a cast?

Thanks,
Richard


^ permalink raw reply	[flat|nested] 35+ messages in thread

* Re: [PATCH net-next V3 13/23] ptp: igb: convert to the 64 bit get/set time methods.
  2015-03-29 21:12 ` [PATCH net-next V3 13/23] ptp: igb: " Richard Cochran
  2015-03-31 21:08   ` Keller, Jacob E
@ 2015-03-31 21:53   ` Richard Cochran
  2015-04-02  0:06     ` Keller, Jacob E
  1 sibling, 1 reply; 35+ messages in thread
From: Richard Cochran @ 2015-03-31 21:53 UTC (permalink / raw)
  To: netdev
  Cc: linux-kernel, Amir Vadai, Ariel Elior, Arnd Bergmann,
	Baolin Wang, Ben Hutchings, Bruce Allan, Carolyn Wyborny,
	Chris Metcalf, David Miller, Frank Li, Giuseppe Cavallaro,
	Jacob Keller, Jeff Kirsher, John Stultz, Luwei Zhou,
	Matthew Vick, Michael Chan, Prashant Sreedharan, Rayagond K,
	Shradha Shah, Solarflare linux maintainers, Sonic Zhang,
	Stefan Sørensen, Thomas Gleixner, Tom Lendacky

On Sun, Mar 29, 2015 at 11:12:03PM +0200, Richard Cochran wrote:

> @@ -627,11 +628,11 @@ static void igb_ptp_overflow_check(struct work_struct *work)
>  {
>  	struct igb_adapter *igb =
>  		container_of(work, struct igb_adapter, ptp_overflow_work.work);
> -	struct timespec ts;
> +	struct timespec64 ts;
>  
> -	igb->ptp_caps.gettime(&igb->ptp_caps, &ts);
> +	igb->ptp_caps.gettime64(&igb->ptp_caps, &ts);
>  
> -	pr_debug("igb overflow check at %ld.%09lu\n", ts.tv_sec, ts.tv_nsec);
> +	pr_debug("igb overflow check at %lld.%09lu\n", ts.tv_sec, ts.tv_nsec);

For a 64 bit build, this produces the same warning as e1000e.

What is the best way to deal with this warning?

Thanks,
Richard


^ permalink raw reply	[flat|nested] 35+ messages in thread

* Re: [PATCH net-next V3 10/23] ptp: e1000e: convert to the 64 bit get/set time methods.
  2015-03-31 21:48   ` Richard Cochran
@ 2015-03-31 23:26     ` David Miller
  0 siblings, 0 replies; 35+ messages in thread
From: David Miller @ 2015-03-31 23:26 UTC (permalink / raw)
  To: richardcochran
  Cc: netdev, linux-kernel, amirv, ariel.elior, arnd, baolin.wang, ben,
	bruce.w.allan, carolyn.wyborny, cmetcalf, Frank.Li,
	peppe.cavallaro, jacob.e.keller, jeffrey.t.kirsher, john.stultz,
	b45643, matthew.vick, mchan, prashant, rayagond, sshah,
	linux-net-drivers, sonic.zhang, stefan.sorensen, tglx,
	thomas.lendacky

From: Richard Cochran <richardcochran@gmail.com>
Date: Tue, 31 Mar 2015 23:48:15 +0200

> How are we supposed to print that field?  With a cast?

I resolved this (and the one in igb) in my merge commit, maybe you
should check it out.

^ permalink raw reply	[flat|nested] 35+ messages in thread

* RE: [PATCH net-next V3 13/23] ptp: igb: convert to the 64 bit get/set time methods.
  2015-03-31 21:53   ` Richard Cochran
@ 2015-04-02  0:06     ` Keller, Jacob E
  2015-04-02  6:33       ` Richard Cochran
  0 siblings, 1 reply; 35+ messages in thread
From: Keller, Jacob E @ 2015-04-02  0:06 UTC (permalink / raw)
  To: Richard Cochran, netdev
  Cc: linux-kernel, Amir Vadai, Ariel Elior, Arnd Bergmann,
	Baolin Wang, Ben Hutchings, Allan, Bruce W, Wyborny, Carolyn,
	Chris Metcalf, David Miller, Frank Li, Giuseppe Cavallaro,
	Kirsher, Jeffrey T, John Stultz, Luwei Zhou, Vick, Matthew,
	Michael Chan, Prashant Sreedharan, Rayagond K, Shradha Shah,
	Solarflare linux maintainers, Sonic Zhang, Stefan Sørensen,
	Thomas Gleixner, Tom Lendacky



> -----Original Message-----
> From: Richard Cochran [mailto:richardcochran@gmail.com]
> Sent: Tuesday, March 31, 2015 2:53 PM
> To: netdev@vger.kernel.org
> Cc: linux-kernel@vger.kernel.org; Amir Vadai; Ariel Elior; Arnd Bergmann;
> Baolin Wang; Ben Hutchings; Allan, Bruce W; Wyborny, Carolyn; Chris
> Metcalf; David Miller; Frank Li; Giuseppe Cavallaro; Keller, Jacob E; Kirsher,
> Jeffrey T; John Stultz; Luwei Zhou; Vick, Matthew; Michael Chan; Prashant
> Sreedharan; Rayagond K; Shradha Shah; Solarflare linux maintainers; Sonic
> Zhang; Stefan Sørensen; Thomas Gleixner; Tom Lendacky
> Subject: Re: [PATCH net-next V3 13/23] ptp: igb: convert to the 64 bit
> get/set time methods.
> 
> On Sun, Mar 29, 2015 at 11:12:03PM +0200, Richard Cochran wrote:
> 
> > @@ -627,11 +628,11 @@ static void igb_ptp_overflow_check(struct
> work_struct *work)
> >  {
> >  	struct igb_adapter *igb =
> >  		container_of(work, struct igb_adapter,
> ptp_overflow_work.work);
> > -	struct timespec ts;
> > +	struct timespec64 ts;
> >
> > -	igb->ptp_caps.gettime(&igb->ptp_caps, &ts);
> > +	igb->ptp_caps.gettime64(&igb->ptp_caps, &ts);
> >
> > -	pr_debug("igb overflow check at %ld.%09lu\n", ts.tv_sec,
> ts.tv_nsec);
> > +	pr_debug("igb overflow check at %lld.%09lu\n", ts.tv_sec,
> ts.tv_nsec);
> 
> For a 64 bit build, this produces the same warning as e1000e.
> 
> What is the best way to deal with this warning?
> 
> Thanks,
> Richard

I don't know how kernel would fix this. Usually macros like PRI64d are used but I am not sure those are defined for the kernel builds

Regards,
Jake

^ permalink raw reply	[flat|nested] 35+ messages in thread

* RE: [PATCH net-next V3 13/23] ptp: igb: convert to the 64 bit get/set time methods.
  2015-03-31 21:37     ` Richard Cochran
@ 2015-04-02  0:08       ` Keller, Jacob E
  0 siblings, 0 replies; 35+ messages in thread
From: Keller, Jacob E @ 2015-04-02  0:08 UTC (permalink / raw)
  To: Richard Cochran
  Cc: thomas.lendacky, linux-kernel, baolin.wang, b45643, sshah, amirv,
	ben, sonic.zhang, peppe.cavallaro, Allan, Bruce W, rayagond,
	tglx, ariel.elior, cmetcalf, Vick, Matthew, linux-net-drivers,
	arnd, Frank.Li, netdev, mchan, Wyborny, Carolyn, prashant, davem,
	Kirsher, Jeffrey T, stefan.sorensen, john.stultz

> -----Original Message-----
> From: Richard Cochran [mailto:richardcochran@gmail.com]
> Sent: Tuesday, March 31, 2015 2:37 PM
> To: Keller, Jacob E
> Cc: thomas.lendacky@amd.com; linux-kernel@vger.kernel.org;
> baolin.wang@linaro.org; b45643@freescale.com; sshah@solarflare.com;
> amirv@mellanox.com; ben@decadent.org.uk; sonic.zhang@analog.com;
> peppe.cavallaro@st.com; Allan, Bruce W; rayagond@vayavyalabs.com;
> tglx@linutronix.de; ariel.elior@qlogic.com; cmetcalf@ezchip.com; Vick,
> Matthew; linux-net-drivers@solarflare.com; arnd@linaro.org;
> Frank.Li@freescale.com; netdev@vger.kernel.org; mchan@broadcom.com;
> Wyborny, Carolyn; prashant@broadcom.com; davem@davemloft.net;
> Kirsher, Jeffrey T; stefan.sorensen@spectralink.com; john.stultz@linaro.org
> Subject: Re: [PATCH net-next V3 13/23] ptp: igb: convert to the 64 bit
> get/set time methods.
> 
> On Tue, Mar 31, 2015 at 09:08:10PM +0000, Keller, Jacob E wrote:
> > On Sun, 2015-03-29 at 23:12 +0200, Richard Cochran wrote:
> > > For the 82576, the driver's clock is implemented using a timecounter,
> > > and so with this patch that device is ready for the year 2038.
> > >
> > > However, in the case of the i210, the device stores the number of
> > > seconds in a 32 bit register.  Therefore, more work is needed on this
> > > driver before the year 2038 comes around.
> > >
> > > Compile tested only.
> >
> > I assume we would want to use a time counter wrapper here to resolve
> > this issue?
> 
> I would just keep the seconds in software for settime() and adjtime(),
> but let the nanoseconds field go to the hardware.  Then, the gettime()
> result, the periodic outputs, the external time stamps, and the skb
> time stamps will need to be corrected by that many seconds.
> 
> Thanks,
> Richard

That seems reasonable.

Regards,
Jake

^ permalink raw reply	[flat|nested] 35+ messages in thread

* Re: [PATCH net-next V3 13/23] ptp: igb: convert to the 64 bit get/set time methods.
  2015-04-02  0:06     ` Keller, Jacob E
@ 2015-04-02  6:33       ` Richard Cochran
  0 siblings, 0 replies; 35+ messages in thread
From: Richard Cochran @ 2015-04-02  6:33 UTC (permalink / raw)
  To: Keller, Jacob E
  Cc: netdev, linux-kernel, Amir Vadai, Ariel Elior, Arnd Bergmann,
	Baolin Wang, Ben Hutchings, Allan, Bruce W, Wyborny, Carolyn,
	Chris Metcalf, David Miller, Frank Li, Giuseppe Cavallaro,
	Kirsher, Jeffrey T, John Stultz, Luwei Zhou, Vick, Matthew,
	Michael Chan, Prashant Sreedharan, Rayagond K, Shradha Shah,
	Solarflare linux maintainers, Sonic Zhang, Stefan Sørensen,
	Thomas Gleixner, Tom Lendacky

On Thu, Apr 02, 2015 at 12:06:56AM +0000, Keller, Jacob E wrote:
> I don't know how kernel would fix this. Usually macros like PRI64d are used but I am not sure those are defined for the kernel builds

Davem fixed it by casting to (long long).

Thanks,
Richard

^ permalink raw reply	[flat|nested] 35+ messages in thread

end of thread, other threads:[~2015-04-02  6:33 UTC | newest]

Thread overview: 35+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-03-29 21:11 [PATCH net-next V3 00/23] ptp: get ready for 2038 Richard Cochran
2015-03-29 21:11 ` [PATCH net-next V3 01/23] ptp: introduce get/set time methods with explicit 64 bit seconds Richard Cochran
2015-03-29 21:11 ` [PATCH net-next V3 02/23] ptp: use the 64 bit gettime method for the SYS_OFFSET ioctl Richard Cochran
2015-03-29 21:11 ` [PATCH net-next V3 03/23] ptp: use the 64 bit get/set time methods for the posix clock Richard Cochran
2015-03-29 21:11 ` [PATCH net-next V3 04/23] ptp: blackfin: convert to the 64 bit get/set time methods Richard Cochran
2015-03-29 21:11 ` [PATCH net-next V3 05/23] ptp: xgbe: " Richard Cochran
2015-03-29 21:11 ` [PATCH net-next V3 06/23] ptp: bnx2x: " Richard Cochran
2015-03-30 21:13   ` Sony Chacko
2015-03-29 21:11 ` [PATCH net-next V3 07/23] ptp: tg3: " Richard Cochran
2015-03-29 21:11 ` [PATCH net-next V3 08/23] ptp: fec: " Richard Cochran
2015-03-29 21:11 ` [PATCH net-next V3 09/23] ptp: gianfar: " Richard Cochran
2015-03-29 21:12 ` [PATCH net-next V3 10/23] ptp: e1000e: " Richard Cochran
2015-03-31 21:48   ` Richard Cochran
2015-03-31 23:26     ` David Miller
2015-03-29 21:12 ` [PATCH net-next V3 11/23] ptp: fm10k: " Richard Cochran
2015-03-29 21:12 ` [PATCH net-next V3 12/23] ptp: i40e: " Richard Cochran
2015-03-29 21:12 ` [PATCH net-next V3 13/23] ptp: igb: " Richard Cochran
2015-03-31 21:08   ` Keller, Jacob E
2015-03-31 21:37     ` Richard Cochran
2015-04-02  0:08       ` Keller, Jacob E
2015-03-31 21:53   ` Richard Cochran
2015-04-02  0:06     ` Keller, Jacob E
2015-04-02  6:33       ` Richard Cochran
2015-03-29 21:12 ` [PATCH net-next V3 14/23] ptp: ixgbe: " Richard Cochran
2015-03-29 21:12 ` [PATCH net-next V3 15/23] ptp: mlx4: " Richard Cochran
2015-03-29 21:12 ` [PATCH net-next V3 16/23] ptp: sfc: " Richard Cochran
2015-03-29 21:12 ` [PATCH net-next V3 17/23] ptp: stmmac: " Richard Cochran
2015-03-29 21:12 ` [PATCH net-next V3 18/23] ptp: cpts: " Richard Cochran
2015-03-29 21:12 ` [PATCH net-next V3 19/23] ptp: tilegx: " Richard Cochran
2015-03-29 21:32   ` Chris Metcalf
2015-03-29 21:12 ` [PATCH net-next V3 20/23] ptp: dp83640: " Richard Cochran
2015-03-29 21:12 ` [PATCH net-next V3 21/23] ptp: ixp46x: " Richard Cochran
2015-03-29 21:12 ` [PATCH net-next V3 22/23] ptp: pch: " Richard Cochran
2015-03-29 21:12 ` [PATCH net-next V3 23/23] ptp: remove 32 bit get/set methods Richard Cochran
2015-03-31 16:01 ` [PATCH net-next V3 00/23] ptp: get ready for 2038 David Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).