igb: restore PPS signal on igb_ptp_reset
authorJacob Keller <jacob.e.keller@intel.com>
Fri, 9 Sep 2016 16:10:51 +0000 (09:10 -0700)
committerJeff Kirsher <jeffrey.t.kirsher@intel.com>
Wed, 28 Sep 2016 02:00:52 +0000 (19:00 -0700)
When a reset occurs, the PPS SYS_WRAP interrupt was not re-enabled which
resulted in disabling of the PPS signaling. Fix this by recording when
the interrupt is on and ensuring that we re-enable it every time we
reset.

Signed-off-by: Jacob Keller <jacob.e.keller@intel.com>
Tested-by: Aaron Brown <aaron.f.brown@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
drivers/net/ethernet/intel/igb/igb.h
drivers/net/ethernet/intel/igb/igb_ptp.c

index 03fbe4b7663b2307528073bfb13f30b3afedac61..d11093dce1b98dc3c892ba7a0507358b92bc13d6 100644 (file)
@@ -489,6 +489,7 @@ struct igb_adapter {
        struct timecounter tc;
        u32 tx_hwtstamp_timeouts;
        u32 rx_hwtstamp_cleared;
+       bool pps_sys_wrap_on;
 
        struct ptp_pin_desc sdp_config[IGB_N_SDP];
        struct {
index 1dd14e166dc800fb9ccb0f07091c22a7a02e3896..a7895c4cbcc3e09023e8901a33d420427548071b 100644 (file)
@@ -591,6 +591,7 @@ static int igb_ptp_feature_enable_i210(struct ptp_clock_info *ptp,
                        tsim |= TSINTR_SYS_WRAP;
                else
                        tsim &= ~TSINTR_SYS_WRAP;
+               igb->pps_sys_wrap_on = !!on;
                wr32(E1000_TSIM, tsim);
                spin_unlock_irqrestore(&igb->tmreg_lock, flags);
                return 0;
@@ -1235,7 +1236,9 @@ void igb_ptp_reset(struct igb_adapter *adapter)
        case e1000_i211:
                wr32(E1000_TSAUXC, 0x0);
                wr32(E1000_TSSDP, 0x0);
-               wr32(E1000_TSIM, TSYNC_INTERRUPTS);
+               wr32(E1000_TSIM,
+                    TSYNC_INTERRUPTS |
+                    (adapter->pps_sys_wrap_on ? TSINTR_SYS_WRAP : 0));
                wr32(E1000_IMS, E1000_IMS_TS);
                break;
        default: