Skip to contentSkip to conversation

iommu/dma: Clean up redundant MSI cookie check

PATCH Applied Robin Murphy 3 participants 3 messages Oct 2 – Oct 9

Subsystems (2)
lore
Share & tools
lore

Robin Murphy

author maintainer
#0 lore raw

PATCH 1/1 iommu/dma: Clean up redundant MSI cookie check

The has_msi_cookie() condition only mattered transiently as an artefact of the cookie rework being done in parallel with the sw_msi rework. Once combined, calls to iommu_dma_sw_msi() are themselves dispatched based on domain->cookie_type, so checking again is clearly redundant.

---
 drivers/iommu/dma-iommu.c | 11 -----------
 1 file changed, 11 deletions(-)
drivers/iommu/dma-iommu.c +0 -11
index 1b8012123232..5d9d282540bc 100644
@@ -2162,12 +2162,6 @@ void iommu_setup_dma_ops(struct device *dev, struct iommu_domain *domain)
 	dev_clear_dma_iommu(dev);
 }
 
-static bool has_msi_cookie(const struct iommu_domain *domain)
-{
-	return domain && (domain->cookie_type == IOMMU_COOKIE_DMA_IOVA ||
-			  domain->cookie_type == IOMMU_COOKIE_DMA_MSI);
-}
-
 static size_t cookie_msi_granule(const struct iommu_domain *domain)
 {
 	switch (domain->cookie_type) {
@@ -2249,11 +2243,6 @@ int iommu_dma_sw_msi(struct iommu_domain *domain, struct msi_desc *desc,
 	struct device *dev = msi_desc_to_dev(desc);
 	const struct iommu_dma_msi_page *msi_page;
 
-	if (!has_msi_cookie(domain)) {
-		msi_desc_set_iommu_msi_iova(desc, 0, 0);
-		return 0;
-	}
-
 	iommu_group_mutex_assert(dev);
 	msi_page = iommu_dma_get_msi_page(dev, msi_addr, domain);
 	if (!msi_page)
Signature · 1 line
2.54.0.dirty
Reviewed-by on v1 1/1
#1 lore raw
Quoted 6 lines · Robin Murphy

The has_msi_cookie() condition only mattered transiently as an artefact of the cookie rework being done in parallel with the sw_msi rework. Once combined, calls to iommu_dma_sw_msi() are themselves dispatched based on domain->cookie_type, so checking again is clearly redundant.

maintainer Applied
#2 lore raw
In reply to Robin Murphy
Quoted 9 lines · Robin Murphy

The has_msi_cookie() condition only mattered transiently as an artefact of the cookie rework being done in parallel with the sw_msi rework. Once combined, calls to iommu_dma_sw_msi() are themselves dispatched based on domain->cookie_type, so checking again is clearly redundant.

---
 drivers/iommu/dma-iommu.c | 11 -----------
 1 file changed, 11 deletions(-)

Applied, thanks.