All of lore.kernel.org
 help / color / mirror / Atom feed
From: Rob Clark <robdclark@gmail.com>
To: iommu@lists.linux-foundation.org, dri-devel@lists.freedesktop.org
Cc: aarch64-laptops@lists.linaro.org,
	Jordan Crouse <jcrouse@codeaurora.org>,
	Rob Clark <robdclark@chromium.org>,
	Abhinav Kumar <abhinavk@codeaurora.org>,
	Andy Shevchenko <andy.shevchenko@gmail.com>,
	Bartosz Golaszewski <brgl@bgdev.pl>,
	Boris Brezillon <bbrezillon@kernel.org>,
	Bruce Wang <bzwang@chromium.org>, Daniel Mack <daniel@zonque.org>,
	Daniel Vetter <daniel.vetter@ffwll.ch>,
	freedreno@lists.freedesktop.org (open list:DRM DRIVER FOR MSM
	ADRENO GPU), Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Heikki Krogerus <heikki.krogerus@linux.intel.com>,
	Jeykumar Sankaran <jsanka@codeaurora.org>,
	Joe Perches <joe@perches.com>, Joerg Roedel <jroedel@suse.de>,
	Jonathan Marek <jonathan@marek.ca>,
	linux-arm-msm@vger.kernel.org (open list:DRM DRIVER FOR MSM
	ADRENO GPU), linux-kernel@vger.kernel.org (open list),
	Mamta Shukla <mamtashukla555@gmail.com>,
	"Rafael J. Wysocki" <rafael.j.wysocki@intel.com>,
	Rasmus Villemoes <linux@rasmusvillemoes.dk>,
	Sean Paul <seanpaul@chromium.org>,
	Sudeep Holla <sudeep.holla@arm.com>,
	Ulf Hansson <ulf.hansson@linaro.org>,
	Vivek Gautam <vivek.gautam@codeaurora.org>
Subject: [PATCH 0/2] iommu: handle drivers that manage iommu directly
Date: Tue,  2 Jul 2019 13:26:17 -0700	[thread overview]
Message-ID: <20190702202631.32148-1-robdclark@gmail.com> (raw)

From: Rob Clark <robdclark@chromium.org>

One of the challenges we need to handle to enable the aarch64 laptops
upstream is dealing with the fact that the bootloader enables the
display and takes the corresponding SMMU context-bank out of BYPASS.
Unfortunately, currently, the IOMMU framework attaches a DMA (or
potentially an IDENTITY) domain before the driver is probed and has
a chance to intervene and shutdown[1] scanout.  Which makes things go
horribly wrong.

This also happens to solve a problem that is blocking us from supporting
per-context pagetables on the GPU, due to domain that is attached before
driver has a chance to attach it's own domain for the GPU.

But since the driver is managing it's own iommu domains directly, and
does not use dev->iommu_group->default_domain at all, the simple
solution to both problems is to just avoid attaching that domain in the
first place.

[1] Eventually we want to be able to do a seemless transition from
    efifb to drm/msm... but first step is to get the core (iommu,
    clk, genpd) pieces in place, so a first step of disabling the
    display before first modeset enables us to get all of the
    dependencies outside of drm/msm in place.  And this at least
    gets us parity with windows (which also appears to do a modeset
    between bootloader and HLSO).  After that there is a bunch of
    drm/msm work that is probably not interesting to folks outside
    of dri-devel.

Rob Clark (2):
  iommu: add support for drivers that manage iommu explicitly
  drm/msm: mark devices where iommu is managed by driver

 drivers/gpu/drm/msm/adreno/adreno_device.c |  1 +
 drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c    |  1 +
 drivers/gpu/drm/msm/disp/mdp5/mdp5_kms.c   |  1 +
 drivers/gpu/drm/msm/msm_drv.c              |  1 +
 drivers/iommu/iommu.c                      | 11 +++++++++++
 include/linux/device.h                     |  3 ++-
 6 files changed, 17 insertions(+), 1 deletion(-)

