mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* [PATCH] mci: fix data write
@ 2025-03-24 11:17 Sascha Hauer
  2025-03-25  7:16 ` Sascha Hauer
  0 siblings, 1 reply; 2+ messages in thread
From: Sascha Hauer @ 2025-03-24 11:17 UTC (permalink / raw)
  To: Barebox List

The dest and src fields in struct mci_data are a union, so we cannot not
set them both to different values. Only set one of them to make write
support operational again.

Fixes: 3854311954 ("mmc: merge block read/write functions")
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
 drivers/mci/mci-core.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/drivers/mci/mci-core.c b/drivers/mci/mci-core.c
index 5b892e8570..947fe44c08 100644
--- a/drivers/mci/mci-core.c
+++ b/drivers/mci/mci-core.c
@@ -360,8 +360,11 @@ static int mci_do_block_op(struct mci *mci, const void *src, void *dst, int bloc
 		mci->high_capacity != 0 ? blocknum : blocknum * mci->read_bl_len,
 		MMC_RSP_R1);
 
-	data.src = src;
-	data.dest = dst;
+	if (dst)
+		data.dest = dst;
+	else
+		data.src = src;
+
 	data.blocks = blocks;
 	data.blocksize = mci->read_bl_len;
 	data.flags = flags;
-- 
2.39.5




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

* Re: [PATCH] mci: fix data write
  2025-03-24 11:17 [PATCH] mci: fix data write Sascha Hauer
@ 2025-03-25  7:16 ` Sascha Hauer
  0 siblings, 0 replies; 2+ messages in thread
From: Sascha Hauer @ 2025-03-25  7:16 UTC (permalink / raw)
  To: Barebox List, Sascha Hauer


On Mon, 24 Mar 2025 12:17:49 +0100, Sascha Hauer wrote:
> The dest and src fields in struct mci_data are a union, so we cannot not
> set them both to different values. Only set one of them to make write
> support operational again.
> 
> 

Applied, thanks!

[1/1] mci: fix data write
      https://git.pengutronix.de/cgit/barebox/commit/?id=f646ed68434f (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:[~2025-03-25  7:23 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-03-24 11:17 [PATCH] mci: fix data write Sascha Hauer
2025-03-25  7:16 ` Sascha Hauer

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