Received: by 2002:ac0:a582:0:0:0:0:0 with SMTP id m2-v6csp3479325imm; Mon, 8 Oct 2018 04:52:26 -0700 (PDT) X-Google-Smtp-Source: ACcGV624lvq9Dgtsmh6SnMESmsnV5avqgniDGKFfgdP52VtGPxz2YHueWLIi2rdUjSYtSI69oab1 X-Received: by 2002:a17:902:b403:: with SMTP id x3-v6mr24034373plr.237.1538999546354; Mon, 08 Oct 2018 04:52:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1538999546; cv=none; d=google.com; s=arc-20160816; b=ijTYr7CxlaeW/VAbyHTKyJMv//fAZc8fzui2xWB0GMIWtPTQ1Zz8r7QNN9dt2e+6Yd I9w/ST8faZyN20xDEfBrw8Trh+LJKy7Ho9UhV+nS3ZnPZRUNm7qQqVAncH+cYGp0AQ8Q my9Xwzf85ciJLafsmkbkq+BUQt9vZj+qrSZQFaSjLUPzvTORzpVH9A3mvIcrSbuC9yKJ U3mqaLQgY7i2vEKi0+YUALvD04QKuYVw3/SP4hgFuIEBoJOp86ojc8IA8WIdba1f4DUC eEIMoAhh8zC6vGNJSzHItf6tc39gLw3UmXxiDBrPHRjc+zFY6mcJJNR0FRbJYgliz3mu j4KA== 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; bh=v4+bTw6iDHKh23adZmm02D1aGVtPElNslPeNy/MbO2E=; b=ksMSw89FAZtTGO+0nLl0q/uWaLkgWP997J0gnjldUvBY5ESiFKq5kB3VyfW2/3oqqD aAO4TctJgZlruBNUsvTLzYksnM0vuanuqaV3gYBBIO5Pgio2oCX3Z6RDcvj0vewLD12I Yd8eVN1xPE9V+lcsdxA3byDGg+YqCVZ+2mWBHldNtq6q5M4Jfkh5RPaFixywB9wZGDvN 3snCMlN9gT3WS62w4U+yb0n7NnGb/W81a+iKhNu581heXepz7VAHOJk8fgbaFEYrbj9g cZeOmoeBvcXqWORtht53ID/BjrugNYppGFCJ5sKfCd7o7P1RsOYpI3PcWJFEh/XN2Sw5 f1+A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=hS296L2F; 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 k17-v6si17602954pll.429.2018.10.08.04.52.11; Mon, 08 Oct 2018 04:52:26 -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=hS296L2F; 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 S1727827AbeJHTDS (ORCPT + 99 others); Mon, 8 Oct 2018 15:03:18 -0400 Received: from mail-io1-f65.google.com ([209.85.166.65]:43300 "EHLO mail-io1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727583AbeJHTDR (ORCPT ); Mon, 8 Oct 2018 15:03:17 -0400 Received: by mail-io1-f65.google.com with SMTP id y10-v6so15581053ioa.10 for ; Mon, 08 Oct 2018 04:51:56 -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=v4+bTw6iDHKh23adZmm02D1aGVtPElNslPeNy/MbO2E=; b=hS296L2Fol5BzbIkJrE5y66MSWaBSegVs4GZMcdMX+LnE5AUj/0VjZ2+OKzs7wrrH8 P1zLUvz7DD0cc4WZ4cYNQQqlZWnNvXiT2cpPLnkKFakhPboNvo4ubcmh4Y/mw+D+4/Bn J3RcxRoZhy0LIiusp2rNOtGhcKoFcRgxL0+tQ= 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=v4+bTw6iDHKh23adZmm02D1aGVtPElNslPeNy/MbO2E=; b=lcs67WebmbMMaIb9qRFyX63tIQr3k5HyYs4LpKf4Uab/LagT3TMLH683sgbfrB8NzJ sYDXH6L3jYLjTBZjxMun+QZE0TiEiXWwyV57zGcr/fYnXUfo0j/UirtM25AOQligxKWD bMPwECF37lu24NCQvJgBcb1LMbG1PYtTXqC1grcuzMcCIQ08d6XdaCKlkHy2U/26EvT7 WA3ORpz8Qaef0aLSvI1vyXiI3cbpY9mGeqAg5dkckZVfdt66lpuz+hFAUACyk0ymgrFM ECAEF6iCOLh+SqaOwOn+cNQNiUTR/ubm7S9+kjRJtfBzbXS2cMYgBr7dad/URVQPr2hw 4FRQ== X-Gm-Message-State: ABuFfoj+nTyF7AumOLsKK2R4rLrvYOSmPId/889gVEZLhJJSaModnAIp QJNfASn9eBGsjbtNZNz4QH0tXci4xdu0+oouXcipIQ== X-Received: by 2002:a6b:203:: with SMTP id 3-v6mr15031986ioc.131.1538999515514; Mon, 08 Oct 2018 04:51:55 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a02:3941:0:0:0:0:0 with HTTP; Mon, 8 Oct 2018 04:51:15 -0700 (PDT) In-Reply-To: <1538188195-3608-2-git-send-email-chaotian.jing@mediatek.com> References: <1538188195-3608-1-git-send-email-chaotian.jing@mediatek.com> <1538188195-3608-2-git-send-email-chaotian.jing@mediatek.com> From: Ulf Hansson Date: Mon, 8 Oct 2018 13:51:15 +0200 Message-ID: Subject: Re: [PATCH v1 2/2] mmc: mediatek: add bus_clk control To: Chaotian Jing Cc: Rob Herring , Mark Rutland , Matthias Brugger , Ryder Lee , Wolfram Sang , Sean Wang , "linux-mmc@vger.kernel.org" , DTML , Linux ARM , linux-mediatek@lists.infradead.org, Linux Kernel Mailing List , srv_heupstream 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 29 September 2018 at 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 Applied for next, thanks! Kind regards Uffe > --- > 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; > /*source clock control gate is optional clock*/ > host->src_clk_cg = devm_clk_get(&pdev->dev, "source_cg"); > if (IS_ERR(host->src_clk_cg)) > -- > 1.8.1.1.dirty >