-- 
2.20.1


WARNING: multiple messages have this Message-ID (diff)
From: Rob Clark <robdclark@gmail.com>
To: iommu@lists.linux-foundation.org, dri-devel@lists.freedesktop.org
Cc: Ulf Hansson <ulf.hansson@linaro.org>,
	Heikki Krogerus <heikki.krogerus@linux.intel.com>,
	Daniel Vetter <daniel.vetter@ffwll.ch>,
	Rasmus Villemoes <linux@rasmusvillemoes.dk>,
	Rob Clark <robdclark@chromium.org>,
	Jonathan Marek <jonathan@marek.ca>,
	Bartosz Golaszewski <brgl@bgdev.pl>,
	"Rafael J. Wysocki" <rafael.j.wysocki@intel.com>,
	Mamta Shukla <mamtashukla555@gmail.com>,
	Andy Shevchenko <andy.shevchenko@gmail.com>,
	Joerg Roedel <jroedel@suse.de>,
	"open list:DRM DRIVER FOR MSM ADRENO GPU"
	<linux-arm-msm@vger.kernel.org>,
	Abhinav Kumar <abhinavk@codeaurora.org>,
	Bruce Wang <bzwang@chromium.org>,
	Sean Paul <seanpaul@chromium.org>,
	Jeykumar Sankaran <jsanka@codeaurora.org>,
	aarch64-laptops@lists.linaro.org,
	Boris Brezillon <bbrezillon@kernel.org>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	open list <linux-kernel@vger.kernel.org>,
	Sudeep Holla <sudeep.holla@arm.com>,
	Joe Perches <joe@perches.com>,
	"open list:DRM DRIVER FOR MSM ADRENO GPU"
	<freedreno@lists.freedesktop.org>,
	Daniel Mack <daniel@zonque.org>
Subject: [PATCH 0/2] iommu: handle drivers that manage iommu directly
Date: Tue,  2 Jul 2019 13:26:17 -0700	[thread overview]
Message-ID: <20190702202631.32148-1-robdclark@gmail.com> (raw)

From: Rob Clark <robdclark@chromium.org>

One of the challenges we need to handle to enable the aarch64 laptops
upstream is dealing with the fact that the bootloader enables the
display and takes the corresponding SMMU context-bank out of BYPASS.
Unfortunately, currently, the IOMMU framework attaches a DMA (or
potentially an IDENTITY) domain before the driver is probed and has
a chance to intervene and shutdown[1] scanout.  Which makes things go
horribly wrong.

This also happens to solve a problem that is blocking us from supporting
per-context pagetables on the GPU, due to domain that is attached before
driver has a chance to attach it's own domain for the GPU.

But since the driver is managing it's own iommu domains directly, and
does not use dev->iommu_group->default_domain at all, the simple
solution to both problems is to just avoid attaching that domain in the
first place.

[1] Eventually we want to be able to do a seemless transition from
    efifb to drm/msm... but first step is to get the core (iommu,
    clk, genpd) pieces in place, so a first step of disabling the
    display before first modeset enables us to get all of the
    dependencies outside of drm/msm in place.  And this at least
    gets us parity with windows (which also appears to do a modeset
    between bootloader and HLSO).  After that there is a bunch of
    drm/msm work that is probably not interesting to folks outside
    of dri-devel.

Rob Clark (2):
  iommu: add support for drivers that manage iommu explicitly
  drm/msm: mark devices where iommu is managed by driver

 drivers/gpu/drm/msm/adreno/adreno_device.c |  1 +
 drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c    |  1 +
 drivers/gpu/drm/msm/disp/mdp5/mdp5_kms.c   |  1 +
 drivers/gpu/drm/msm/msm_drv.c              |  1 +
 drivers/iommu/iommu.c                      | 11 +++++++++++
 include/linux/device.h                     |  3 ++-
 6 files changed, 17 insertions(+), 1 deletion(-)

-- 
2.20.1

