]> www.infradead.org Git - users/jedix/linux-maple.git/commit
e1000e: e1000e_cyclecounter_read(): do overflow check only if needed
authorDenys Vlasenko <dvlasenk@redhat.com>
Wed, 20 Apr 2016 15:45:56 +0000 (17:45 +0200)
committerChuck Anderson <chuck.anderson@oracle.com>
Thu, 22 Jun 2017 06:24:39 +0000 (23:24 -0700)
commit1c8dfc3f294d2d2dafe31eba05b11add98640959
tree118e733e7ee2396514e3e54fff17616cb8f19e96
parentaa5391b028476227d68ba47f915d57403b08d914
e1000e: e1000e_cyclecounter_read(): do overflow check only if needed

SYSTIMH:SYSTIML registers are incremented by 24-bit value TIMINCA[23..0]

er32(SYSTIML) are probably moderately expensive (they are pci bus reads).
Can we avoid one of them? Yes, we can.

If the SYSTIML value we see is smaller than 0xff000000, the overflow
into SYSTIMH would require at least two increments.

We do two reads, er32(SYSTIML) and er32(SYSTIMH), in this order.

Even if one increment happens between them, the overflow into SYSTIMH
is impossible, and we can avoid doing another er32(SYSTIML) read
and overflow check.

Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
Tested-by: Aaron Brown <aaron.f.brown@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Orabug: 26243014
(cherry picked from commit ab507c9a54ce3580e6a3829c9f4c24a13c32cbac)
Signed-off-by: Jack Vogel <jack.vogel@oracle.com>
Reviewed-by: Ethan Zhao <ethan.zhao@oracle.com>
drivers/net/ethernet/intel/e1000e/netdev.c