From: Geert Uytterhoeven <geert@linux-m68k.org>
To: Ulf Hansson <ulf.hansson@linaro.org>
Cc: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>,
"linux-mmc@vger.kernel.org" <linux-mmc@vger.kernel.org>,
"linux-renesas-soc@vger.kernel.org"
<linux-renesas-soc@vger.kernel.org>
Subject: Re: [PATCH/RFC] mmc: core: Issue power_off_notify for eMMC Suspend-to-RAM
Date: Mon, 8 Jun 2020 14:36:28 +0200 [thread overview]
Message-ID: <CAMuHMdXK2QkxMr3Lh6JnAh9RzHm4-CwpO_GLjD0+Vh-cM5a7nw@mail.gmail.com> (raw)
In-Reply-To: <CAPDyKFrcENub_NCP5s0v+3A09O55qGrK+gNrVswYjdqoLzPVzA@mail.gmail.com>
Hi Ulf,
On Mon, Jun 8, 2020 at 1:47 PM Ulf Hansson <ulf.hansson@linaro.org> wrote:
> On Mon, 8 Jun 2020 at 12:39, Yoshihiro Shimoda
> <yoshihiro.shimoda.uh@renesas.com> wrote:
> > > From: Ulf Hansson, Sent: Monday, June 8, 2020 5:14 PM
> > > On Thu, 4 Jun 2020 at 14:17, Yoshihiro Shimoda
> > > <yoshihiro.shimoda.uh@renesas.com> wrote:
> > > > > From: Yoshihiro Shimoda, Sent: Tuesday, May 19, 2020 8:33 PM
> > > > >
> > > > > The commit 432356793415 ("mmc: core: Enable power_off_notify for
> > > > > eMMC shutdown sequence") enabled the power off notification
> > > > > even if MMC_CAP2_POWEROFF_NOTIFY (MMC_CAP2_FULL_PWR_CYCLE now) is
> > > > > not set. However, the mmc core lacks to issue the power off
> > > > > notificaiton when Suspend-to-{RAM,Disk} happens on the system.
> > > > >
> > > > > So, add Suspend-to-RAM support at first because this is easy to
> > > > > check by using pm_suspend_target_state condition on _mmc_suspend().
> > > > >
> > > > > Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
> > > >
> > > > I'd like to add more detail why this patch is needed.
> > > > I think we should think some events (which are Shutdown, Suspend-to-idle,
> > > > Suspend-to-RAM) for the Power off Notification control.
> > > > I described these events like below.
> > > >
> > > > Assumption of the host : MMC_CAP2_FULL_PWR_CYCLE=false
> > > > Assumption of the eMMC : in POWERED_ON
> > > >
> > > > 1) Event : Shutdown
> > > > - power : going to VCC=OFF & VCCQ=OFF
> > > > - ideal : Either POWER_OFF_LONG or POWER_OFF_SHORT
> > > > - current : POWER_OFF_LONG --> Perfect
> > > > - Remarks : the commit 432356793415
> > > >
> > > > 2) Event : Suspend-to-Idle
> > > > - power : Keep VCC=ON & VCCQ=ON
> > > > - ideal : issue MMC_SLEEP_AWAKE and keep the power (because the host could not change VCC=OFF)
> > > > - current : issue MMC_SLEEP_AWAKE and keep the power --> Perfect
> > > > - Remarks : IIUC, even if the eMMC is in POWERED_ON, a host can issue CMD5 (sleep).
> > >
> > > As a matter of fact, VCCQ *must* remain on in sleep state, while VCC
> > > can be powered off.
> >
> > I got it.
> >
> > > >
> > > > 3) Event : Suspend-to-RAM
> > > > - power : going to VCC=OFF & VCCQ=OFF
> > >
> > > I don't understand why you think S2R should be treated differently
> > > from S2I? At least from the MMC subsystem point of view, there is no
> > > difference. No?
> >
> > On my environment, VCC & VCCQ condition differs like below.
> > S2I: VCC=ON & VCCQ=ON
> > S2R: VCC=OFF & VCCQ=OFF
>
> Can you explain why it differs? Who is managing the regulators and who
> decides to turn them off?
The firmware does, through PSCI system suspend.
And what it does exactly is not standardized.
Perhaps we do need an "arm,psci-system-suspend-is-power-down"[1]
DT property?
> Perhaps this is a regulator-enable usage count problem?
Unfortunately not. Else we could fix it :-)
[1] "[PATCH/RFC 4/6] drivers: firmware: psci: Fix non-PMIC wake-up if
SYSTEM_SUSPEND cuts power"
https://lore.kernel.org/linux-arm-kernel/1487622809-25127-5-git-send-email-geert+renesas@glider.be/
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org
In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds
next prev parent reply other threads:[~2020-06-08 12:36 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-05-19 11:33 [PATCH/RFC] mmc: core: Issue power_off_notify for eMMC Suspend-to-RAM Yoshihiro Shimoda
2020-06-04 12:17 ` Yoshihiro Shimoda
2020-06-08 8:14 ` Ulf Hansson
2020-06-08 10:39 ` Yoshihiro Shimoda
2020-06-08 11:45 ` Ulf Hansson
2020-06-08 12:36 ` Geert Uytterhoeven [this message]
2020-06-08 14:50 ` Ulf Hansson
2020-06-09 10:29 ` Yoshihiro Shimoda
2020-06-08 7:57 ` Ulf Hansson
2020-06-08 10:38 ` Yoshihiro Shimoda
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=CAMuHMdXK2QkxMr3Lh6JnAh9RzHm4-CwpO_GLjD0+Vh-cM5a7nw@mail.gmail.com \
--to=geert@linux-m68k.org \
--cc=linux-mmc@vger.kernel.org \
--cc=linux-renesas-soc@vger.kernel.org \
--cc=ulf.hansson@linaro.org \
--cc=yoshihiro.shimoda.uh@renesas.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).