From owner-freebsd-mobile@FreeBSD.ORG Mon Oct 13 17:04:00 2008 Return-Path: Delivered-To: freebsd-mobile@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BF63510656A2; Mon, 13 Oct 2008 17:04:00 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from harmony.bsdimp.com (bsdimp.com [199.45.160.85]) by mx1.freebsd.org (Postfix) with ESMTP id 5EF4C8FC19; Mon, 13 Oct 2008 17:04:00 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from localhost (localhost [127.0.0.1]) by harmony.bsdimp.com (8.14.2/8.14.1) with ESMTP id m9DH29jV043173; Mon, 13 Oct 2008 11:02:10 -0600 (MDT) (envelope-from imp@bsdimp.com) Date: Mon, 13 Oct 2008 11:03:10 -0600 (MDT) Message-Id: <20081013.110310.-1622595361.imp@bsdimp.com> To: webmaster@kibab.com From: "M. Warner Losh" In-Reply-To: <20081012171201.da4da754.webmaster@kibab.com> References: <5f67a8c40810052226k3070a11ah463a819c677f6307@mail.gmail.com> <20081008113848.c9b44354.webmaster@kibab.com> <20081012171201.da4da754.webmaster@kibab.com> X-Mailer: Mew version 5.2 on Emacs 21.3 / Mule 5.0 (SAKAKI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Cc: zbeeble@gmail.com, mav@freebsd.org, freebsd-current@freebsd.org, freebsd-arm@freebsd.org, freebsd-mobile@freebsd.org Subject: Re: RFC: PCI SD host controller driver & mmc/mmcsd modules improvements X-BeenThere: freebsd-mobile@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Mobile computing with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 13 Oct 2008 17:04:01 -0000 In message: <20081012171201.da4da754.webmaster@kibab.com> Ilya Bakulin writes: : On Wed, 8 Oct 2008 11:38:48 +0400 : Ilya Bakulin wrote: : : > I have another SD card, 2 Gb size, in my camera. It's from Kingston. It doesn't work: : > : > sdhci0-slot0: Card inserted : > mmc0: on sdhci0 : > sdhci0-slot0: Command error 1 (opcode 2 arg 0 flags 103 dlen 0 dflags 0) : > mmc0: setting transfer rate to 50.000MHz : > : > ... and no new storage devices appear. : : Problem was solved by increasing the number of answer read attempts in mmc_send_app_op_cond(). With attached patch (against latest driver version) card is recognized properly on ~ 190th attempt (while in original driver there are only 100 attempts). : : Output from dmesg now: : sdhci0-slot0: Card inserted : mmc0: on sdhci0 : sdhci0-slot0: Command error 1 (opcode 8 arg 426 flags 101 dlen 0 dflags 0) : mmc_send_app_ocond(): cmd completed in 0 iter : sdhci0-slot0: Command error 1 (opcode 8 arg 426 flags 101 dlen 0 dflags 0) : mmc_send_app_ocond(): cmd completed in 195 iter : mmcsd0: 1964MB at mmc0 50MHz/4bit : GEOM_LABEL: Label for provider mmcsd0s1 is msdosfs/KODAK. : : Furthermore, non-mine SDHC card is now also recognized in this cardreader (it doesn't even under Windows). In this case, it takes about 400 attempts to read answer. I think I bumped the number of iterations to 100 when I found that 10 wasn't enough. 25 different cards worked just fine, but I got use of a 16MB SD card at BSDcan that needed like 65. Bumping it from 100 to 1000, however, makes the timeout go from 1s to 10s. That opens up window for insertion races, but that's the only downside I see... Of course, we want to fix those races, but this may expose them a little more.. I can't believe that you had a card that took 4s to become active! Can you confirm the elapsed time is really 4s for that card? Otherwise, this may be pointing out a bug in another area of the code... Warner