From: Ulf Hansson <ulf.hansson@linaro.org> To: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com> Cc: Mark Rutland <mark.rutland@arm.com>, Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>, "linux-mmc@vger.kernel.org" <linux-mmc@vger.kernel.org>, Linux ARM <linux-arm-kernel@lists.infradead.org>, Linux-Renesas <linux-renesas-soc@vger.kernel.org> Subject: Re: [PATCH v3 2/2] mmc: core: Call mmc_poweroff_nofity() if pm_suspend_via_firmware() Date: Wed, 24 Jun 2020 12:05:19 +0200 [thread overview] Message-ID: <CAPDyKFq-dEPaU094hrk2xg18VpJAsbnf8enieFmcMhKiB1bW1A@mail.gmail.com> (raw) In-Reply-To: <1592792699-24638-3-git-send-email-yoshihiro.shimoda.uh@renesas.com> On Mon, 22 Jun 2020 at 04:25, Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com> wrote: > > If pm_suspend_via_firmware() returns true, the system will be able > to cut both vcc and vccq in the suspend. So, call > mmc_poweroff_nofity() if pm_suspend_via_firmware() returns true. > > Note that we should not update the MMC_CAP2_FULL_PWR_CYCLE caps > because the mmc_select_voltage() checks the caps when attaches > a mmc/sd. > > Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com> > --- > drivers/mmc/core/mmc.c | 4 +++- > 1 file changed, 3 insertions(+), 1 deletion(-) > > diff --git a/drivers/mmc/core/mmc.c b/drivers/mmc/core/mmc.c > index 4203303..81941fd 100644 > --- a/drivers/mmc/core/mmc.c > +++ b/drivers/mmc/core/mmc.c > @@ -11,6 +11,7 @@ > #include <linux/of.h> > #include <linux/slab.h> > #include <linux/stat.h> > +#include <linux/suspend.h> > #include <linux/pm_runtime.h> > > #include <linux/mmc/host.h> > @@ -2038,7 +2039,8 @@ static int _mmc_suspend(struct mmc_host *host, bool is_suspend) > goto out; > > if (mmc_can_poweroff_notify(host->card) && > - ((host->caps2 & MMC_CAP2_FULL_PWR_CYCLE) || !is_suspend)) > + ((host->caps2 & MMC_CAP2_FULL_PWR_CYCLE) || !is_suspend || > + pm_suspend_via_firmware())) Sorry, but this doesn't work. Even if PSCI is a generic FW interface, it doesn't mean that all PSCI implementations will cut the vcc and vccq for the MMC card at system suspend. Instead, you need to decide this based on some specific DT property. Perhaps in conjunction with using pm_suspend_via_firmware(). > err = mmc_poweroff_notify(host->card, notify_type); > else if (mmc_can_sleep(host->card)) > err = mmc_sleep(host); > -- > 2.7.4 > Kind regards Uffe
WARNING: multiple messages have this Message-ID (diff)
From: Ulf Hansson <ulf.hansson@linaro.org> To: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com> Cc: Mark Rutland <mark.rutland@arm.com>, Linux-Renesas <linux-renesas-soc@vger.kernel.org>, Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>, "linux-mmc@vger.kernel.org" <linux-mmc@vger.kernel.org>, Linux ARM <linux-arm-kernel@lists.infradead.org> Subject: Re: [PATCH v3 2/2] mmc: core: Call mmc_poweroff_nofity() if pm_suspend_via_firmware() Date: Wed, 24 Jun 2020 12:05:19 +0200 [thread overview] Message-ID: <CAPDyKFq-dEPaU094hrk2xg18VpJAsbnf8enieFmcMhKiB1bW1A@mail.gmail.com> (raw) In-Reply-To: <1592792699-24638-3-git-send-email-yoshihiro.shimoda.uh@renesas.com> On Mon, 22 Jun 2020 at 04:25, Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com> wrote: > > If pm_suspend_via_firmware() returns true, the system will be able > to cut both vcc and vccq in the suspend. So, call > mmc_poweroff_nofity() if pm_suspend_via_firmware() returns true. > > Note that we should not update the MMC_CAP2_FULL_PWR_CYCLE caps > because the mmc_select_voltage() checks the caps when attaches > a mmc/sd. > > Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com> > --- > drivers/mmc/core/mmc.c | 4 +++- > 1 file changed, 3 insertions(+), 1 deletion(-) > > diff --git a/drivers/mmc/core/mmc.c b/drivers/mmc/core/mmc.c > index 4203303..81941fd 100644 > --- a/drivers/mmc/core/mmc.c > +++ b/drivers/mmc/core/mmc.c > @@ -11,6 +11,7 @@ > #include <linux/of.h> > #include <linux/slab.h> > #include <linux/stat.h> > +#include <linux/suspend.h> > #include <linux/pm_runtime.h> > > #include <linux/mmc/host.h> > @@ -2038,7 +2039,8 @@ static int _mmc_suspend(struct mmc_host *host, bool is_suspend) > goto out; > > if (mmc_can_poweroff_notify(host->card) && > - ((host->caps2 & MMC_CAP2_FULL_PWR_CYCLE) || !is_suspend)) > + ((host->caps2 & MMC_CAP2_FULL_PWR_CYCLE) || !is_suspend || > + pm_suspend_via_firmware())) Sorry, but this doesn't work. Even if PSCI is a generic FW interface, it doesn't mean that all PSCI implementations will cut the vcc and vccq for the MMC card at system suspend. Instead, you need to decide this based on some specific DT property. Perhaps in conjunction with using pm_suspend_via_firmware(). > err = mmc_poweroff_notify(host->card, notify_type); > else if (mmc_can_sleep(host->card)) > err = mmc_sleep(host); > -- > 2.7.4 > Kind regards Uffe _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
next prev parent reply other threads:[~2020-06-24 10:05 UTC|newest] Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top 2020-06-22 2:24 [PATCH v3 0/2] treewide: fix _mmc_suspend() on PSCI Yoshihiro Shimoda 2020-06-22 2:24 ` [PATCH v3 1/2] firmware: psci: call pm_set_suspend_via_firmware() Yoshihiro Shimoda 2020-08-05 8:08 ` Geert Uytterhoeven 2020-08-05 8:08 ` Geert Uytterhoeven 2020-06-22 2:24 ` [PATCH v3 2/2] mmc: core: Call mmc_poweroff_nofity() if pm_suspend_via_firmware() Yoshihiro Shimoda 2020-06-24 10:05 ` Ulf Hansson [this message] 2020-06-24 10:05 ` Ulf Hansson 2020-06-24 11:13 ` Geert Uytterhoeven 2020-06-24 11:13 ` Geert Uytterhoeven 2020-06-25 6:31 ` Yoshihiro Shimoda 2020-06-25 6:31 ` Yoshihiro Shimoda 2020-06-25 9:26 ` Geert Uytterhoeven 2020-06-25 9:26 ` Geert Uytterhoeven 2020-06-26 11:03 ` Ulf Hansson 2020-06-26 11:03 ` Ulf Hansson 2020-07-02 12:37 ` Yoshihiro Shimoda 2020-07-02 12:37 ` Yoshihiro Shimoda 2020-07-06 13:10 ` Ulf Hansson 2020-07-06 13:10 ` Ulf Hansson 2020-07-07 1:26 ` Yoshihiro Shimoda 2020-07-07 1:26 ` 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=CAPDyKFq-dEPaU094hrk2xg18VpJAsbnf8enieFmcMhKiB1bW1A@mail.gmail.com \ --to=ulf.hansson@linaro.org \ --cc=linux-arm-kernel@lists.infradead.org \ --cc=linux-mmc@vger.kernel.org \ --cc=linux-renesas-soc@vger.kernel.org \ --cc=lorenzo.pieralisi@arm.com \ --cc=mark.rutland@arm.com \ --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: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.