Received: by 2002:a05:7412:37c9:b0:e2:908c:2ebd with SMTP id jz9csp1357339rdb; Wed, 20 Sep 2023 07:07:50 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGl9koOF3CTWJyyYVDP6d6XZQA7clrzaajlC6a95ilLJCFyChy0GaWqNLQDD9VhvFKaWU1o X-Received: by 2002:a05:6e02:884:b0:34f:6d6c:79bd with SMTP id z4-20020a056e02088400b0034f6d6c79bdmr3020205ils.28.1695218869952; Wed, 20 Sep 2023 07:07:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695218869; cv=none; d=google.com; s=arc-20160816; b=geP+MVygWgTSJ8Mt/Kxf0fYVee1RdeL0ZXo6S6DwCzH18PkwOIe4xMA4y+IsOvOzXQ If6UEXIuwFVLZOoU8rv0RgLQRWO8NZxsAQDTiu/QKvpn/owfkEoZKzHjgUo7MG61RyVb xch2xU5FYfW1i4zUWhpjsz1S4I4Cq5BXehFLwoeFEmoPrzguHikXzXC2ATIUw8zQ1V8Z b07frXw4ARab9wrDtL+yGu/LD+IPm0z5OqvJzxAr5uRdssdcUpr+tAqCEhu3iuq4RIPl K+qM2LS3zz9klTeE5ch7Fz59g1CO2JLnE8LZLkTxMxaJIkZ/a2zwiJtCwZoLh3vDLIUe 0LqQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id; bh=IOLkv7nGp2DmuOkkMXf41cJ0Vfp2v2NoR03UU87KHzA=; fh=aEbFUbtD8Dao3Qftj8jLkfnB0B/uLD9O357GaA0Ejtc=; b=MDxqN+7Bt/cvilkfpKX6lkRerouuxI0QChCHFSVt+2PeNIVE3KB9ZbGHUYL1OLyjnf hrfKYr7cmZpX0RUtBe1gd+/p45Js/7h0qwADNQld1bUpGW2o9pS7KqfwlPYytfRdleii qNCMMjPl4OHG14ZWXbSFeJnrnWFjbxPz52/khniBuE29jhOC3+ZAxHWfjxtgDfXGC+zL YMy7kaQPXKAvnMjJX/ygRD+9DWFhqb4gar7PG93i8eopUM7+8EP1GNy63qGdtk8r5al2 iscMKCfIOchvUr0syrTzv7SgsK+wK+wzsQj34XPrNq8w1ubbl10baUtgjPEjHGF0Yhqt H91Q== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from agentk.vger.email (agentk.vger.email. [23.128.96.32]) by mx.google.com with ESMTPS id r20-20020a6560d4000000b0056ae965c533si11674171pgv.16.2023.09.20.07.07.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 20 Sep 2023 07:07:49 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) client-ip=23.128.96.32; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by agentk.vger.email (Postfix) with ESMTP id E3D62825AC3D; Wed, 20 Sep 2023 06:53:01 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235034AbjITNwz (ORCPT + 99 others); Wed, 20 Sep 2023 09:52:55 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47796 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234796AbjITNwy (ORCPT ); Wed, 20 Sep 2023 09:52:54 -0400 Received: from wp530.webpack.hosteurope.de (wp530.webpack.hosteurope.de [80.237.130.52]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2B158AC; Wed, 20 Sep 2023 06:52:48 -0700 (PDT) Received: from [2a02:8108:8980:2478:8cde:aa2c:f324:937e]; authenticated by wp530.webpack.hosteurope.de running ExIM with esmtpsa (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) id 1qixdE-0002e2-SC; Wed, 20 Sep 2023 15:52:44 +0200 Message-ID: Date: Wed, 20 Sep 2023 15:52:44 +0200 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH] mmc: meson-mx-sdhc: Fix initialization frozen issue Content-Language: en-US, de-DE To: Ulf Hansson , Ziyang Huang , martin.blumenstingl@googlemail.com Cc: neil.armstrong@linaro.org, khilman@baylibre.com, jbrunet@baylibre.com, linux-mmc@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-amlogic@lists.infradead.org, linux-kernel@vger.kernel.org, Brian Norris References: From: Thorsten Leemhuis In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-bounce-key: webpack.hosteurope.de;regressions@leemhuis.info;1695217968;03883f8f; X-HE-SMSGID: 1qixdE-0002e2-SC X-Spam-Status: No, score=-0.8 required=5.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on agentk.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (agentk.vger.email [0.0.0.0]); Wed, 20 Sep 2023 06:53:02 -0700 (PDT) On 14.09.23 16:45, Ulf Hansson wrote: > + Thorsten I recently gave up on this, as it seems nobody cared anymore, but let's give this another try. > On Mon, 19 Jun 2023 at 19:36, Ziyang Huang wrote: >> >> Commit 4bc31edebde5 ("mmc: core: Set HS clock speed before sending >> HS CMD13") set HS clock (52MHz) before switching to HS mode. For this >> freq, FCLK_DIV5 will be selected and div value is 10 (reg value is 9). >> Then we set rx_clk_phase to 11 or 15 which is out of range and make >> hardware frozen. After we send command request, no irq will be >> interrupted and the mmc driver will keep to wait for request finished, >> even durning rebooting. >> >> So let's set a common value - 1 just for initialization. Then let >> meson_mx_sdhc_execute_tuning() to find the accurate value for data >> transfer. >> >> Fixes: e4bf1b0970ef ("mmc: host: meson-mx-sdhc: new driver for the Amlogic Meson SDHC host") >> Signed-off-by: Ziyang Huang > > I don't quite understand if this patch is ok for everybody for me to apply? > > It seems like it solves at least some part of the problems that > Martin/Thorsten were looking at too [1], right? Martin, could you help clarifying the situation here? It seems Ziyang Huang is busy. I briefly skimmed this thread again and to me it sounded like there was a plan for an improved patch that hasn't shown up yet. Also CCing Brian Norris who according to the bisection from Martin in that "[1]" caused the regression (or am I missing/confusing something here?). > [1] > https://lore.kernel.org/all/CAFBinCD0RT0p-jk86W0JuMT3ufohRh1RqWCcM35DKZJpuc10HQ@mail.gmail.com/#r Ciao, Thorsten >> --- >> drivers/mmc/host/meson-mx-sdhc-mmc.c | 26 +++----------------------- >> 1 file changed, 3 insertions(+), 23 deletions(-) >> >> diff --git a/drivers/mmc/host/meson-mx-sdhc-mmc.c b/drivers/mmc/host/meson-mx-sdhc-mmc.c >> index da85c2f2..a01090a2 100644 >> --- a/drivers/mmc/host/meson-mx-sdhc-mmc.c >> +++ b/drivers/mmc/host/meson-mx-sdhc-mmc.c >> @@ -269,7 +269,6 @@ static int meson_mx_sdhc_enable_clks(struct mmc_host *mmc) >> static int meson_mx_sdhc_set_clk(struct mmc_host *mmc, struct mmc_ios *ios) >> { >> struct meson_mx_sdhc_host *host = mmc_priv(mmc); >> - u32 rx_clk_phase; >> int ret; >> >> meson_mx_sdhc_disable_clks(mmc); >> @@ -290,31 +289,12 @@ static int meson_mx_sdhc_set_clk(struct mmc_host *mmc, struct mmc_ios *ios) >> mmc->actual_clock = clk_get_rate(host->sd_clk); >> >> /* >> - * according to Amlogic the following latching points are >> - * selected with empirical values, there is no (known) formula >> - * to calculate these. >> + * This value is just for initialization. For data transmission, >> + * meson_mx_sdhc_execute_tuning() will find a accurate value >> */ >> - if (mmc->actual_clock > 100000000) { >> - rx_clk_phase = 1; >> - } else if (mmc->actual_clock > 45000000) { >> - if (ios->signal_voltage == MMC_SIGNAL_VOLTAGE_330) >> - rx_clk_phase = 15; >> - else >> - rx_clk_phase = 11; >> - } else if (mmc->actual_clock >= 25000000) { >> - rx_clk_phase = 15; >> - } else if (mmc->actual_clock > 5000000) { >> - rx_clk_phase = 23; >> - } else if (mmc->actual_clock > 1000000) { >> - rx_clk_phase = 55; >> - } else { >> - rx_clk_phase = 1061; >> - } >> - >> regmap_update_bits(host->regmap, MESON_SDHC_CLK2, >> MESON_SDHC_CLK2_RX_CLK_PHASE, >> - FIELD_PREP(MESON_SDHC_CLK2_RX_CLK_PHASE, >> - rx_clk_phase)); >> + FIELD_PREP(MESON_SDHC_CLK2_RX_CLK_PHASE, 1)); >> } else { >> mmc->actual_clock = 0; >> } >> -- >> 2.34.1 >> >