From: tfiga@chromium.org (Tomasz Figa)
To: linux-arm-kernel@lists.infradead.org
Subject: [RFC PATCH 0/2] Fix rockchip IOMMU driver vs PM issues
Date: Thu, 11 Dec 2014 17:26:25 +0900 [thread overview]
Message-ID: <1418286387-9663-1-git-send-email-tfiga@chromium.org> (raw)
On Rockchip SoCs, the IOMMUs are located inside the same power domains as
IP blocks using them. This means that as soon as we runtime suspend such
IP block, causing the power domain to be powered off, the IOMMU would also
be powered off, losing all its state.
This means that whenever the power domain is being powered off, the IOMMU
driver needs to be able to deinitialize the hardware and whenever the domain
is being powered on, it needs to restore all the state, so the consumer
device is able to perform memory transactions.
The solution proposed here revives the idea of PM domain notifiers submitted
originally by Samsung's Sylwester Nawrocki and Marek Szyprowski in [1].
The main benefit of this idea that it is very simple, adding just 84 lines
of code, but effective and also useful for other purposes, what can be seen
in thread [2] and [3]. Moreover, it lets us avoid adding device specific
code (in this case specific to single IOMMU type) to power domain drivers,
which can be used for more devices than just IOMMU and which may vary
between platforms using the same IOMMU driver.
The IOMMU-specific part of the solution simply uses the pre-power-off and
post-power-on notifications to do the necessary setup without the need
of any action from inside drivers of devices behind the IOMMU, so all the
code specific to this particular IOMMU type stays outside other drivers
that should not rely on being run with a particular type of IOMMU (and
often even SoC).
Tested with a custom board based on RK3288 SoC.
[1] http://thread.gmane.org/gmane.linux.kernel.samsung-soc/36079/focus=346956
[2] http://thread.gmane.org/gmane.linux.power-management.general/51993/focus=39158
[3] http://marc.info/?l=linux-pm&m=136448756308203&w=2
Sylwester Nawrocki (1):
pm: Add PM domain notifications
Tomasz Figa (1):
iommu: rockchip: Handle system-wide and runtime PM
Documentation/power/notifiers.txt | 14 +++
drivers/base/power/domain.c | 50 +++++++++
drivers/iommu/rockchip-iommu.c | 208 +++++++++++++++++++++++++++++++-------
include/linux/pm_domain.h | 20 ++++
4 files changed, 256 insertions(+), 36 deletions(-)
--
2.2.0.rc0.207.ga3a616c
next reply other threads:[~2014-12-11 8:26 UTC|newest]
Thread overview: 29+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-12-11 8:26 Tomasz Figa [this message]
2014-12-11 8:26 ` [RFC PATCH 1/2] pm: Add PM domain notifications Tomasz Figa
2014-12-11 10:36 ` Sylwester Nawrocki
2014-12-11 11:04 ` Tomasz Figa
2014-12-11 13:54 ` Sylwester Nawrocki
2014-12-11 15:30 ` Ulf Hansson
2014-12-11 8:26 ` [RFC PATCH 2/2] iommu: rockchip: Handle system-wide and runtime PM Tomasz Figa
2014-12-11 11:58 ` Ulf Hansson
2014-12-11 12:42 ` Tomasz Figa
2014-12-11 15:22 ` Ulf Hansson
2014-12-11 15:31 ` Kevin Hilman
2014-12-11 15:51 ` Ulf Hansson
2014-12-11 20:48 ` Rafael J. Wysocki
2014-12-12 4:15 ` Tomasz Figa
2014-12-12 20:04 ` Kevin Hilman
2014-12-15 2:32 ` Tomasz Figa
2014-12-15 8:35 ` Geert Uytterhoeven
2014-12-15 18:06 ` Kevin Hilman
2014-12-12 20:47 ` Laurent Pinchart
2014-12-15 2:39 ` Tomasz Figa
2014-12-15 19:53 ` Laurent Pinchart
2014-12-16 2:18 ` Tomasz Figa
2014-12-17 0:15 ` Laurent Pinchart
2014-12-18 1:32 ` Rafael J. Wysocki
2014-12-18 19:12 ` Laurent Pinchart
2014-12-18 21:14 ` Kevin Hilman
2014-12-18 21:28 ` Laurent Pinchart
2014-12-19 2:27 ` Rafael J. Wysocki
2014-12-20 19:01 ` Laurent Pinchart
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=1418286387-9663-1-git-send-email-tfiga@chromium.org \
--to=tfiga@chromium.org \
--cc=linux-arm-kernel@lists.infradead.org \
/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).