Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp1876899imm; Sat, 29 Sep 2018 05:56:40 -0700 (PDT) X-Google-Smtp-Source: ACcGV62UxFfbkdAgCenJPVQGjaHAlQfPC7xfMtSKK+Ck2uel1028mHQVQ3IMRjozsJ6BtayKRP2P X-Received: by 2002:a17:902:5a89:: with SMTP id r9-v6mr3130353pli.95.1538225800341; Sat, 29 Sep 2018 05:56:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1538225800; cv=none; d=google.com; s=arc-20160816; b=yTAlYviR06y6OrWnjHXGsrNR9EVadgnXY+3ZOFFBy2Vs+VyBV3Vx8VAnTWmWX57zjd pKc9/6vOKWpaxJZg9Q3GrWFlYTLUYUHAvwoOU7jhXE+kFlWhfomIESnmvP+qMOKNGOPZ OLcViijEJIUGr/mNsksOcE1nfAmwb3SxDw7n6MGvpswzPN6OrrgQmJLBffSbbS9EiEri wL4ibbdicJApvWW7ljXiiVOCpU5tijljytMvxJWQQQFaxHyTr/lMK3gOBFwj/eu79l44 yiZvGntwV0DP/2pa4Nz5CTVfqK+7z9yK6sOLt+SFjL5PicjeEh4BcPR0AVYoQDXW11V3 ns5w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:autocrypt:openpgp:from:references:cc:to:subject :dkim-signature; bh=0Vet9+d8MECqz4x7wr86ALZx7dPHCbSRgY+YnYT74J4=; b=rXoL0VLxXghGmQPC/ewb4QCV+9gaRjo8LhjXs/xVHdNZAtkALc3zICMb5y7K5z0dL7 MRJhveaS+38kqTrWNj7oZvlNREu32e5xbZIAMsFeebVvHSriu2LhAnG9NsjQekRcjFEW 2Q+41jVif6froKTpogIM7j3wUcgAM+dopuCfQDOILkOEw8Fsw0cx6/vPkmdCQKFDNsJi ZDRbfCrGGPIpY/gyug+loYD5mZ8s/xB9v9waODTUD3ggxn996hsdGgbd4dtRo631AGmE 1ETYtsMUrXVOImRbKdFq/v5t6tqDeM0AAZtBdTKAmZrkZqgvD9aHpCG2RhkVnjZm3hTD H2EQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=lTFzjX4n; 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id u7-v6si1364649pls.28.2018.09.29.05.56.24; Sat, 29 Sep 2018 05:56:40 -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=@gmail.com header.s=20161025 header.b=lTFzjX4n; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728231AbeI2TYl (ORCPT + 99 others); Sat, 29 Sep 2018 15:24:41 -0400 Received: from mail-ed1-f68.google.com ([209.85.208.68]:34444 "EHLO mail-ed1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727979AbeI2TYk (ORCPT ); Sat, 29 Sep 2018 15:24:40 -0400 Received: by mail-ed1-f68.google.com with SMTP id q19-v6so10417404edr.1; Sat, 29 Sep 2018 05:56:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:cc:references:from:openpgp:autocrypt:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=0Vet9+d8MECqz4x7wr86ALZx7dPHCbSRgY+YnYT74J4=; b=lTFzjX4nu8qowc6x6wKHPzSYAuaWXTbPuRJl8nf5A3I6DqDM1dcoiVp4ifIWKfkwQs mhf4sOwyZlXejNmS0wJ4VcfEFrJbRofhuE8vw7gheJE3/5ikCGVqfztDgLls9x/TKiaU BKL4WGZkPHmJU/Y6DSFnKInmRMhQeisHUlAfl6gLshKXYjtF9QiUl5kGDXScIIrbzQK/ +DLDey7+akWzwSYd0OSSedjAOdLTV+r9nH6Ue/HSb4KJQmq/H4CHyaXP2lRbel5kpoYe WgSE+aOMwS4Sv3mPMg4rOzZZxyPX0SI9+8Ye4xGrkww+Klubq8cGDZzvIdxaNa7F1PU2 5z9A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:openpgp:autocrypt :message-id:date:user-agent:mime-version:in-reply-to :content-language:content-transfer-encoding; bh=0Vet9+d8MECqz4x7wr86ALZx7dPHCbSRgY+YnYT74J4=; b=dszfXgbRuL76polIlRAZmtFnWuzNbqCFZMqBQ5u/Yfd97zRPQwIE2Q/+i++zmj2t9e QpnUHkbKjrAA9MuFUcgR0mqKJzM3vqIqop1blXo6uaz+SofbNHf6uAWNt9H2SmUM3pqK E4bvX5y/wVxMt6Gq2ItBRwWX18NUqTZYsRDj3H2sAtLLsJm+hoNGoxFT9gSh4dii8zXn +iiiNse0Uyn9/Ctg5asl+M9MrfM0Zq4uK6cWJDJTQb3pk62YrxDqdojFI641yXh1adpJ Nnc+J5dlko0Eu1jJ2N6ghL11X1zpxZTv5ZxzarJtgbJhTny9xlVWS5n7UNAe84lP8w31 D1DQ== X-Gm-Message-State: ABuFfoi/kTSOs77n+5SDlLGzhzaA1zTevObI6iQ3Ks3SB/NoLXyKKjxy OuYCRIJ+Qztc/LrB0VYqg3k= X-Received: by 2002:a17:906:1f87:: with SMTP id t7-v6mr1043044ejr.153.1538225776136; Sat, 29 Sep 2018 05:56:16 -0700 (PDT) Received: from ziggy.stardust (p54A4E637.dip0.t-ipconnect.de. [84.164.230.55]) by smtp.gmail.com with ESMTPSA id n25-v6sm2649074edq.27.2018.09.29.05.56.14 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 29 Sep 2018 05:56:15 -0700 (PDT) Subject: Re: [PATCH v1 2/2] mmc: mediatek: add bus_clk control To: Chaotian Jing , Ulf Hansson Cc: Rob Herring , Mark Rutland , Ryder Lee , Wolfram Sang , Sean Wang , linux-mmc@vger.kernel.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, linux-kernel@vger.kernel.org, srv_heupstream@mediatek.com References: <1538188195-3608-1-git-send-email-chaotian.jing@mediatek.com> <1538188195-3608-2-git-send-email-chaotian.jing@mediatek.com> From: Matthias Brugger Openpgp: preference=signencrypt Autocrypt: addr=matthias.bgg@gmail.com; prefer-encrypt=mutual; keydata= xsFNBFP1zgUBEAC21D6hk7//0kOmsUrE3eZ55kjc9DmFPKIz6l4NggqwQjBNRHIMh04BbCMY fL3eT7ZsYV5nur7zctmJ+vbszoOASXUpfq8M+S5hU2w7sBaVk5rpH9yW8CUWz2+ZpQXPJcFa OhLZuSKB1F5JcvLbETRjNzNU7B3TdS2+zkgQQdEyt7Ij2HXGLJ2w+yG2GuR9/iyCJRf10Okq gTh//XESJZ8S6KlOWbLXRE+yfkKDXQx2Jr1XuVvM3zPqH5FMg8reRVFsQ+vI0b+OlyekT/Xe 0Hwvqkev95GG6x7yseJwI+2ydDH6M5O7fPKFW5mzAdDE2g/K9B4e2tYK6/rA7Fq4cqiAw1+u EgO44+eFgv082xtBez5WNkGn18vtw0LW3ESmKh19u6kEGoi0WZwslCNaGFrS4M7OH+aOJeqK fx5dIv2CEbxc6xnHY7dwkcHikTA4QdbdFeUSuj4YhIZ+0QlDVtS1QEXyvZbZky7ur9rHkZvP ZqlUsLJ2nOqsmahMTIQ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mUSsTwWC3HpE/D9sM+xACs803lFUIZC5H62G059cCPAXKgsFpNMKmBAWweBkVJAisoQeX 50OP+/11ArV0cv+fOTfJj0/KwFXJaaYh3LUQNILLBNxkSrhCLl8dUg53IbHx4NfIAgqxLWGf XM8DY1aFdU79pac005PuhxCWkKTJz3gCmznnoat4GCnL5gy/m0Qk45l4PFqwWXVLo9AQg2Kp 3mlIFZ6fsEKIAN5hxlbNvNb9V2Zo5bFZjPWPFTxOteM0omUAS+QopwU0yPLLGJVf2iCmItHc UXI+r2JwH1CJjrHWeQEI2ucSKsNa8FllDmG/fQ== Message-ID: Date: Sat, 29 Sep 2018 14:56:13 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.0 MIME-Version: 1.0 In-Reply-To: <1538188195-3608-2-git-send-email-chaotian.jing@mediatek.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 29/09/2018 04:29, Chaotian Jing wrote: > when gate MSDC0_HCLK, access register will hang, even the MSDC driver > will never accessing register after HCLK was gated, but for safety, need > gate the bus_clk(which used to access register) too. > > Signed-off-by: Chaotian Jing > --- > drivers/mmc/host/mtk-sd.c | 6 ++++++ > 1 file changed, 6 insertions(+) > > diff --git a/drivers/mmc/host/mtk-sd.c b/drivers/mmc/host/mtk-sd.c > index 0484138..1c1c967 100644 > --- a/drivers/mmc/host/mtk-sd.c > +++ b/drivers/mmc/host/mtk-sd.c > @@ -387,6 +387,7 @@ struct msdc_host { > > struct clk *src_clk; /* msdc source clock */ > struct clk *h_clk; /* msdc h_clk */ > + struct clk *bus_clk; /* bus clock which used to access register */ > struct clk *src_clk_cg; /* msdc source clock control gate */ > u32 mclk; /* mmc subsystem clock frequency */ > u32 src_clk_freq; /* source clock frequency */ > @@ -660,12 +661,14 @@ static void msdc_gate_clock(struct msdc_host *host) > { > clk_disable_unprepare(host->src_clk_cg); > clk_disable_unprepare(host->src_clk); > + clk_disable_unprepare(host->bus_clk); > clk_disable_unprepare(host->h_clk); > } > > static void msdc_ungate_clock(struct msdc_host *host) > { > clk_prepare_enable(host->h_clk); > + clk_prepare_enable(host->bus_clk); > clk_prepare_enable(host->src_clk); > clk_prepare_enable(host->src_clk_cg); > while (!(readl(host->base + MSDC_CFG) & MSDC_CFG_CKSTB)) > @@ -1900,6 +1903,9 @@ static int msdc_drv_probe(struct platform_device *pdev) > goto host_free; > } > > + host->bus_clk = devm_clk_get(&pdev->dev, "bus_clk"); > + if (IS_ERR(host->bus_clk)) > + host->bus_clk = NULL; That means the bus_clk is not requiered, even for mt2712, although the binding says so. Not sure if this is good enough or if we want to enforce the driver to actually error out, when the clock is not present in a mt2712 DTS. I suppose that's up to the maintainer :) Regards, Matthias