Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 12 Oct 2008 17:12:01 +0400
From:      Ilya Bakulin <webmaster@kibab.com>
To:        Ilya Bakulin <webmaster@kibab.com>
Cc:        Alexander Motin <mav@freebsd.org>, freebsd-mobile@freebsd.org, freebsd-arm@freebsd.org, freebsd-current@freebsd.org, Zaphod Beeblebrox <zbeeble@gmail.com>, imp@freebsd.org
Subject:   Re: RFC: PCI SD host controller driver & mmc/mmcsd modules improvements
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>

next in thread | previous in thread | raw e-mail | index | archive | help
--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 <webmaster@kibab.com> 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: <MMC/SD bus> 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: <MMC/SD bus> 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 <SD Memory Card> 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 <webmaster@kibab.com>

--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--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20081012171201.da4da754.webmaster>