Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp1874081imm; Thu, 27 Sep 2018 04:02:29 -0700 (PDT) X-Google-Smtp-Source: ACcGV60NGGrCq+6YC4MBgfCcycSlJm+J8thtioZvBsIbMbABpu1vVLRh5jUSx5dLQac0oJa2HKZz X-Received: by 2002:a62:1a8f:: with SMTP id a137-v6mr10885596pfa.190.1538046149294; Thu, 27 Sep 2018 04:02:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1538046149; cv=none; d=google.com; s=arc-20160816; b=GEjTXfsF4OEtrug1h7SSRw7r5LwLdssRcEKep3FUneZpeyCkLItSy8OARHDpZrL3bE XX4FNO3U/W7+yJSvpCof7mKuvej0VrTyKeK9OKoaRMiJGUTohrbSP4BxiY/47NCK5SXA KH6UHW7rOyZ0ArfbKQ6YaixBvzD05QjJKQnq2UtnyI0FDfEyAlu2wFrqxNm5K5Mv8Hwj jSd6SKL6vKpJpUHkQ1YGWUe3zRhdZiCtukiB7NGlw2XBBT5LbL5Klanbgm5OnPK/ueAn PUKcknEWJPftimv/0tKT16/Fi6ZIdmz7b/JOIBh1NdGkSMEENRErO30fifzzcdY1tz5e +xiw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-language :content-transfer-encoding:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dmarc-filter :dkim-signature:dkim-signature; bh=0M3/4OX2EkM1jOW3e8Ql3ftlUbDgAWRyQxMeC3L6A7I=; b=DNeQ+wecVEmS7trv/CgieEh6pmAcwVRyC7KiUumxAFHNiaujJYauAQCAwgc0K/0AzA 8GxsQrkoNAXKDh0/Usmma/XScKCvqtJSXA1w/DH3RSQ43ybG1O71IW2IIA7pwN0T0/Od X/dt/vMQwJqLZibfQ98njEufKoMFI0zvtKKwl62DldAdZiJx/jmVpxvDnjKgFzDtqJaW zZzsJlS3W6l9Aiu8Vh02lvfuRNa4Q8OM3b2qtCInn7Zw1dHqFPDRC64knxzjHdK9HN5r E04uMc8jFG4wp2W624j3T6S/CdNW54XnbJwzNxpcEzfsaKtG5OeuMo+vGlG0MR7xzdOe fGOA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@codeaurora.org header.s=default header.b=eNtyxRtF; dkim=pass header.i=@codeaurora.org header.s=default header.b=eNtyxRtF; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f10-v6si1426886pgs.362.2018.09.27.04.02.12; Thu, 27 Sep 2018 04:02:29 -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=@codeaurora.org header.s=default header.b=eNtyxRtF; dkim=pass header.i=@codeaurora.org header.s=default header.b=eNtyxRtF; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727377AbeI0RRq (ORCPT + 99 others); Thu, 27 Sep 2018 13:17:46 -0400 Received: from smtp.codeaurora.org ([198.145.29.96]:40384 "EHLO smtp.codeaurora.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726820AbeI0RRq (ORCPT ); Thu, 27 Sep 2018 13:17:46 -0400 Received: by smtp.codeaurora.org (Postfix, from userid 1000) id A729B60B72; Thu, 27 Sep 2018 11:00:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1538046002; bh=jS1nmCIpqujG+mfxRrARKy+iWzwTv6mhvNTOgaKkBI0=; h=Subject:To:Cc:References:From:Date:In-Reply-To:From; b=eNtyxRtF9DAkSthMZUJxBxLueq47PfAQL/mbJtStN+EuGXYvtdq6JaNnZsWZzh5qT RDKHNnoKjx2CBHalyPSF2kbRacu6Q5PpLW6TdjNE2Wc+GmkDbBugo98Jvsbl+tkekf kFoJfMvoR7sD9lOWHZl5WYCpLdnCAO8jr6Ypiz9M= X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on pdx-caf-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.7 required=2.0 tests=ALL_TRUSTED,BAYES_00, DKIM_INVALID,DKIM_SIGNED autolearn=no autolearn_force=no version=3.4.0 Received: from [10.206.25.139] (blr-c-bdr-fw-01_globalnat_allzones-outside.qualcomm.com [103.229.19.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: vbadigan@smtp.codeaurora.org) by smtp.codeaurora.org (Postfix) with ESMTPSA id DD0F260214; Thu, 27 Sep 2018 10:59:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1538046002; bh=jS1nmCIpqujG+mfxRrARKy+iWzwTv6mhvNTOgaKkBI0=; h=Subject:To:Cc:References:From:Date:In-Reply-To:From; b=eNtyxRtF9DAkSthMZUJxBxLueq47PfAQL/mbJtStN+EuGXYvtdq6JaNnZsWZzh5qT RDKHNnoKjx2CBHalyPSF2kbRacu6Q5PpLW6TdjNE2Wc+GmkDbBugo98Jvsbl+tkekf kFoJfMvoR7sD9lOWHZl5WYCpLdnCAO8jr6Ypiz9M= DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org DD0F260214 Authentication-Results: pdx-caf-mail.web.codeaurora.org; dmarc=none (p=none dis=none) header.from=codeaurora.org Authentication-Results: pdx-caf-mail.web.codeaurora.org; spf=none smtp.mailfrom=vbadigan@codeaurora.org Subject: Re: [PATCH 2/2] mmc: sdhci-msm: Re-initialize DLL if MCLK is gated dynamically To: Doug Anderson Cc: Adrian Hunter , Ulf Hansson , Rob Herring , Asutosh Das , riteshh@codeaurora.org, stummala@codeaurora.org, sayalil@codeaurora.org, Evan Green , LKML References: <1537887875-29494-1-git-send-email-vbadigan@codeaurora.org> <1537887875-29494-3-git-send-email-vbadigan@codeaurora.org> From: Veerabhadrarao Badiganti Message-ID: Date: Thu, 27 Sep 2018 16:29:50 +0530 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Doug, On 9/26/2018 3:58 AM, Doug Anderson wrote: > Hi, > > On Tue, Sep 25, 2018 at 8:05 AM Veerabhadrarao Badiganti > wrote: >> + /* >> + * Whenever core-clock is gated dynamically, it's needed to >> + * re-initialize the DLL when the clock is ungated. >> + */ >> + if (msm_host->restore_dll_cfg_needed && msm_host->clk_rate) { >> + msm_host->restore_dll_cfg = true; >> + mmc_retune_needed(host->mmc); > Using the boolean "restore_dll_cfg" to communicate like this seems > really fragile. I have no basis in fact, but I worry that something > will happen in the meantime that really ought to invalidate the > "saved_tuning_phase" but the boolean will still be set. > > Is there a reason you can't just call msm_config_cm_dll_phase() > directly from sdhci_msm_runtime_resume()? Perhaps after the > clk_bulk_prepare_enable() call below? I can do that. But we don't need to restore the clock phase for all speed modes since every mode doesn't use DLL. Only few speed modes (only SDR104 mode for SD card) would need to restore DLL setting. So I would need to do some extra checks for performing this operation for only required speed modes. And we should re-initialize the DLL first before programming the phase. I wanted to reuse the existing logic which does all these things. So did this way. > > -Doug Thanks Veera