From: Adrian Hunter <adrian.hunter@intel.com>
To: "Sven van Ashbrook" <svenva@chromium.org>,
"Kornel Dulęba" <korneld@chromium.org>
Cc: "Ulf Hansson" <ulf.hansson@linaro.org>,
"Jason Lai" <jasonlai.genesyslogic@gmail.com>,
"Victor Shih" <victor.shih@genesyslogic.com.tw>,
"Ben Chuang" <ben.chuang@genesyslogic.com.tw>,
"Stanisław Kardach" <skardach@google.com>,
linux-kernel@vger.kernel.org, linux-mmc@vger.kernel.org,
stable@vger.kernel.org, "Rafael J Wysocki" <rafael@kernel.org>
Subject: Re: [PATCH] mmc: sdhci-pci-gli: Disable LPM during initialization
Date: Tue, 14 Nov 2023 12:26:24 +0200 [thread overview]
Message-ID: <fc7ac047-e604-4a1a-a850-de1d44189565@intel.com> (raw)
In-Reply-To: <CAG-rBiiXPzcMndhvT=vV7W--6i0O+26hgMcHL3wbCyKrnw6LsQ@mail.gmail.com>
On 10/11/23 18:58, Sven van Ashbrook wrote:
> There's something happening in this driver that doesn't
> make much sense to me.
>
> According to the pm runtime docs [1] the initial runtime pm
> status of all devices is 'suspended'. Which I presume, means:
> if the driver doesn't use any of the pm_runtime_*() functions
> to tell the core "actually, I am active after probe", then the
> device remains suspended until explicitly going active, at which
> point the runtime_resume() callback is invoked.
>
> That's the theory. In practice, what do I see on a device
> containing this bridge?
> Intel SoC <-> PCIe bus <-> gl9763e bridge <-> eMMC bus <-> eMMC drive
>
> at probe() (does not exist in this driver so I stubbed it):
> [ 0.601542] runtime pm is enabled = 1 (disable_depth == 0)
> [ 0.601552] runtime pm is active = 2 (usage_count)
>
> at probe_slot():
> [ 0.602024] runtime pm is enabled = 1
> [ 0.602027] runtime pm is active = 2
>
> At add_host():
> [ 0.602804] runtime pm is enabled = 1
> [ 0.602809] runtime pm is active = 3
>
> It looks like:
> - nowhere does the gl9763e driver inform runtime pm it's active
PCI subsystem does it in pci_pm_init()
> - the device is active in probe(), probe_slot() and add_host()
> - the runtime_resume() callback did not get called before
> probe(), probe_slot(), or add_host().
>
> Why is the runtime_resume() callback not invoked?
Most drivers expect the device to be active at probe(). How it
gets that way is up to the bus. Note, the driver may call
pm_runtime_set_active() but that doesn't call runtime_resume().
> Does the driver have a runtime_pm misconfiguration issue here?
No
>
> Perhaps Rafael could clarify?
>
> [1] https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/tree/Documentation/power/runtime_pm.rst?h=v6.6.1#n563
next prev parent reply other threads:[~2023-11-14 10:26 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-11-09 11:19 [PATCH] mmc: sdhci-pci-gli: Disable LPM during initialization Kornel Dulęba
2023-11-09 19:19 ` Sven van Ashbrook
2023-11-10 8:26 ` Kornel Dulęba
2023-11-10 16:58 ` Sven van Ashbrook
2023-11-14 10:26 ` Adrian Hunter [this message]
2023-11-09 19:23 ` Sven van Ashbrook
2023-11-14 10:46 ` Adrian Hunter
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=fc7ac047-e604-4a1a-a850-de1d44189565@intel.com \
--to=adrian.hunter@intel.com \
--cc=ben.chuang@genesyslogic.com.tw \
--cc=jasonlai.genesyslogic@gmail.com \
--cc=korneld@chromium.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mmc@vger.kernel.org \
--cc=rafael@kernel.org \
--cc=skardach@google.com \
--cc=stable@vger.kernel.org \
--cc=svenva@chromium.org \
--cc=ulf.hansson@linaro.org \
--cc=victor.shih@genesyslogic.com.tw \
/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