Skip to contentSkip to conversation

sparc64: restore irq in error paths in iommu

PATCH New Dan Carpenter 1 participant 1 message Nov 25, 2016

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 sparc64: restore irq in error paths in iommu

There are some error paths where we should restore IRQs but we don't.

Fixes bb620c3d3925 ("sparc: Make sparc64 use scalable lib/iommu-common.c functions")
arch/sparc/kernel/pci_sun4v.c +2 -0
index 06981cc7..7d23cad 100644
@@ -242,6 +242,7 @@ static void *dma_4v_alloc_coherent(struct device *dev, size_t size,
 	return ret;
 
 iommu_map_fail:
+	local_irq_restore(flags);
 	iommu_tbl_range_free(tbl, *dma_addrp, npages, IOMMU_ERROR_CODE);
 
 range_alloc_fail:
@@ -414,6 +415,7 @@ static dma_addr_t dma_4v_map_page(struct device *dev, struct page *page,
 	return DMA_ERROR_CODE;
 
 iommu_map_fail:
+	local_irq_restore(flags);
 	iommu_tbl_range_free(tbl, bus_addr, npages, IOMMU_ERROR_CODE);
 	return DMA_ERROR_CODE;
 }