Skip to content

Commit 944e15f

Browse files
committed
Merge tag 'dma-mapping-7.0-2026-02-26' of git://git.kernel.org/pub/scm/linux/kernel/git/mszyprowski/linux
Pull dma-mapping fixes from Marek Szyprowski: "Two DMA-mapping fixes for the recently merged API rework (Jiri Pirko and Stian Halseth)" * tag 'dma-mapping-7.0-2026-02-26' of git://git.kernel.org/pub/scm/linux/kernel/git/mszyprowski/linux: sparc: Fix page alignment in dma mapping dma-mapping: avoid random addr value print out on error path
2 parents e094883 + d5b5e81 commit 944e15f

3 files changed

Lines changed: 5 additions & 1 deletion

File tree

arch/sparc/kernel/iommu.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -312,6 +312,8 @@ static dma_addr_t dma_4u_map_phys(struct device *dev, phys_addr_t phys,
312312
if (direction != DMA_TO_DEVICE)
313313
iopte_protection |= IOPTE_WRITE;
314314

315+
phys &= IO_PAGE_MASK;
316+
315317
for (i = 0; i < npages; i++, base++, phys += IO_PAGE_SIZE)
316318
iopte_val(*base) = iopte_protection | phys;
317319

arch/sparc/kernel/pci_sun4v.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -410,6 +410,8 @@ static dma_addr_t dma_4v_map_phys(struct device *dev, phys_addr_t phys,
410410

411411
iommu_batch_start(dev, prot, entry);
412412

413+
phys &= IO_PAGE_MASK;
414+
413415
for (i = 0; i < npages; i++, phys += IO_PAGE_SIZE) {
414416
long err = iommu_batch_add(phys, mask);
415417
if (unlikely(err < 0L))

kernel/dma/direct.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ static inline dma_addr_t dma_direct_map_phys(struct device *dev,
8585

8686
if (is_swiotlb_force_bounce(dev)) {
8787
if (attrs & DMA_ATTR_MMIO)
88-
goto err_overflow;
88+
return DMA_MAPPING_ERROR;
8989

9090
return swiotlb_map(dev, phys, size, dir, attrs);
9191
}

0 commit comments

Comments
 (0)