Merge branch 'timecounter-next'
authorDavid S. Miller <davem@davemloft.net>
Fri, 2 Jan 2015 21:47:51 +0000 (16:47 -0500)
committerDavid S. Miller <davem@davemloft.net>
Fri, 2 Jan 2015 21:47:51 +0000 (16:47 -0500)
Richard Cochran says:

====================
Fixing the "Time Counter fixes and improvements"

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>
====================

Signed-off-by: David S. Miller <davem@davemloft.net>
arch/microblaze/kernel/timer.c
drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c
drivers/net/ethernet/intel/e1000e/netdev.c
drivers/net/ethernet/intel/igb/igb_ptp.c
drivers/net/ethernet/intel/ixgbe/ixgbe_ptp.c
drivers/net/ethernet/mellanox/mlx4/en_clock.c
include/linux/timecounter.h

index dd96f0e..c897745 100644 (file)
@@ -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;
index 2c95132..0758c8b 100644 (file)
@@ -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;
 }
index 2537d36..332a298 100644 (file)
@@ -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() */
 
index 8baf3fd..5e7a4e3 100644 (file)
@@ -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. */
index 47c29ea..79c00f5 100644 (file)
@@ -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;
 
index e9cce4f..90b5309 100644 (file)
@@ -32,6 +32,7 @@
  */
 
 #include <linux/mlx4/device.h>
+#include <linux/clocksource.h>
 
 #include "mlx4_en.h"
 
index 74f4549..4382035 100644 (file)
@@ -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)
  */