public inbox for linux-mmc@vger.kernel.org
 help / color / mirror / Atom feed
From: Chaotian Jing <chaotian.jing-NuS5LvNUpcJWk0Htik3J/w@public.gmane.org>
To: Ulf Hansson <ulf.hansson-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
Cc: "Mark Rutland" <mark.rutland-5wv7dgnIgG8@public.gmane.org>,
	"James Liao"
	<jamesjj.liao-NuS5LvNUpcJWk0Htik3J/w@public.gmane.org>,
	"Arnd Bergmann" <arnd-r2nGTMty4D4@public.gmane.org>,
	srv_heupstream
	<srv_heupstream-NuS5LvNUpcJWk0Htik3J/w@public.gmane.org>,
	"devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org"
	<devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
	"Hongzhou Yang"
	<hongzhou.yang-NuS5LvNUpcJWk0Htik3J/w@public.gmane.org>,
	"Catalin Marinas" <catalin.marinas-5wv7dgnIgG8@public.gmane.org>,
	"Bin Zhang (章斌)"
	<bin.zhang-NuS5LvNUpcJWk0Htik3J/w@public.gmane.org>,
	linux-mmc <linux-mmc-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
	"Chris Ball" <chris-OsFVWbfNK3isTnJN9+BGXg@public.gmane.org>,
	"Will Deacon" <will.deacon-5wv7dgnIgG8@public.gmane.org>,
	"linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org"
	<linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
	"linux-gpio-u79uwXL29TY76Z2rM5mHXA@public.gmane.org"
	<linux-gpio-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
	"Rob Herring" <robh+dt-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>,
	linux-mediatek-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org,
	"Sascha Hauer" <kernel-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>,
	"Matthias Brugger"
	<matthias.bgg-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>,
	"Joe.C" <yingjoe.chen-NuS5LvNUpcJWk0Htik3J/w@public.gmane.org>,
	"Eddie Huang"
	<eddie.huang-NuS5LvNUpcJWk0Htik3J/w@public.gmane.org>
Subject: Re: [PATCH v3 2/7] mmc: mediatek: Add Mediatek MMC driver
Date: Thu, 7 May 2015 09:42:36 +0800	[thread overview]
Message-ID: <1430962956.15154.48.camel@mhfsdcap03> (raw)
In-Reply-To: <CAPDyKFr+FTXAzYVn3F41dmw2zW01pSbSHPfGJHXbUFLJfvQ5CA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>

Dear Ulf,

Thanks!
Below is my comment:

On Wed, 2015-05-06 at 18:31 +0200, Ulf Hansson wrote:
> On 6 May 2015 at 08:54, chaotian.jing <chaotian.jing-NuS5LvNUpcJWk0Htik3J/w@public.gmane.org> wrote:
> > Dear Ulf,
> >
> > Thanks for your review.
> > I must do a explain of our MMC host:
> > Source clock is source clock of the MMC bus, MMC host has a divider to
> > get different bus clock frequency. now the runtime suspend is gating
> > this clock.
> >
> > Hclk is the power domain of the MMC host, if Hclk is gated, the MMC host
> > cannot work(all registers readout is zero). and, all registers would be
> > reset to default value if Hclk is gated/ungated.
> > At MT8173, MSDC0 and MSDC2 has independent Hclk, MSDC1 and MSDC3's Hclk
> > was controlled by "Infra module".
Sorry for mistake, MSDC0 and MSDC3 has independent Hclk, MSDC1 and
MSDC2's Hclk was controlled by "Infra module". the Infra module is a
"power saving module", when the system go to sleep, Infra module will be
set and MSDC1 & MSDC2's Hclk will be gated automatically.
> 
> Thanks for clarifying!
> 
> I don't have enough knowledge about your SoC to understand the detail,
> but it seems like we are mixing clocks and power domains. I would
> rather keep this separate - if the HW allows it.
> 
> I guess the key question I have is the following:
> 1) Is it hardware wise possible to gate the hclk, but without gating
> the power domain?
> 2) At what level is the reference counting done for each device in the
> power domain? In HW or in sofftware?
> 

