Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp2882174pxj; Sun, 6 Jun 2021 18:01:41 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyi74oOyjwSfKxl9RFtpgqu11MYWLtQAkay8GpEhrtD8yS0D8AlwycnxrGswdcNm4zcfKqM X-Received: by 2002:a05:6402:170e:: with SMTP id y14mr17807980edu.367.1623027701325; Sun, 06 Jun 2021 18:01:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1623027701; cv=none; d=google.com; s=arc-20160816; b=VNbsdWTPENGjQm5L5tjdntsA6VzMcVMsKrp+kLicnJXBe6ouP4wJp/OvOcshUnRbCl 6XnbQX6sZC8PVKE6DrtyFcGsIF/0qWHnBGoNQeaKpsVBbOAzZZlzxyKCuf6miZYJmimK RpJBXXkn9YJUYRdmJiR73e08mz8vl5dNO7yvvwSDM2sJ48SB6qdfNGoqz+iEtEtDWRha uE2mSNb7nftxWly9clqjJq2nzzDMl6iWERrnWCU63IVUjAPBW+7YQXzri+frUj78NxWr wkghnF7rZ5Sq6rqPjE3PHAs/wKB+FTIfTV8v6weHsAj/20OgbEcDoFEtcyGsFfhPH6U7 RKNQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:subject:cc:to:from:date:references:in-reply-to :message-id:mime-version:user-agent:dkim-signature:dkim-signature; bh=T0W141wRe6b71/Xg2Xn4ohInHEOkVFt9X3xu0i/suIE=; b=OoQo8s7c4K2SpYh80a73JEuV/kPqeLcj+nKTxnYqakc1tmBRlPfZRr29g0pf+NyBod 0jVErow0n2+qg28QfPl2JkvEXcUD5Fi0V8d0AVzQTMKcGgCBNQ7YesvfKPvkxaL3JlFs nz83rrWTV+aMK2rHYU+/Uqa12Ep1ZDxW2qKl3P7kRWyo4fKQqEvxUztZVrwk5e7Vw8sI MBG8ASHz0gAxFldRqJcoJFA4L2twNXV9U275xkMyYhtMRD8GfhDZDRZq2p9YF5sFvRPc t9thy4RzkoC3iFGbFIeIUIbWAQYYQ975J6fBltEAUrTIKF9LaO7zLw4V/cQKGe8+9+YB 3BFA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@aj.id.au header.s=fm3 header.b=RWt2oykH; dkim=pass header.i=@messagingengine.com header.s=fm3 header.b=URHRROFe; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id cz26si11507982edb.106.2021.06.06.18.01.18; Sun, 06 Jun 2021 18:01:41 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@aj.id.au header.s=fm3 header.b=RWt2oykH; dkim=pass header.i=@messagingengine.com header.s=fm3 header.b=URHRROFe; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230093AbhFGBBv (ORCPT + 99 others); Sun, 6 Jun 2021 21:01:51 -0400 Received: from new2-smtp.messagingengine.com ([66.111.4.224]:43905 "EHLO new2-smtp.messagingengine.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229884AbhFGBBu (ORCPT ); Sun, 6 Jun 2021 21:01:50 -0400 Received: from compute2.internal (compute2.nyi.internal [10.202.2.42]) by mailnew.nyi.internal (Postfix) with ESMTP id 0A40458076C; Sun, 6 Jun 2021 20:59:59 -0400 (EDT) Received: from imap43 ([10.202.2.93]) by compute2.internal (MEProxy); Sun, 06 Jun 2021 20:59:59 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=aj.id.au; h= mime-version:message-id:in-reply-to:references:date:from:to:cc :subject:content-type; s=fm3; bh=T0W141wRe6b71/Xg2Xn4ohInHEOkVFt 9X3xu0i/suIE=; b=RWt2oykHHeI3if1e49E8EZdj++lPJnMr5wKlaVb+eFGqQ/a mBXK2X2O/7BdzaD69+RJ/5ler+UMo1A/KRLtotNJ62wKgv/i2aL+EVYM0M6yMknS J+Lo5Zeq09soHYUjf9qD9suI9TR5G2ZwqioLj7LY3c0Q/0ACXfWG/GdKwIQ9NLEv 8qZZD33W04zzwxp+vPj1l+BRZHGxO6cbzrMzE0f8MC7juDlyftxOLAY8HKodr8ZJ dxZ/hKns9JzaFdSdQ25rlj+HgH0Kb1CMx1R2E2JrBw86r0ribe9VVJzk7OfYGt0E ks6myNv2BrnIwIgEXhTbqHg0zt/Hk5JSEYKtX1w== 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=fm3; bh=T0W141 wRe6b71/Xg2Xn4ohInHEOkVFt9X3xu0i/suIE=; b=URHRROFeAnIoBkMxIR8RBV oL61SDRhqVuqW/IWKin4K6GPgp402gOTcCVco5CYYXQaYPWM16PMIucy+bku1PRB c6jHJ/6PSVJ6tFIJaF/tvBeZXnECH1stI5wLcpd+jueTPruqZ1fDGOERGlXIc/ws lKzFtTmdAGrHLLdLS31a6ugXpL8dMU33xO/PzOmusNBBnE82hbn7U39qRe9U6DcE rs/ii4cEp2eSEhPfg0cDL0mZqJpQ/0OU/MZzUk82Cy2qyeuE70bLCeBRLXCgwmdY Ggi4kWfEWwHU0YjWYp07O7e/fcXYRByVMhv/wp2hQePQml5FRiOvwO+u53csHCHQ == X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduledrfedtiedgfeelucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepofgfggfkjghffffhvffutgesthdtredtreerjeenucfhrhhomhepfdetnhgu rhgvficulfgvfhhfvghrhidfuceorghnughrvgifsegrjhdrihgurdgruheqnecuggftrf grthhtvghrnhepkeekteekuddvffeigeetkeegudduffejfffguedvveffvdekheeivdet hefftefhnecuffhomhgrihhnpehlkhhmlhdrohhrghenucevlhhushhtvghrufhiiigvpe dtnecurfgrrhgrmhepmhgrihhlfhhrohhmpegrnhgurhgvfiesrghjrdhiugdrrghu X-ME-Proxy: Received: by mailuser.nyi.internal (Postfix, from userid 501) id 738A2AC0062; Sun, 6 Jun 2021 20:59:57 -0400 (EDT) X-Mailer: MessagingEngine.com Webmail Interface User-Agent: Cyrus-JMAP/3.5.0-alpha0-519-g27a961944e-fm-20210531.001-g27a96194 Mime-Version: 1.0 Message-Id: <987dca0b-1164-42d0-91d9-39e45896a47f@www.fastmail.com> In-Reply-To: References: <20210524073308.9328-1-steven_lee@aspeedtech.com> <20210525094815.GA8757@aspeedtech.com> Date: Mon, 07 Jun 2021 10:29:36 +0930 From: "Andrew Jeffery" To: "Joel Stanley" , "Steven Lee" Cc: "Rob Herring" , "Adrian Hunter" , "Ulf Hansson" , "open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS" , "moderated list:ARM/ASPEED MACHINE SUPPORT" , "moderated list:ARM/ASPEED MACHINE SUPPORT" , "open list" , linux-mmc , "moderated list:ASPEED SD/MMC DRIVER" , "Hongwei Zhang" , "Ryan Chen" , "Chin-Ting Kuo" Subject: =?UTF-8?Q?Re:_[PATCH_v5_0/4]_mmc:_sdhci-of-aspeed:_Support_toggling_SD_b?= =?UTF-8?Q?us_signal?= Content-Type: text/plain Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 26 May 2021, at 08:29, Andrew Jeffery wrote: > > > On Tue, 25 May 2021, at 22:26, Joel Stanley wrote: > > On Tue, 25 May 2021 at 09:48, Steven Lee wrote: > > > > > > The 05/25/2021 15:55, Joel Stanley wrote: > > > > When I was testing on my A2 EVB I saw this: > > > > > > > > [ 1.436219] sdhci-aspeed 1e750100.sdhci: Requested out of range > > > > phase tap 192 for 9 degrees of phase compensation at 1562500Hz, > > > > clamping to tap 15 > > > > [ 1.450913] sdhci-aspeed 1e750100.sdhci: Requested out of range > > > > phase tap 963 for 45 degrees of phase compensation at 1562500Hz, > > > > clamping to tap 15 > > > > > > > > Do you know what is happening there? > > > > > > > > > > Per MMC spec, eMMC bus speed is set as legacy mode(0~26MHz) at startup of > > > eMMC initializtion flow. Clock phase calculation is triggered in set_clock() > > > and it calculates taps based on phase_deg(<9>, <225>) in the dts file and the > > > current speed(1562500Hz), which causes the warning message you mentioned. > > > As the phase_deg in the dts file should be calculated with 100MHz. > > > > > > https://lkml.org/lkml/2021/5/24/95 > > > > > > But after some initialization flow, eMMC bus speed will be set to > > > correct speed(100MHz). > > > Clock phase calculation will be triggered again to get correct taps. > > > > Thanks for the explanation. I added another debug print and I can see > > it doing what you describe: > > > > [ 1.465904] sdhci-aspeed 1e750100.sdhci: Requested out of range > > phase tap 192 for 9 degrees of phase compensation at 1562500Hz, > > clamping to tap 15 > > [ 1.480598] sdhci-aspeed 1e750100.sdhci: rate 1562500 phase 9 tap 15 > > [ 1.490316] sdhci-aspeed 1e750100.sdhci: Requested out of range > > phase tap 963 for 45 degrees of phase compensation at 1562500Hz, > > clamping to tap 15 > > [ 1.505077] sdhci-aspeed 1e750100.sdhci: rate 1562500 phase 45 tap 15 > > [ 1.515059] sdhci-aspeed 1e750100.sdhci: rate 100000000 phase 9 tap 3 > > [ 1.524886] sdhci-aspeed 1e750100.sdhci: rate 100000000 phase 45 tap 15 > > [ 1.534904] sdhci-aspeed 1e750100.sdhci: rate 100000000 phase 9 tap 3 > > [ 1.544713] sdhci-aspeed 1e750100.sdhci: rate 100000000 phase 45 tap 15 > > > > We should change the "out of range" message to be dev_dbg, as it is > > expected on a normal boot. > > I would think the issue is rather that we shouldn't be applying a phase > correction for a bus speed that isn't what the correction was specified > for. > > Let me look at this a bit further. Okay, looks like the issue is that setting the card timing and the bus frequency are not atomic in the sense that the bus clock enable is toggled in between the two, and the MMC core calls through the driver's set_clock() callback when toggling the bus clock state. This means the driver observes a transient state where the card timing is not aligned with the bus frequency, and so we have garbage inputs to the phase correction calculation. Ideally there'd be a better solution than just switching to dev_dbg(), but I'm not sure what it would look like. Andrew