From owner-svn-src-head@FreeBSD.ORG Sat Mar 28 06:22:11 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D7AE01065677; Sat, 28 Mar 2009 06:22:11 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C5E008FC1F; Sat, 28 Mar 2009 06:22:11 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n2S6MBun086714; Sat, 28 Mar 2009 06:22:11 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2S6MBTE086713; Sat, 28 Mar 2009 06:22:11 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <200903280622.n2S6MBTE086713@svn.freebsd.org> From: Warner Losh Date: Sat, 28 Mar 2009 06:22:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r190488 - head/sys/dev/ed X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 28 Mar 2009 06:22:12 -0000 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); } /*