From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jisheng Zhang Subject: Re: [PATCH v2] mmc: sdhci-xenon: Fix clock resource by adding an optional bus clock Date: Sat, 30 Sep 2017 10:41:09 +0800 Message-ID: <20170930104109.60853202@xhacker.debian> References: <20170929130435.6805-1-gregory.clement@free-electrons.com> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Return-path: Received: from mail-by2nam03on0052.outbound.protection.outlook.com ([104.47.42.52]:7872 "EHLO NAM03-BY2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752578AbdI3Cle (ORCPT ); Fri, 29 Sep 2017 22:41:34 -0400 In-Reply-To: <20170929130435.6805-1-gregory.clement@free-electrons.com> Sender: linux-mmc-owner@vger.kernel.org List-Id: linux-mmc@vger.kernel.org To: Gregory CLEMENT Cc: Ulf Hansson , Adrian Hunter , linux-mmc@vger.kernel.org, Rob Herring , devicetree@vger.kernel.org, Jason Cooper , Andrew Lunn , Sebastian Hesselbarth , Thomas Petazzoni , linux-arm-kernel@lists.infradead.org, Antoine Tenart , =?UTF-8?B?TWlxdcOobA==?= Raynal , Nadav Haklai , Shadi Ammouri , Yehuda Yitschak , Omri Itach , Hanna Hawa , Igal Liberman , Marcin Wojtas Hi Gregory, On Fri, 29 Sep 2017 15:04:35 +0200 Gregory CLEMENT wrote: > On Armada 7K/8K we need to explicitly enable the bus clock. The bus clock > is optional because not all the SoCs need them but at least for Armada > 7K/8K it is actually mandatory. > > The binding documentation is updating accordingly. > > Without this patch the kernel hand during boot if the mvpp2.2 network > driver was not present in the kernel. Indeed the clock needed by the > xenon controller was set by the network driver. > > Fixes: 3a3748dba881 ("mmc: sdhci-xenon: Add Marvell Xenon SDHC core > functionality)" > CC: Stable > Signed-off-by: Gregory CLEMENT > diff --git a/drivers/mmc/host/sdhci-xenon.c b/drivers/mmc/host/sdhci-xenon.c > index 2eec2e652c53..15f912d08a4c 100644 > --- a/drivers/mmc/host/sdhci-xenon.c > +++ b/drivers/mmc/host/sdhci-xenon.c > @@ -466,6 +466,7 @@ static int xenon_probe(struct platform_device *pdev) > { > struct sdhci_pltfm_host *pltfm_host; > struct sdhci_host *host; > + struct xenon_priv *priv; > int err; > > host = sdhci_pltfm_init(pdev, &sdhci_xenon_pdata, > @@ -474,6 +475,7 @@ static int xenon_probe(struct platform_device *pdev) > return PTR_ERR(host); > > pltfm_host = sdhci_priv(host); > + priv = sdhci_pltfm_priv(pltfm_host); > > /* > * Link Xenon specific mmc_host_ops function, > @@ -491,9 +493,21 @@ static int xenon_probe(struct platform_device *pdev) > if (err) > goto free_pltfm; > > + priv->axi_clk = devm_clk_get(&pdev->dev, "axi"); > + if (IS_ERR(priv->axi_clk)) { > + err = PTR_ERR(priv->axi_clk); > + if (err == -EPROBE_DEFER) > + goto err_clk; > + priv->axi_clk = NULL; IMHO, this assignment could be removed. What do you think? Thanks