From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
To: Geert Uytterhoeven <geert+renesas@glider.be>
Cc: Mark Brown <broonie@kernel.org>,
linux-spi@vger.kernel.org, linux-sh@vger.kernel.org
Subject: Re: [PATCH] spi: sh-msiof: Use correct device for DMA mapping with IOMMU
Date: Wed, 09 Jul 2014 21:38:06 +0000 [thread overview]
Message-ID: <70265909.OPtNRHeAkP@avalon> (raw)
In-Reply-To: <1404901277-31107-1-git-send-email-geert+renesas@glider.be>
Hi Geert,
Thank you for the patch.
On Wednesday 09 July 2014 12:21:17 Geert Uytterhoeven wrote:
> To function correctly in the presence of an IOMMU, the DMA buffers must be
> mapped using the DMA channel's device instead of the MSIOF platform
> device's device.
Shouldn't you also update the dma_unmap_single() calls ?
> Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
>
> ---
> drivers/spi/spi-sh-msiof.c | 6 ++++--
> 1 file changed, 4 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/spi/spi-sh-msiof.c b/drivers/spi/spi-sh-msiof.c
> index 9922ed3a4441..4f0f1cbc92ef 100644
> --- a/drivers/spi/spi-sh-msiof.c
> +++ b/drivers/spi/spi-sh-msiof.c
> @@ -1026,12 +1026,14 @@ static int sh_msiof_request_dma(struct
> sh_msiof_spi_priv *p) if (!p->rx_dma_page)
> goto free_tx_page;
>
> - p->tx_dma_addr = dma_map_single(dev, p->tx_dma_page, PAGE_SIZE,
> + p->tx_dma_addr = dma_map_single(&master->dma_tx->dev->device,
> + p->tx_dma_page, PAGE_SIZE,
> DMA_TO_DEVICE);
> if (dma_mapping_error(dev, p->tx_dma_addr))
> goto free_rx_page;
>
> - p->rx_dma_addr = dma_map_single(dev, p->rx_dma_page, PAGE_SIZE,
> + p->rx_dma_addr = dma_map_single(&master->dma_rx->dev->device,
> + p->rx_dma_page, PAGE_SIZE,
> DMA_FROM_DEVICE);
> if (dma_mapping_error(dev, p->rx_dma_addr))
> goto unmap_tx_page;
--
Regards,
Laurent Pinchart
WARNING: multiple messages have this Message-ID (diff)
From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
To: Geert Uytterhoeven <geert+renesas@glider.be>
Cc: Mark Brown <broonie@kernel.org>,
linux-spi@vger.kernel.org, linux-sh@vger.kernel.org
Subject: Re: [PATCH] spi: sh-msiof: Use correct device for DMA mapping with IOMMU
Date: Wed, 09 Jul 2014 23:38:06 +0200 [thread overview]
Message-ID: <70265909.OPtNRHeAkP@avalon> (raw)
In-Reply-To: <1404901277-31107-1-git-send-email-geert+renesas@glider.be>
Hi Geert,
Thank you for the patch.
On Wednesday 09 July 2014 12:21:17 Geert Uytterhoeven wrote:
> To function correctly in the presence of an IOMMU, the DMA buffers must be
> mapped using the DMA channel's device instead of the MSIOF platform
> device's device.
Shouldn't you also update the dma_unmap_single() calls ?
> Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
>
> ---
> drivers/spi/spi-sh-msiof.c | 6 ++++--
> 1 file changed, 4 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/spi/spi-sh-msiof.c b/drivers/spi/spi-sh-msiof.c
> index 9922ed3a4441..4f0f1cbc92ef 100644
> --- a/drivers/spi/spi-sh-msiof.c
> +++ b/drivers/spi/spi-sh-msiof.c
> @@ -1026,12 +1026,14 @@ static int sh_msiof_request_dma(struct
> sh_msiof_spi_priv *p) if (!p->rx_dma_page)
> goto free_tx_page;
>
> - p->tx_dma_addr = dma_map_single(dev, p->tx_dma_page, PAGE_SIZE,
> + p->tx_dma_addr = dma_map_single(&master->dma_tx->dev->device,
> + p->tx_dma_page, PAGE_SIZE,
> DMA_TO_DEVICE);
> if (dma_mapping_error(dev, p->tx_dma_addr))
> goto free_rx_page;
>
> - p->rx_dma_addr = dma_map_single(dev, p->rx_dma_page, PAGE_SIZE,
> + p->rx_dma_addr = dma_map_single(&master->dma_rx->dev->device,
> + p->rx_dma_page, PAGE_SIZE,
> DMA_FROM_DEVICE);
> if (dma_mapping_error(dev, p->rx_dma_addr))
> goto unmap_tx_page;
--
Regards,
Laurent Pinchart
next prev parent reply other threads:[~2014-07-09 21:38 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-07-09 10:21 [PATCH] spi: sh-msiof: Use correct device for DMA mapping with IOMMU Geert Uytterhoeven
2014-07-09 10:21 ` Geert Uytterhoeven
2014-07-09 21:38 ` Laurent Pinchart [this message]
2014-07-09 21:38 ` Laurent Pinchart
2014-07-09 21:52 ` Geert Uytterhoeven
2014-07-09 21:52 ` Geert Uytterhoeven
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=70265909.OPtNRHeAkP@avalon \
--to=laurent.pinchart@ideasonboard.com \
--cc=broonie@kernel.org \
--cc=geert+renesas@glider.be \
--cc=linux-sh@vger.kernel.org \
--cc=linux-spi@vger.kernel.org \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.