From mboxrd@z Thu Jan 1 00:00:00 1970 Delivery-date: Fri, 30 Sep 2022 14:25:51 +0200 Received: from metis.ext.pengutronix.de ([2001:67c:670:201:290:27ff:fe1d:cc33]) by lore.white.stw.pengutronix.de with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1oeF5T-001Pfy-Eh for lore@lore.pengutronix.de; Fri, 30 Sep 2022 14:25:51 +0200 Received: from bombadil.infradead.org ([2607:7c80:54:3::133]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oeF5S-0004qU-8i for lore@pengutronix.de; Fri, 30 Sep 2022 14:25:50 +0200 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:From:In-Reply-To: Content-Type:MIME-Version:References:Message-ID:Subject:Cc:To:Date:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=5NCVslMWCqMRu/3nBzHKqEh92iEYJ0rHeAF+KBjASbk=; b=XxkxmMu4DF5YN9vuOPRjzXTg/I 7vXVQlj8hwr1yfsr+2Qacbr1hETzFFBNpNxIPOxRirvrvBdb35/sTldrtXtH08uT9jkBMv1Z9SHqZ iL9MbU5EibZWHIGqXimx7EbYAuwtB1eUA5cwaThpA+rVDY4TghHNzQTEkRi66BHeHFJxaUDyZsVvV n36kgX619jRWzYP5m/kQW7taVkOQRjzLjls6O7wAH+eoRqy2uK6WWVJLpvINjSsOZhEDGkLgzh7MG oDeCdQKq+DwZBT7684fbtwuDnsUc5FsYL6nkXt4pydAW/K4Mub9PMrisLlX79SV2uIB+GHH47LQk6 A7VRF2BQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oeF40-009887-Sm; Fri, 30 Sep 2022 12:24:20 +0000 Received: from metis.ext.pengutronix.de ([2001:67c:670:201:290:27ff:fe1d:cc33]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1oeF3w-00986e-9x for barebox@lists.infradead.org; Fri, 30 Sep 2022 12:24:17 +0000 Received: from ptx.hi.pengutronix.de ([2001:67c:670:100:1d::c0]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oeF3v-0004cT-1B; Fri, 30 Sep 2022 14:24:15 +0200 Received: from sha by ptx.hi.pengutronix.de with local (Exim 4.92) (envelope-from ) id 1oeF3u-0001ZP-QY; Fri, 30 Sep 2022 14:24:14 +0200 Date: Fri, 30 Sep 2022 14:24:14 +0200 To: Ahmad Fatoum Cc: barebox@lists.infradead.org Message-ID: <20220930122414.GZ986@pengutronix.de> References: <20220930111940.1323140-1-a.fatoum@pengutronix.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220930111940.1323140-1-a.fatoum@pengutronix.de> X-Sent-From: Pengutronix Hildesheim X-URL: http://www.pengutronix.de/ X-Accept-Language: de,en X-Accept-Content-Type: text/plain User-Agent: Mutt/1.10.1 (2018-07-13) From: Sascha Hauer X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220930_052416_363662_CCD53AB1 X-CRM114-Status: GOOD ( 24.42 ) X-BeenThere: barebox@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "barebox" X-SA-Exim-Connect-IP: 2607:7c80:54:3::133 X-SA-Exim-Mail-From: barebox-bounces+lore=pengutronix.de@lists.infradead.org X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on metis.ext.pengutronix.de X-Spam-Level: X-Spam-Status: No, score=-4.7 required=4.0 tests=AWL,BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED,SPF_HELO_NONE,SPF_NONE autolearn=unavailable autolearn_force=no version=3.4.2 Subject: Re: [PATCH master] mci: bcm2835: reset host controller on barebox shutdown X-SA-Exim-Version: 4.2.1 (built Wed, 08 May 2019 21:11:16 +0000) X-SA-Exim-Scanned: Yes (on metis.ext.pengutronix.de) On Fri, Sep 30, 2022 at 01:19:40PM +0200, Ahmad Fatoum wrote: > We don't usually disable MMC controllers on barebox shutdown, because > they don't DMA on their own, unlike e.g. network controllers. > > Booting Linux v5.17.0 on a Raspberry Pi 4 in 32-bit mode still has the > MMC host controller driver complain: > > [ 22.464887] mmc1: Got data interrupt 0x00000002 even though no > data operation was in progress. > > Fix this by resetting the SDHCI once barebox is done with it. > > Signed-off-by: Ahmad Fatoum > --- > drivers/mci/mci-bcm2835.c | 12 ++++++++++++ > 1 file changed, 12 insertions(+) Applied, thanks Sascha > > diff --git a/drivers/mci/mci-bcm2835.c b/drivers/mci/mci-bcm2835.c > index f092156f9a83..c5b226ba033c 100644 > --- a/drivers/mci/mci-bcm2835.c > +++ b/drivers/mci/mci-bcm2835.c > @@ -385,6 +385,8 @@ static int bcm2835_mci_probe(struct device_d *hw_dev) > host->sdhci.read32 = bcm2835_sdhci_read32; > host->sdhci.write32 = bcm2835_sdhci_write32; > > + hw_dev->priv = host; > + > mci_of_parse(&host->mci); > > iores = dev_request_mem_resource(hw_dev, 0); > @@ -420,6 +422,15 @@ static int bcm2835_mci_probe(struct device_d *hw_dev) > return mci_register(&host->mci); > } > > +static void bcm2835_mci_remove(struct device_d *dev) > +{ > + struct bcm2835_mci_host *host = dev->priv; > + > + sdhci_write32(&host->sdhci, > + SDHCI_CLOCK_CONTROL__TIMEOUT_CONTROL__SOFTWARE_RESET, > + 0x00); > +} > + > static __maybe_unused struct of_device_id bcm2835_mci_compatible[] = { > { > .compatible = "brcm,bcm2835-sdhci", > @@ -433,6 +444,7 @@ static __maybe_unused struct of_device_id bcm2835_mci_compatible[] = { > static struct driver_d bcm2835_mci_driver = { > .name = "bcm2835_mci", > .probe = bcm2835_mci_probe, > + .remove = bcm2835_mci_remove, > .of_compatible = DRV_OF_COMPAT(bcm2835_mci_compatible), > }; > > -- > 2.30.2 > > > -- Pengutronix e.K. | | Steuerwalder Str. 21 | http://www.pengutronix.de/ | 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 | Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |