mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* [PATCH] mci: sdhci: fix dma mapping
@ 2024-04-08 16:31 Marco Felsch
  2024-04-10  6:35 ` Sascha Hauer
  0 siblings, 1 reply; 2+ messages in thread
From: Marco Felsch @ 2024-04-08 16:31 UTC (permalink / raw)
  To: barebox

In case of MMC_DATA_READ the dest address should be used and in case of
MMC_DATA_WRITE the src address should be used. We had no issues for now
since both dest and src point to same address due to the union.

Signed-off-by: Marco Felsch <m.felsch@pengutronix.de>
---
 drivers/mci/sdhci.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/mci/sdhci.c b/drivers/mci/sdhci.c
index edb819d66d42..a141e504971b 100644
--- a/drivers/mci/sdhci.c
+++ b/drivers/mci/sdhci.c
@@ -233,10 +233,10 @@ void sdhci_setup_data_dma(struct sdhci *sdhci, struct mci_data *data,
 	nbytes = data->blocks * data->blocksize;
 
 	if (data->flags & MMC_DATA_READ)
-		*dma = dma_map_single(dev, (void *)data->src, nbytes,
+		*dma = dma_map_single(dev, data->dest, nbytes,
 				      DMA_FROM_DEVICE);
 	else
-		*dma = dma_map_single(dev, data->dest, nbytes,
+		*dma = dma_map_single(dev, (void *)data->src, nbytes,
 				      DMA_TO_DEVICE);
 
 	if (dma_mapping_error(dev, *dma)) {
-- 
2.39.2




^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] mci: sdhci: fix dma mapping
  2024-04-08 16:31 [PATCH] mci: sdhci: fix dma mapping Marco Felsch
@ 2024-04-10  6:35 ` Sascha Hauer
  0 siblings, 0 replies; 2+ messages in thread
From: Sascha Hauer @ 2024-04-10  6:35 UTC (permalink / raw)
  To: barebox, Marco Felsch


On Mon, 08 Apr 2024 18:31:01 +0200, Marco Felsch wrote:
> In case of MMC_DATA_READ the dest address should be used and in case of
> MMC_DATA_WRITE the src address should be used. We had no issues for now
> since both dest and src point to same address due to the union.
> 
> 

Applied, thanks!

[1/1] mci: sdhci: fix dma mapping
      https://git.pengutronix.de/cgit/barebox/commit/?id=743130a7c75f (link may not be stable)

Best regards,
-- 
Sascha Hauer <s.hauer@pengutronix.de>




^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2024-04-10  6:36 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-04-08 16:31 [PATCH] mci: sdhci: fix dma mapping Marco Felsch
2024-04-10  6:35 ` Sascha Hauer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox