netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] e1000e: Include clocksource.h to get CLOCKSOURCE_MASK.
@ 2014-12-31 23:33 David Miller
  2014-12-31 23:42 ` Jeff Kirsher
                   ` (2 more replies)
  0 siblings, 3 replies; 22+ messages in thread
From: David Miller @ 2014-12-31 23:33 UTC (permalink / raw)
  To: richardcochran; +Cc: netdev


Signed-off-by: David S. Miller <davem@davemloft.net>
---
 drivers/net/ethernet/intel/e1000e/netdev.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/net/ethernet/intel/e1000e/netdev.c b/drivers/net/ethernet/intel/e1000e/netdev.c
index e14fd85..2537d36a 100644
--- a/drivers/net/ethernet/intel/e1000e/netdev.c
+++ b/drivers/net/ethernet/intel/e1000e/netdev.c
@@ -43,6 +43,7 @@
 #include <linux/pm_runtime.h>
 #include <linux/aer.h>
 #include <linux/prefetch.h>
+#include <linux/clocksource.h>
 
 #include "e1000.h"
 
-- 
2.1.0

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

* Re: [PATCH 1/2] e1000e: Include clocksource.h to get CLOCKSOURCE_MASK.
  2014-12-31 23:33 [PATCH 1/2] e1000e: Include clocksource.h to get CLOCKSOURCE_MASK David Miller
@ 2014-12-31 23:42 ` Jeff Kirsher
  2015-01-01 10:39 ` [PATCH net-next 0/7] Fixing the "Time Counter fixes and improvements" Richard Cochran
  2015-01-02 19:22 ` [PATCH net-next V2 0/7] Fixing the "Time Counter fixes and improvements" Richard Cochran
  2 siblings, 0 replies; 22+ messages in thread
From: Jeff Kirsher @ 2014-12-31 23:42 UTC (permalink / raw)
  To: David Miller; +Cc: Richard Cochran, netdev

On Wed, Dec 31, 2014 at 3:33 PM, David Miller <davem@davemloft.net> wrote:
>
> Signed-off-by: David S. Miller <davem@davemloft.net>

Acked-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>

> ---
>  drivers/net/ethernet/intel/e1000e/netdev.c | 1 +
>  1 file changed, 1 insertion(+)

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

* [PATCH net-next 0/7] Fixing the "Time Counter fixes and improvements"
  2014-12-31 23:33 [PATCH 1/2] e1000e: Include clocksource.h to get CLOCKSOURCE_MASK David Miller
  2014-12-31 23:42 ` Jeff Kirsher
@ 2015-01-01 10:39 ` Richard Cochran
  2015-01-01 10:39   ` [PATCH net-next 1/7] timecounter: provide a macro to initialize the cyclecounter mask field Richard Cochran
                     ` (6 more replies)
  2015-01-02 19:22 ` [PATCH net-next V2 0/7] Fixing the "Time Counter fixes and improvements" Richard Cochran
  2 siblings, 7 replies; 22+ messages in thread
From: Richard Cochran @ 2015-01-01 10:39 UTC (permalink / raw)
  To: netdev
  Cc: linux-kernel, David Miller, Jeff Kirsher, John Stultz,
	Thomas Gleixner

Dave,

I did not catch the missing includes in my x86 and arm testing,
because those archs somehow do include clocksource.h for the drivers
in question. Sorry.

This is how I would like to fix the header fallout. We really should
decouple the timecounter/cyclecounter code from the clocksource code
where possible.


Thanks,
Richard


Richard Cochran (7):
  timecounter: provide a macro to initialize the cyclecounter mask
    field.
  bnx2x: convert to CYCLECOUNTER_MASK macro.
  e1000e: convert to CYCLECOUNTER_MASK macro.
  igb: convert to CYCLECOUNTER_MASK macro.
  ixgbe: convert to CYCLECOUNTER_MASK macro.
  mlx4: include clocksource.h again
  microblaze: include the new timecounter header.

 arch/microblaze/kernel/timer.c                   |    1 +
 drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c |    2 +-
 drivers/net/ethernet/intel/e1000e/netdev.c       |    2 +-
 drivers/net/ethernet/intel/igb/igb_ptp.c         |    4 ++--
 drivers/net/ethernet/intel/ixgbe/ixgbe_ptp.c     |    2 +-
 drivers/net/ethernet/mellanox/mlx4/en_clock.c    |    1 +
 include/linux/timecounter.h                      |    5 ++++-
 7 files changed, 11 insertions(+), 6 deletions(-)

-- 
1.7.10.4

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

