From owner-freebsd-arm@freebsd.org Sat Jul 18 01:03:54 2015 Return-Path: Delivered-To: freebsd-arm@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1BB789A44EE for ; Sat, 18 Jul 2015 01:03:54 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) by mx1.freebsd.org (Postfix) with ESMTP id 062A1155A; Sat, 18 Jul 2015 01:03:54 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from FreeBSD.org (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) by freefall.freebsd.org (Postfix) with ESMTP id 6646810CF; Sat, 18 Jul 2015 01:03:53 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Date: Sat, 18 Jul 2015 01:03:51 +0000 From: Glen Barber To: Andreas Schwarz Cc: freebsd-arm@freebsd.org, Ian Lepore Subject: Re: SDHC errors during boot on RPi2 (11.0-CURRENT) Message-ID: <20150718010351.GI1438@FreeBSD.org> References: <55A5A3F4.7040105@foxvalley.net> <20150716142329.4387b29de5d7fc9a2a9c27ab@strcmp.org> <1437072916.1334.364.camel@freebsd.org> <08A8C4D5-54A5-432B-B3D7-744287B76EF9@bsdimp.com> <1437144948.1334.373.camel@freebsd.org> <20150718030157.2aa9a78a874d3657131a2bed@strcmp.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="EdRE1UL8d3mMOE6m" Content-Disposition: inline In-Reply-To: <20150718030157.2aa9a78a874d3657131a2bed@strcmp.org> X-Operating-System: FreeBSD 11.0-CURRENT amd64 X-SCUD-Definition: Sudden Completely Unexpected Dataloss X-SULE-Definition: Sudden Unexpected Learning Event X-PEKBAC-Definition: Problem Exists, Keyboard Between Admin/Computer User-Agent: Mutt/1.5.23 (2014-03-12) X-BeenThere: freebsd-arm@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "Porting FreeBSD to ARM processors." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 18 Jul 2015 01:03:54 -0000 --EdRE1UL8d3mMOE6m Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sat, Jul 18, 2015 at 03:01:57AM +0200, Andreas Schwarz wrote: > On Fri, 17 Jul 2015 08:55:48 -0600 > Ian Lepore wrote: >=20 > > On Thu, 2015-07-16 at 21:57 -0600, Warner Losh wrote: > > > > On Jul 16, 2015, at 12:55 PM, Ian Lepore wrote: > > > >=20 > > > > On Thu, 2015-07-16 at 15:17 -0300, Luiz Otavio O Souza wrote: > > > >> On 16 July 2015 at 09:23, Andreas Schwarz wrote: > > > >>> On Wed, 15 Jul 2015 21:17:21 -0600 > > > >>> Warner Losh wrote: > > > >>>=20 > > > >>>>> On Jul 14, 2015, at 6:06 PM, Dan Raymond wrote: > > > >>>>>=20 > > > >>>>> Is anyone else getting these errors during every boot? I'm run= ning r285346. > > > >>>>=20 > > > >>>> I=E2=80=99ve been running on the RPi2 for some time and have nev= er seen this. I haven=E2=80=99t > > > >>>> rebuild in the past few weeks though. > > > >>>>=20 > > > >>>> Does this happen on either SD cards? Or other versions of the ke= rnel? > > > >>>=20 > > > >>> I've the same output (using generic RPI2 kernel conf). > > > >>=20 > > > >> This is a side effect of r283128, if you comment that line that > > > >> re-select the card, CMD7 won't fail. > > > >>=20 > > > >> This also affects the MMC controller on Allwinner SoCs. > > > >=20 > > > > Hmm, so some cards deselect themselves when they shouldn't, and our > > > > workaround that reselects them fails if the card didn't deselect it= self. > > > > Maybe it will work for all cards/controllers if we explicitly desel= ect > > > > then reselect the card at that point. (This only happens once at > > > > card-insert/boot time, so it shouldn't impact performance.) > > > >=20 > > > > The attached patch adds the explicit deselect; it may or may not he= lp. > > > > (I haven't tested this at all). > > > >=20 > > > > -- Ian > > > >=20 > > > > Index: mmc.c > > > > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > > > > --- mmc.c (revision 285419) > > > > +++ mmc.c (working copy) > > > > @@ -1392,6 +1392,7 @@ mmc_discover_cards(struct mmc_softc *sc) > > > > * out. Others seem to handle it correctly, so it may > > > > * be a combination of card and controller. > > > > */ > > > > + mmc_select_card(sc, 0); > > > > mmc_select_card(sc, ivar->rca); > > > > mmc_app_sd_status(sc, ivar->rca, ivar->raw_sd_status); > > > > mmc_app_decode_sd_status(ivar->raw_sd_status, > > >=20 > > > Yes. I like this. Update the comment though please. > > >=20 > > > Warner > > >=20 > >=20 > > Yeah, when I commit I'll make the comment match the new reality, just > > waiting to hear another success report or two first. >=20 > I can confirm that the problem is gone (after applying your patch to r285= 661). >=20 > root@pizelot:~ # uname -a > FreeBSD pizelot.schwarzes.net 11.0-CURRENT FreeBSD 11.0-CURRENT #0 r28566= 1M: Sat Jul 18 02:19:21 CEST 2015 root@pizelot.schwarzes.net:/usr/obj/u= sr/src/sys/RPI2 arm >=20 Ian, will you please commit the fix, with the plan to have this in the next 10.2 build? Glen --EdRE1UL8d3mMOE6m Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQIcBAEBCAAGBQJVqaX3AAoJEAMUWKVHj+KTcyMP/jXewNwtHKPKoZFIiXnfF0/z 3RQ55PJF+x3ny+pwkLgK5UKiqgtJcjkljpJsXnZ3mJHarx+TtPaPbHWUmxwpEv/a 7fBvF0q+eMMJH8CJKFtymiRcFgz6nSu3M4AdsGVpP4H3+uE8sZlvwBmPlnlHy54S cib68MZEwfJ/4LJZoxuWReKvLc8hP8npDSN5Q2q+Iu2RvoFOzXiHNUx37Qb7r+mC PiE6Y1MdPAmVAk5WhZOQiLV3Xpbxf5I186DFQJaQNqRoP+UhH87ESlNURJFqj846 p2e53XWYACh7zOB/E8EuM2AUKJQo2Bg2Cc4cSZiqIsW1opkJWYZEcrg0TBEXd/v2 LdN6TzWlJmGYBMZq1wTsLX7Uruyeao35YUuTifOduQ0Kj+r/NOtyOGLRBUYGwb9K uAlwFPzJFb2AKzMfrrOME1UUN60ZKxAJkkrR8s07D1N54hQAzfDkLIQJJDgjYKks gX9Kre71UmtyhvJVm280/ix9TPVbUQb/UP8alewZUmtNJiZW0aNo8+6R//wKP3Tx 4U39+2+zrVZbE9KVdT+fMQ8pnOLEZrrQ0cJY2XjwenYiq7wQruW2t8+hDFefVB0t VtoKcoNhnPDh0Z2AvAQ3GxS0uREDX671MvjPp8h1OrgAlu9KalgCZTGiL4re0hOO H9aqerlfj7v7mJSoeAQM =n7eX -----END PGP SIGNATURE----- --EdRE1UL8d3mMOE6m--