Commit f00bef33fe for qemu.org
commit f00bef33febb92dfc91a00bba3e4819070ee8d29
Author: Peter Maydell <peter.maydell@linaro.org>
Date: Mon Jul 20 19:05:30 2026 +0100
hw/dma/soc_dma: Simplify soc_dma_ch_update()
Now we only have "mem" and "other" as soc_dma_port_type values, we
can simplify soc_dma_ch_update(): either both src and dst are mem, in
which case we use transfer_mem2mem and set update to 1 to tell
omap_dma_transfer_setup() to update all the guest-visible
src/dest/count information to indicate a completed transfer; or else
we use the omap_dma_transfer_generic() function, and we set update to
0 to tell omap_dma_transfer_setup() that the transfer function will
be updating the src/dest/count.
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Message-id: 20260710105907.2570621-3-peter.maydell@linaro.org
Reviewed-by: Alex Bennée <alex.bennee@linaro.org>
diff --git a/hw/dma/soc_dma.c b/hw/dma/soc_dma.c
index 8ba531feea..ff51338388 100644
--- a/hw/dma/soc_dma.c
+++ b/hw/dma/soc_dma.c
@@ -121,19 +121,14 @@ void soc_dma_ch_update(struct soc_dma_ch_s *ch)
enum soc_dma_port_type src, dst;
src = soc_dma_ch_update_type(ch, 0);
- if (src == soc_dma_port_other) {
+ dst = soc_dma_ch_update_type(ch, 1);
+ if (src == soc_dma_port_other || dst == soc_dma_port_other) {
ch->update = 0;
ch->transfer_fn = ch->dma->transfer_fn;
- return;
- }
- dst = soc_dma_ch_update_type(ch, 1);
-
- if (src == soc_dma_port_mem && dst == soc_dma_port_mem)
+ } else {
+ ch->update = 1;
ch->transfer_fn = transfer_mem2mem;
- else
- ch->transfer_fn = ch->dma->transfer_fn;
-
- ch->update = (dst != soc_dma_port_other);
+ }
}
static void soc_dma_ch_freq_update(struct dma_s *s)