On Sat, Dec 12, 2015 at 03:18:01PM -0500, Brian Walsh wrote:
> I see that. Comparing that code to what happens in the ixgbe driver it
> looks like reseting the clock should be part of e1000e_ptp_init. Then
> the e1000e_ptp_init code should be called in the device open function to
> initialize whenever the device is made active. Pull ptp_init out of the
> probe function.

Sorry, I mixed up the Intel cards WRT the unfortunate HW limitation.
The 82574 does not need to reset the clock at link loss, or at least
it doesn't appear to need it.

I wouldn't follow ixgbe, because putting the reset in the 'open'
method means that the clock will become reset during ifup/ifdown.  For
the ixgbe this is necessary, IIRC, but I wouldn't do it unless you are 
absolutely by some HW quirk.

I would try something like the following untested patch...

Thanks,
Richard


diff --git a/drivers/net/ethernet/intel/e1000e/netdev.c 
b/drivers/net/ethernet/intel/e1000e/netdev.c
index 0a854a4..1823148 100644
--- a/drivers/net/ethernet/intel/e1000e/netdev.c
+++ b/drivers/net/ethernet/intel/e1000e/netdev.c
@@ -3732,16 +3732,6 @@ static int e1000e_config_hwtstamp(struct e1000_adapter 
*adapter,
        er32(RXSTMPH);
        er32(TXSTMPH);
 
-       /* Get and set the System Time Register SYSTIM base frequency */
-       ret_val = e1000e_get_base_timinca(adapter, &regval);
-       if (ret_val)
-               return ret_val;
-       ew32(TIMINCA, regval);
-
-       /* reset the ns time counter */
-       timecounter_init(&adapter->tc, &adapter->cc,
-                        ktime_to_ns(ktime_get_real()));
-
        return 0;
 }
 
@@ -6980,6 +6970,7 @@ static int e1000_probe(struct pci_dev *pdev, const struct 
pci_device_id *ent)
        u16 eeprom_data = 0;
        u16 eeprom_apme_mask = E1000_EEPROM_APME;
        s32 rval = 0;
+       u32 regval;
 
        if (ei->flags2 & FLAG2_DISABLE_ASPM_L0S)
                aspm_disable_flag = PCIE_LINK_STATE_L0S;
@@ -7270,6 +7261,16 @@ static int e1000_probe(struct pci_dev *pdev, const 
struct pci_device_id *ent)
        /* carrier off reporting is important to ethtool even BEFORE open */
        netif_carrier_off(netdev);
 
+       /* Get and set the System Time Register SYSTIM base frequency */
+       err = e1000e_get_base_timinca(adapter, &regval);
+       if (err)
+               goto err_register;
+       ew32(TIMINCA, regval);
+
+       /* reset the ns time counter */
+       timecounter_init(&adapter->tc, &adapter->cc,
+                        ktime_to_ns(ktime_get_real()));
+
        /* init PTP hardware clock */
        e1000e_ptp_init(adapter);
 

------------------------------------------------------------------------------
_______________________________________________
Linuxptp-users mailing list
Linuxptp-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxptp-users

Reply via email to