Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 28 Mar 2009 06:22:11 +0000 (UTC)
From:      Warner Losh <imp@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r190488 - head/sys/dev/ed
Message-ID:  <200903280622.n2S6MBTE086713@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: imp
Date: Sat Mar 28 06:22:11 2009
New Revision: 190488
URL: http://svn.freebsd.org/changeset/base/190488

Log:
  When reading via memory, read in (amount + 1) / 2 (to properly round
  up) rather than amount + 1 / 2, which is the same as amount, or 2x too
  many words which leads to data corruption.
  
  # This fixes the sbdrop panics I was seeing with the Toshiba LANCT00A.

Modified:
  head/sys/dev/ed/if_ed.c

Modified: head/sys/dev/ed/if_ed.c
==============================================================================
--- head/sys/dev/ed/if_ed.c	Sat Mar 28 06:12:39 2009	(r190487)
+++ head/sys/dev/ed/if_ed.c	Sat Mar 28 06:22:11 2009	(r190488)
@@ -1311,7 +1311,7 @@ ed_shmem_readmem16(struct ed_softc *sc, 
     uint16_t amount)
 {
 	bus_space_read_region_2(sc->mem_bst, sc->mem_bsh, src, (uint16_t *)dst,
-	    amount + 1 / 2);
+	    (amount + 1) / 2);
 }
 
 /*



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200903280622.n2S6MBTE086713>