[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20190507064000.GB5173@infradead.org>
Date: Mon, 6 May 2019 23:40:00 -0700
From: Christoph Hellwig <hch@...radead.org>
To: Tom Murphy <tmurphy@...sta.com>
Cc: iommu@...ts.linux-foundation.org, murphyt7@....ie,
Joerg Roedel <joro@...tes.org>,
Will Deacon <will.deacon@....com>,
Robin Murphy <robin.murphy@....com>,
Marek Szyprowski <m.szyprowski@...sung.com>,
Kukjin Kim <kgene@...nel.org>,
Krzysztof Kozlowski <krzk@...nel.org>,
David Woodhouse <dwmw2@...radead.org>,
Andy Gross <andy.gross@...aro.org>,
David Brown <david.brown@...aro.org>,
Matthias Brugger <matthias.bgg@...il.com>,
Rob Clark <robdclark@...il.com>,
Heiko Stuebner <heiko@...ech.de>,
Gerald Schaefer <gerald.schaefer@...ibm.com>,
Thierry Reding <thierry.reding@...il.com>,
Jonathan Hunter <jonathanh@...dia.com>,
linux-kernel@...r.kernel.org, linux-arm-kernel@...ts.infradead.org,
linux-samsung-soc@...r.kernel.org, linux-arm-msm@...r.kernel.org,
linux-mediatek@...ts.infradead.org,
linux-rockchip@...ts.infradead.org, linux-s390@...r.kernel.org,
linux-tegra@...r.kernel.org
Subject: Re: [PATCH v3 2/4] iommu/dma-iommu: Handle deferred devices
On Mon, May 06, 2019 at 07:52:04PM +0100, Tom Murphy wrote:
> +static int handle_deferred_device(struct device *dev)
> +{
> + struct iommu_domain *domain;
> + const struct iommu_ops *ops;
> +
> + if (!is_kdump_kernel())
> + return 0;
> +
> + domain = iommu_get_domain_for_dev(dev);
> - dma_handle =__iommu_dma_map(dev, phys, size,
> + if (unlikely(handle_deferred_device(dev)))
> + return DMA_MAPPING_ERROR;
> +
> + dma_handle = __iommu_dma_map(dev, phys, size,
__iommu_dma_map already looks up the domain, and as far as I can
tell all callers need the handle_deferred_device call. Should we
just move it to there and pass the domain from the caller?
Also shouldn't the iommu_attach_device call inside
handle_deferred_device also get an unlikely marker?
Powered by blists - more mailing lists