[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <1421278252-13622-1-git-send-email-bhavesh@vmware.com>
Date: Wed, 14 Jan 2015 15:30:52 -0800
From: Bhavesh Davda <bhavesh@...are.com>
To: linux.nics@...el.com, netdev@...r.kernel.org
Cc: nithin@...are.com, ninad@...are.com, gyang@...are.com,
smurali@...are.com, pv-drivers@...are.com,
Bhavesh Davda <bhavesh@...are.com>
Subject: [PATCH] e1000e: Fix 82574/82583 TimeSync errata handling for SYSTIM read
In emulated 82574 vNICs, TIMINCA might read as '0', so this change prevents a
divide-by-zero error.
Signed-off-by: Bhavesh Davda <bhavesh@...are.com>
Acked-by: Nithin Raju <nithin@...are.com>
Acked-by: Ninad Ghodke <ninad@...are.com>
Reviewed-by: Guolin Yang <gyang@...are.com>
Reviewed-by: Srividya Murali <smurali@...are.com>
---
drivers/net/ethernet/intel/e1000e/netdev.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/drivers/net/ethernet/intel/e1000e/netdev.c b/drivers/net/ethernet/intel/e1000e/netdev.c
index e14fd85..a4727e3 100644
--- a/drivers/net/ethernet/intel/e1000e/netdev.c
+++ b/drivers/net/ethernet/intel/e1000e/netdev.c
@@ -4141,6 +4141,8 @@ static cycle_t e1000e_cyclecounter_read(const struct cyclecounter *cc)
* rate and is a multiple of incvalue
*/
incvalue = er32(TIMINCA) & E1000_TIMINCA_INCVALUE_MASK;
+ if (incvalue == 0)
+ goto out;
for (i = 0; i < E1000_MAX_82574_SYSTIM_REREADS; i++) {
/* latch SYSTIMH on read of SYSTIML */
systim_next = (cycle_t)er32(SYSTIML);
@@ -4157,6 +4159,7 @@ static cycle_t e1000e_cyclecounter_read(const struct cyclecounter *cc)
break;
}
}
+out:
return systim;
}
--
2.3.0.rc0
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists