]> git.baikalelectronics.ru Git - kernel.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)
committerJeff Kirsher <jeffrey.t.kirsher@intel.com>
Fri, 13 May 2016 21:56:35 +0000 (14:56 -0700)
commita5030f527a4450999ef94d08110c90c3499a3e37
tree1f9da7034ffee2c96ef95b9a5dd1cf045c1da412
parent3b18e948fad22eb22c6288fb2db06ea84b9293f1
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>
drivers/net/ethernet/intel/e1000e/netdev.c