Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp2153010imm; Mon, 16 Jul 2018 03:13:32 -0700 (PDT) X-Google-Smtp-Source: AAOMgpcnAE27hsdnBSqZY+ue0UqvRCtXiynpPLN+tblN/oOMolawJjYlueUQtz/7OsU3hZBd7B+p X-Received: by 2002:a62:c60e:: with SMTP id m14-v6mr17487809pfg.40.1531736012756; Mon, 16 Jul 2018 03:13:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1531736012; cv=none; d=google.com; s=arc-20160816; b=Dgojy35ZYQbwd36JQ2EAVppnbfHlUjym8LklM+3ae7c5N+qU7/S4jD3i3tdPvOkv/3 zWU5XsjKGMdjCZ31v3V/YsDqGP9yOo0ihLCT3kPlR5FI4jV8LXV/GaaqrbASo9akkFf7 2tb3cL/H8qTU1lcQZihnQN7jthL79W6mp8PmKLfN/MYoPtcPUywUql+ES0ELrap6kEG/ HwZyVVx2MFA2B+stFDpURmAMPb151X+Q+wor9kMG2fz1sL1qan7E6XptNi6OV2kHYW9Z HuWVmZSwkBN08q5YP2PAvjnLP2UK49648/WTTRFfrON1AND8cN+g00bVrPP3pt/YSZ/C Mblw== 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=6BG2GFRFf/12wXMN/jFHpgwSxkgZKyfC+0Faha92Blw=; b=GxHKCS7tgbTPtIJZJEHfniF2pud5FxWL3Bn8KI8FXahtwWmA0zHsRs6jS28d4ItQ4u pSWySPvtAFaErf6/+XwCty6hErKul7UlTARjAjqhBrRkauShddWKvR4EbwtAwTd/8ZdE wig5iyXnJgZL1OV3sTemlB9azvf9fLnUaHij2pduHfWz1E0L2RxQmjAOZoGGvAM5cq1h aqlEk+cmLXZRlaJ7JAsDn8ymgdbMPlL8y5y5qUO5R1KkLRB6OineX2NGux9vdvbWxvOU WOExozaL6VCwsQtgfOp3Fsehx7rWWuWyxoIR289Teb7G4R1E/x1rasEvvh+DAvOyIoNd skSg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Gx1hp6WX; 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 k23-v6si30135375pls.134.2018.07.16.03.13.18; Mon, 16 Jul 2018 03:13:32 -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=Gx1hp6WX; 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 S1731041AbeGPKiC (ORCPT + 99 others); Mon, 16 Jul 2018 06:38:02 -0400 Received: from mail-io0-f193.google.com ([209.85.223.193]:34965 "EHLO mail-io0-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730882AbeGPKiB (ORCPT ); Mon, 16 Jul 2018 06:38:01 -0400 Received: by mail-io0-f193.google.com with SMTP id q4-v6so37258132iob.2 for ; Mon, 16 Jul 2018 03:11:21 -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=6BG2GFRFf/12wXMN/jFHpgwSxkgZKyfC+0Faha92Blw=; b=Gx1hp6WXraf2pOWidq9PLIc0tKcxxr/nBLhm71XD2mC+UnsmG8F5jiAO+rxbKQAMS5 X0AYNx8/tU0CrpO364mawq8B963XZi1CRhrmPKTcRaDES7mhA7F/cISkC+NyX/u64a6N ErjyGteI1XagfFv7ZJsDHFYEOWxqUrQwf3Kis= 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=6BG2GFRFf/12wXMN/jFHpgwSxkgZKyfC+0Faha92Blw=; b=d46VidEGRy69Lk0BKmuq5ptbhqjlrjO7USH9Aood5FyaUTL4zFRdNHR92H1i+UaXQE 3eqZO5Gb75qVFnTj5apjFZfOLGcUhdrRHKuH9YoGudcDR86/8kiJREmWlK3PiKKMf0zb U+NB4VM817M70MlWu3OY+7pjMgaRjZb1ATccCvkPTJTfChx8f8Wjj+AeU68DdC/h7ak5 Ao4p6KNenAFEd1ziqZmLm0i9wcTKwiF34d+QIdtZf3H97R7aF7Zj+b10ecWdauPrsSsZ J7S5Hw0yheB/c2zKgjbYFUf8K5cJF4yG9K2dy5fqNdbZM8KCedc4n2IdIMpZdtpLuUkk AEIA== X-Gm-Message-State: AOUpUlFm667GhNZ9OhBuAkLbTUJmxNw9i1mW9zdTwPkUuEZTh6XKwTcW W4aGsu7POiVixWYBZRR6tV/Ji1bj7wl51hw0LrHQJg== X-Received: by 2002:a6b:144c:: with SMTP id 73-v6mr38366277iou.218.1531735880805; Mon, 16 Jul 2018 03:11:20 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a02:2b03:0:0:0:0:0 with HTTP; Mon, 16 Jul 2018 03:11:20 -0700 (PDT) In-Reply-To: <20180712080650.13878-1-stefan@agner.ch> References: <20180712080650.13878-1-stefan@agner.ch> From: Ulf Hansson Date: Mon, 16 Jul 2018 12:11:20 +0200 Message-ID: Subject: Re: [PATCH v2 1/2] mmc: sdhci-esdhc-imx: disable clocks before changing frequency To: Stefan Agner Cc: Adrian Hunter , Fabio Estevam , Haibo Chen , Aisheng Dong , "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 12 July 2018 at 10:06, Stefan Agner wrote: > In the uSDHC case (e.g. i.MX 6) clocks only get disabled if frequency > is set to 0. However, it could be that the stack asks for a frequency > change while clocks are on. In that case the function clears the > divider registers (by clearing ESDHC_CLOCK_MASK) while the clock is > enabled! This causes a short period of time where the clock is > undivided (on a i.MX 6DL a clock of 196MHz has been measured). > > For older IP variants the driver disables clock by clearing some bits > in ESDHC_SYSTEM_CONTROL. > > Make sure to disable card clock before changing frequency for uSDHC > IP variants too. > > Signed-off-by: Stefan Agner Thanks, applied for next! Kind regards Uffe > --- > drivers/mmc/host/sdhci-esdhc-imx.c | 12 ++++++------ > 1 file changed, 6 insertions(+), 6 deletions(-) > > diff --git a/drivers/mmc/host/sdhci-esdhc-imx.c b/drivers/mmc/host/sdhci-esdhc-imx.c > index 85fd5a8b0b6d..acacd8481473 100644 > --- a/drivers/mmc/host/sdhci-esdhc-imx.c > +++ b/drivers/mmc/host/sdhci-esdhc-imx.c > @@ -708,14 +708,14 @@ static inline void esdhc_pltfm_set_clock(struct sdhci_host *host, > int div = 1; > u32 temp, val; > > + if (esdhc_is_usdhc(imx_data)) { > + val = readl(host->ioaddr + ESDHC_VENDOR_SPEC); > + writel(val & ~ESDHC_VENDOR_SPEC_FRC_SDCLK_ON, > + host->ioaddr + ESDHC_VENDOR_SPEC); > + } > + > if (clock == 0) { > host->mmc->actual_clock = 0; > - > - if (esdhc_is_usdhc(imx_data)) { > - val = readl(host->ioaddr + ESDHC_VENDOR_SPEC); > - writel(val & ~ESDHC_VENDOR_SPEC_FRC_SDCLK_ON, > - host->ioaddr + ESDHC_VENDOR_SPEC); > - } > return; > } > > -- > 2.18.0 > > -- > To unsubscribe from this list: send the line "unsubscribe linux-mmc" in > the body of a message to majordomo@vger.kernel.org > More majordomo info at http://vger.kernel.org/majordomo-info.html