From owner-freebsd-arm@freebsd.org Thu Jul 16 18:55:19 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 71E3D9A34C8 for ; Thu, 16 Jul 2015 18:55:19 +0000 (UTC) (envelope-from ian@freebsd.org) Received: from erouter6.ore.mailhop.org (erouter6.ore.mailhop.org [54.187.213.119]) by mx1.freebsd.org (Postfix) with SMTP id 3522C109F for ; Thu, 16 Jul 2015 18:55:19 +0000 (UTC) (envelope-from ian@freebsd.org) Received: from ilsoft.org (unknown [73.34.117.227]) by outbound3.ore.mailhop.org (Halon Mail Gateway) with ESMTPSA; Thu, 16 Jul 2015 18:53:44 +0000 (UTC) Received: from rev (rev [172.22.42.240]) by ilsoft.org (8.14.9/8.14.9) with ESMTP id t6GItGYm054548; Thu, 16 Jul 2015 12:55:16 -0600 (MDT) (envelope-from ian@freebsd.org) Message-ID: <1437072916.1334.364.camel@freebsd.org> Subject: Re: SDHC errors during boot on RPi2 (11.0-CURRENT) From: Ian Lepore To: Luiz Otavio O Souza Cc: "freebsd-arm@freebsd.org" , Warner Losh Date: Thu, 16 Jul 2015 12:55:16 -0600 In-Reply-To: References: <55A5A3F4.7040105@foxvalley.net> <20150716142329.4387b29de5d7fc9a2a9c27ab@strcmp.org> Content-Type: multipart/mixed; boundary="=-qq1U0f2kB6yRSUFT5ALH" X-Mailer: Evolution 3.12.10 FreeBSD GNOME Team Port Mime-Version: 1.0 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: Thu, 16 Jul 2015 18:55:19 -0000 --=-qq1U0f2kB6yRSUFT5ALH Content-Type: text/plain; charset="iso-8859-7" Content-Transfer-Encoding: 8bit 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 --=-qq1U0f2kB6yRSUFT5ALH Content-Disposition: inline; filename="mmc_desel_resel.diff" Content-Type: text/x-patch; name="mmc_desel_resel.diff"; charset="us-ascii" Content-Transfer-Encoding: 7bit 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, --=-qq1U0f2kB6yRSUFT5ALH--