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 D11C9C433F5 for ; Wed, 12 Jan 2022 09:22:16 +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=Rq2xxEeIwgn4uw7eu/Kb0XwhduElfE8EzMuQDyaT7Dc=; b=fmcf2y9kddEsX1O7vjsfMbrypC Y7940EC419xhc93fng2i4cZeGN3bQLOf19oERtTEfEgGsQtuFMLuyn4q4CQDxjD0k5tjpkn/4lGqW rB4h0Dj5+KLoisFnXGhjDHs+h7Cz/SW4Xhk7kJPzDwdkBxfzf1d/MTzXkWgQts3NHlGJXXX+ZkOc3 S3d+QuQKBQ47YUtGkdoWAW5oFpyBZtyPXT/hSrcU0OtmmmOTdUlqI2t497wUQIK2R3C692LphKcvN D4n1z9TLbVdg1e1PlCEjwkXGRFSaPUw1O31tfB16mn1KSXGGhiCIDqFWRvxXyo+D+BVBTfqJtUvkz xP6mzNeQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1n7ZoZ-001kYp-8p; Wed, 12 Jan 2022 09:21:07 +0000 Received: from out4-smtp.messagingengine.com ([66.111.4.28]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1n7ZoP-001kV7-SU for linux-arm-kernel@lists.infradead.org; Wed, 12 Jan 2022 09:20:59 +0000 Received: from compute2.internal (compute2.nyi.internal [10.202.2.46]) by mailout.nyi.internal (Postfix) with ESMTP id 2BCC15C0079; Wed, 12 Jan 2022 04:20:57 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute2.internal (MEProxy); Wed, 12 Jan 2022 04:20:57 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cerno.tech; h= date:from:to:cc:subject:message-id:references:mime-version :content-type:in-reply-to; s=fm1; bh=V+GbNSPBdICaZKehO+PC4kEUsaB EXQDl4qLU+2VgtCk=; b=B+onJ4TC5FsYfNdGlXGkmB7EI/LR4jr+5mMGyKN+SNg lztvN0zNHoVIq5q2cZoDS6tBGBQJKQ+Bs4fZvcSytUTiO3p4BLYPmEgSkM/wDSyY 8Mx1KoWsCRzwjBMyN3uNhjJptxc2oAzp7Nkw747Ojz6rgo8Fgv7r/lZbuJ+7ADvy aZuFEaqIlAAuzDUWlZr/c1jkfymyOkYjCg8Uu3ViQMf1WlqT6Hi7uADfedcXwsEY 9txzMYNzigtUwY13wNQvT7Fw2/T8QJLV+4ZCYeSlB5dWTlAD/oA+knhidpdALEqJ Hg0WCUlnGyv/dJH7c+x+BYk75YUwIF+wA+oCSvGgICQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm1; bh=V+GbNS PBdICaZKehO+PC4kEUsaBEXQDl4qLU+2VgtCk=; b=Vn8EuFshYYWqDRfu8bbAVb 4P8KYMLNyFv+CQ0zJ24q1f5Xgr315b2l1S/MAGyijhM9B7CP1PEoPG80Fpy0yPLq KsuCs9XLKmSjbRgRGgPFMPLTGrBITTitAOLDgmnYSmQC8HoROlV0Oq6IT0T+Az2c bR/t7eEH2wfvSeffjXX4IBeVuV3Gnug60Fq4pQy9C/o3h83Tcwq5IC9vR5AhYVrP bn/hYYuWXDhrinZv+ODmYCvoKsoEDXtyZAYcuIWPKsBhwQgrSYE2j95HZFWRJnhA 1Wyldluxag40wPsizr3t2EyKLkfpHnv08lrSVH3ZRQ9VEksyZ/QsmkGmmb7n4fWQ == X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvuddrudehhedgtdduucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepfffhvffukfhfgggtuggjsehgtderredttddvnecuhfhrohhmpeforgigihhm vgcutfhiphgrrhguuceomhgrgihimhgvsegtvghrnhhordhtvggthheqnecuggftrfgrth htvghrnhepleekgeehhfdutdeljefgleejffehfffgieejhffgueefhfdtveetgeehieeh gedunecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepmh grgihimhgvsegtvghrnhhordhtvggthh X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA; Wed, 12 Jan 2022 04:20:55 -0500 (EST) Date: Wed, 12 Jan 2022 10:20:54 +0100 From: Maxime Ripard To: Michael Wu Cc: ulf.hansson@linaro.org, wens@csie.org, samuel@sholland.org, andre.przywara@arm.com, jernej.skrabec@gmail.com, linux-mmc@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-sunxi@lists.linux.dev, linux-kernel@vger.kernel.org Subject: Re: [PATCH 2/3] mmc:sunxi-mmc:fix clock division for timing mode Message-ID: <20220112092054.4agh3lydvibea5wh@houat> References: <20211222031521.34170-1-michael@allwinnertech.com> MIME-Version: 1.0 In-Reply-To: <20211222031521.34170-1-michael@allwinnertech.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220112_012058_022836_2ACC812A X-CRM114-Status: GOOD ( 23.11 ) 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="===============7234805840106955463==" Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org --===============7234805840106955463== Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="fymmmzrzovlh7ofo" Content-Disposition: inline --fymmmzrzovlh7ofo Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hi Michael, Thanks for your patch On Wed, Dec 22, 2021 at 11:15:21AM +0800, Michael Wu wrote: > When use new timings,all speed mode requires a doubled module clock > if speed mode is ddr,requires a four times module clock > When use old timings,only 8 bit ddr requires a doubled module clock >=20 > Signed-off-by: Michael Wu > --- > drivers/mmc/host/sunxi-mmc.c | 27 +++++++++++++++------------ > 1 file changed, 15 insertions(+), 12 deletions(-) >=20 > diff --git a/drivers/mmc/host/sunxi-mmc.c b/drivers/mmc/host/sunxi-mmc.c > index afeefead6501..7b47ec453fb6 100644 > --- a/drivers/mmc/host/sunxi-mmc.c > +++ b/drivers/mmc/host/sunxi-mmc.c > @@ -774,20 +774,23 @@ static int sunxi_mmc_clk_set_rate(struct sunxi_mmc_= host *host, > if (!ios->clock) > return 0; > =20 > - /* > - * Under the old timing mode, 8 bit DDR requires the module > - * clock to be double the card clock. Under the new timing > - * mode, all DDR modes require a doubled module clock. > - * > - * We currently only support the standard MMC DDR52 mode. > - * This block should be updated once support for other DDR > - * modes is added. > + /** > + * When use new timings, all speed mode requires a doubled module clock. > + * if speed mode is ddr, requires a four times module clock. > + * When use old timings, only 8 bit ddr requires a doubled module clock. > */ I found the original comment to be clearer, maybe we can change it to something like: /* * Under the old timing mode, 8 bit DDR requires the module * clock to be double the card clock. Under the new timing * mode, all modes require a doubled module clock, and DDR modes * require a quadrupled module clock. * * ... > - if (ios->timing =3D=3D MMC_TIMING_MMC_DDR52 && > - (host->use_new_timings || > - ios->bus_width =3D=3D MMC_BUS_WIDTH_8)) { > - div =3D 2; > + if (host->use_new_timings) { > clock <<=3D 1; > + if (ios->timing =3D=3D MMC_TIMING_MMC_DDR52) { > + div =3D 2; Shouldn't that be 4? > + clock <<=3D 1; > + } > + } else { > + if (ios->timing =3D=3D MMC_TIMING_MMC_DDR52 && > + (ios->bus_width =3D=3D MMC_BUS_WIDTH_8)) { This creates some checkpatch.pl --strict warnings Maxime --fymmmzrzovlh7ofo Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iHUEABYKAB0WIQRcEzekXsqa64kGDp7j7w1vZxhRxQUCYd6ddgAKCRDj7w1vZxhR xaLiAP47v9sW+jH0z6DXKRDumXm1PSSMgqdjfsjbfy1lddD97gD9FGv36UyHu+Do VjNu5T34Utzn7S9mZeT4p/pUA5ic/wY= =F8YC -----END PGP SIGNATURE----- --fymmmzrzovlh7ofo-- --===============7234805840106955463== 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 --===============7234805840106955463==--