From owner-svn-src-head@FreeBSD.ORG Sat Dec 6 01:31:08 2008 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 55CB8106564A; Sat, 6 Dec 2008 01:31:08 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 440568FC13; Sat, 6 Dec 2008 01:31:08 +0000 (UTC) (envelope-from mav@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 mB61V7KB078930; Sat, 6 Dec 2008 01:31:07 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mB61V7xX078929; Sat, 6 Dec 2008 01:31:07 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <200812060131.mB61V7xX078929@svn.freebsd.org> From: Alexander Motin Date: Sat, 6 Dec 2008 01:31:07 +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: r185661 - head/sys/dev/sdhci 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, 06 Dec 2008 01:31:08 -0000 Author: mav Date: Sat Dec 6 01:31:07 2008 New Revision: 185661 URL: http://svn.freebsd.org/changeset/base/185661 Log: Forget current bus power settings on full reset. Chip must be reconfigured. Do not issue command if there is no card, clock or power. Controller will not detect command timeout without clock active. Modified: head/sys/dev/sdhci/sdhci.c Modified: head/sys/dev/sdhci/sdhci.c ============================================================================== --- head/sys/dev/sdhci/sdhci.c Sat Dec 6 01:11:45 2008 (r185660) +++ head/sys/dev/sdhci/sdhci.c Sat Dec 6 01:31:07 2008 (r185661) @@ -301,8 +301,10 @@ sdhci_reset(struct sdhci_slot *slot, uin WR1(slot, SDHCI_SOFTWARE_RESET, mask); - if (mask & SDHCI_RESET_ALL) + if (mask & SDHCI_RESET_ALL) { slot->clock = 0; + slot->power = 0; + } /* Wait max 100 ms */ timeout = 100; @@ -904,8 +906,11 @@ sdhci_start_command(struct sdhci_slot *s /* Read controller present state. */ state = RD4(slot, SDHCI_PRESENT_STATE); - /* Do not issue command if there is no card. */ - if ((state & SDHCI_CARD_PRESENT) == 0) { + /* Do not issue command if there is no card, clock or power. + * Controller will not detect timeout without clock active. */ + if ((state & SDHCI_CARD_PRESENT) == 0 || + slot->power == 0 || + slot->clock == 0) { cmd->error = MMC_ERR_FAILED; slot->req = NULL; slot->curcmd = NULL;