From: Rob Clark <robdclark@gmail.com>
To: Joerg Roedel <joro@8bytes.org>
Cc: "list@263.net:IOMMU DRIVERS <iommu@lists.linux-foundation.org>,
Joerg Roedel <joro@8bytes.org>,"
<iommu@lists.linux-foundation.org>,
dri-devel <dri-devel@lists.freedesktop.org>,
linux-arm-msm <linux-arm-msm@vger.kernel.org>,
Robin Murphy <robin.murphy@arm.com>,
Will Deacon <will@kernel.org>, Rob Clark <robdclark@chromium.org>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
"Rafael J. Wysocki" <rafael.j.wysocki@intel.com>,
Andrew Morton <akpm@linux-foundation.org>,
Suzuki K Poulose <suzuki.poulose@arm.com>,
Rasmus Villemoes <linux@rasmusvillemoes.dk>,
Heikki Krogerus <heikki.krogerus@linux.intel.com>,
Bartosz Golaszewski <brgl@bgdev.pl>,
Sudeep Holla <sudeep.holla@arm.com>,
Joe Perches <joe@perches.com>, Arnd Bergmann <arnd@arndb.de>,
open list <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH v2 1/2] iommu: add support for drivers that manage iommu explicitly
Date: Tue, 10 Sep 2019 08:34:13 -0700 [thread overview]
Message-ID: <CAF6AEGsFmuO5M_RWm-RjDT_F_1Z=MLYmNqRXqFNDR7aUoPaMdg@mail.gmail.com> (raw)
In-Reply-To: <20190910081415.GB3247@8bytes.org>
On Tue, Sep 10, 2019 at 1:14 AM Joerg Roedel <joro@8bytes.org> wrote:
>
> On Fri, Sep 06, 2019 at 02:44:01PM -0700, Rob Clark wrote:
> > @@ -674,7 +674,7 @@ int iommu_group_add_device(struct iommu_group *group, struct device *dev)
> >
> > mutex_lock(&group->mutex);
> > list_add_tail(&device->list, &group->devices);
> > - if (group->domain)
> > + if (group->domain && !(dev->driver && dev->driver->driver_manages_iommu))
>
> Hmm, this code usually runs at enumeration time when no driver is
> attached to the device. Actually it would be pretty dangerous when this
> code runs while a driver is attached to the device. How does that change
> make things work for you?
>
I was seeing this get called via the path driver_probe_device() ->
platform_dma_configure() -> of_dma_configure() -> of_iommu_configure()
-> iommu_probe_device() -> ...
The only cases I was seeing where dev->driver is NULL where a few
places that drivers call of_dma_configure() on their own sub-devices.
But maybe there are some other paths that I did not notice?
BR,
-R
next prev parent reply other threads:[~2019-09-10 15:34 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-09-06 21:44 [PATCH v3 0/2] iommu: handle drivers that manage iommu directly Rob Clark
2019-09-06 21:44 ` [PATCH v2 1/2] iommu: add support for drivers that manage iommu explicitly Rob Clark
2019-09-10 8:14 ` Joerg Roedel
2019-09-10 15:34 ` Rob Clark [this message]
2019-09-10 16:51 ` Robin Murphy
2019-09-06 21:44 ` [PATCH v2 2/2] drm/msm: mark devices where iommu is managed by driver Rob Clark
2019-09-10 16:34 ` [PATCH v3 0/2] iommu: handle drivers that manage iommu directly Robin Murphy
2019-09-10 17:10 ` Rob Clark
2019-09-17 13:36 ` Will Deacon
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='CAF6AEGsFmuO5M_RWm-RjDT_F_1Z=MLYmNqRXqFNDR7aUoPaMdg@mail.gmail.com' \
--to=robdclark@gmail.com \
--cc=akpm@linux-foundation.org \
--cc=arnd@arndb.de \
--cc=brgl@bgdev.pl \
--cc=dri-devel@lists.freedesktop.org \
--cc=gregkh@linuxfoundation.org \
--cc=heikki.krogerus@linux.intel.com \
--cc=iommu@lists.linux-foundation.org \
--cc=joe@perches.com \
--cc=joro@8bytes.org \
--cc=linux-arm-msm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@rasmusvillemoes.dk \
--cc=rafael.j.wysocki@intel.com \
--cc=robdclark@chromium.org \
--cc=robin.murphy@arm.com \
--cc=sudeep.holla@arm.com \
--cc=suzuki.poulose@arm.com \
--cc=will@kernel.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).