From owner-p4-projects@FreeBSD.ORG Sat Apr 7 13:39:33 2012 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 50DD01065670; Sat, 7 Apr 2012 13:39:33 +0000 (UTC) Delivered-To: perforce@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1386A106564A for ; Sat, 7 Apr 2012 13:39:33 +0000 (UTC) (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Received: from skunkworks.freebsd.org (skunkworks.freebsd.org [IPv6:2001:4f8:fff6::2d]) by mx1.freebsd.org (Postfix) with ESMTP id EF21D8FC08 for ; Sat, 7 Apr 2012 13:39:32 +0000 (UTC) Received: from skunkworks.freebsd.org (localhost [127.0.0.1]) by skunkworks.freebsd.org (8.14.4/8.14.4) with ESMTP id q37DdW3S045280 for ; Sat, 7 Apr 2012 13:39:32 GMT (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Received: (from perforce@localhost) by skunkworks.freebsd.org (8.14.4/8.14.4/Submit) id q37DdUZY045277 for perforce@freebsd.org; Sat, 7 Apr 2012 13:39:30 GMT (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Date: Sat, 7 Apr 2012 13:39:30 GMT Message-Id: <201204071339.q37DdUZY045277@skunkworks.freebsd.org> X-Authentication-Warning: skunkworks.freebsd.org: perforce set sender to bb+lists.freebsd.perforce@cyrus.watson.org using -f From: Robert Watson To: Perforce Change Reviews Precedence: bulk Cc: Subject: PERFORCE change 209200 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 07 Apr 2012 13:39:33 -0000 http://p4web.freebsd.org/@@209200?ac=10 Change 209200 by rwatson@rwatson_svr_ctsrd_mipsbuild on 2012/04/07 13:39:22 When performing an SD Card write, ignore the ASR bit described by the specification as "most recently received data contains errors"; this bit is apparently always set if a block write is performed, and only useful when looking at the results of a block read. With this change, many block writes using the SD Card slot on the Terasic DE-4 board often succeed. Affected files ... .. //depot/projects/ctsrd/beribsd/src/sys/dev/altera/sdcard/altera_sdcard_io.c#9 edit Differences ... ==== //depot/projects/ctsrd/beribsd/src/sys/dev/altera/sdcard/altera_sdcard_io.c#9 (text+ko) ==== @@ -301,8 +301,8 @@ /* * Handle I/O retries if an error is returned by the device. */ - if (asr & - (ALTERA_SDCARD_ASR_CMDTIMEOUT | ALTERA_SDCARD_ASR_CMDDATAERROR)) { + if ((asr & ALTERA_SDCARD_ASR_CMDTIMEOUT) || (bp->bio_cmd == BIO_READ + && (asr & ALTERA_SDCARD_ASR_CMDDATAERROR))) { rr1 = altera_sdcard_read_rr1(sc); sc->as_retriesleft--; if (sc->as_retriesleft != 0) {