mirror of
https://github.com/torvalds/linux.git
synced 2026-03-08 03:24:45 +01:00
dma-mapping fixes for Linux 7.0
A set of two fixes for DMA-mapping subsystem for the recently merged API rework (Jiri Pirko and Stian Halseth). -----BEGIN PGP SIGNATURE----- iHUEABYIAB0WIQSrngzkoBtlA8uaaJ+Jp1EFxbsSRAUCaaDJnAAKCRCJp1EFxbsS RBBTAP0WhFXOPeheDasVySviHbXxEdP2uc9/XgbnW40/HwWGRQD+KLkYSJDgGegv v+fbLYNkZPgtOKAztp70imOOBM0fGQY= =Q/dC -----END PGP SIGNATURE----- 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
This commit is contained in:
commit
944e15f200
3 changed files with 5 additions and 1 deletions
|
|
@ -312,6 +312,8 @@ static dma_addr_t dma_4u_map_phys(struct device *dev, phys_addr_t phys,
|
|||
if (direction != DMA_TO_DEVICE)
|
||||
iopte_protection |= IOPTE_WRITE;
|
||||
|
||||
phys &= IO_PAGE_MASK;
|
||||
|
||||
for (i = 0; i < npages; i++, base++, phys += IO_PAGE_SIZE)
|
||||
iopte_val(*base) = iopte_protection | phys;
|
||||
|
||||
|
|
|
|||
|
|
@ -410,6 +410,8 @@ static dma_addr_t dma_4v_map_phys(struct device *dev, phys_addr_t phys,
|
|||
|
||||
iommu_batch_start(dev, prot, entry);
|
||||
|
||||
phys &= IO_PAGE_MASK;
|
||||
|
||||
for (i = 0; i < npages; i++, phys += IO_PAGE_SIZE) {
|
||||
long err = iommu_batch_add(phys, mask);
|
||||
if (unlikely(err < 0L))
|
||||
|
|
|
|||
|
|
@ -85,7 +85,7 @@ static inline dma_addr_t dma_direct_map_phys(struct device *dev,
|
|||
|
||||
if (is_swiotlb_force_bounce(dev)) {
|
||||
if (attrs & DMA_ATTR_MMIO)
|
||||
goto err_overflow;
|
||||
return DMA_MAPPING_ERROR;
|
||||
|
||||
return swiotlb_map(dev, phys, size, dir, attrs);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue