From owner-freebsd-current@FreeBSD.ORG Sun Oct 12 13:12:14 2008 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 115D81065697; Sun, 12 Oct 2008 13:12:14 +0000 (UTC) (envelope-from webmaster@kibab.com) Received: from smtp.ht-systems.ru (mr0.ht-systems.ru [78.110.50.55]) by mx1.freebsd.org (Postfix) with ESMTP id E1FF78FC08; Sun, 12 Oct 2008 13:12:12 +0000 (UTC) (envelope-from webmaster@kibab.com) Received: from [83.237.171.239] (helo=kibab-nb) by smtp.ht-systems.ru with esmtpa (Exim 4.62) (envelope-from ) id 1Kp0jy-0006zC-Ev; Sun, 12 Oct 2008 17:12:10 +0400 Date: Sun, 12 Oct 2008 17:12:01 +0400 From: Ilya Bakulin To: Ilya Bakulin Message-Id: <20081012171201.da4da754.webmaster@kibab.com> In-Reply-To: <20081008113848.c9b44354.webmaster@kibab.com> References: <48DEA8E7.2080503@FreeBSD.org> <5f67a8c40810052226k3070a11ah463a819c677f6307@mail.gmail.com> <20081008113848.c9b44354.webmaster@kibab.com> Organization: HT-Systems X-Mailer: Sylpheed 2.5.0 (GTK+ 2.12.11; i386-portbld-freebsd7.1) Mime-Version: 1.0 Content-Type: multipart/signed; protocol="application/pgp-signature"; micalg="PGP-SHA1"; boundary="Signature=_Sun__12_Oct_2008_17_12_01_+0400_0_zhgMgXDi6X6+dB" X-Mailman-Approved-At: Sun, 12 Oct 2008 13:40:07 +0000 Cc: Alexander Motin , freebsd-mobile@freebsd.org, freebsd-arm@freebsd.org, freebsd-current@freebsd.org, Zaphod Beeblebrox , imp@freebsd.org Subject: Re: RFC: PCI SD host controller driver & mmc/mmcsd modules improvements X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 12 Oct 2008 13:12:14 -0000 --Signature=_Sun__12_Oct_2008_17_12_01_+0400_0_zhgMgXDi6X6+dB Content-Type: multipart/mixed; boundary="Multipart=_Sun__12_Oct_2008_17_12_01_+0400_e1mHiLotC0w.aU4r" --Multipart=_Sun__12_Oct_2008_17_12_01_+0400_e1mHiLotC0w.aU4r Content-Type: text/plain; charset=US-ASCII Content-Disposition: inline Content-Transfer-Encoding: quoted-printable 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 d= oesn't work: >=20 > 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 >=20 > ... 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) car= d 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 t= o read answer. --=20 Ilya Bakulin --Multipart=_Sun__12_Oct_2008_17_12_01_+0400_e1mHiLotC0w.aU4r Content-Type: text/x-diff; name="mmc_c_inc_attempts.diff" Content-Disposition: attachment; filename="mmc_c_inc_attempts.diff" Content-Transfer-Encoding: quoted-printable --- mmc.c~ 2008-10-11 21:30:40.000000000 +0400 +++ mmc.c 2008-10-12 13:34:32.000000000 +0400 @@ -428,7 +428,7 @@ cmd.flags =3D MMC_RSP_R3 | MMC_CMD_BCR; cmd.data =3D NULL; =20 - for (i =3D 0; i < 100; i++) { + for (i =3D 0; i < 1000; i++) { err =3D mmc_wait_for_app_cmd(sc, 0, &cmd, CMD_RETRIES); if (err !=3D MMC_ERR_NONE) break; @@ -438,8 +438,9 @@ err =3D MMC_ERR_TIMEOUT; mmc_ms_delay(10); } + printf("mmc_send_app_ocond(): cmd completed in %d iter\n", i); if (rocr && err =3D=3D MMC_ERR_NONE) - *rocr =3D cmd.resp[0]; + *rocr =3D cmd.resp[0]; return (err); } =20 --Multipart=_Sun__12_Oct_2008_17_12_01_+0400_e1mHiLotC0w.aU4r-- --Signature=_Sun__12_Oct_2008_17_12_01_+0400_0_zhgMgXDi6X6+dB Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.9 (FreeBSD) iEYEARECAAYFAkjx96kACgkQo9vlj1oadwjF5gCgnVPkD6m95Cc+DsnlE934e7eL dSgAoNXvcx8U33ZXrTVrTlDqrqqynBUg =RaPu -----END PGP SIGNATURE----- --Signature=_Sun__12_Oct_2008_17_12_01_+0400_0_zhgMgXDi6X6+dB--