Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1401792 > unrolled thread

RE: [Intel-wired-lan] [PATCH] e1000e: prevent division by zero if TIMINCA is zero

Started by"Brown, Aaron F" <aaron.f.brown@intel.com>
First post2016-05-17 00:40 +0200
Last post2016-05-17 00:40 +0200
Articles 1 — 1 participant

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  RE: [Intel-wired-lan] [PATCH] e1000e: prevent division by zero if  TIMINCA is zero "Brown, Aaron F" <aaron.f.brown@intel.com> - 2016-05-17 00:40 +0200

#1401792 — RE: [Intel-wired-lan] [PATCH] e1000e: prevent division by zero if TIMINCA is zero

From"Brown, Aaron F" <aaron.f.brown@intel.com>
Date2016-05-17 00:40 +0200
SubjectRE: [Intel-wired-lan] [PATCH] e1000e: prevent division by zero if TIMINCA is zero
Message-ID<rzzl7-4AJ-7@gated-at.bofh.it>
> From: Intel-wired-lan [mailto:intel-wired-lan-bounces@lists.osuosl.org] On
> Behalf Of Denys Vlasenko
> Sent: Friday, May 6, 2016 12:42 PM
> To: Kirsher, Jeffrey T <jeffrey.t.kirsher@intel.com>
> Cc: intel-wired-lan@lists.osuosl.org; Denys Vlasenko
> <dvlasenk@redhat.com>; LKML <linux-kernel@vger.kernel.org>;
> netdev@vger.kernel.org
> Subject: [Intel-wired-lan] [PATCH] e1000e: prevent division by zero if
> TIMINCA is zero
> 
> Users report that under VMWare, er32(TIMINCA) returns zero.
> This causes division by zero at init time as follows:
> 
>  ==>            incvalue = er32(TIMINCA) & E1000_TIMINCA_INCVALUE_MASK;
>                 for (i = 0; i < E1000_MAX_82574_SYSTIM_REREADS; i++) {
>                         /* latch SYSTIMH on read of SYSTIML */
>                         systim_next = (cycle_t)er32(SYSTIML);
>                         systim_next |= (cycle_t)er32(SYSTIMH) << 32;
> 
>                         time_delta = systim_next - systim;
>                         temp = time_delta;
>  ====>                  rem = do_div(temp, incvalue);
> 
> This change makes kernel survive this, and users report that
> NIC does work after this change.
> 
> Since on real hardware incvalue is never zero, this should not affect
> real hardware use case.
> 
> Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
> CC: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
> CC: "Ruinskiy, Dima" <dima.ruinskiy@intel.com>
> CC: intel-wired-lan@lists.osuosl.org
> CC: netdev@vger.kernel.org
> CC: LKML <linux-kernel@vger.kernel.org>
> ---
>  drivers/net/ethernet/intel/e1000e/netdev.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)

As Mark Rustad pointed out I recall this was earlier rejected as something that is a VMWare error and it should be fixed there so that existing VMs will start working without installing a new driver.  Having said that, it does not seem to be causing any harm in my testing, so...

Tested-by: Aaron Brown <aaron.f.brown@intel.com>

[toc] | [standalone]


Back to top | Article view | linux.kernel


csiph-web