Received: by 2002:a25:c593:0:0:0:0:0 with SMTP id v141csp2092280ybe; Tue, 3 Sep 2019 07:54:39 -0700 (PDT) X-Google-Smtp-Source: APXvYqw+wobxTRgjgO3cY1XC9Mwi2ELu3kH/6L2wga/FTSTZApmAP1J51MOFOZEHj7CkhYUpcUfb X-Received: by 2002:a17:902:7c88:: with SMTP id y8mr11376711pll.306.1567522478968; Tue, 03 Sep 2019 07:54:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1567522478; cv=none; d=google.com; s=arc-20160816; b=Y61AChJuYEohCERdAKnyE2C+QFJhOW4DsfCaSecsPD4gKAeIqMvr8LzV5ft3/s/Qwr 33NkLNxhpbfwdVtUezPoUjb29z45lfYkyewXJeFx25lV8hyDHzr6+zEnK2vlPvfTFKdZ c443F0owDjzA76VS+z+KJxZ62Lp+0+RbbRAHZgtzdEJroElCk6FsZpKUG3r8L9bqrdCY 7sMN1bzZUDZP0ydmQq4yp+m2LqmliwofEaDAAXhv6Fpn/oxsFmyi5wKi8rYpbqzWmHYM HWFagO4Se98VaMHqVnHqBYTWlALTX3aZpP3/o1h092hkW6SfaAUxW1kabgeSIs7Jt5dZ GBvg== 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 :in-reply-to:references:mime-version:dkim-signature; bh=ZwoxSskeP0023k+XOLK7qG1mfuenS/a51g77gLnDidE=; b=DuPcNnoN+oHc5GylYAOTcds2mrsqlRn8yZP9An40jsl7o8lb8Iet+F/auu1xGc7x/q Kp17HG0Kam6TXGj/K8hKckXp+LFF79P6/eU/RasNwupA+uNaZ5GQqR7nMzUCVuGFMXK6 YBD8gACXWFX4m/bIwUbz8aGzrceyifTkSEA8SuYXG3k1ldswWV6uy+sqhAfM2xhxKtpZ zAxkr64Q/vj4CW3Tsxmqlw6qDLJDb1WOW2iceRPIRLMCSk8Be2O8RxsPnalBSmrq8NuZ LBaetNxcjg0LETPj4LjNGXXgX7tNhzF7POYrvF2sUtd04gUUtlg1NjdaOyD/m3FOm7/i mvLA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Fa33lR9t; 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 e91si9962097pjk.82.2019.09.03.07.54.22; Tue, 03 Sep 2019 07:54:38 -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=Fa33lR9t; 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 S1729273AbfICOwR (ORCPT + 99 others); Tue, 3 Sep 2019 10:52:17 -0400 Received: from mail-vs1-f68.google.com ([209.85.217.68]:38952 "EHLO mail-vs1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728490AbfICOwQ (ORCPT ); Tue, 3 Sep 2019 10:52:16 -0400 Received: by mail-vs1-f68.google.com with SMTP id y62so11470813vsb.6 for ; Tue, 03 Sep 2019 07:52:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=ZwoxSskeP0023k+XOLK7qG1mfuenS/a51g77gLnDidE=; b=Fa33lR9t7UgiD8FO8rUeW2DVG3Nv4mjXNYBCR/EGzrJTPKb6tzmtE0h96gDu5DZJbk dzVwPLR8SXffeq49jjnD/jCRKWKvOW71V9cVVKCBGKhGwQFZmDiPEXuNRk/DMjApoXTw +eQQoOLHW8BH+SR8Ak8nD1aIA94HNlogEgnlmn3OqopmA1e2pdiR4L4LKJ2QoYe+Qp+l UvQIjcQqPScxkltSFzRxFI7O+VwNc+lIVFFTvkd09gL2k1YXZ5NzUczfyXJXocIIWET6 CBEJWXJ2bmtX+YI0J2a56uha5NjAX3ldZE+OnnRZT/sYmnSmFel9Xul35wtutHem3YOL U1aA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=ZwoxSskeP0023k+XOLK7qG1mfuenS/a51g77gLnDidE=; b=RC0+1kLekGfVS+eJZvo8hnFpSvUHIKE75aw2834q3PluuQ4tXcjgPwPYJyRW5US/c0 bA4DUPTqWJvzTYa6H2iNzMsgjBF+7v6ZGvjU6dpv9q8wBe2KunPLY0QKjBiz6zroCTRA uZn217q2ZuHBLTHY0ZORbBfiWml27H9NV6+onyYblWTj+6PKwBTODKM23+ASIeBuDM1m tsYAYuzJ6HKswRYsl/8T+faLi6og5vjX/g/qB4gWOqp9aGW2+IXswrPeS1tyNFZYCdPu 2xrDN/06Um8DBKRyuuBJz801cTIf/Z+orL2dbBunLKdZ9LEcJ6lZekPpckUzEzMZQD/u +V/A== X-Gm-Message-State: APjAAAUJs1MKCWx9seo5/NxuI2rqaperk1l2q65Dd7DE7Dca+i9/AVdy 3ePBc6eyL2oTA/0C1mt4mygA2gHs3/OybTkohpaAMQ== X-Received: by 2002:a67:983:: with SMTP id 125mr13634122vsj.191.1567522335355; Tue, 03 Sep 2019 07:52:15 -0700 (PDT) MIME-Version: 1.0 References: <20190903115114.33053-1-alcooperx@gmail.com> In-Reply-To: <20190903115114.33053-1-alcooperx@gmail.com> From: Ulf Hansson Date: Tue, 3 Sep 2019 16:51:39 +0200 Message-ID: Subject: Re: [PATCH] mmc: sdhci: Fix incorrect switch to HS mode To: Al Cooper Cc: Linux Kernel Mailing List , Adrian Hunter , "linux-mmc@vger.kernel.org" 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 Tue, 3 Sep 2019 at 13:51, Al Cooper wrote: > > When switching from any MMC speed mode that requires 1.8v > (HS200, HS400 and HS400ES) to High Speed (HS) mode, the system > ends up configured for SDR12 with a 50MHz clock which is an illegal > mode. > > This happens because the SDHCI_CTRL_VDD_180 bit in the > SDHCI_HOST_CONTROL2 register is left set and when this bit is > set, the speed mode is controlled by the SDHCI_CTRL_UHS field > in the SDHCI_HOST_CONTROL2 register. The SDHCI_CTRL_UHS field > will end up being set to 0 (SDR12) by sdhci_set_uhs_signaling() > because there is no UHS mode being set. > > The fix is to change sdhci_set_uhs_signaling() to set the > SDHCI_CTRL_UHS field to SDR25 (which is the same as HS) for > any switch to HS mode. > > This was found on a new eMMC controller that does strict checking > of the speed mode and the corresponding clock rate. It caused the > switch to HS400 mode to fail because part of the sequence to switch > to HS400 requires a switch from HS200 to HS before going to HS400. > > This fix was suggested by Adrian Hunter > > Signed-off-by: Al Cooper Should this be applied for fixes and tagged for stable you think? Kind regards Uffe > --- > drivers/mmc/host/sdhci.c | 4 +++- > 1 file changed, 3 insertions(+), 1 deletion(-) > > diff --git a/drivers/mmc/host/sdhci.c b/drivers/mmc/host/sdhci.c > index 61d845fe0b97..068149640ecd 100644 > --- a/drivers/mmc/host/sdhci.c > +++ b/drivers/mmc/host/sdhci.c > @@ -1858,7 +1858,9 @@ void sdhci_set_uhs_signaling(struct sdhci_host *host, unsigned timing) > ctrl_2 |= SDHCI_CTRL_UHS_SDR104; > else if (timing == MMC_TIMING_UHS_SDR12) > ctrl_2 |= SDHCI_CTRL_UHS_SDR12; > - else if (timing == MMC_TIMING_UHS_SDR25) > + else if (timing == MMC_TIMING_SD_HS || > + timing == MMC_TIMING_MMC_HS || > + timing == MMC_TIMING_UHS_SDR25) > ctrl_2 |= SDHCI_CTRL_UHS_SDR25; > else if (timing == MMC_TIMING_UHS_SDR50) > ctrl_2 |= SDHCI_CTRL_UHS_SDR50; > -- > 2.17.1 >