* [PATCH net-next 1/7] timecounter: provide a macro to initialize the cyclecounter mask field.
  2015-01-01 10:39 ` [PATCH net-next 0/7] Fixing the "Time Counter fixes and improvements" Richard Cochran
@ 2015-01-01 10:39   ` Richard Cochran
  2015-01-05 13:20     ` David Laight
  2015-01-01 10:39   ` [PATCH net-next 2/7] bnx2x: convert to CYCLECOUNTER_MASK macro Richard Cochran
                     ` (5 subsequent siblings)
  6 siblings, 1 reply; 22+ messages in thread
From: Richard Cochran @ 2015-01-01 10:39 UTC (permalink / raw)
  To: netdev
  Cc: linux-kernel, David Miller, Jeff Kirsher, John Stultz,
	Thomas Gleixner

There is no need for users of the timecounter/cyclecounter code to include
clocksource.h just for a single macro.

Signed-off-by: Richard Cochran <richardcochran@gmail.com>
---
 include/linux/timecounter.h |    5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/include/linux/timecounter.h b/include/linux/timecounter.h
index 74f4549..4382035 100644
--- a/include/linux/timecounter.h
+++ b/include/linux/timecounter.h
@@ -19,6 +19,9 @@
 
 #include <linux/types.h>
 
+/* simplify initialization of mask field */
+#define CYCLECOUNTER_MASK(bits) (cycle_t)((bits) < 64 ? ((1ULL<<(bits))-1) : -1)
+
 /**
  * struct cyclecounter - hardware abstraction for a free running counter
  *	Provides completely state-free accessors to the underlying hardware.
@@ -29,7 +32,7 @@
  * @read:		returns the current cycle value
  * @mask:		bitmask for two's complement
  *			subtraction of non 64 bit counters,
- *			see CLOCKSOURCE_MASK() helper macro
+ *			see CYCLECOUNTER_MASK() helper macro
  * @mult:		cycle to nanosecond multiplier
  * @shift:		cycle to nanosecond divisor (power of two)
  */
-- 
1.7.10.4

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

* [PATCH net-next 2/7] bnx2x: convert to CYCLECOUNTER_MASK macro.
  2015-01-01 10:39 ` [PATCH net-next 0/7] Fixing the "Time Counter fixes and improvements" Richard Cochran
  2015-01-01 10:39   ` [PATCH net-next 1/7] timecounter: provide a macro to initialize the cyclecounter mask field Richard Cochran
@ 2015-01-01 10:39   ` Richard Cochran
  2015-01-01 10:39   ` [PATCH net-next 3/7] e1000e: " Richard Cochran
                     ` (4 subsequent siblings)
  6 siblings, 0 replies; 22+ messages in thread
From: Richard Cochran @ 2015-01-01 10:39 UTC (permalink / raw)
  To: netdev
  Cc: linux-kernel, David Miller, Jeff Kirsher, John Stultz,
	Thomas Gleixner

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

diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c
index 2c95132..0758c8b 100644
--- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c
+++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c
@@ -14610,7 +14610,7 @@ static void bnx2x_init_cyclecounter(struct bnx2x *bp)
 {
 	memset(&bp->cyclecounter, 0, sizeof(bp->cyclecounter));
 	bp->cyclecounter.read = bnx2x_cyclecounter_read;
-	bp->cyclecounter.mask = CLOCKSOURCE_MASK(64);
+	bp->cyclecounter.mask = CYCLECOUNTER_MASK(64);
 	bp->cyclecounter.shift = 1;
 	bp->cyclecounter.mult = 1;
 }
-- 
1.7.10.4

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

* [PATCH net-next 3/7] e1000e: convert to CYCLECOUNTER_MASK macro.
  2015-01-01 10:39 ` [PATCH net-next 0/7] Fixing the "Time Counter fixes and improvements" Richard Cochran
  2015-01-01 10:39   ` [PATCH net-next 1/7] timecounter: provide a macro to initialize the cyclecounter mask field Richard Cochran
  2015-01-01 10:39   ` [PATCH net-next 2/7] bnx2x: convert to CYCLECOUNTER_MASK macro Richard Cochran
@ 2015-01-01 10:39   ` Richard Cochran
  2015-01-01 10:39   ` [PATCH net-next 4/7] igb: " Richard Cochran
                     ` (3 subsequent siblings)
  6 siblings, 0 replies; 22+ messages in thread
From: Richard Cochran @ 2015-01-01 10:39 UTC (permalink / raw)
  To: netdev
  Cc: linux-kernel, David Miller, Jeff Kirsher, John Stultz,
	Thomas Gleixner

Signed-off-by: Richard Cochran <richardcochran@gmail.com>
---
 drivers/net/ethernet/intel/e1000e/netdev.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/intel/e1000e/netdev.c b/drivers/net/ethernet/intel/e1000e/netdev.c
