linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Peter Griffin <peter.griffin@linaro.org>
To: Lee Jones <lee.jones@linaro.org>
Cc: linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org, maxime.coquelin@st.com,
	patrice.chotard@st.com, srinivas.kandagatla@gmail.com,
	chris@printf.net, ulf.hansson@linaro.org, kernel@stlinux.com,
	linux-mmc@vger.kernel.org, devicetree@vger.kernel.org,
	Giuseppe Cavallaro <peppe.cavallaro@st.com>
Subject: Re: [PATCH 1/8] mmc: sdhci-st: Intial support for ST SDHCI controller
Date: Mon, 2 Jun 2014 12:06:39 +0100	[thread overview]
Message-ID: <20140602110639.GA1483@griffinp-ThinkPad-X1-Carbon-2nd> (raw)
In-Reply-To: <20140522165036.GK19747@lee--X1>

Hi Lee,

Thanks for your feedback, all your other comments will be fixed in v2. 
However see comments below for this patch

> > +	clk_prepare_enable(clk);
> 
> Move this down as far as it will go.  When do you _need_ the clock
> running by?
> 
> > +	host->mmc->caps |= MMC_CAP_8_BIT_DATA | MMC_CAP_BUS_WIDTH_TEST
> > +			| MMC_CAP_1_8V_DDR;
> > +
> > +	if (of_property_read_bool(np, "non-removable"))
> > +		host->mmc->caps |= MMC_CAP_NONREMOVABLE;
> > +
> > +	pltfm_host = sdhci_priv(host);
> > +	pltfm_host->clk = clk;
> > +
> > +	ret = sdhci_add_host(host);
> > +	if (ret) {
> > +		dev_err(&pdev->dev, "Failed sdhci_add_host\n");
> > +		goto err_out;
> 
> If it's possible to move the clk_prepare enable down past here, then
> you only need to do sdhci_pltfm_free() and you can remove all of the
> err_out error path.

No its not possible. sdhci_add_host() reads registers on
the IP, if the clock isn't enabled the system can hang.

> 
> > +	}
> > +
> > +	pltfm_host->priv = pdata;
> > +
> > +	platform_set_drvdata(pdev, host);
> > +
> > +	host_version = readw_relaxed((host->ioaddr + SDHCI_HOST_VERSION));
> 
> Do we want to be doing any error checking for unsupported devices
> here?

Not that I'm aware of. This is just a debug print I added as it is useful
for debugging. Its not unheard for software folks not to be told that the
IP version has changed in a new SoC, so comparing dmesg traces of working
kernels with non working ones which include IP versions etc can often
shed some light on whats happening.

Arguably if the maintainers think its helpful then it could be added in 
sdhci_add_host(), and every platform would benefit. Or if its deemed 
not helpful then it can be removed!

Cheers,

Peter.

  reply	other threads:[~2014-06-02 11:06 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-05-22 15:18 Add SDHCI support for STMicroelectronics SoCs Peter Griffin
2014-05-22 15:18 ` [PATCH 1/8] mmc: sdhci-st: Intial support for ST SDHCI controller Peter Griffin
2014-05-22 15:41   ` Maxime Coquelin
2014-06-04 11:05     ` Peter Griffin
2014-05-22 16:50   ` Lee Jones
2014-06-02 11:06     ` Peter Griffin [this message]
2014-05-23  6:18   ` Srinivas Kandagatla
2014-06-04  8:37     ` Peter Griffin
2014-05-23  7:34   ` Ulf Hansson
     [not found]     ` <20140604084831.GB23469@griffinp-ThinkPad-X1-Carbon-2nd>
2014-06-04 11:06       ` Ulf Hansson
2014-05-22 15:18 ` [PATCH 2/8] mmc: sdhci-st: STMicroelectronics SDHCI binding documentation Peter Griffin
2014-05-22 15:46   ` Maxime Coquelin
2014-05-22 16:06   ` Lee Jones
2014-05-23  6:57   ` Ulf Hansson
2014-05-22 15:18 ` [PATCH 3/8] ARM: STi: DT: Add sdhci pins for stih416 Peter Griffin
2014-05-22 15:50   ` Maxime Coquelin
2014-05-22 15:59   ` Lee Jones
2014-05-22 15:18 ` [PATCH 4/8] ARM: STi: DT: Add sdhci controller " Peter Griffin
2014-05-22 15:58   ` Lee Jones
2014-05-22 15:18 ` [PATCH 5/8] ARM: STi: DT: Add sdhci pin configuration for stih415 Peter Griffin
2014-05-22 15:57   ` Lee Jones
2014-05-22 15:18 ` [PATCH 6/8] ARM: STi: DT: Enable mmc0 for both stih415 and stih416 SoCs Peter Griffin
2014-05-22 15:41   ` Lee Jones
2014-05-22 15:18 ` [PATCH 7/8] ARM: STi: DT: Enable second sdhci controller for stih416 b2020 boards Peter Griffin
2014-05-22 15:39   ` Lee Jones
2014-05-22 15:18 ` [PATCH 8/8] ARM: update multi_v7_defconfig for STI Peter Griffin
2014-05-22 15:36   ` Lee Jones
2014-05-22 15:44 ` Add SDHCI support for STMicroelectronics SoCs Maxime Coquelin
2014-06-02 10:29   ` Peter Griffin
2014-06-02 13:53     ` Lee Jones

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20140602110639.GA1483@griffinp-ThinkPad-X1-Carbon-2nd \
    --to=peter.griffin@linaro.org \
    --cc=chris@printf.net \
    --cc=devicetree@vger.kernel.org \
    --cc=kernel@stlinux.com \
    --cc=lee.jones@linaro.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mmc@vger.kernel.org \
    --cc=maxime.coquelin@st.com \
    --cc=patrice.chotard@st.com \
    --cc=peppe.cavallaro@st.com \
    --cc=srinivas.kandagatla@gmail.com \
    --cc=ulf.hansson@linaro.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).