On 28.10.2019 13:38, [email protected] wrote: > On Mon, Oct 28, 2019 at 10:55:05AM +0000, Laurentiu Tudor wrote: >>>> @@ -85,9 +75,10 @@ static void free_rx_fd(struct dpaa2_eth_priv *priv, >>>> sgt = vaddr + dpaa2_fd_get_offset(fd); >>>> for (i = 1; i < DPAA2_ETH_MAX_SG_ENTRIES; i++) { >>>> addr = dpaa2_sg_get_addr(&sgt[i]); >>>> - sg_vaddr = dpaa2_iova_to_virt(priv->iommu_domain, addr); >>>> - dma_unmap_page(dev, addr, DPAA2_ETH_RX_BUF_SIZE, >>>> - DMA_BIDIRECTIONAL); >>>> + sg_vaddr = page_to_virt >>>> + (dma_unmap_page_desc(dev, addr, >>>> + DPAA2_ETH_RX_BUF_SIZE, >>>> + DMA_BIDIRECTIONAL)); >>> >>> This is doing virt -> page -> virt. Why not just have the new >>> function return the VA corresponding to the addr, which would >>> match the other functions? >> >> I'd really like that as it would get rid of the page_to_virt() calls but >> it will break the symmetry with the dma_map_page() API. I'll let the >> maintainers decide. > > It would be symmetric with dma_map_single, though. Maybe we need > both variants?
Patch 1/3 also adds an dma_unmap_single_desc(). Would it be legal to just use dma_unmap_single_desc() in the driver even if the driver does it's mappings with dma_map_page()? --- Best Regards, Laurentiu _______________________________________________ iommu mailing list [email protected] https://lists.linuxfoundation.org/mailman/listinfo/iommu
