From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 1AE61C433EF for ; Fri, 6 May 2022 09:19:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:Content-Type: List-Subscribe:List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id: In-Reply-To:MIME-Version:References:Message-ID:Subject:Cc:To:From: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=iUGvGKph37GuKPsn0uKPGfDsXLgVl3szIOxJxIEhKPI=; b=Zd+DuNGV6jBtRfOOX44fTLi7cb kzPaHkgWvrBydz66uQIzEYkPWNy7pYzwe9NEOpcy85CbA4T3SBGWOxK7ZHMJC6590aPZGCZgxshnu h0p96BbzNbaAMUiSYDbw9xJIlbXN7buMfH5CmG+zysGlKB1WNlGUAifcqCAHilyjaxSFUgUgiCaf4 PmKyN7MuVPbYMWb7fmgpmo+esTA1Ximoj0voQJqhhFa/9q1N+Gz6/cJ7fqZn9XMgdmqpforfano3v hyAbMw0CIiuSVNDsCxJzieQEktgh5zeP+iaoSPNQ2AMfvSJLjllvm8NwhXbztS47eu5294IJDnbkb JLm6pZtg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nmu6o-002IQ0-Mv; Fri, 06 May 2022 09:18:46 +0000 Received: from bhuna.collabora.co.uk ([46.235.227.227]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1nmu6k-002INb-TM; Fri, 06 May 2022 09:18:44 +0000 Received: from [127.0.0.1] (localhost [127.0.0.1]) (Authenticated sender: sre) with ESMTPSA id 8DAA31F4608C DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1651828719; bh=LagxlbknCNKZ/XfP0so1ZIDtnMrlAsXXeHWaGvHTB4Q=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=cM39Y7h+YdmaL5+yQdLEp+AHGdUEQriZx4EHdV2GwT//rXc7oQCQL3lcs+g8cdL39 hK882V/9z4a67vzdMiSeYx9uDsMCiTQgG409tJAEhWWFMJw9NhB3noO08myQXsJtsy BsYPT5MNWPG0R7vjPwUDn/cPhZiytcZw39GZaoZkJsaY7RjKXjvHNh39B2G1ThifMv Kw8Ud/gBiaJnCjHR4v0TOurkPw8ICP6lAIoGV8iA3esDMgEdUslAcabn1vupUfC7ow TQzEjuF7haew1hme03M4bAqfbqajucOj6mCPqWMkCsz5E/PJKS6nhRybyDKxwe9omI H64n/RkSM7ELA== Received: by mercury (Postfix, from userid 1000) id 0DAAE1060437; Fri, 6 May 2022 11:18:37 +0200 (CEST) Date: Fri, 6 May 2022 11:18:37 +0200 From: Sebastian Reichel To: Ulf Hansson , Krzysztof Kozlowski , Rob Herring Cc: Heiko Stuebner , Linus Walleij , Bartosz Golaszewski , Adrian Hunter , Philipp Zabel , Michael Turquette , Stephen Boyd , linux-clk@vger.kernel.org, linux-mmc@vger.kernel.org, linux-gpio@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-rockchip@lists.infradead.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Yifeng Zhao , kernel@collabora.com Subject: Re: [PATCHv2 09/21] mmc: sdhci-of-dwcmshc: add reset call back for rockchip Socs Message-ID: <20220506091837.bbwupigb4f3hwgp4@mercury.elektranox.org> References: <20220504213251.264819-1-sebastian.reichel@collabora.com> <20220504213251.264819-10-sebastian.reichel@collabora.com> MIME-Version: 1.0 In-Reply-To: X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220506_021843_255645_1AD5300C X-CRM114-Status: GOOD ( 29.93 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: multipart/mixed; boundary="===============3650478882359637158==" Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org --===============3650478882359637158== Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="xt2hfq4oogyrqves" Content-Disposition: inline --xt2hfq4oogyrqves Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hi, On Fri, May 06, 2022 at 10:52:42AM +0200, Ulf Hansson wrote: > On Wed, 4 May 2022 at 23:33, Sebastian Reichel > wrote: > > > > From: Yifeng Zhao > > > > The reset function build in the SDHCI will not reset the logic > > circuit related to the tuning function, which may cause data > > reading errors. Resetting the complete SDHCI controller through > > the reset controller fixes the issue. > > > > Signed-off-by: Yifeng Zhao > > [rebase, use optional variant of reset getter] > > Acked-by: Adrian Hunter > > Signed-off-by: Sebastian Reichel >=20 > I think this needs a corresponding update of the DT docs. Otherwise > this looks good to me. I do have 'resets' and 'reset-names' properties in the rk3588s.dtsi for the sdhci interface and 'make dtbs_check' did not complain about anything but missing 'arm,sdei-1.0' compatible for the rk3588 EVB (sdei binding has not yet been converted to yaml). Thus I assume the resets property is inferred from somewhere? -- Sebastian >=20 > Kind regards > Uffe >=20 > > --- > > drivers/mmc/host/sdhci-of-dwcmshc.c | 26 +++++++++++++++++++++++++- > > 1 file changed, 25 insertions(+), 1 deletion(-) > > > > diff --git a/drivers/mmc/host/sdhci-of-dwcmshc.c b/drivers/mmc/host/sdh= ci-of-dwcmshc.c > > index bac874ab0b33..3a1b5ba36405 100644 > > --- a/drivers/mmc/host/sdhci-of-dwcmshc.c > > +++ b/drivers/mmc/host/sdhci-of-dwcmshc.c > > @@ -15,6 +15,7 @@ > > #include > > #include > > #include > > +#include > > #include > > > > #include "sdhci-pltfm.h" > > @@ -63,6 +64,7 @@ > > struct rk3568_priv { > > /* Rockchip specified optional clocks */ > > struct clk_bulk_data rockchip_clks[RK3568_MAX_CLKS]; > > + struct reset_control *reset; > > u8 txclk_tapnum; > > }; > > > > @@ -255,6 +257,21 @@ static void dwcmshc_rk3568_set_clock(struct sdhci_= host *host, unsigned int clock > > sdhci_writel(host, extra, DWCMSHC_EMMC_DLL_STRBIN); > > } > > > > +static void rk35xx_sdhci_reset(struct sdhci_host *host, u8 mask) > > +{ > > + struct sdhci_pltfm_host *pltfm_host =3D sdhci_priv(host); > > + struct dwcmshc_priv *dwc_priv =3D sdhci_pltfm_priv(pltfm_host); > > + struct rk35xx_priv *priv =3D dwc_priv->priv; > > + > > + if (mask & SDHCI_RESET_ALL && priv->reset) { > > + reset_control_assert(priv->reset); > > + udelay(1); > > + reset_control_deassert(priv->reset); > > + } > > + > > + sdhci_reset(host, mask); > > +} > > + > > static const struct sdhci_ops sdhci_dwcmshc_ops =3D { > > .set_clock =3D sdhci_set_clock, > > .set_bus_width =3D sdhci_set_bus_width, > > @@ -269,7 +286,7 @@ static const struct sdhci_ops sdhci_dwcmshc_rk3568_= ops =3D { > > .set_bus_width =3D sdhci_set_bus_width, > > .set_uhs_signaling =3D dwcmshc_set_uhs_signaling, > > .get_max_clock =3D sdhci_pltfm_clk_get_max_clock, > > - .reset =3D sdhci_reset, > > + .reset =3D rk35xx_sdhci_reset, > > .adma_write_desc =3D dwcmshc_adma_write_desc, > > }; > > > > @@ -292,6 +309,13 @@ static int dwcmshc_rk3568_init(struct sdhci_host *= host, struct dwcmshc_priv *dwc > > int err; > > struct rk3568_priv *priv =3D dwc_priv->priv; > > > > + priv->reset =3D devm_reset_control_array_get_optional_exclusive= (mmc_dev(host->mmc)); > > + if (IS_ERR(priv->reset)) { > > + err =3D PTR_ERR(priv->reset); > > + dev_err(mmc_dev(host->mmc), "failed to get reset contro= l %d\n", err); > > + return err; > > + } > > + > > priv->rockchip_clks[0].id =3D "axi"; > > priv->rockchip_clks[1].id =3D "block"; > > priv->rockchip_clks[2].id =3D "timer"; > > -- > > 2.35.1 > > --xt2hfq4oogyrqves Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEE72YNB0Y/i3JqeVQT2O7X88g7+poFAmJ059oACgkQ2O7X88g7 +pp5Cw/9G072+IU/K2eJWP6MsQoWNwQMA5mqxId7SEACncdb+5ywvkilvq4UOtHM s2MHQxKpMxWKQFQEYFXh48Dn6OeVElkrO7kIGRSR0M8KuXXKQ4eQm0Q5a0jbryFl YqwRShmGpd4urXNhsCRjRjL/u/jTvhYKIzz2AiwFKgiHTZFB6fifmy67KIzAe8lx F8v57BW994hmYpABPnybuvMk1VGOJqw9xXrC/mTiGd1HyDBjot1KrIVvWpT9Q3ZL nwTP3EzJGIsrCQi9/YOuPCifjxJI2CppJZhy5Hd3aG8H9cZog9yEUalsd7x2sVih /eeVopGR+fhM/qwVV4Swya7QL/4/0ZjXCGP5HApLqzewQc6UGkAHkcZTfJ+78Yfc upAIXzL4CSJItDkZ2IT1O4hgwEW+933ol4z7gOA3yhvGQ7drLtnrXt65qTrw5k5P xt1ouOL76Ru8D9Xm8fMBzcHXOz+9xwLgtDnHHBzIr535biqqhTtRlu6CTbDxEGEn UZxNxg2punmcQ82ODHw0cvmGmiCkqPPUYEFxS/5a1P4hyUZE6PSXve+V6Hp21mNL jC1TXbbjVeroh11HGuz9yqC/wMvV5U3+951r79DODpIS6rXMIFzVFtTHyHs1kUSw WtfO28lxaTfaq7jwpyAvxAs1mIJl7POoaXODSCna+T3lf21nDaM= =UBWn -----END PGP SIGNATURE----- --xt2hfq4oogyrqves-- --===============3650478882359637158== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel --===============3650478882359637158==--