From: Arnd Bergmann <arnd@arndb.de>
To: linux-arm-kernel@lists.infradead.org
Cc: "Vincent. Yang" <Vincent.Yang@tw.fujitsu.com>,
"mark.rutland@arm.com" <mark.rutland@arm.com>,
"devicetree@vger.kernel.org" <devicetree@vger.kernel.org>,
Mollie Wu <mollie.wu@linaro.org>,
"linux@arm.linux.org.uk" <linux@arm.linux.org.uk>,
"anton@enomsg.org" <anton@enomsg.org>,
"pawel.moll@arm.com" <pawel.moll@arm.com>,
Tetsuya Takinishi <t.takinishi@jp.fujitsu.com>,
"patches@linaro.org" <patches@linaro.org>,
"linux-mmc@vger.kernel.org" <linux-mmc@vger.kernel.org>,
"chris@printf.net" <chris@printf.net>,
"robh+dt@kernel.org" <robh+dt@kernel.org>,
"jaswinder.singh@linaro.org" <jaswinder.singh@linaro.org>,
"andy.green@linaro.org" <andy.green@linaro.org>,
"olof@lixom.net" <olof@lixom.net>
Subject: Re: [PATCH 2/8] mmc: sdhci: host: add new f_sdh30
Date: Wed, 16 Jul 2014 12:10:07 +0200 [thread overview]
Message-ID: <5526913.sJ4RMkanr6@wuerfel> (raw)
In-Reply-To: <830AC58E49A426478AC39824BC0FA915D8B8FF0609@fmpitwmsex01.fmpi.sea.css.fujitsu.com>
On Wednesday 16 July 2014 17:35:41 Vincent. Yang wrote:
> >
> >> +unsigned int sdhci_f_sdh30_get_min_clock(struct sdhci_host *host)
> >> +{
> >> + return F_SDH30_MIN_CLOCK;
> >> +}
> >> +
> >> +void sdhci_f_sdh30_reset(struct sdhci_host *host, u8 mask)
> >> +{
> >> + struct f_sdhost_priv *priv = sdhci_priv(host);
> >> +
> >> + if (gpio_is_valid(priv->gpio_select_1v8))
> >> + gpio_direction_output(priv->gpio_select_1v8, 1);
> >> +
> >> + if (sdhci_readw(host, SDHCI_CLOCK_CONTROL) == 0) {
> >> + sdhci_writew(host, 0xBC01, SDHCI_CLOCK_CONTROL);
> >> + mmiowb();
> >> + }
> >
> >Can you explain the mmiowb call here?
>
> This came from the original 3.0 based driver. It's trying to be a
> write memory barrier. It wants to ensure the clock control change
> actually happened before the following code.
> I'll change it to a regular wmb in next version.
Note that with 'readw'/writew', you shouldn't need any extra barriers.
If sdhci_writew() is readw_relaxed(), wmb() is the correct barrier.
> >> +
> >> + if (!of_property_read_u32(pdev->dev.of_node, "bus-width", &bus_width))
> >{
> >> + switch (bus_width) {
> >> + case 8:
> >> + dev_info(dev, "Applying 8 bit bus width\n");
> >> + host->mmc->caps |= MMC_CAP_8_BIT_DATA;
> >> + break;
> >> + case 4:
> >> + dev_info(dev, "Applying 4 bit bus width\n");
> >> + host->mmc->caps |= MMC_CAP_4_BIT_DATA;
> >> + break;
> >> + case 1:
> >> + default:
> >> + dev_err(dev, "Invalid bus width: %u\n", bus_width);
> >> + break;
> >> + }
> >> + }
> >
> >This should probably be done in generic sdhci code somewhere. How about
> >adding it to sdhci_get_of_property instead_
>
> I should use generic mmc_of_parse for it. I'll update it in next version.
Ah right, I thought we had this in common code already but couldn't find
it. Using mmc_of_parse() is definitely the correct solution here.
> >> + priv->clk_sd4 = clk_get(&pdev->dev, "sd_sd4clk");
> >> + if (!IS_ERR(priv->clk_sd4)) {
> >> + ret = clk_prepare_enable(priv->clk_sd4);
> >> + if (ret < 0) {
> >> + dev_err(dev, "Failed to enable sd4 clock: %d\n", ret);
> >> + goto err_clk1;
> >> + }
> >> + }
> >> + priv->clk_b = clk_get(&pdev->dev, "sd_bclk");
> >> + if (!IS_ERR(priv->clk_b)) {
> >> + ret = clk_prepare_enable(priv->clk_b);
> >> + if (ret < 0) {
> >> + dev_err(dev, "Failed to enable clk_b clock: %d\n", ret);
> >> + goto err_clk2;
> >> + }
> >> + }
> >
> >Please pick clock names that match what some of the other drivers use.
>
> I'll use "iface" and "core" for clock names because they match what used
> in sdhci-msm driver.
Ok, makes sense.
Arnd
next prev parent reply other threads:[~2014-07-16 10:10 UTC|newest]
Thread overview: 44+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <message-id-of-cover-letter>
2014-07-13 6:28 ` [PATCH 1/8] ARM: Add platform support for Fujitsu MB86S7X SoCs Mollie Wu
[not found] ` <1405232911-4569-1-git-send-email-mollie.wu-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
2014-07-14 13:33 ` Arnd Bergmann
2014-07-15 17:37 ` Jassi Brar
[not found] ` <CAJe_Zhc9MVrX_Yi_u91qeSCWdO65MqEro=eQ1U_nWPfzM0ayjw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2014-07-15 20:09 ` Arnd Bergmann
2014-07-17 13:32 ` Jassi Brar
[not found] ` <CAJe_Zhc91g1=CTJUBaFaqk9Np4u4oEqddZEx_zeVxn7EdMEjmw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2014-07-17 13:48 ` Arnd Bergmann
2014-07-17 16:54 ` Jassi Brar
2014-07-17 17:12 ` Arnd Bergmann
2014-07-15 15:11 ` Rob Herring
[not found] ` <CAL_JsqKvwxjEDZPVwL646PhPKr7oemBzxr6cZ+X=uJQ2u_XZ8g-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2014-07-15 16:11 ` Nicolas Pitre
2014-07-15 18:03 ` Jassi Brar
2014-07-16 5:52 ` Andy Green
2014-07-15 17:05 ` Nicolas Pitre
[not found] ` <alpine.LFD.2.11.1407151214070.3647-fMhRO7WWcppj+hNMo8g0rg@public.gmane.org>
2014-07-15 18:16 ` Jassi Brar
2014-07-13 6:29 ` [PATCH 2/8] mmc: sdhci: host: add new f_sdh30 Mollie Wu
2014-07-14 14:04 ` Arnd Bergmann
2014-07-16 9:35 ` Vincent.Yang
2014-07-16 10:10 ` Arnd Bergmann [this message]
2014-07-16 11:07 ` Vincent.Yang
2014-07-13 6:30 ` [PATCH 4/8] clk: Add clock driver for mb86s7x Mollie Wu
[not found] ` <1405233052-4688-1-git-send-email-mollie.wu-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
2014-07-14 14:08 ` Arnd Bergmann
2014-07-16 7:09 ` Jassi Brar
2014-07-13 6:31 ` [PATCH 5/8] pinctrl: add driver for MB86S7x Mollie Wu
[not found] ` <1405233067-4725-1-git-send-email-mollie.wu-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
2014-07-22 16:11 ` Linus Walleij
[not found] ` <CACRpkdb_NC7j=XkbMPv8YYLSeEd1AOpFqmD8x+ohC7ds3cPCfg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2014-07-24 18:04 ` Jassi Brar
[not found] ` <CAJe_Zhc2gz8DZjzo-4YAucAZ2P=UamZ2MtTP1fHmxC0vspZJDw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2014-08-08 12:42 ` Linus Walleij
2014-08-22 7:46 ` Jassi Brar
[not found] ` <CAJe_Zhe2VuzHtkojm9nxvDTjT4AL7Znvma+5T7JTadvFJ1vAJQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2014-08-27 16:58 ` Jassi Brar
2014-09-03 9:17 ` Linus Walleij
2014-07-13 6:31 ` [PATCH 6/8] net: ethernet driver: Fujitsu OGMA Mollie Wu
2014-07-14 9:06 ` Tobias Klauser
2014-07-14 10:36 ` Andy Green
2014-07-14 13:50 ` Arnd Bergmann
2014-07-14 14:00 ` Andy Green
2014-07-13 6:32 ` [PATCH 7/8] mailbox: f_mhu: add driver for Fujitsu MHU controller Mollie Wu
[not found] ` <1405233128-4799-1-git-send-email-mollie.wu-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
2014-07-16 17:37 ` Sudeep Holla
[not found] ` <53C6B83D.80602-5wv7dgnIgG8@public.gmane.org>
2014-07-17 6:25 ` Jassi Brar
2014-07-17 10:31 ` Sudeep Holla
[not found] ` <53C7A5F1.30209-5wv7dgnIgG8@public.gmane.org>
2014-07-17 12:56 ` Jassi Brar
[not found] ` <CAJe_ZhegVczzcRVikt=nWnwU3nGx2G2mNg9nGR3bF4FfHnPeEg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2014-07-17 15:09 ` Sudeep Holla
[not found] ` <53C7E71C.8020501-5wv7dgnIgG8@public.gmane.org>
2014-07-17 17:07 ` Jassi Brar
[not found] ` <CAJe_ZhcROjhXebJetyJus43jNKoBU60jXXRLwnHwMdPJ7LPq7Q-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2014-07-17 18:51 ` Sudeep Holla
[not found] ` <53C81B3E.2020503-5wv7dgnIgG8@public.gmane.org>
2014-07-18 9:06 ` Jassi Brar
2014-07-13 6:32 ` =?y?q?=5BPATCH=208/8=5D=20of=3A=20add=20Fujitsu=20vendor=20prefix?= Mollie Wu
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=5526913.sJ4RMkanr6@wuerfel \
--to=arnd@arndb.de \
--cc=Vincent.Yang@tw.fujitsu.com \
--cc=andy.green@linaro.org \
--cc=anton@enomsg.org \
--cc=chris@printf.net \
--cc=devicetree@vger.kernel.org \
--cc=jaswinder.singh@linaro.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-mmc@vger.kernel.org \
--cc=linux@arm.linux.org.uk \
--cc=mark.rutland@arm.com \
--cc=mollie.wu@linaro.org \
--cc=olof@lixom.net \
--cc=patches@linaro.org \
--cc=pawel.moll@arm.com \
--cc=robh+dt@kernel.org \
--cc=t.takinishi@jp.fujitsu.com \
/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).