[lkml]   [2019]   [Oct]   [9]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRE: [PATCH 19/20] dpaa_eth: add dpaa_dma_to_virt()
> -----Original Message-----
> From: Christoph Hellwig <>
> Sent: Wednesday, October 9, 2019 10:39 AM
> To: Madalin-cristian Bucur <>
> Cc:;; Roy Pledge
> <>; Laurentiu Tudor <>; linux-
> Subject: Re: [PATCH 19/20] dpaa_eth: add dpaa_dma_to_virt()
> On Tue, Oct 08, 2019 at 03:10:40PM +0300, Madalin Bucur wrote:
> > Centralize the phys_to_virt() calls.
> You don't need to centralize those, you need to fix them. Calling
> phys_to_virt on a dma_addr is completely bogus.

Hi Christoph, thank you for your input, I'm aware of the limited scenarios
that are supported with the current code state (SMMU disabled/bypassed).
The existing customers using the DPAA platforms cannot make use of the SMMU
features until this is fixed. The problem is there is no fast forward path
to fixing this, the performance requirements of the existing use-cases
preclude the use of the recommended approaches suggested to date. I'm moving
all these phys_to_virt calls into one central location specifically because
of this, as the lack of progress on the SMMU fix problem prevented me from
upstreaming other driver changes/fixes. Having this contained allows it to
follow a separate path towards a solution while it enables me to address
issues for the current users of the DPAA with minimal interference. To
illustrate the decoupling of the DPAA driver code changes from the iova
handling fix, the only change to the driver code that would be required
to make it work with the SMMU enables would look similar to this:

static void *dpaa_dma_to_virt(struct device *dev, dma_addr_t addr)
+ struct iommu_domain *domain = iommu_get_domain_for_dev(dev);
+ if (domain)
+ return phys_to_virt(iommu_iova_to_phys(domain, addr));
return phys_to_virt(addr);

Other refinements in regards to the actual APIs to be used would only
affect this code area.

Thank you,

 \ /
  Last update: 2019-10-09 12:57    [W:0.046 / U:1.928 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site