linux-pm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Kevin Hilman <khilman@kernel.org>
To: Tomasz Figa <tfiga@chromium.org>
Cc: "Rafael J. Wysocki" <rjw@rjwysocki.net>,
	Ulf Hansson <ulf.hansson@linaro.org>,
	"open list:ARM/Rockchip SoC..."
	<linux-rockchip@lists.infradead.org>,
	"linux-pm@vger.kernel.org" <linux-pm@vger.kernel.org>,
	"linux-arm-kernel@lists.infradead.org"
	<linux-arm-kernel@lists.infradead.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	iommu@lists.linux-foundation.org, Len Brown <len.brown@intel.com>,
	Pavel Machek <pavel@ucw.cz>, Heiko Stuebner <heiko@sntech.de>,
	Joerg Roedel <joro@8bytes.org>,
	Geert Uytterhoeven <geert+renesas@glider.be>,
	Sylwester Nawrocki <s.nawrocki@samsung.com>,
	Daniel Kurtz <djkurtz@chromium.org>,
	Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Subject: Re: [RFC PATCH 2/2] iommu: rockchip: Handle system-wide and runtime PM
Date: Fri, 12 Dec 2014 12:04:16 -0800	[thread overview]
Message-ID: <7ha92sk533.fsf@deeprootsystems.com> (raw)
In-Reply-To: <CAAFQd5B28WiWUqmbmROJUa3H25R=Y774NuemTZDvkoa=CvZUsw@mail.gmail.com> (Tomasz Figa's message of "Fri, 12 Dec 2014 13:15:51 +0900")

Tomasz Figa <tfiga@chromium.org> writes:

[...]

> We have a power domain, which contains an IOMMU and an IP block, which
> can do bus transactions through that IOMMU. Of course the IP block is
> not aware of the IOMMU, because this is just an integration detail and
> on other platforms using the same IP block the IOMMU might not be
> there. This implies that the driver for this IP block should not be
> aware of the IOMMU either, which, on the buffer allocation and mapping
> side, is achieved by DMA mapping subsystem. We would also want the
> IOMMU to be fully transparent to that driver on PM side.

An even more exciting problem exists when a CPU is in the same domain as
other peripherals, those peripherals are all idle and the power domain
is gated. :)

> Now, for PM related details, they are located in the same power
> domain, which means that whenever the power domain is turned off, the
> CPU can't access their registers and all the hardware state is gone.
> To make the case more interesting, there is no point in programming
> the IOMMU unless the device using it is powered on. Similarly, there
> is no point in powering the domain on to just access the IOMMU. This
> implies that the power domain should be fully controlled by the
> stand-alone IP block, while the peripheral IOMMU shouldn't affect its
> state and its driver only respond to operations performed by driver of
> that stand-alone IP block.

Which implies that the IOMMU driver should have it's own set of
runtime_suspend/runtime_resume callbacks to properly save/restore state
as well.

> A solution like below could work for the above:
>
> - There is a per-device list of peripheral devices, which need to be
> powered on for this device to work.
> - Whenever the IOMMU subsystem/driver binds an IOMMU to a device, it
> adds the IOMMU device to the list of peripheral devices of that device
> (and similarly for removal).
> - A runtime PM operation on a device will also perform the same
> operation on all its peripheral devices.

Yes, that is exactly what we need.

I'd rather use the term "dependent" devices rather than peripheral
devices, but otherwise it sounds like the right approach to me.

Kevin

> Another way would be to extend what the PM runtime core does with
> parent-child relations to handle the whole list of peripheral devices
> instead of just the parent.


  reply	other threads:[~2014-12-12 20:04 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-12-11  8:26 [RFC PATCH 0/2] Fix rockchip IOMMU driver vs PM issues Tomasz Figa
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
     [not found]         ` <5489A227.8010907-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>
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
     [not found]       ` <CAAFQd5CA374MF-_w=3zqsZctwTcBHz9J_0Ygg4fD_wjg8kLATg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2014-12-11 15:22         ` Ulf Hansson
2014-12-11 15:31       ` Kevin Hilman
     [not found]         ` <7h8uiemce7.fsf-1D3HCaltpLuhEniVeURVKkEOCMrvLtNR@public.gmane.org>
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 [this message]
2014-12-15  2:32                   ` Tomasz Figa
     [not found]                   ` <7ha92sk533.fsf-1D3HCaltpLuhEniVeURVKkEOCMrvLtNR@public.gmane.org>
2014-12-15  8:35                     ` Geert Uytterhoeven
     [not found]                       ` <CAMuHMdVpCgK-hNqZ=JWjFGS53g+ZUQ5t=uBxtN1qGXJhoRg8BQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2014-12-15 18:06                         ` Kevin Hilman
     [not found]                 ` <CAAFQd5B28WiWUqmbmROJUa3H25R=Y774NuemTZDvkoa=CvZUsw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2014-12-12 20:47                   ` Laurent Pinchart
2014-12-15  2:39                     ` Tomasz Figa
     [not found]                       ` <CAAFQd5A5UAYpV6Z3ii+TTuPOxJF8VFJmnUnHZWkc9dZN04qxYA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
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
     [not found]                                     ` <7hppbg7j9r.fsf-1D3HCaltpLuhEniVeURVKkEOCMrvLtNR@public.gmane.org>
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=7ha92sk533.fsf@deeprootsystems.com \
    --to=khilman@kernel.org \
    --cc=djkurtz@chromium.org \
    --cc=geert+renesas@glider.be \
    --cc=heiko@sntech.de \
    --cc=iommu@lists.linux-foundation.org \
    --cc=joro@8bytes.org \
    --cc=laurent.pinchart@ideasonboard.com \
    --cc=len.brown@intel.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=linux-rockchip@lists.infradead.org \
    --cc=pavel@ucw.cz \
    --cc=rjw@rjwysocki.net \
    --cc=s.nawrocki@samsung.com \
    --cc=tfiga@chromium.org \
    --cc=ulf.hansson@linaro.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).