Actually, Our MMC host do not have power domain, all the control of the
host is the Hclk.
> >
> > And, our MMC host has ability to control the gate/ungate of bus clock
> > automatically, in MSDC_CFG bit 1, if this bit is set to 0, then "bus
> > clock is gated to 0 if no command or data is transmitted".
> > So, if the runtime PM do not control the Source clock, Hclk, then the
> > runtime PM is needless.
> >
> > if runtime PM do gate/ungate Hclk, then need do save/restore the
> > registers meanwhile.
> 
> Yes agree, that's a common thing to deal with from runtime PM callbacks.
> That means that the runtime PM need gate/ungate source clock and Hclk ?
If it is, then need do save registers before gate Hclk and restore
registers after ungate Hclk.
> >
> > So, how about your suggestion ?
> > do we still need runtime PM ?
> 
> Yes, I definitely think you need it!
> 
> Kind regards
> Uffe

  parent reply	other threads:[~2015-05-07  1:42 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-04-28  9:48 [PATCH v3 0/7] Add Mediatek MMC driver Chaotian Jing
     [not found] ` <1430214525-19198-1-git-send-email-chaotian.jing-NuS5LvNUpcJWk0Htik3J/w@public.gmane.org>
2015-04-28  9:48   ` [PATCH v3 1/7] mmc: dt-bindings: add Mediatek MMC bindings Chaotian Jing
2015-04-28  9:48   ` [PATCH v3 2/7] mmc: mediatek: Add Mediatek MMC driver Chaotian Jing
2015-05-05 12:49     ` Ulf Hansson
     [not found]       ` <CAPDyKFq=R9B6ZHHgmDcSg-TNSfqQKAUKc2NjACvpwxFpmk954g-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2015-05-06  6:54         ` chaotian.jing
2015-05-06 16:31           ` Ulf Hansson
     [not found]             ` <CAPDyKFr+FTXAzYVn3F41dmw2zW01pSbSHPfGJHXbUFLJfvQ5CA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2015-05-07  1:42               ` Chaotian Jing [this message]
2015-05-08 12:12                 ` Ulf Hansson
     [not found]                   ` <CAPDyKFr5N_08HbLuY=4Wfv1BoVQLVR-VW+NKh_umL1hzi_KozA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2015-05-11  9:18                     ` Chaotian Jing
2015-05-11 10:29                       ` Ulf Hansson
     [not found]                         ` <CAPDyKFqeAzjpbZsyfcwb_WarC=dzoCsEeLTmxAbtvOo3Y4cYyg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2015-05-17  9:40                           ` Chaotian Jing
2015-04-28  9:48   ` [PATCH v3 3/7] mmc: mediatek: Add PM support for " Chaotian Jing
2015-05-05 12:57     ` Ulf Hansson
2015-04-28  9:48   ` [PATCH v3 4/7] arm64: dts: mediatek: Add MT8173 MMC dts Chaotian Jing
2015-04-29  6:37     ` Sascha Hauer
2015-04-28  9:48   ` [PATCH v3 5/7] arm64: mediatek: Add Mediatek MMC support in defconfig Chaotian Jing
2015-04-28  9:48   ` [PATCH v3 6/7] ARM: mediatek: dts: Add emmc support to mt8135 Chaotian Jing
     [not found]     ` <1430214525-19198-7-git-send-email-chaotian.jing-NuS5LvNUpcJWk0Htik3J/w@public.gmane.org>
2015-04-28 12:37       ` Sascha Hauer
2015-04-28  9:48   ` [PATCH 7/7] ARM: multi_v7_defconfig: Enable Mediatek MMC support multi-v7 Chaotian Jing

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=1430962956.15154.48.camel@mhfsdcap03 \
    --to=chaotian.jing-nus5lvnupcjwk0htik3j/w@public.gmane.org \
    --cc=arnd-r2nGTMty4D4@public.gmane.org \
    --cc=bin.zhang-NuS5LvNUpcJWk0Htik3J/w@public.gmane.org \
    --cc=catalin.marinas-5wv7dgnIgG8@public.gmane.org \
    --cc=chris-OsFVWbfNK3isTnJN9+BGXg@public.gmane.org \
    --cc=devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=eddie.huang-NuS5LvNUpcJWk0Htik3J/w@public.gmane.org \
    --cc=hongzhou.yang-NuS5LvNUpcJWk0Htik3J/w@public.gmane.org \
    --cc=jamesjj.liao-NuS5LvNUpcJWk0Htik3J/w@public.gmane.org \
    --cc=kernel-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org \
    --cc=linux-gpio-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=linux-mediatek-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org \
    --cc=linux-mmc-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=mark.rutland-5wv7dgnIgG8@public.gmane.org \
    --cc=matthias.bgg-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
    --cc=robh+dt-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org \
    --cc=srv_heupstream-NuS5LvNUpcJWk0Htik3J/w@public.gmane.org \
    --cc=ulf.hansson-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org \
    --cc=will.deacon-5wv7dgnIgG8@public.gmane.org \
    --cc=yingjoe.chen-NuS5LvNUpcJWk0Htik3J/w@public.gmane.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