From owner-freebsd-arm@freebsd.org Sat Jul 18 01:02:08 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 8922C9A44CA for ; Sat, 18 Jul 2015 01:02:08 +0000 (UTC) (envelope-from freebsd.asc@strcmp.org) Received: from olinguito.schwarzes.net (olinguito.schwarzes.net [IPv6:2a01:4f8:7d:1b5::1]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 427EF14A4 for ; Sat, 18 Jul 2015 01:02:04 +0000 (UTC) (envelope-from freebsd.asc@strcmp.org) Received: from asc-t60.schwarzes.net (p5B031FF4.dip0.t-ipconnect.de [91.3.31.244]) (authenticated bits=0) by olinguito.schwarzes.net (8.14.9/8.14.9) with ESMTP id t6I11wKw061922 for ; Sat, 18 Jul 2015 03:01:59 +0200 (CEST) (envelope-from freebsd.asc@strcmp.org) Date: Sat, 18 Jul 2015 03:01:57 +0200 From: Andreas Schwarz To: freebsd-arm@freebsd.org Subject: Re: SDHC errors during boot on RPi2 (11.0-CURRENT) Message-Id: <20150718030157.2aa9a78a874d3657131a2bed@strcmp.org> In-Reply-To: <1437144948.1334.373.camel@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> X-Mailer: Sylpheed 3.4.3 (GTK+ 2.10.14; i686-pc-mingw32) Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.4.3 (olinguito.schwarzes.net [78.47.41.143]); Sat, 18 Jul 2015 03:01:59 +0200 (CEST) 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:02:08 -0000 On Fri, 17 Jul 2015 08:55:48 -0600 Ian Lepore wrote: > On Thu, 2015-07-16 at 21:57 -0600, Warner Losh wrote: > > > On Jul 16, 2015, at 12:55 PM, Ian Lepore wrote: > > > > > > 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: > > >>> > > >>>>> On Jul 14, 2015, at 6:06 PM, Dan Raymond wrote: > > >>>>> > > >>>>> Is anyone else getting these errors during every boot? I'm running r285346. > > >>>> > > >>>> I’ve been running on the RPi2 for some time and have never seen this. I haven’t > > >>>> rebuild in the past few weeks though. > > >>>> > > >>>> Does this happen on either SD cards? Or other versions of the kernel? > > >>> > > >>> I've the same output (using generic RPI2 kernel conf). > > >> > > >> This is a side effect of r283128, if you comment that line that > > >> re-select the card, CMD7 won't fail. > > >> > > >> This also affects the MMC controller on Allwinner SoCs. > > > > > > Hmm, so some cards deselect themselves when they shouldn't, and our > > > workaround that reselects them fails if the card didn't deselect itself. > > > Maybe it will work for all cards/controllers if we explicitly deselect > > > then reselect the card at that point. (This only happens once at > > > card-insert/boot time, so it shouldn't impact performance.) > > > > > > The attached patch adds the explicit deselect; it may or may not help. > > > (I haven't tested this at all). > > > > > > -- Ian > > > > > > Index: mmc.c > > > =================================================================== > > > --- 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, > > > > Yes. I like this. Update the comment though please. > > > > Warner > > > > Yeah, when I commit I'll make the comment match the new reality, just > waiting to hear another success report or two first. I can confirm that the problem is gone (after applying your patch to r285661). root@pizelot:~ # uname -a FreeBSD pizelot.schwarzes.net 11.0-CURRENT FreeBSD 11.0-CURRENT #0 r285661M: Sat Jul 18 02:19:21 CEST 2015 root@pizelot.schwarzes.net:/usr/obj/usr/src/sys/RPI2 arm -- best regards Andreas