[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <ffd585c3-3808-5083-ec98-bc2fc44d34ef@nxp.com>
Date: Wed, 6 Nov 2019 11:17:58 +0000
From: Laurentiu Tudor <laurentiu.tudor@....com>
To: "hch@....de" <hch@....de>
CC: Jonathan Lemon <jlemon@...gsvamp.com>,
"joro@...tes.org" <joro@...tes.org>,
Ioana Ciocoi Radulescu <ruxandra.radulescu@....com>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
"iommu@...ts.linux-foundation.org" <iommu@...ts.linux-foundation.org>,
"netdev@...r.kernel.org" <netdev@...r.kernel.org>,
Ioana Ciornei <ioana.ciornei@....com>,
Leo Li <leoyang.li@....com>,
"robin.murphy@....com" <robin.murphy@....com>,
Diana Madalina Craciun <diana.craciun@....com>,
"davem@...emloft.net" <davem@...emloft.net>,
Madalin Bucur <madalin.bucur@....com>
Subject: Re: [PATCH v2 3/3] dpaa2_eth: use new unmap and sync dma api variants
On 28.10.2019 13:38, hch@....de 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
Powered by blists - more mailing lists