devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Joerg Roedel <joro@8bytes.org>
To: honghui.zhang@mediatek.com
Cc: treding@nvidia.com, mark.rutland@arm.com, matthias.bgg@gmail.com,
	robh@kernel.org, robin.murphy@arm.com, p.zabel@pengutronix.de,
	devicetree@vger.kernel.org, pebolle@tiscali.nl,
	kendrick.hsu@mediatek.com, arnd@arndb.de,
	srv_heupstream@mediatek.com, catalin.marinas@arm.com,
	will.deacon@arm.com, linux-kernel@vger.kernel.org,
	tfiga@google.com, iommu@lists.linux-foundation.org,
	robh+dt@kernel.org, djkurtz@google.com, kernel@pengutronix.de,
	linux-mediatek@lists.infradead.org,
	linux-arm-kernel@lists.infradead.org, l.stach@pengutronix.de,
	yingjoe.chen@mediatek.com, eddie.huang@mediatek.com,
	youlin.pei@mediatek.com, erin.lo@mediatek.com
Subject: Re: [RFC PATCH] iommu: create direct_mapping after device attached
Date: Wed, 20 Jul 2016 16:01:27 +0200	[thread overview]
Message-ID: <20160720140127.GA3030@8bytes.org> (raw)
In-Reply-To: <1469018961-16367-1-git-send-email-honghui.zhang@mediatek.com>

On Wed, Jul 20, 2016 at 08:49:21PM +0800, honghui.zhang@mediatek.com wrote:
> From: Honghui Zhang <honghui.zhang@mediatek.com>
> 
> For mtk iommu, the domain_finalize was called in device attatch, the mtk
> iommu iopgt ops was allocated and initialized in domain_finalize, the
> iommu_group_create_direct_mappings would call the map interface to
> implement the map. If it's earlier than device attach, there would be NULL
> dereference. Move the iommu_group_create_direct_mappings call after device
> attached.

No, this would open a race window where the device is attached, but
doesn't have its unity-mappings in place. You should re-organize the mtk
driver instead, so that it works in this order too.



	Joerg

      reply	other threads:[~2016-07-20 14:01 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-07-20 12:49 [RFC PATCH] iommu: create direct_mapping after device attached honghui.zhang-NuS5LvNUpcJWk0Htik3J/w
2016-07-20 14:01 ` Joerg Roedel [this message]

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=20160720140127.GA3030@8bytes.org \
    --to=joro@8bytes.org \
    --cc=arnd@arndb.de \
    --cc=catalin.marinas@arm.com \
    --cc=devicetree@vger.kernel.org \
    --cc=djkurtz@google.com \
    --cc=eddie.huang@mediatek.com \
    --cc=erin.lo@mediatek.com \
    --cc=honghui.zhang@mediatek.com \
    --cc=iommu@lists.linux-foundation.org \
    --cc=kendrick.hsu@mediatek.com \
    --cc=kernel@pengutronix.de \
    --cc=l.stach@pengutronix.de \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mediatek@lists.infradead.org \
    --cc=mark.rutland@arm.com \
    --cc=matthias.bgg@gmail.com \
    --cc=p.zabel@pengutronix.de \
    --cc=pebolle@tiscali.nl \
    --cc=robh+dt@kernel.org \
    --cc=robh@kernel.org \
    --cc=robin.murphy@arm.com \
    --cc=srv_heupstream@mediatek.com \
    --cc=tfiga@google.com \
    --cc=treding@nvidia.com \
    --cc=will.deacon@arm.com \
    --cc=yingjoe.chen@mediatek.com \
    --cc=youlin.pei@mediatek.com \
    /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).