[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20160720140127.GA3030@8bytes.org>
Date: Wed, 20 Jul 2016 16:01:27 +0200
From: Joerg Roedel <joro@...tes.org>
To: honghui.zhang@...iatek.com
Cc: treding@...dia.com, mark.rutland@....com, matthias.bgg@...il.com,
robh@...nel.org, robin.murphy@....com, p.zabel@...gutronix.de,
devicetree@...r.kernel.org, pebolle@...cali.nl,
kendrick.hsu@...iatek.com, arnd@...db.de,
srv_heupstream@...iatek.com, catalin.marinas@....com,
will.deacon@....com, linux-kernel@...r.kernel.org,
tfiga@...gle.com, iommu@...ts.linux-foundation.org,
robh+dt@...nel.org, djkurtz@...gle.com, kernel@...gutronix.de,
linux-mediatek@...ts.infradead.org,
linux-arm-kernel@...ts.infradead.org, l.stach@...gutronix.de,
yingjoe.chen@...iatek.com, eddie.huang@...iatek.com,
youlin.pei@...iatek.com, erin.lo@...iatek.com
Subject: Re: [RFC PATCH] iommu: create direct_mapping after device attached
On Wed, Jul 20, 2016 at 08:49:21PM +0800, honghui.zhang@...iatek.com wrote:
> From: Honghui Zhang <honghui.zhang@...iatek.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
Powered by blists - more mailing lists