Received: by 2002:a05:6358:1087:b0:cb:c9d3:cd90 with SMTP id j7csp1907967rwi; Tue, 11 Oct 2022 02:01:00 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5BohfoGMNbIrT5g4zHsl4vQzfiEnLAucIQ8qo+ZWQfOARCqjz3g0GL8zsEXeJ86xCRKm7K X-Received: by 2002:a17:907:7245:b0:78d:1de4:7033 with SMTP id ds5-20020a170907724500b0078d1de47033mr17743535ejc.114.1665478860239; Tue, 11 Oct 2022 02:01:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1665478860; cv=none; d=google.com; s=arc-20160816; b=utBrSuvDvbXSgpJm6BYYj9fkAc42fvDYxgoFlPZ+qbvQRfjpi4njq35n9+x3OLYe1F Td3DguKunsphfuqlQvo/KVcyLW5ELZOUYgdb8YfEQzTD41eGiOYnEf46H3AM8oWX9r1q xDYoHO2x+KvVLtF80f/lxEgYZPrlsTE7O9ik96RMYu8etmO7Fb17uDmHJfS0BFNezRYK zH3rYQ1DGYQVXbJHipuNK1zy6BgSNrF2JGuWfME8al1lr8WmI2h+Nba4NVsXCIR75W4j nx3BnI7JJBOVDvG42yv1Ds+vcRR4C/KSyBviOEJvvsQDP0pUeQ+HszIZkriE+YAmv4Me 81xQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=stD9RetreA6pMH+h5I7/aCirn6VqDL5duR4zBb4PDuU=; b=ugAKwG5j9Bm4tbhcpqfjqHdgmFFz9wFAo2zDirySB9hNd9ddjb3+3danpiiXyhTPBO x0JMLSGNsWN1MHMWztrZ9kWULqLssnes8oU89Dyuj/NrAylqtBcd8HfCkl+QWAzKcsnX 4KYXa5+OwN94E09dZqP/vR724hWmr4UY1+CEta2OHOeL+S+cH17uNR5BFsYwVEdgWUh3 LmVmgMBIKpXBP0sB1mVzo0XPB6eLWi9aOqlY6k6dWLVlswBTgt9GBq8szTEFmm4U7Neu t5/z5F8D+rK/VFAdiRtJTznBqwzqDnggD3qaCM3k6N/u9U9qeb+nlx8avGcFY33LPoAE CfPA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=gLxZrUts; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id r17-20020a056402035100b0044ea553d7cdsi11363269edw.105.2022.10.11.02.00.34; Tue, 11 Oct 2022 02:01:00 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=gLxZrUts; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229799AbiJKIkf (ORCPT + 99 others); Tue, 11 Oct 2022 04:40:35 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36202 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229607AbiJKIkc (ORCPT ); Tue, 11 Oct 2022 04:40:32 -0400 Received: from mail-pl1-x62d.google.com (mail-pl1-x62d.google.com [IPv6:2607:f8b0:4864:20::62d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4813A4C629; Tue, 11 Oct 2022 01:40:30 -0700 (PDT) Received: by mail-pl1-x62d.google.com with SMTP id f23so12583688plr.6; Tue, 11 Oct 2022 01:40:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=stD9RetreA6pMH+h5I7/aCirn6VqDL5duR4zBb4PDuU=; b=gLxZrUtsS/AJ3LkHGuuw1XWpmk1r9cM0/Z6lImO3WPV+dSTjEgH/dCAK7kVffOhB8n L+J1l2CQX908ATwS9pHCVRBddQI1QKvZiHsf5g7mlDPc9U0GSCZTA5X/viGg5Xak/TKv Bmp009OneeNAwj1bec6kFL/1d0vV1CZgDPwYLvZb6bmyJNi7B4fYAWRlWjDvyqqzY/Rb ToPQDoLf3pogzIKHZk64131CibRGIQLKUchypMSU0rNXZa9nZvVYbRLPTU6AaKBUa0ge reCQbayKWa/YNC9t4q2M06L/k8Ra4DB/7zfwV/qTenhd8vTfynMzMX4178o6bRgb6WKY SPtg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=stD9RetreA6pMH+h5I7/aCirn6VqDL5duR4zBb4PDuU=; b=vmQxCqEv+AZyok0WjL02HCNk+aOawD9xgWRAcvnMyI6tcdzkmuZoDO1g+fvhygQvUS 6Oa1dM46eoC6E5hjLR3AA9SKZzTEpMo7f+SXBRpVO/0Phn5ESWLP/Jaf+vpAd5JibG+6 6h3vip5MjznTR0/tkwzMNNUkzF6YP/vrwp5gJiBPbA/8k/bMVOIUl22wajn+zTZZzrcG p4+btXQ/BDQj7KDNIdJhN3Go3zGmr6GFinDo9zm0kD4hqpnNYVrNQCrGf/UECt4GgeCt q+/kYkd2jrReSxVCNz0cU9e/Rv9bq8cPuvv2VFrXjQLIRfzfYrUgpzWb68PkvSJltX+4 6kPw== X-Gm-Message-State: ACrzQf2QjQEVcBCmKGyZJuFUi9Cs9ydc0DI1MfoYN9yAqqF+Kl5ZukFo WjdnwE4R7UDITPCo+sjIqjaqXdZcJ3e4Kf6NYvo= X-Received: by 2002:a17:902:9a49:b0:17a:6662:9334 with SMTP id x9-20020a1709029a4900b0017a66629334mr22529280plv.63.1665477630463; Tue, 11 Oct 2022 01:40:30 -0700 (PDT) MIME-Version: 1.0 References: <20221011063043.11074-1-wenchao.chen666@gmail.com> In-Reply-To: From: Wenchao Chen Date: Tue, 11 Oct 2022 16:40:19 +0800 Message-ID: Subject: Re: [PATCH] mmc: sdhci-sprd: Fix minimum clock limit To: Adrian Hunter Cc: ulf.hansson@linaro.org, orsonzhai@gmail.com, baolin.wang@linux.alibaba.com, zhang.lyra@gmail.com, linux-mmc@vger.kernel.org, linux-kernel@vger.kernel.org, megoo.tang@gmail.com, lzx.stg@gmail.com Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-1.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_ENVFROM_END_DIGIT, FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Oct 11, 2022 at 2:45 PM Adrian Hunter wrote: > > On 11/10/22 09:30, Wenchao Chen wrote: > > From: Wenchao Chen > > > > The minimum clock supported by SPRD Host is 100000. > > Commit messages are better if they say why a change > is being made. > > This begs the question, was there a problem with 400 kHz? > Are there cases that benefit from this change? > Should it have a fixes tag,cc stable? > Code show as below: static struct sdhci_ops sdhci_sprd_ops = { ... .get_min_clock = sdhci_sprd_get_min_clock, ... }; int sdhci_setup_host(struct sdhci_host *host) { ... if (host->ops->get_min_clock) mmc->f_min = host->ops->get_min_clock(host); ... } static const unsigned freqs[] = { 400000, 300000, 200000, 100000 }; void mmc_rescan(struct work_struct *work) { ... for (i = 0; i < ARRAY_SIZE(freqs); i++) { unsigned int freq = freqs[i]; if (freq > host->f_max) { if (i + 1 < ARRAY_SIZE(freqs)) continue; freq = host->f_max; } if (!mmc_rescan_try_freq(host, max(freq, host->f_min))) break; if (freqs[i] <= host->f_min) // If you start at 100K, you will try 400K, 300K, 200K, 100K. break; } ... } Our controller supports 100K. During the test, it was found that mmc_rescan failed to scan the card at 400K, and did not try 300K, 200K, and 100K. After modifying the minimum clock limit to 100K, the card scan was successful. > > > > Signed-off-by: Wenchao Chen > > --- > > drivers/mmc/host/sdhci-sprd.c | 2 +- > > 1 file changed, 1 insertion(+), 1 deletion(-) > > > > diff --git a/drivers/mmc/host/sdhci-sprd.c b/drivers/mmc/host/sdhci-sprd.c > > index 46c55ab4884c..b92a408f138d 100644 > > --- a/drivers/mmc/host/sdhci-sprd.c > > +++ b/drivers/mmc/host/sdhci-sprd.c > > @@ -309,7 +309,7 @@ static unsigned int sdhci_sprd_get_max_clock(struct sdhci_host *host) > > > > static unsigned int sdhci_sprd_get_min_clock(struct sdhci_host *host) > > { > > - return 400000; > > + return 100000; > > } > > > > static void sdhci_sprd_set_uhs_signaling(struct sdhci_host *host, >