index e14fd85..332a298 100644
--- a/drivers/net/ethernet/intel/e1000e/netdev.c
+++ b/drivers/net/ethernet/intel/e1000e/netdev.c
@@ -4189,7 +4189,7 @@ static int e1000_sw_init(struct e1000_adapter *adapter)
 	/* Setup hardware time stamping cyclecounter */
 	if (adapter->flags & FLAG_HAS_HW_TIMESTAMP) {
 		adapter->cc.read = e1000e_cyclecounter_read;
-		adapter->cc.mask = CLOCKSOURCE_MASK(64);
+		adapter->cc.mask = CYCLECOUNTER_MASK(64);
 		adapter->cc.mult = 1;
 		/* cc.shift set in e1000e_get_base_tininca() */
 
-- 
1.7.10.4

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

* [PATCH net-next 4/7] igb: convert to CYCLECOUNTER_MASK macro.
  2015-01-01 10:39 ` [PATCH net-next 0/7] Fixing the "Time Counter fixes and improvements" Richard Cochran
                     ` (2 preceding siblings ...)
  2015-01-01 10:39   ` [PATCH net-next 3/7] e1000e: " Richard Cochran
@ 2015-01-01 10:39   ` Richard Cochran
  2015-01-01 10:39   ` [PATCH net-next 5/7] ixgbe: " Richard Cochran
                     ` (2 subsequent siblings)
  6 siblings, 0 replies; 22+ messages in thread
From: Richard Cochran @ 2015-01-01 10:39 UTC (permalink / raw)
  To: netdev
  Cc: linux-kernel, David Miller, Jeff Kirsher, John Stultz,
	Thomas Gleixner

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

diff --git a/drivers/net/ethernet/intel/igb/igb_ptp.c b/drivers/net/ethernet/intel/igb/igb_ptp.c
index 1d27f2d..5e7a4e3 100644
--- a/drivers/net/ethernet/intel/igb/igb_ptp.c
+++ b/drivers/net/ethernet/intel/igb/igb_ptp.c
@@ -765,7 +765,7 @@ void igb_ptp_init(struct igb_adapter *adapter)
 		adapter->ptp_caps.settime = igb_ptp_settime_82576;
 		adapter->ptp_caps.enable = igb_ptp_feature_enable;
 		adapter->cc.read = igb_ptp_read_82576;
-		adapter->cc.mask = CLOCKSOURCE_MASK(64);
+		adapter->cc.mask = CYCLECOUNTER_MASK(64);
 		adapter->cc.mult = 1;
 		adapter->cc.shift = IGB_82576_TSYNC_SHIFT;
 		/* Dial the nominal frequency. */
@@ -785,7 +785,7 @@ void igb_ptp_init(struct igb_adapter *adapter)
 		adapter->ptp_caps.settime = igb_ptp_settime_82576;
 		adapter->ptp_caps.enable = igb_ptp_feature_enable;
 		adapter->cc.read = igb_ptp_read_82580;
-		adapter->cc.mask = CLOCKSOURCE_MASK(IGB_NBITS_82580);
+		adapter->cc.mask = CYCLECOUNTER_MASK(IGB_NBITS_82580);
 		adapter->cc.mult = 1;
 		adapter->cc.shift = 0;
 		/* Enable the timer functions by clearing bit 31. */
-- 
1.7.10.4

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

* [PATCH net-next 5/7] ixgbe: convert to CYCLECOUNTER_MASK macro.
  2015-01-01 10:39 ` [PATCH net-next 0/7] Fixing the "Time Counter fixes and improvements" Richard Cochran
                     ` (3 preceding siblings ...)
  2015-01-01 10:39   ` [PATCH net-next 4/7] igb: " Richard Cochran
@ 2015-01-01 10:39   ` Richard Cochran
  2015-01-01 10:40   ` [PATCH net-next 6/7] mlx4: include clocksource.h again Richard Cochran
  2015-01-01 10:40   ` [PATCH net-next 7/7] microblaze: include the new timecounter header Richard Cochran
  6 siblings, 0 replies; 22+ messages in thread
From: Richard Cochran @ 2015-01-01 10:39 UTC (permalink / raw)
  To: netdev
  Cc: linux-kernel, David Miller, Jeff Kirsher, John Stultz,
	Thomas Gleixner

Signed-off-by: Richard Cochran <richardcochran@gmail.com>
---
 drivers/net/ethernet/intel/ixgbe/ixgbe_ptp.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_ptp.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_ptp.c
index 47c29ea..79c00f5 100644
--- a/drivers/net/ethernet/intel/ixgbe/ixgbe_ptp.c
+++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_ptp.c
@@ -793,7 +793,7 @@ void ixgbe_ptp_start_cyclecounter(struct ixgbe_adapter *adapter)
 
 	memset(&adapter->cc, 0, sizeof(adapter->cc));
 	adapter->cc.read = ixgbe_ptp_read;
-	adapter->cc.mask = CLOCKSOURCE_MASK(64);
+	adapter->cc.mask = CYCLECOUNTER_MASK(64);
 	adapter->cc.shift = shift;
 	adapter->cc.mult = 1;
 
-- 
1.7.10.4

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

* [PATCH net-next 6/7] mlx4: include clocksource.h again
  2015-01-01 10:39 ` [PATCH net-next 0/7] Fixing the "Time Counter fixes and improvements" Richard Cochran
                     ` (4 preceding siblings ...)
  2015-01-01 10:39   ` [PATCH net-next 5/7] ixgbe: " Richard Cochran
@ 2015-01-01 10:40   ` Richard Cochran
  2015-01-01 10:40   ` [PATCH net-next 7/7] microblaze: include the new timecounter header Richard Cochran
  6 siblings, 0 replies; 22+ messages in thread
From: Richard Cochran @ 2015-01-01 10:40 UTC (permalink / raw)
  To: netdev
  Cc: linux-kernel, David Miller, Jeff Kirsher, John Stultz,
	Thomas Gleixner

This driver uses the function, clocksource_khz2mult, and so it really must
include clocksource.h.

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

diff --git a/drivers/net/ethernet/mellanox/mlx4/en_clock.c b/drivers/net/ethernet/mellanox/mlx4/en_clock.c
index e9cce4f..90b5309 100644
--- a/drivers/net/ethernet/mellanox/mlx4/en_clock.c
+++ b/drivers/net/ethernet/mellanox/mlx4/en_clock.c
@@ -32,6 +32,7 @@
  */
 
 #include <linux/mlx4/device.h>
+#include <linux/clocksource.h>
 
 #include "mlx4_en.h"
 
-- 
1.7.10.4

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

* [PATCH net-next 7/7] microblaze: include the new timecounter header.
  2015-01-01 10:39 ` [PATCH net-next 0/7] Fixing the "Time Counter fixes and improvements" Richard Cochran
                     ` (5 preceding siblings ...)
  2015-01-01 10:40   ` [PATCH net-next 6/7] mlx4: include clocksource.h again Richard Cochran
@ 2015-01-01 10:40   ` Richard Cochran
  6 siblings, 0 replies; 22+ messages in thread
From: Richard Cochran @ 2015-01-01 10:40 UTC (permalink / raw)
  To: netdev
  Cc: linux-kernel, David Miller, Jeff Kirsher, John Stultz,
	Thomas Gleixner

The timecounter/cyclecounter code has moved, so users need the new include.

Signed-off-by: Richard Cochran <richardcochran@gmail.com>
---
 arch/microblaze/kernel/timer.c |    1 +
 1 file changed, 1 insertion(+)

diff --git a/arch/microblaze/kernel/timer.c b/arch/microblaze/kernel/timer.c
index dd96f0e..c897745 100644
--- a/arch/microblaze/kernel/timer.c
+++ b/arch/microblaze/kernel/timer.c
@@ -17,6 +17,7 @@
 #include <linux/clockchips.h>
 #include <linux/of_address.h>
 #include <linux/of_irq.h>
+#include <linux/timecounter.h>
 #include <asm/cpuinfo.h>
 
 static void __iomem *timer_baseaddr;
-- 
1.7.10.4

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

* [PATCH net-next V2 0/7] Fixing the "Time Counter fixes and improvements"
  2014-12-31 23:33 [PATCH 1/2] e1000e: Include clocksource.h to get CLOCKSOURCE_MASK David Miller
  2014-12-31 23:42 ` Jeff Kirsher
  2015-01-01 10:39 ` [PATCH net-next 0/7] Fixing the "Time Counter fixes and improvements" Richard Cochran
@ 2015-01-02 19:22 ` Richard Cochran
  2015-01-02 19:22   ` [PATCH net-next V2 1/7] timecounter: provide a macro to initialize the cyclecounter mask field Richard Cochran
                     ` (7 more replies)
  2 siblings, 8 replies; 22+ messages in thread
From: Richard Cochran @ 2015-01-02 19:22 UTC (permalink / raw)
  To: netdev; +Cc: David Miller, John Stultz

Dave,

For this series I had only tested the build with ARCH=x86 and arm, but
others like sparc64, microblaze, powerpc, and s390 will fail because
they somehow don't indirectly include clocksource.h for the drivers in
question.

This series fixes the build issues reported by:
 kbuild test robot <fengguang.wu@intel.com>

Thanks,
Richard


Richard Cochran (7):
  timecounter: provide a macro to initialize the cyclecounter mask
    field.
  bnx2x: convert to CYCLECOUNTER_MASK macro.
  e1000e: convert to CYCLECOUNTER_MASK macro.
  igb: convert to CYCLECOUNTER_MASK macro.
  ixgbe: convert to CYCLECOUNTER_MASK macro.
  mlx4: include clocksource.h again
  microblaze: include the new timecounter header.

 arch/microblaze/kernel/timer.c                   |    1 +
 drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c |    2 +-
 drivers/net/ethernet/intel/e1000e/netdev.c       |    3 +--
 drivers/net/ethernet/intel/igb/igb_ptp.c         |    5 ++---
 drivers/net/ethernet/intel/ixgbe/ixgbe_ptp.c     |    2 +-
 drivers/net/ethernet/mellanox/mlx4/en_clock.c    |    1 +
 include/linux/timecounter.h                      |    5 ++++-
 7 files changed, 11 insertions(+), 8 deletions(-)

-- 
1.7.10.4

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

* [PATCH net-next V2 1/7] timecounter: provide a macro to initialize the cyclecounter mask field.
  2015-01-02 19:22 ` [PATCH net-next V2 0/7] Fixing the "Time Counter fixes and improvements" Richard Cochran
@ 2015-01-02 19:22   ` Richard Cochran
  2015-01-02 19:22   ` [PATCH net-next V2 2/7] bnx2x: convert to CYCLECOUNTER_MASK macro Richard Cochran
                     ` (6 subsequent siblings)
  7 siblings, 0 replies; 22+ messages in thread
From: Richard Cochran @ 2015-01-02 19:22 UTC (permalink / raw)
  To: netdev; +Cc: David Miller, John Stultz

There is no need for users of the timecounter/cyclecounter code to include
clocksource.h just for a single macro.

Signed-off-by: Richard Cochran <richardcochran@gmail.com>
---
 include/linux/timecounter.h |    5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/include/linux/timecounter.h b/include/linux/timecounter.h
index 74f4549..4382035 100644
--- a/include/linux/timecounter.h
+++ b/include/linux/timecounter.h
@@ -19,6 +19,9 @@
 
 #include <linux/types.h>
 
+/* simplify initialization of mask field */
+#define CYCLECOUNTER_MASK(bits) (cycle_t)((bits) < 64 ? ((1ULL<<(bits))-1) : -1)
+
 /**
  * struct cyclecounter - hardware abstraction for a free running counter
  *	Provides completely state-free accessors to the underlying hardware.
@@ -29,7 +32,7 @@
  * @read:		returns the current cycle value
  * @mask:		bitmask for two's complement
  *			subtraction of non 64 bit counters,
- *			see CLOCKSOURCE_MASK() helper macro
+ *			see CYCLECOUNTER_MASK() helper macro
  * @mult:		cycle to nanosecond multiplier
  * @shift:		cycle to nanosecond divisor (power of two)
  */
-- 
1.7.10.4

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

* [PATCH net-next V2 2/7] bnx2x: convert to CYCLECOUNTER_MASK macro.
  2015-01-02 19:22 ` [PATCH net-next V2 0/7] Fixing the "Time Counter fixes and improvements" Richard Cochran
  2015-01-02 19:22   ` [PATCH net-next V2 1/7] timecounter: provide a macro to initialize the cyclecounter mask field Richard Cochran
@ 2015-01-02 19:22   ` Richard Cochran
  2015-01-02 19:22   ` [PATCH net-next V2 3/7] e1000e: " Richard Cochran
                     ` (5 subsequent siblings)
  7 siblings, 0 replies; 22+ messages in thread
From: Richard Cochran @ 2015-01-02 19:22 UTC (permalink / raw)
  To: netdev; +Cc: David Miller, John Stultz

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

diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c
index 2c95132..0758c8b 100644
--- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c
+++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c
@@ -14610,7 +14610,7 @@ static void bnx2x_init_cyclecounter(struct bnx2x *bp)
 {
 	memset(&bp->cyclecounter, 0, sizeof(bp->cyclecounter));
 	bp->cyclecounter.read = bnx2x_cyclecounter_read;
-	bp->cyclecounter.mask = CLOCKSOURCE_MASK(64);
+	bp->cyclecounter.mask = CYCLECOUNTER_MASK(64);
 	bp->cyclecounter.shift = 1;
 	bp->cyclecounter.mult = 1;
 }
-- 
1.7.10.4

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

* [PATCH net-next V2 3/7] e1000e: convert to CYCLECOUNTER_MASK macro.
  2015-01-02 19:22 ` [PATCH net-next V2 0/7] Fixing the "Time Counter fixes and improvements" Richard Cochran
  2015-01-02 19:22   ` [PATCH net-next V2 1/7] timecounter: provide a macro to initialize the cyclecounter mask field Richard Cochran
  2015-01-02 19:22   ` [PATCH net-next V2 2/7] bnx2x: convert to CYCLECOUNTER_MASK macro Richard Cochran
@ 2015-01-02 19:22   ` Richard Cochran
  2015-01-02 19:22   ` [PATCH net-next V2 4/7] igb: " Richard Cochran
                     ` (4 subsequent siblings)
  7 siblings, 0 replies; 22+ messages in thread
From: Richard Cochran @ 2015-01-02 19:22 UTC (permalink / raw)
  To: netdev; +Cc: David Miller, John Stultz

Signed-off-by: Richard Cochran <richardcochran@gmail.com>
---
 drivers/net/ethernet/intel/e1000e/netdev.c |    3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/net/ethernet/intel/e1000e/netdev.c b/drivers/net/ethernet/intel/e1000e/netdev.c
index 2537d36a..332a298 100644
--- a/drivers/net/ethernet/intel/e1000e/netdev.c
+++ b/drivers/net/ethernet/intel/e1000e/netdev.c
@@ -43,7 +43,6 @@
 #include <linux/pm_runtime.h>
 #include <linux/aer.h>
 #include <linux/prefetch.h>
-#include <linux/clocksource.h>
 
 #include "e1000.h"
 
@@ -4190,7 +4189,7 @@ static int e1000_sw_init(struct e1000_adapter *adapter)
 	/* Setup hardware time stamping cyclecounter */
 	if (adapter->flags & FLAG_HAS_HW_TIMESTAMP) {
 		adapter->cc.read = e1000e_cyclecounter_read;
-		adapter->cc.mask = CLOCKSOURCE_MASK(64);
+		adapter->cc.mask = CYCLECOUNTER_MASK(64);
 		adapter->cc.mult = 1;
 		/* cc.shift set in e1000e_get_base_tininca() */
 
-- 
1.7.10.4

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

* [PATCH net-next V2 4/7] igb: convert to CYCLECOUNTER_MASK macro.
  2015-01-02 19:22 ` [PATCH net-next V2 0/7] Fixing the "Time Counter fixes and improvements" Richard Cochran
                     ` (2 preceding siblings ...)
  2015-01-02 19:22   ` [PATCH net-next V2 3/7] e1000e: " Richard Cochran
@ 2015-01-02 19:22   ` Richard Cochran
  2015-01-02 19:22   ` [PATCH net-next V2 5/7] ixgbe: " Richard Cochran
                     ` (3 subsequent siblings)
  7 siblings, 0 replies; 22+ messages in thread
From: Richard Cochran @ 2015-01-02 19:22 UTC (permalink / raw)
  To: netdev; +Cc: David Miller, John Stultz

Signed-off-by: Richard Cochran <richardcochran@gmail.com>
---
 drivers/net/ethernet/intel/igb/igb_ptp.c |    5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/drivers/net/ethernet/intel/igb/igb_ptp.c b/drivers/net/ethernet/intel/igb/igb_ptp.c
index 8baf3fd..5e7a4e3 100644
--- a/drivers/net/ethernet/intel/igb/igb_ptp.c
+++ b/drivers/net/ethernet/intel/igb/igb_ptp.c
@@ -19,7 +19,6 @@
 #include <linux/device.h>
 #include <linux/pci.h>
 #include <linux/ptp_classify.h>
-#include <linux/clocksource.h>
 
 #include "igb.h"
 
@@ -766,7 +765,7 @@ void igb_ptp_init(struct igb_adapter *adapter)
 		adapter->ptp_caps.settime = igb_ptp_settime_82576;
 		adapter->ptp_caps.enable = igb_ptp_feature_enable;
 		adapter->cc.read = igb_ptp_read_82576;
-		adapter->cc.mask = CLOCKSOURCE_MASK(64);
+		adapter->cc.mask = CYCLECOUNTER_MASK(64);
 		adapter->cc.mult = 1;
 		adapter->cc.shift = IGB_82576_TSYNC_SHIFT;
 		/* Dial the nominal frequency. */
@@ -786,7 +785,7 @@ void igb_ptp_init(struct igb_adapter *adapter)
 		adapter->ptp_caps.settime = igb_ptp_settime_82576;
 		adapter->ptp_caps.enable = igb_ptp_feature_enable;
 		adapter->cc.read = igb_ptp_read_82580;
-		adapter->cc.mask = CLOCKSOURCE_MASK(IGB_NBITS_82580);
+		adapter->cc.mask = CYCLECOUNTER_MASK(IGB_NBITS_82580);
 		adapter->cc.mult = 1;
 		adapter->cc.shift = 0;
 		/* Enable the timer functions by clearing bit 31. */
-- 
1.7.10.4

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

* [PATCH net-next V2 5/7] ixgbe: convert to CYCLECOUNTER_MASK macro.
  2015-01-02 19:22 ` [PATCH net-next V2 0/7] Fixing the "Time Counter fixes and improvements" Richard Cochran
                     ` (3 preceding siblings ...)
  2015-01-02 19:22   ` [PATCH net-next V2 4/7] igb: " Richard Cochran
@ 2015-01-02 19:22   ` Richard Cochran
  2015-01-02 19:22   ` [PATCH net-next V2 6/7] mlx4: include clocksource.h again Richard Cochran
                     ` (2 subsequent siblings)
  7 siblings, 0 replies; 22+ messages in thread
From: Richard Cochran @ 2015-01-02 19:22 UTC (permalink / raw)
  To: netdev; +Cc: David Miller, John Stultz

Signed-off-by: Richard Cochran <richardcochran@gmail.com>
---
 drivers/net/ethernet/intel/ixgbe/ixgbe_ptp.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_ptp.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_ptp.c
index 47c29ea..79c00f5 100644
--- a/drivers/net/ethernet/intel/ixgbe/ixgbe_ptp.c
+++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_ptp.c
@@ -793,7 +793,7 @@ void ixgbe_ptp_start_cyclecounter(struct ixgbe_adapter *adapter)
 
 	memset(&adapter->cc, 0, sizeof(adapter->cc));
 	adapter->cc.read = ixgbe_ptp_read;
-	adapter->cc.mask = CLOCKSOURCE_MASK(64);
+	adapter->cc.mask = CYCLECOUNTER_MASK(64);
 	adapter->cc.shift = shift;
 	adapter->cc.mult = 1;
 
-- 
1.7.10.4

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

* [PATCH net-next V2 6/7] mlx4: include clocksource.h again
  2015-01-02 19:22 ` [PATCH net-next V2 0/7] Fixing the "Time Counter fixes and improvements" Richard Cochran
                     ` (4 preceding siblings ...)
  2015-01-02 19:22   ` [PATCH net-next V2 5/7] ixgbe: " Richard Cochran
@ 2015-01-02 19:22   ` Richard Cochran
  2015-01-02 19:22   ` [PATCH net-next V2 7/7] microblaze: include the new timecounter header Richard Cochran
  2015-01-02 21:48   ` [PATCH net-next V2 0/7] Fixing the "Time Counter fixes and improvements" David Miller
  7 siblings, 0 replies; 22+ messages in thread
From: Richard Cochran @ 2015-01-02 19:22 UTC (permalink / raw)
  To: netdev; +Cc: David Miller, John Stultz

This driver uses the function, clocksource_khz2mult, and so it really must
include clocksource.h.

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

diff --git a/drivers/net/ethernet/mellanox/mlx4/en_clock.c b/drivers/net/ethernet/mellanox/mlx4/en_clock.c
index e9cce4f..90b5309 100644
--- a/drivers/net/ethernet/mellanox/mlx4/en_clock.c
+++ b/drivers/net/ethernet/mellanox/mlx4/en_clock.c
@@ -32,6 +32,7 @@
  */
 
 #include <linux/mlx4/device.h>
+#include <linux/clocksource.h>
 
 #include "mlx4_en.h"
 
-- 
1.7.10.4

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

* [PATCH net-next V2 7/7] microblaze: include the new timecounter header.
  2015-01-02 19:22 ` [PATCH net-next V2 0/7] Fixing the "Time Counter fixes and improvements" Richard Cochran
                     ` (5 preceding siblings ...)
  2015-01-02 19:22   ` [PATCH net-next V2 6/7] mlx4: include clocksource.h again Richard Cochran
@ 2015-01-02 19:22   ` Richard Cochran
  2015-01-02 21:48   ` [PATCH net-next V2 0/7] Fixing the "Time Counter fixes and improvements" David Miller
  7 siblings, 0 replies; 22+ messages in thread
From: Richard Cochran @ 2015-01-02 19:22 UTC (permalink / raw)
  To: netdev; +Cc: David Miller, John Stultz

The timecounter/cyclecounter code has moved, so users need the new include.

Signed-off-by: Richard Cochran <richardcochran@gmail.com>
---
 arch/microblaze/kernel/timer.c |    1 +
 1 file changed, 1 insertion(+)

diff --git a/arch/microblaze/kernel/timer.c b/arch/microblaze/kernel/timer.c
index dd96f0e..c897745 100644
--- a/arch/microblaze/kernel/timer.c
+++ b/arch/microblaze/kernel/timer.c
@@ -17,6 +17,7 @@
 #include <linux/clockchips.h>
 #include <linux/of_address.h>
 #include <linux/of_irq.h>
+#include <linux/timecounter.h>
 #include <asm/cpuinfo.h>
 
 static void __iomem *timer_baseaddr;
-- 
1.7.10.4

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

* Re: [PATCH net-next V2 0/7] Fixing the "Time Counter fixes and improvements"
  2015-01-02 19:22 ` [PATCH net-next V2 0/7] Fixing the "Time Counter fixes and improvements" Richard Cochran
                     ` (6 preceding siblings ...)
  2015-01-02 19:22   ` [PATCH net-next V2 7/7] microblaze: include the new timecounter header Richard Cochran
@ 2015-01-02 21:48   ` David Miller
  7 siblings, 0 replies; 22+ messages in thread
From: David Miller @ 2015-01-02 21:48 UTC (permalink / raw)
  To: richardcochran; +Cc: netdev, john.stultz

From: Richard Cochran <richardcochran@gmail.com>
Date: Fri,  2 Jan 2015 20:22:02 +0100

> For this series I had only tested the build with ARCH=x86 and arm, but
> others like sparc64, microblaze, powerpc, and s390 will fail because
> they somehow don't indirectly include clocksource.h for the drivers in
> question.
> 
> This series fixes the build issues reported by:
>  kbuild test robot <fengguang.wu@intel.com>

Series applied, thanks Richard.

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

* RE: [PATCH net-next 1/7] timecounter: provide a macro to initialize the cyclecounter mask field.
  2015-01-01 10:39   ` [PATCH net-next 1/7] timecounter: provide a macro to initialize the cyclecounter mask field Richard Cochran
@ 2015-01-05 13:20     ` David Laight
  2015-01-05 13:43       ` Richard Cochran
  0 siblings, 1 reply; 22+ messages in thread
From: David Laight @ 2015-01-05 13:20 UTC (permalink / raw)
  To: 'Richard Cochran', netdev@vger.kernel.org
  Cc: linux-kernel@vger.kernel.org, David Miller, Jeff Kirsher,
	John Stultz, Thomas Gleixner

> There is no need for users of the timecounter/cyclecounter code to include
> clocksource.h just for a single macro.
> 
> Signed-off-by: Richard Cochran <richardcochran@gmail.com>
> ---
>  include/linux/timecounter.h |    5 ++++-
>  1 file changed, 4 insertions(+), 1 deletion(-)
> 
> diff --git a/include/linux/timecounter.h b/include/linux/timecounter.h
> index 74f4549..4382035 100644
> --- a/include/linux/timecounter.h
> +++ b/include/linux/timecounter.h
> @@ -19,6 +19,9 @@
> 
>  #include <linux/types.h>
> 
> +/* simplify initialization of mask field */
> +#define CYCLECOUNTER_MASK(bits) (cycle_t)((bits) < 64 ? ((1ULL<<(bits))-1) : -1)

That has me chasing through the C integer promotion rules.
Better might be:
	((bits) < 64 ? (1ULL << (bits)) - 1 : (((1ULL << 63) - 1) << 1) + 1)
I actually suspect there is a standard definition somewhere?

	David 

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

* Re: [PATCH net-next 1/7] timecounter: provide a macro to initialize the cyclecounter mask field.
  2015-01-05 13:20     ` David Laight
@ 2015-01-05 13:43       ` Richard Cochran
  2015-01-05 13:53         ` David Laight
  0 siblings, 1 reply; 22+ messages in thread
From: Richard Cochran @ 2015-01-05 13:43 UTC (permalink / raw)
  To: David Laight
  Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
	David Miller, Jeff Kirsher, John Stultz, Thomas Gleixner

On Mon, Jan 05, 2015 at 01:20:57PM +0000, David Laight wrote:
> > +/* simplify initialization of mask field */
> > +#define CYCLECOUNTER_MASK(bits) (cycle_t)((bits) < 64 ? ((1ULL<<(bits))-1) : -1)
> 
> That has me chasing through the C integer promotion rules.
> Better might be:
> 	((bits) < 64 ? (1ULL << (bits)) - 1 : (((1ULL << 63) - 1) << 1) + 1)
> I actually suspect there is a standard definition somewhere?

This is an exact copy of CLOCKSOURCE_MASK, and if wrong, then both are
wrong.  In any case, I can't see any issue here. Is not

	(some_int_type) -1

always equal to

	0xf...(width of type)

for all integer types, when using 2s compliment?

Thanks
Richard

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

* RE: [PATCH net-next 1/7] timecounter: provide a macro to initialize the cyclecounter mask field.
  2015-01-05 13:43       ` Richard Cochran
@ 2015-01-05 13:53         ` David Laight
  0 siblings, 0 replies; 22+ messages in thread
From: David Laight @ 2015-01-05 13:53 UTC (permalink / raw)
  To: 'Richard Cochran'
  Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
	David Miller, Jeff Kirsher, John Stultz, Thomas Gleixner

> On Mon, Jan 05, 2015 at 01:20:57PM +0000, David Laight wrote:
> > > +/* simplify initialization of mask field */
> > > +#define CYCLECOUNTER_MASK(bits) (cycle_t)((bits) < 64 ? ((1ULL<<(bits))-1) : -1)
> >
> > That has me chasing through the C integer promotion rules.
> > Better might be:
> > 	((bits) < 64 ? (1ULL << (bits)) - 1 : (((1ULL << 63) - 1) << 1) + 1)
> > I actually suspect there is a standard definition somewhere?
> 
> This is an exact copy of CLOCKSOURCE_MASK, and if wrong, then both are
> wrong.  In any case, I can't see any issue here. Is not
> 
> 	(some_int_type) -1
> 
> always equal to
> 
> 	0xf...(width of type)
> 
> for all integer types, when using 2s compliment?

As I said, it leaves me chasing through the promotion rules (which I
probably know if I actually think hard enough).

Thinking... ~0ULL would be nice and simple and correct.

	David

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

end of thread, other threads:[~2015-01-05 13:53 UTC | newest]

Thread overview: 22+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-12-31 23:33 [PATCH 1/2] e1000e: Include clocksource.h to get CLOCKSOURCE_MASK David Miller
2014-12-31 23:42 ` Jeff Kirsher
2015-01-01 10:39 ` [PATCH net-next 0/7] Fixing the "Time Counter fixes and improvements" Richard Cochran
2015-01-01 10:39   ` [PATCH net-next 1/7] timecounter: provide a macro to initialize the cyclecounter mask field Richard Cochran
2015-01-05 13:20     ` David Laight
2015-01-05 13:43       ` Richard Cochran
2015-01-05 13:53         ` David Laight
2015-01-01 10:39   ` [PATCH net-next 2/7] bnx2x: convert to CYCLECOUNTER_MASK macro Richard Cochran
2015-01-01 10:39   ` [PATCH net-next 3/7] e1000e: " Richard Cochran
2015-01-01 10:39   ` [PATCH net-next 4/7] igb: " Richard Cochran
2015-01-01 10:39   ` [PATCH net-next 5/7] ixgbe: " Richard Cochran
2015-01-01 10:40   ` [PATCH net-next 6/7] mlx4: include clocksource.h again Richard Cochran
2015-01-01 10:40   ` [PATCH net-next 7/7] microblaze: include the new timecounter header Richard Cochran
2015-01-02 19:22 ` [PATCH net-next V2 0/7] Fixing the "Time Counter fixes and improvements" Richard Cochran
2015-01-02 19:22   ` [PATCH net-next V2 1/7] timecounter: provide a macro to initialize the cyclecounter mask field Richard Cochran
2015-01-02 19:22   ` [PATCH net-next V2 2/7] bnx2x: convert to CYCLECOUNTER_MASK macro Richard Cochran
2015-01-02 19:22   ` [PATCH net-next V2 3/7] e1000e: " Richard Cochran
2015-01-02 19:22   ` [PATCH net-next V2 4/7] igb: " Richard Cochran
2015-01-02 19:22   ` [PATCH net-next V2 5/7] ixgbe: " Richard Cochran
2015-01-02 19:22   ` [PATCH net-next V2 6/7] mlx4: include clocksource.h again Richard Cochran
2015-01-02 19:22   ` [PATCH net-next V2 7/7] microblaze: include the new timecounter header Richard Cochran
2015-01-02 21:48   ` [PATCH net-next V2 0/7] Fixing the "Time Counter fixes and improvements" 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).