From: Thierry Reding <thierry.reding@gmail.com>
To: Dmitry Osipenko <digetx@gmail.com>
Cc: Wolfram Sang <wsa@the-dreams.de>,
Jon Hunter <jonathanh@nvidia.com>,
linux-i2c@vger.kernel.org, linux-tegra@vger.kernel.org
Subject: Re: [PATCH 2/5] i2c: tegra: Restore pinmux on system resume
Date: Tue, 19 May 2020 17:57:28 +0200 [thread overview]
Message-ID: <20200519155728.GA2113674@ulmo> (raw)
In-Reply-To: <f149bb64-e93b-364e-47bc-c851e9638a35@gmail.com>
[-- Attachment #1: Type: text/plain, Size: 1539 bytes --]
On Fri, May 08, 2020 at 06:00:57PM +0300, Dmitry Osipenko wrote:
> 08.05.2020 13:31, Thierry Reding пишет:
> ...
> >> Is it legal to touch DPAUX registers while DPAUX is in a suspended state?
> >
> > DPAUX is never runtime suspended and the dependency from the I2C
> > controller on DPAUX should ensure that they are suspended and resumed in
> > the right order during system sleep.
>
> 1. Could you please explain why DPAUX is never suspended? Isn't it a
> problem?
>
> It looks a bit odd that driver is doing this [1][2]. RPM is supposed to
> be used for the *dynamic* power management. Should we remove RPM usage
> from the DPAUX driver?
>
> [1]
> https://elixir.bootlin.com/linux/v5.7-rc4/source/drivers/gpu/drm/tegra/dpaux.c#L524
> [2]
> https://elixir.bootlin.com/linux/v5.7-rc4/source/drivers/gpu/drm/tegra/dpaux.c#L591
Looks more like the intention had been to eventually enable dynamic
power management but I never got around to it. The runtime PM
implementations are what's necessary to runtime suspend the device,
so all that should be needed is hook up the pm_runtime_get() and
pm_runtime_put() calls correctly.
> 2. Could you please explain why I2C driver has to care about restoring
> the pinmux state? Why pinctrl driver isn't doing that for I2C and
> everything else?
We could probably do it either way. I did it this way because the
runtime suspend/resume will get called either way, so might as well
reuse the same code paths rather than add context save/restore.
Thierry
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
WARNING: multiple messages have this Message-ID (diff)
From: Thierry Reding <thierry.reding-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
To: Dmitry Osipenko <digetx-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
Cc: Wolfram Sang <wsa-z923LK4zBo2bacvFa/9K2g@public.gmane.org>,
Jon Hunter <jonathanh-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>,
linux-i2c-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
linux-tegra-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Subject: Re: [PATCH 2/5] i2c: tegra: Restore pinmux on system resume
Date: Tue, 19 May 2020 17:57:28 +0200 [thread overview]
Message-ID: <20200519155728.GA2113674@ulmo> (raw)
In-Reply-To: <f149bb64-e93b-364e-47bc-c851e9638a35-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
[-- Attachment #1: Type: text/plain, Size: 1539 bytes --]
On Fri, May 08, 2020 at 06:00:57PM +0300, Dmitry Osipenko wrote:
> 08.05.2020 13:31, Thierry Reding пишет:
> ...
> >> Is it legal to touch DPAUX registers while DPAUX is in a suspended state?
> >
> > DPAUX is never runtime suspended and the dependency from the I2C
> > controller on DPAUX should ensure that they are suspended and resumed in
> > the right order during system sleep.
>
> 1. Could you please explain why DPAUX is never suspended? Isn't it a
> problem?
>
> It looks a bit odd that driver is doing this [1][2]. RPM is supposed to
> be used for the *dynamic* power management. Should we remove RPM usage
> from the DPAUX driver?
>
> [1]
> https://elixir.bootlin.com/linux/v5.7-rc4/source/drivers/gpu/drm/tegra/dpaux.c#L524
> [2]
> https://elixir.bootlin.com/linux/v5.7-rc4/source/drivers/gpu/drm/tegra/dpaux.c#L591
Looks more like the intention had been to eventually enable dynamic
power management but I never got around to it. The runtime PM
implementations are what's necessary to runtime suspend the device,
so all that should be needed is hook up the pm_runtime_get() and
pm_runtime_put() calls correctly.
> 2. Could you please explain why I2C driver has to care about restoring
> the pinmux state? Why pinctrl driver isn't doing that for I2C and
> everything else?
We could probably do it either way. I did it this way because the
runtime suspend/resume will get called either way, so might as well
reuse the same code paths rather than add context save/restore.
Thierry
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
next prev parent reply other threads:[~2020-05-19 15:57 UTC|newest]
Thread overview: 32+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-05-06 19:33 [PATCH 0/5] i2c: tegra: Various fixes and improvements Thierry Reding
2020-05-06 19:33 ` Thierry Reding
2020-05-06 19:33 ` [PATCH 1/5] Revert "i2c: tegra: Fix suspending in active runtime PM state" Thierry Reding
2020-05-06 19:33 ` Thierry Reding
2020-05-06 19:33 ` [PATCH 2/5] i2c: tegra: Restore pinmux on system resume Thierry Reding
2020-05-06 19:33 ` Thierry Reding
2020-05-06 22:43 ` mirq-test
2020-05-06 22:43 ` mirq-test-CoA6ZxLDdyEEUmgCuDUIdw
2020-05-07 10:03 ` Thierry Reding
2020-05-07 10:03 ` Thierry Reding
2020-05-07 12:20 ` Michał Mirosław
2020-05-07 12:20 ` Michał Mirosław
2020-05-07 21:50 ` Dmitry Osipenko
2020-05-07 21:50 ` Dmitry Osipenko
2020-05-08 10:31 ` Thierry Reding
2020-05-08 10:31 ` Thierry Reding
2020-05-08 15:00 ` Dmitry Osipenko
2020-05-08 15:00 ` Dmitry Osipenko
2020-05-09 15:35 ` Dmitry Osipenko
2020-05-09 15:35 ` Dmitry Osipenko
2020-05-19 16:07 ` Thierry Reding
2020-05-19 16:07 ` Thierry Reding
2020-05-19 15:57 ` Thierry Reding [this message]
2020-05-19 15:57 ` Thierry Reding
2020-05-08 15:05 ` Dmitry Osipenko
2020-05-08 15:05 ` Dmitry Osipenko
2020-05-06 19:33 ` [PATCH 3/5] i2c: tegra: Keep IRQs enabled during suspend/resume Thierry Reding
2020-05-06 19:33 ` Thierry Reding
2020-05-06 19:33 ` [PATCH 4/5] i2c: tegra: Better handle case where CPU0 is busy for a long time Thierry Reding
2020-05-06 19:33 ` Thierry Reding
2020-05-06 19:33 ` [PATCH 5/5] i2c: tegra: Synchronize DMA before termination Thierry Reding
2020-05-06 19:33 ` Thierry Reding
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=20200519155728.GA2113674@ulmo \
--to=thierry.reding@gmail.com \
--cc=digetx@gmail.com \
--cc=jonathanh@nvidia.com \
--cc=linux-i2c@vger.kernel.org \
--cc=linux-tegra@vger.kernel.org \
--cc=wsa@the-dreams.de \
/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 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.