[Intel-wired-lan] [PATCH 2/3] e1000e: e1000e_cyclecounter_read(): fix er32(SYSTIML) overflow check
Brown, Aaron F
aaron.f.brown at intel.com
Mon Apr 25 23:08:00 UTC 2016
> From: Intel-wired-lan [mailto:intel-wired-lan-bounces at lists.osuosl.org] On
> Behalf Of Denys Vlasenko
> Sent: Wednesday, April 20, 2016 8:46 AM
> To: intel-wired-lan at lists.osuosl.org
> Cc: Denys Vlasenko <dvlasenk at redhat.com>
> Subject: [Intel-wired-lan] [PATCH 2/3] e1000e: e1000e_cyclecounter_read():
> fix er32(SYSTIML) overflow check
>
> If two consecutive reads of the counter are the same, it is also not an
> overflow.
> "systimel_1 < systimel_2" should be "systimel_1 <= systimel_2".
>
> Before the patch, we could perform an *erroneous* correction:
>
> Let's say that systimel_1 == systimel_2 == 0xffffffff.
> "systimel_1 < systimel_2" is false, we think it's an overflow,
> we read "systimeh = er32(SYSTIMH)" which meanwhile had incremented,
> and use "(systimeh << 32) + systimel_2" value which is 2^32 too large.
>
> Signed-off-by: Denys Vlasenko <dvlasenk at redhat.com>
> CC: intel-wired-lan at lists.osuosl.org
> ---
> drivers/net/ethernet/intel/e1000e/netdev.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
This patch also gives me the possible unwrapped commit description (prefer a maximum 75 chars per line) warning but otherwise seems fine.
Tested-by: Aaron Brown <aaron.f.brown at intel.com>
More information about the Intel-wired-lan
mailing list