_______________________________________________
iommu mailing list
iommu@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/iommu

WARNING: multiple messages have this Message-ID (diff)
From: Rob Clark <robdclark-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
To: iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org,
	dri-devel-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org
Cc: Ulf Hansson <ulf.hansson-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>,
	Heikki Krogerus
	<heikki.krogerus-VuQAYsv1563Yd54FQh9/CA@public.gmane.org>,
	Daniel Vetter <daniel.vetter-/w4YWyX8dFk@public.gmane.org>,
	Rasmus Villemoes
	<linux-qQsb+v5E8BnlAoU/VqSP6n9LOBIZ5rWg@public.gmane.org>,
	Vivek Gautam
	<vivek.gautam-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>,
	Rob Clark <robdclark-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org>,
	Jonathan Marek <jonathan-eSc4qw6YbEQ@public.gmane.org>,
	Bartosz Golaszewski <brgl-ARrdPY/1zhM@public.gmane.org>,
	"Rafael J. Wysocki"
	<rafael.j.wysocki-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>,
	Mamta Shukla
	<mamtashukla555-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>,
	Andy Shevchenko
	<andy.shevchenko-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>,
	Joerg Roedel <jroedel-l3A5Bk7waGM@public.gmane.org>,
	"open list:DRM DRIVER FOR MSM ADRENO GPU"
	<linux-arm-msm-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
	Abhinav Kumar <abhinavk-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>,
	Bruce Wang <bzwang-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org>,
	Jordan Crouse <jcrouse-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>,
	Sean Paul <seanpaul-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org>,
	Jeykumar Sankaran
	<jsanka-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>,
	aarch64-laptops-cunTk1MwBs8s++Sfvej+rw@public.gmane.org,
	Boris Brezillon
	<bbrezillon-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.o>
Subject: [PATCH 0/2] iommu: handle drivers that manage iommu directly
Date: Tue,  2 Jul 2019 13:26:17 -0700	[thread overview]
Message-ID: <20190702202631.32148-1-robdclark@gmail.com> (raw)

From: Rob Clark <robdclark@chromium.org>

One of the challenges we need to handle to enable the aarch64 laptops
upstream is dealing with the fact that the bootloader enables the
display and takes the corresponding SMMU context-bank out of BYPASS.
Unfortunately, currently, the IOMMU framework attaches a DMA (or
potentially an IDENTITY) domain before the driver is probed and has
a chance to intervene and shutdown[1] scanout.  Which makes things go
horribly wrong.

This also happens to solve a problem that is blocking us from supporting
per-context pagetables on the GPU, due to domain that is attached before
driver has a chance to attach it's own domain for the GPU.

But since the driver is managing it's own iommu domains directly, and
does not use dev->iommu_group->default_domain at all, the simple
solution to both problems is to just avoid attaching that domain in the
first place.

[1] Eventually we want to be able to do a seemless transition from
    efifb to drm/msm... but first step is to get the core (iommu,
    clk, genpd) pieces in place, so a first step of disabling the
    display before first modeset enables us to get all of the
    dependencies outside of drm/msm in place.  And this at least
    gets us parity with windows (which also appears to do a modeset
    between bootloader and HLSO).  After that there is a bunch of
    drm/msm work that is probably not interesting to folks outside
    of dri-devel.

Rob Clark (2):
  iommu: add support for drivers that manage iommu explicitly
  drm/msm: mark devices where iommu is managed by driver

 drivers/gpu/drm/msm/adreno/adreno_device.c |  1 +
 drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c    |  1 +
 drivers/gpu/drm/msm/disp/mdp5/mdp5_kms.c   |  1 +
 drivers/gpu/drm/msm/msm_drv.c              |  1 +
 drivers/iommu/iommu.c                      | 11 +++++++++++
 include/linux/device.h                     |  3 ++-
 6 files changed, 17 insertions(+), 1 deletion(-)

-- 
2.20.1

