Received: by 2002:ac0:a581:0:0:0:0:0 with SMTP id m1-v6csp58290imm; Mon, 2 Jul 2018 07:38:36 -0700 (PDT) X-Google-Smtp-Source: ADUXVKKlzkxzIzbvCB8Rwr/dEUrQfjC5tc2uy+Lm/GK/oR829rNjENFmr1X6+VUM0jFbMhwrb6dB X-Received: by 2002:a17:902:7295:: with SMTP id d21-v6mr25874274pll.221.1530542316568; Mon, 02 Jul 2018 07:38:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1530542316; cv=none; d=google.com; s=arc-20160816; b=LDVM1+p2XolRUXRTNmMHlH3zcNjdl+uDM+ELEVQzrc7tza/Xs54kKjiLqoTyiqKXfv kzCZ/l72drZNkD2pwtHL0D6bEX6QQVAj8hCo6CYE8C8IHgf/hslQDZQf6vD9C3Vu6Tjw +/pwYTk46JvCF7v+B0O+d42rXKQ4FbSj222uKGJ/fI29VzTvsu4oQJt2wbBwh7fZEXE1 AG/b+h9s4ktozPrTDkLO1v96fTG/Qhsqysw0iiFU4zIJUjxx9ZeAef0VnXEwTa6bQU9F P4E7LHoOF7JAHxscowqQfTc+2/FhkhTqGf7MOD1G4hiRNZIKMKLQd5elSn5imcnoPISR g/rw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :references:in-reply-to:mime-version:dkim-signature :arc-authentication-results; bh=UdkZKrJTrVLAYmJJd/4SeiwTVFwKsw8LWOVEDJLB1cw=; b=RIBpgA2OR9SniwnnbfoH4686SO6UT1pMZT2o+SEt/ny/ovmEn0ncIPEPj5OlUCp5j9 zSECZP/0/tcqVJIfJR3XFibs60y/0VGj8rKg8+Zg3OaEwmrBnaWRLTlWaG36UfhB6v4k v6tubPHV9aM8yg+7KPe4PVVDUxYK28PJZOQL3BCVWZhRMd5/6/tPJuzO0CMVBoN7YigD AhYGkU6O+r6WauGW+gAMH+dCe5CBq+DRbq2HqxzgQMynlZrEppNrOwkDqIRefXpFVCA/ ik+GNSswF4rJyG6ONtA0L7Pz9d+c/Iib7c5S/6Rf8mgVFysJzMrtpucAtfZOvzC3qM+s /QhQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=d9TG2mJM; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id t128-v6si4984433pfc.194.2018.07.02.07.38.08; Mon, 02 Jul 2018 07:38:36 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=d9TG2mJM; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752271AbeGBOhC (ORCPT + 99 others); Mon, 2 Jul 2018 10:37:02 -0400 Received: from mail-io0-f194.google.com ([209.85.223.194]:46636 "EHLO mail-io0-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752218AbeGBOhA (ORCPT ); Mon, 2 Jul 2018 10:37:00 -0400 Received: by mail-io0-f194.google.com with SMTP id p7-v6so2546029ioh.13 for ; Mon, 02 Jul 2018 07:37:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=UdkZKrJTrVLAYmJJd/4SeiwTVFwKsw8LWOVEDJLB1cw=; b=d9TG2mJMr85FUe3Ka9dzmVXisnPxjX5HtxPisVcJl2GkUoQrW+ozAPurxeHlJ5ts3a jEicY+kcRaHBMKCwn9pLSGIVvEkW/Nkm00/LuTAwg9V3ERH7XAnn7Mj59oqTuV4X0BDP qh5luNNBHXLWwIP0Zv4W+YeGltlSnks5CmcCU= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=UdkZKrJTrVLAYmJJd/4SeiwTVFwKsw8LWOVEDJLB1cw=; b=btU9JBseo6q3IlBIVeuf1/kXFqr9Xp8Y25G98qpAuB8k8Md1OQ+sR3tVbdePcEI905 GK4G/R5inelNns4VsFm/A7biG/y53xZFofgLo241u3WyK+mUfJvnqhRljQed3MThAuQF e0muhTKuZkoIbK88QvJX1HNHXcjiFXLnzl6i4GF0HcDWtCZWSnmnwitKb5DEsDWwSuzC BqGfh0LOcQjaQNx2g9H159XQHdmN0AkondvZFMaE+VuupMThYnag9NJw2IG4H8GVw2q4 TQPfwM0MGo1MKALR65uwTdJ8jEdmIAcHo925eTrCqSKPHJejIKPiHAnNmkoqaSRdurz6 dzRA== X-Gm-Message-State: APt69E2sgSX6CvK+UoNVfgKUYR9w8l6pxiZHcJPLTVWWQIXwivgouYGB lA/gAmrmj1J4gksgjc55DCVvDuIIbmAe8WE4mOKBkg== X-Received: by 2002:a6b:e403:: with SMTP id u3-v6mr20586737iog.131.1530542220076; Mon, 02 Jul 2018 07:37:00 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a02:818f:0:0:0:0:0 with HTTP; Mon, 2 Jul 2018 07:36:59 -0700 (PDT) In-Reply-To: <20180628081331.13051-3-stefan@agner.ch> References: <20180628081331.13051-1-stefan@agner.ch> <20180628081331.13051-3-stefan@agner.ch> From: Ulf Hansson Date: Mon, 2 Jul 2018 16:36:59 +0200 Message-ID: Subject: Re: [PATCH 2/3] mmc: sdhci: add quirk to prevent higher speed modes To: Stefan Agner Cc: Adrian Hunter , Fabio Estevam , Haibo Chen , Aisheng Dong , Michael Trimarchi , Russell King , "linux-mmc@vger.kernel.org" , Linux Kernel Mailing List Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 28 June 2018 at 10:13, Stefan Agner wrote: > Some hosts are capable of running higher speed modes but do not > have the board support for it. Introduce a quirk which prevents > the stack from using modes running at 100MHz or faster. To cap the freq, use the DT property "max-frequency". To enable certain speed modes, use the corresponding speed mode binding. For example "sd-uhs-sdr*" and "mmc-hs200*". Documented in Documentation/devicetree/bindings/mmc/mmc.txt In case the sdhci cap register, doesn't reflect the board support properly, such that you may want to disable some speed modes, then you may benefit from using the DT properties "sdhci-caps*. Documented in Documentation/devicetree/bindings/mmc/sdhci.txt Kind regards Uffe > > Signed-off-by: Stefan Agner > --- > drivers/mmc/host/sdhci.c | 8 ++++++++ > drivers/mmc/host/sdhci.h | 2 ++ > 2 files changed, 10 insertions(+) > > diff --git a/drivers/mmc/host/sdhci.c b/drivers/mmc/host/sdhci.c > index 1c828e0e9905..8ac257dfaab3 100644 > --- a/drivers/mmc/host/sdhci.c > +++ b/drivers/mmc/host/sdhci.c > @@ -3749,6 +3749,14 @@ int sdhci_setup_host(struct sdhci_host *host) > } > } > > + if (host->quirks2 & SDHCI_QUIRK2_NO_UHS_HS200_HS400) { > + host->caps1 &= ~(SDHCI_SUPPORT_SDR104 | SDHCI_SUPPORT_SDR50 | > + SDHCI_SUPPORT_DDR50); > + > + mmc->caps2 &= ~(MMC_CAP2_HSX00_1_8V | MMC_CAP2_HSX00_1_2V | > + MMC_CAP2_HS400_ES); > + } > + > if (host->quirks2 & SDHCI_QUIRK2_NO_1_8_V) { > host->caps1 &= ~(SDHCI_SUPPORT_SDR104 | SDHCI_SUPPORT_SDR50 | > SDHCI_SUPPORT_DDR50); > diff --git a/drivers/mmc/host/sdhci.h b/drivers/mmc/host/sdhci.h > index 23966f887da6..cb2433d6d61f 100644 > --- a/drivers/mmc/host/sdhci.h > +++ b/drivers/mmc/host/sdhci.h > @@ -450,6 +450,8 @@ struct sdhci_host { > * obtainable timeout. > */ > #define SDHCI_QUIRK2_DISABLE_HW_TIMEOUT (1<<17) > +/* Do not support any higher speeds (>50MHz) */ > +#define SDHCI_QUIRK2_NO_UHS_HS200_HS400 (1<<18) > > int irq; /* Device IRQ */ > void __iomem *ioaddr; /* Mapped address */ > -- > 2.18.0 >