linux-mmc.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Tony Lindgren <tony@atomide.com>
To: Ulf Hansson <ulf.hansson@linaro.org>
Cc: Adrian Hunter <adrian.hunter@intel.com>,
	Chunyan Zhang <zhang.chunyan@linaro.org>,
	Faiz Abbas <faiz_abbas@ti.com>,
	Kishon Vijay Abraham I <kishon@ti.com>,
	Santosh Shilimkar <ssantosh@kernel.org>,
	linux-mmc <linux-mmc@vger.kernel.org>,
	linux-omap <linux-omap@vger.kernel.org>,
	Rob Herring <robh@kernel.org>, DTML <devicetree@vger.kernel.org>
Subject: Re: [PATCH 4/6] mmc: sdhci-omap: Implement PM runtime functions
Date: Fri, 15 Oct 2021 12:34:46 +0300	[thread overview]
Message-ID: <YWlLNn0yN2r1xDSq@atomide.com> (raw)
In-Reply-To: <CAPDyKFq_jiYPrm_kcprijFfcceVVGnZpkG+4ZY_XSBXJnCT0LA@mail.gmail.com>

* Ulf Hansson <ulf.hansson@linaro.org> [211012 15:17]:
> On Tue, 12 Oct 2021 at 12:38, Tony Lindgren <tony@atomide.com> wrote:
> > @@ -1350,15 +1355,21 @@ static int sdhci_omap_probe(struct platform_device *pdev)
> >         if (ret)
> >                 goto err_cleanup_host;
> >
> > +       sdhci_omap_context_save(omap_host);
> 
> Calling sdhci_omap_context_save() here looks unnecessary. The device
> is already runtime resumed at this point.
> 
> In other words, sdhci_omap_context_save() will be called from the
> ->runtime_suspend() callback, next time the device becomes runtime
> suspended. That should be sufficient, right?

Yup this can be now dropped with omap_host->con initialized to
-EINVAL earlier.

> > @@ -1371,8 +1382,12 @@ static int sdhci_omap_remove(struct platform_device *pdev)
> >         struct device *dev = &pdev->dev;
> >         struct sdhci_host *host = platform_get_drvdata(pdev);
> >
> > +       pm_runtime_get_sync(dev);
> >         sdhci_remove_host(host, true);
> > +       pm_runtime_dont_use_autosuspend(dev);
> >         pm_runtime_put_sync(dev);
> > +       /* Ensure device gets idled despite userspace sysfs config */
> > +       pm_runtime_force_suspend(dev);
> >         pm_runtime_disable(dev);
> 
> The call to pm_runtime_disable() can be removed, as that is taken care
> of in pm_runtime_force_suspend().

OK

> > +static int __maybe_unused sdhci_omap_suspend(struct device *dev)
> > +{
> > +       struct sdhci_host *host = dev_get_drvdata(dev);
> > +       int err;
> > +
> > +       /* Enable for configuring wakeups, paired in resume */
> > +       err = pm_runtime_resume_and_get(dev);
> > +       if (err < 0)
> > +               return err;
> > +
> > +       sdhci_suspend_host(host);
> 
> As far as I can tell, sdhci_suspend_host() doesn't really make sense
> for the omap variant. What you need, is to put the device into the
> same low power state as "runtime suspend", that should be sufficient.
> 
> The system wakeup will be armed (and later then disarmed) by the PM
> core, when it calls device_wakeup_arm_wake_irqs() from the
> dpm_suspend_noirq() phase.
> 
> In other words, pointing the system suspend/resume callbacks to
> pm_runtime_force_suspend|resume() should work fine, I think.

OK sounds good to me.

Regards,

Tony

  reply	other threads:[~2021-10-15  9:34 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-10-12 10:37 [PATCHv3 0/6] More SoCs for sdhci-omap to deprecate omap_hsmmc Tony Lindgren
2021-10-12 10:37 ` [PATCH 1/6] dt-bindings: sdhci-omap: Update binding for legacy SoCs Tony Lindgren
2021-10-12 10:37 ` [PATCH 2/6] mmc: sdhci-omap: Handle voltages to add support omap4 Tony Lindgren
2021-10-12 14:16   ` kernel test robot
2021-10-12 10:37 ` [PATCH 3/6] mmc: sdhci-omap: Add omap_offset to support omap3 and earlier Tony Lindgren
2021-10-12 10:37 ` [PATCH 4/6] mmc: sdhci-omap: Implement PM runtime functions Tony Lindgren
2021-10-12 15:11   ` kernel test robot
2021-10-12 15:16   ` Ulf Hansson
2021-10-15  9:34     ` Tony Lindgren [this message]
2021-10-12 10:37 ` [PATCH 5/6] sdhci: omap: Enable aggressive PM Tony Lindgren
2021-10-12 14:14   ` Ulf Hansson
2021-10-12 10:37 ` [PATCH 6/6] mmc: sdhci-omap: Configure optional wakeirq Tony Lindgren
2021-10-12 15:02   ` Ulf Hansson
2021-10-15 10:47 [PATCHv4 0/6] More SoCs for sdhci-omap to deprecate omap_hsmmc Tony Lindgren
2021-10-15 10:47 ` [PATCH 4/6] mmc: sdhci-omap: Implement PM runtime functions Tony Lindgren

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=YWlLNn0yN2r1xDSq@atomide.com \
    --to=tony@atomide.com \
    --cc=adrian.hunter@intel.com \
    --cc=devicetree@vger.kernel.org \
    --cc=faiz_abbas@ti.com \
    --cc=kishon@ti.com \
    --cc=linux-mmc@vger.kernel.org \
    --cc=linux-omap@vger.kernel.org \
    --cc=robh@kernel.org \
    --cc=ssantosh@kernel.org \
    --cc=ulf.hansson@linaro.org \
    --cc=zhang.chunyan@linaro.org \
    --subject='Re: [PATCH 4/6] mmc: sdhci-omap: Implement PM runtime functions' \
    /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

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).