_______________________________________________
Freedreno mailing list
Freedreno@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/freedreno

             reply	other threads:[~2019-07-03  1:50 UTC|newest]

Thread overview: 45+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-07-02 20:26 Rob Clark [this message]
2019-07-02 20:26 ` [PATCH 0/2] iommu: handle drivers that manage iommu directly Rob Clark
2019-07-02 20:26 ` Rob Clark
2019-07-02 20:26 ` [PATCH 1/2] iommu: add support for drivers that manage iommu explicitly Rob Clark
2019-07-02 20:26   ` Rob Clark
2019-07-02 20:26   ` Rob Clark
2019-07-03 12:42   ` Robin Murphy
2019-07-03 12:42     ` Robin Murphy
2019-07-03 14:18     ` Rob Clark
2019-07-03 14:18       ` Rob Clark
2019-07-04  8:20   ` Joerg Roedel
2019-07-04  8:20     ` Joerg Roedel
2019-07-04 13:51     ` Rob Clark
2019-07-04 13:51       ` Rob Clark
2019-07-04 13:51       ` Rob Clark
2019-07-10 18:28   ` [PATCH v2] " Rob Clark
2019-07-10 18:28     ` Rob Clark
2019-07-10 18:28     ` Rob Clark
2019-07-22 14:28     ` Joerg Roedel
2019-07-22 14:28       ` Joerg Roedel
2019-07-22 14:28       ` Joerg Roedel
2019-07-22 15:41       ` Rob Clark
2019-07-22 15:41         ` Rob Clark
2019-07-22 15:41         ` Rob Clark
2019-07-22 15:48         ` Joerg Roedel
2019-07-22 15:48           ` Joerg Roedel
2019-07-22 15:48           ` Joerg Roedel
2019-07-22 16:23           ` Rob Clark
2019-07-22 16:23             ` Rob Clark
2019-07-22 16:23             ` Rob Clark
2019-07-23 15:38             ` Will Deacon
2019-07-23 15:38               ` Will Deacon
2019-07-23 15:38               ` Will Deacon
2019-07-23 17:40               ` Rob Clark
2019-07-23 17:40                 ` Rob Clark
2019-07-23 17:40                 ` Rob Clark
2019-07-24 10:51                 ` Will Deacon
2019-07-24 10:51                   ` Will Deacon
2019-07-24 10:51                   ` Will Deacon
2019-07-24 16:11                   ` Rob Clark
2019-07-24 16:11                     ` Rob Clark
2019-07-24 16:11                     ` Rob Clark
2019-07-02 20:26 ` [PATCH 2/2] drm/msm: mark devices where iommu is managed by driver Rob Clark
2019-07-02 20:26   ` Rob Clark
2019-07-02 20:26   ` Rob Clark

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=20190702202631.32148-1-robdclark@gmail.com \
    --to=robdclark@gmail.com \
    --cc=aarch64-laptops@lists.linaro.org \
    --cc=abhinavk@codeaurora.org \
    --cc=andy.shevchenko@gmail.com \
    --cc=bbrezillon@kernel.org \
    --cc=brgl@bgdev.pl \
    --cc=bzwang@chromium.org \
    --cc=daniel.vetter@ffwll.ch \
    --cc=daniel@zonque.org \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=freedreno@lists.freedesktop.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=heikki.krogerus@linux.intel.com \
    --cc=iommu@lists.linux-foundation.org \
    --cc=jcrouse@codeaurora.org \
    --cc=joe@perches.com \
    --cc=jonathan@marek.ca \
    --cc=jroedel@suse.de \
    --cc=jsanka@codeaurora.org \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@rasmusvillemoes.dk \
    --cc=mamtashukla555@gmail.com \
    --cc=rafael.j.wysocki@intel.com \
    --cc=robdclark@chromium.org \
    --cc=seanpaul@chromium.org \
    --cc=sudeep.holla@arm.com \
    --cc=ulf.hansson@linaro.org \
    --cc=vivek.gautam@codeaurora.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 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.