All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Alex Bennée" <alex.bennee@linaro.org>
To: Peter Maydell <peter.maydell@linaro.org>
Cc: qemu-arm@nongnu.org,  qemu-devel@nongnu.org,
	 Jim MacArthur <jim.macarthur@linaro.org>
Subject: Re: [PATCH 2/9] hw/dma/soc_dma: Simplify soc_dma_ch_update()
Date: Mon, 20 Jul 2026 11:10:53 +0100	[thread overview]
Message-ID: <8733xet1hu.fsf@draig.linaro.org> (raw)
In-Reply-To: <20260710105907.2570621-3-peter.maydell@linaro.org> (Peter Maydell's message of "Fri, 10 Jul 2026 11:59:00 +0100")

Peter Maydell <peter.maydell@linaro.org> writes:

> 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>
> ---
>  hw/dma/soc_dma.c | 15 +++++----------
>  1 file changed, 5 insertions(+), 10 deletions(-)
>
> 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);
> +    }
>  }

heh the diff is messy and the soc_dma_ch_update_type could do with some
clean-up but for this patch:

Reviewed-by: Alex Bennée <alex.bennee@linaro.org>

>  
>  static void soc_dma_ch_freq_update(struct dma_s *s)

-- 
Alex Bennée
Virtualisation Tech Lead @ Linaro


  reply	other threads:[~2026-07-20 10:11 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-10 10:58 [PATCH 0/9] omap_dma: avoid non-bounds-checked memcopy Peter Maydell
2026-07-10 10:58 ` [PATCH 1/9] hw/dma/soc_dma: Remove soc_dma_port_fifo support Peter Maydell
2026-07-13 10:57   ` Philippe Mathieu-Daudé
2026-07-10 10:59 ` [PATCH 2/9] hw/dma/soc_dma: Simplify soc_dma_ch_update() Peter Maydell
2026-07-20 10:10   ` Alex Bennée [this message]
2026-07-10 10:59 ` [PATCH 3/9] hw/dma/soc_dma: Remove union from memmap_entry_s struct Peter Maydell
2026-07-13 10:56   ` Philippe Mathieu-Daudé
2026-07-10 10:59 ` [PATCH 4/9] hw/dma/omap_dma: Be more careful about overflow in transfer setup Peter Maydell
2026-07-14 15:50   ` Jim MacArthur
2026-07-10 10:59 ` [PATCH 5/9] hw/dma/soc_dma: dma bytes is uint64_t Peter Maydell
2026-07-14 15:56   ` Jim MacArthur
2026-07-10 10:59 ` [PATCH 6/9] hw/dma/soc_dma: Use physical_memory_map() for mem2mem transfers Peter Maydell
2026-07-13 11:00   ` Philippe Mathieu-Daudé
2026-07-10 10:59 ` [PATCH 7/9] hw/dma/soc_dma: Remove unused mem.base, paddr fields Peter Maydell
2026-07-13 11:02   ` Philippe Mathieu-Daudé
2026-07-10 10:59 ` [PATCH 8/9] include/hw/arm/omap_dma.h: Move to include/hw/dma Peter Maydell
2026-07-10 13:37   ` Philippe Mathieu-Daudé
2026-07-10 13:49     ` Peter Maydell
2026-07-10 10:59 ` [PATCH 9/9] MAINTAINERS: Add soc_dma to OMAP section Peter Maydell
2026-07-13 12:12   ` Philippe Mathieu-Daudé

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=8733xet1hu.fsf@draig.linaro.org \
    --to=alex.bennee@linaro.org \
    --cc=jim.macarthur@linaro.org \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-arm@nongnu.org \
    --cc=qemu-devel@nongnu.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.