From: Sascha Hauer <s.hauer@pengutronix.de>
To: Christian Eggers <ceggers@arri.de>
Cc: Mark Brown <broonie@kernel.org>, Shawn Guo <shawnguo@kernel.org>,
Pengutronix Kernel Team <kernel@pengutronix.de>,
Fabio Estevam <festevam@gmail.com>,
NXP Linux Team <linux-imx@nxp.com>,
linux-spi@vger.kernel.org, linux-arm-kernel@lists.infradead.org,
linux-kernel@vger.kernel.org, Clark Wang <xiaoning.wang@nxp.com>
Subject: Re: [PATCH] spi: imx: Revert "spi: imx: enable runtime pm support"
Date: Mon, 12 Oct 2020 15:28:21 +0200 [thread overview]
Message-ID: <20201012132821.GE11648@pengutronix.de> (raw)
In-Reply-To: <2670390.HS4A6M72fu@n95hx1g2>
On Mon, Oct 12, 2020 at 12:59:34PM +0200, Christian Eggers wrote:
> Hi Sascha,
>
> On Friday, 9 October 2020, 09:39:44 CEST, Sascha Hauer wrote:
> > On Fri, Oct 09, 2020 at 06:27:38AM +0200, Christian Eggers wrote:
> > > This reverts commit 525c9e5a32bd7951eae3f06d9d077fea51718a6c.
> > >
> > > If CONFIG_PM is disabled, the system completely freezes on probe as
> > > nothing enables the clock of the SPI peripheral.
> >
> > Instead of reverting it, why not just fix it?
> >
> > Normally the device should be brought to active state manually in probe
> > before pm_runtime takes over, then CONFIG_PM disabled doesn't hurt.
> > Using pm_runtime to put the device to active state initially has the
> > problem you describe.
>
> prior introducing runtime pm for spi-imx, the clock was "manually" enabled and
> disabled around each transfer (so the power usage should already have been
> optimal). If we would manually enable the clock in probe() as you suggested,
> for users without CONFIG_PM there would be a drawback compared with the
> previous state (as the clock will always be on now).
>
> What is the benefit of controlling the SPI clock with runtime PM instead of
> doing it manually?
The clocks are reconfigured less frequently with pm_runtime. Especially
when enabling/disabling PLLs are involved pm_runtime can increase
performance.
Also you can put other stuff you need to handle for your device into
pm_runtime, think of regulators for example. All this is then abstracted
behind a common kernel API.
Generally when you disable CONFIG_PM then you are not interested in
power consumption and in that case you shouldn't be interested in
disabling your SPI clocks.
Sascha
--
Pengutronix e.K. | |
Steuerwalder Str. 21 | http://www.pengutronix.de/ |
31137 Hildesheim, Germany | Phone: +49-5121-206917-0 |
Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |
next prev parent reply other threads:[~2020-10-12 13:28 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-10-09 4:27 [PATCH] spi: imx: Revert "spi: imx: enable runtime pm support" Christian Eggers
2020-10-09 7:39 ` Sascha Hauer
2020-10-09 7:48 ` Christian Eggers
2020-10-12 14:07 ` Sascha Hauer
2020-10-13 11:58 ` Christian Eggers
2020-10-14 12:15 ` Mark Brown
2020-10-12 10:59 ` Christian Eggers
2020-10-12 13:28 ` Sascha Hauer [this message]
2020-10-12 13:42 ` Mark Brown
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=20201012132821.GE11648@pengutronix.de \
--to=s.hauer@pengutronix.de \
--cc=broonie@kernel.org \
--cc=ceggers@arri.de \
--cc=festevam@gmail.com \
--cc=kernel@pengutronix.de \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-imx@nxp.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-spi@vger.kernel.org \
--cc=shawnguo@kernel.org \
--cc=xiaoning.wang@nxp.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).