linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Madalin-cristian Bucur <madalin.bucur@nxp.com>
To: Christoph Hellwig <hch@infradead.org>,
	Laurentiu Tudor <laurentiu.tudor@nxp.com>
Cc: "davem@davemloft.net" <davem@davemloft.net>,
	"netdev@vger.kernel.org" <netdev@vger.kernel.org>,
	Roy Pledge <roy.pledge@nxp.com>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: RE: [PATCH 19/20] dpaa_eth: add dpaa_dma_to_virt()
Date: Wed, 9 Oct 2019 10:56:57 +0000	[thread overview]
Message-ID: <VI1PR04MB55677E492084AB7F816DED7BEC950@VI1PR04MB5567.eurprd04.prod.outlook.com> (raw)
In-Reply-To: <20191009073926.GA6916@infradead.org>

> -----Original Message-----
> From: Christoph Hellwig <hch@infradead.org>
> Sent: Wednesday, October 9, 2019 10:39 AM
> To: Madalin-cristian Bucur <madalin.bucur@nxp.com>
> Cc: davem@davemloft.net; netdev@vger.kernel.org; Roy Pledge
> <roy.pledge@nxp.com>; Laurentiu Tudor <laurentiu.tudor@nxp.com>; linux-
> kernel@vger.kernel.org
> 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,
Madalin

  parent reply	other threads:[~2019-10-09 10:57 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-10-08 12:10 [PATCH 00/20] DPAA fixes Madalin Bucur
2019-10-08 12:10 ` [PATCH 01/20] fsl/fman: don't touch liodn base regs reserved on non-PAMU SoCs Madalin Bucur
2019-10-08 12:10 ` [PATCH 02/20] dpaa_eth: defer probing after qbman Madalin Bucur
2019-10-08 12:10 ` [PATCH 03/20] dpaa_eth: remove redundant code Madalin Bucur
2019-10-08 12:10 ` [PATCH 04/20] fsl/fman: add API to get the device behind a fman port Madalin Bucur
2019-10-08 12:10 ` [PATCH 05/20] dpaa_eth: change DMA device Madalin Bucur
2019-10-08 12:10 ` [PATCH 06/20] fsl/fman: remove unused struct member Madalin Bucur
2019-10-08 12:10 ` [PATCH 07/20] dpaa_eth: use only one buffer pool per interface Madalin Bucur
2019-10-08 12:10 ` [PATCH 08/20] dpaa_eth: use page backed rx buffers Madalin Bucur
2019-10-08 12:10 ` [PATCH 09/20] dpaa_eth: perform DMA unmapping before read Madalin Bucur
2019-10-08 12:10 ` [PATCH 10/20] dpaa_eth: avoid timestamp read on error paths Madalin Bucur
2019-10-08 12:10 ` [PATCH 11/20] dpaa_eth: simplify variables used in dpaa_cleanup_tx_fd() Madalin Bucur
2019-10-08 12:10 ` [PATCH 12/20] dpaa_eth: use fd information " Madalin Bucur
2019-10-08 12:10 ` [PATCH 13/20] dpaa_eth: use a page to store the SGT Madalin Bucur
2019-10-08 12:10 ` [PATCH 14/20] soc: fsl: qbman: allow registering a device link for the portal user Madalin Bucur
2019-10-08 12:10 ` [PATCH 15/20] dpaa_eth: register a device link for the qman portal used Madalin Bucur
2019-10-08 12:10 ` [PATCH 16/20] dpaa_eth: add dropped frames to percpu ethtool stats Madalin Bucur
2019-10-08 12:10 ` [PATCH 17/20] dpaa_eth: remove netdev_err() for user errors Madalin Bucur
2019-10-08 12:10 ` [PATCH 18/20] dpaa_eth: extend delays in ndo_stop Madalin Bucur
2019-10-08 12:10 ` [PATCH 19/20] dpaa_eth: add dpaa_dma_to_virt() Madalin Bucur
2019-10-09  7:39   ` Christoph Hellwig
2019-10-09 10:06     ` Laurentiu Tudor
2019-10-09 10:56     ` Madalin-cristian Bucur [this message]
2019-10-08 12:10 ` [PATCH 20/20] dpaa_eth: cleanup skb_to_contig_fd() Madalin Bucur
2019-10-09  4:01 ` [PATCH 00/20] DPAA fixes Jakub Kicinski
2019-10-09  5:53   ` Madalin-cristian Bucur

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=VI1PR04MB55677E492084AB7F816DED7BEC950@VI1PR04MB5567.eurprd04.prod.outlook.com \
    --to=madalin.bucur@nxp.com \
    --cc=davem@davemloft.net \
    --cc=hch@infradead.org \
    --cc=laurentiu.tudor@nxp.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=roy.pledge@nxp.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).