From owner-svn-src-head@FreeBSD.ORG Fri Aug 23 15:07:54 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 9D5F7E8F; Fri, 23 Aug 2013 15:07:54 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 8A8962D62; Fri, 23 Aug 2013 15:07:54 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r7NF7sO9008516; Fri, 23 Aug 2013 15:07:54 GMT (envelope-from ian@svn.freebsd.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r7NF7spP008515; Fri, 23 Aug 2013 15:07:54 GMT (envelope-from ian@svn.freebsd.org) Message-Id: <201308231507.r7NF7spP008515@svn.freebsd.org> From: Ian Lepore Date: Fri, 23 Aug 2013 15:07:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r254716 - head/sys/dev/mmc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 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: Fri, 23 Aug 2013 15:07:54 -0000 Author: ian Date: Fri Aug 23 15:07:54 2013 New Revision: 254716 URL: http://svnweb.freebsd.org/changeset/base/254716 Log: Don't give up so easily on failure of CMD55 to put the card into app-cmd mode. We don't know why it failed, so we can't know that a retry will also fail (the low-level driver might have reset the controller state machine or something similar that would allow a retry to work). Modified: head/sys/dev/mmc/mmc.c Modified: head/sys/dev/mmc/mmc.c ============================================================================== --- head/sys/dev/mmc/mmc.c Fri Aug 23 14:50:03 2013 (r254715) +++ head/sys/dev/mmc/mmc.c Fri Aug 23 15:07:54 2013 (r254716) @@ -106,7 +106,7 @@ struct mmc_ivars { #define CMD_RETRIES 3 -#define CARD_ID_FREQUENCY 400000 /* Spec requires 400KHz max during ID phase. */ +#define CARD_ID_FREQUENCY 400000 /* Spec requires 400kHz max during ID phase. */ static SYSCTL_NODE(_hw, OID_AUTO, mmc, CTLFLAG_RD, NULL, "mmc driver"); @@ -447,8 +447,8 @@ mmc_wait_for_app_cmd(struct mmc_softc *s err = appcmd.error; if (err == MMC_ERR_NONE) { if (!(appcmd.resp[0] & R1_APP_CMD)) - return MMC_ERR_FAILED; /* Retries won't help. */ - if (mmc_wait_for_cmd(sc, cmd, 0) != 0) + err = MMC_ERR_FAILED; + else if (mmc_wait_for_cmd(sc, cmd, 0) != 0) err = MMC_ERR_FAILED; else err = cmd->error;