linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: jszhang@marvell.com (Jisheng Zhang)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v2 2/5] mmc: sdhci-pxav3: enable usage of DAT3 pin as HW card detect
Date: Mon, 12 Oct 2015 10:52:12 +0800	[thread overview]
Message-ID: <20151012105212.504a4ab1@xhacker> (raw)
In-Reply-To: <CAPv3WKcPAieXFBWD9m2LLZLaiUprh83ySB9LCG2DyAq5p-RT=A@mail.gmail.com>

Hi Marcin,

On Sat, 10 Oct 2015 14:13:51 +0200
Marcin Wojtas <mw@semihalf.com> wrote:

> Hi Jisheng,
> 
> 
> >>
> >> >>
> >> >> When using DAT3-based detection Armada 38x SDIO IP expects its internal
> >> >> clock to be always on, which had to be ensured twofold:
> >> >
> >> > What happen if runtime suspend disables its core clk and axi clk? I guess
> >> > dat3-based detection isn't compatible with runtime pm. If so, do we also
> >> > need to disable runtime pm in probe function?
> >>
> >> Is runtime resume supposed to be triggered by card detection? Is there
> >
> > I think so. Take marvell berlin for example, card insert => gpio interrupt
> > or => sdhci runtime resume.
> >
> >> a way to manually trigger runtime suspend and resume of sdhci? Anyway
> >
> > If runtime-pm is builtin and the host driver supports runtime-pm (sdhci-pxav3
> > supports runtime-pm well), when there's no sdhc transactions, runtime suspend
> > will be triggered automatically after some time (50ms?)
> >
> >> coreclk is not a problem, as it's not used by A38x.
> >
> > I checked A38x dts files, it's <&gateclk 17>. So the question is: what will
> > happen if <&gateclk 17> is disabled in runtime suspend? Is the dat3-based
> > CD still works? In theory, it should not work any more.
> >
> 
> Actually in pxav3 driver there is one obligatory clock ("io") which
> can be either named in dts on not (like in armada38x.dtsi). "coreclk"
> is optional, however all this does not matter, as both are disabled in

Hmm, grep the dts, I think commit 8afdc9cca27f ("mmc: sdhci-pxav3: Get optional
core clock") mainly targets for Marvell Berlin SoCs, but the two clks for sdhci
in Berlin SoCs are coreclk and axiclk, rather than ioclk and coreclk, during
which the axiclk is optional. Will cook one patch to fix this.

> runtime_suspend function. I think that when we disable the gate clock,
> dat3 detection won't work, but I guess that card detection is not the
> only thing that wakes up the mmc subsystem and make runtime_pm useful.

Card insert is not the only thing can wake up mmc, mmc initiate sdhc
transactions will also wake up mmc.

Thanks,
Jisheng

> 
> I will try to check how it works. If there's problem with detection I
> propose, in order not to spoil the code too much and not to loose all
> runtime_pm benefits, to avoid disabling/enabling clock in
> runtime_suspend/resume functions on a38x working with dat3 detection.
> In such case sdhci_runtime_suspend/resume would execute without
> problems and we will be sure that detection will work in such
> configuration.
> 
> Best regards,
> Marcin

  reply	other threads:[~2015-10-12  2:52 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-10-09  1:03 [PATCH v2 0/5] Armada 38x SDHCI driver improvements Marcin Wojtas
2015-10-09  1:03 ` [PATCH v2 1/5] mmc: sdhci-pxav3: enable proper resuming on Armada 38x SoC Marcin Wojtas
2015-10-09  1:03 ` [PATCH v2 2/5] mmc: sdhci-pxav3: enable usage of DAT3 pin as HW card detect Marcin Wojtas
2015-10-09 12:13   ` Jisheng Zhang
2015-10-09 13:46     ` Russell King - ARM Linux
2015-10-09 14:45     ` Marcin Wojtas
2015-10-10  7:05       ` Jisheng Zhang
2015-10-10 12:13         ` Marcin Wojtas
2015-10-12  2:52           ` Jisheng Zhang [this message]
2015-10-09  1:03 ` [PATCH v2 3/5] ARM: mvebu: set SW polling as SDHCI card detection on A388-GP Marcin Wojtas
2015-10-09  7:52   ` Thomas Petazzoni
2015-10-09 10:16     ` Marcin Wojtas
2015-10-09 13:46   ` Andrew Lunn
2015-10-09  1:03 ` [PATCH v2 4/5] mmc: sdhci: add init_card callback to sdhci Marcin Wojtas
2015-10-09  1:03 ` [PATCH v2 5/5] mmc: sdhci-pxav3: enable modifying MMC_CARD bit during card initialization Marcin Wojtas

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=20151012105212.504a4ab1@xhacker \
    --to=jszhang@marvell.com \
    --cc=linux-arm-kernel@lists.infradead.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).