[PATCH v5 1/3] iommu/rockchip: rk3288 iommu driver
Joerg Roedel
joro at 8bytes.org
Wed Oct 22 08:12:54 PDT 2014
On Tue, Oct 14, 2014 at 04:02:40PM +0800, Daniel Kurtz wrote:
> +static void rk_iommu_detach_device(struct iommu_domain *domain,
> + struct device *dev)
> +{
> + struct rk_iommu *iommu = dev_get_drvdata(dev->archdata.iommu);
> + struct rk_iommu_domain *rk_domain = domain->priv;
> + unsigned long flags;
> +
> + /* Allow 'virtual devices' (eg drm) to detach from domain */
> + if (!iommu)
> + return;
> +
> + iommu->domain = NULL;
I guess this line is a left-over? Setting iommu->domain to NULL here
before you disabled the IOMMU interrupt is racy. To be fully secure, you
should make sure that no interrupt handler is still running after you
disabled the IOMMU irq and before setting iommu->domain = NULL.
Other than that the code looks good.
Joerg
More information about the Linux-rockchip
mailing list