From: "Philippe Mathieu-Daudé" <philmd@linaro.org>
To: Raphael Poggi <raphael.poggi@lynxleap.co.uk>, qemu-devel@nongnu.org
Cc: luc@lmichel.fr, damien.hedde@dahe.fr,
Peter Maydell <peter.maydell@linaro.org>
Subject: Re: [PATCH] hw/core/clock: always iterate through childs in clock_propagate_period
Date: Thu, 18 Apr 2024 21:43:42 +0200 [thread overview]
Message-ID: <5b8ce05b-62c6-4362-aa16-a9e845eb4df7@linaro.org> (raw)
In-Reply-To: <20240418191602.2017-1-raphael.poggi@lynxleap.co.uk>
Hi Raphael,
On 18/4/24 21:16, Raphael Poggi wrote:
> When dealing with few clocks depending with each others, sometimes
> we might only want to update the multiplier/diviser on a specific clock
> (cf clockB in drawing below) and call "clock_propagate(clockA)" to
> update the childs period according to the potential new multiplier/diviser values.
>
> +--------+ +--------+ +--------+
> | clockA | --> | clockB | --> | clockC |
> +--------+ +--------+ +--------+
>
> The actual code would not allow that because, since we cannot call
> "clock_propagate" directly on a child, it would exit on the
> first child has the period has not changed for clockB, only clockC is
Typo "as the period has not changed"?
Why can't you call clock_propagate() on a child?
> impacted in our example.
>
> Signed-off-by: Raphael Poggi <raphael.poggi@lynxleap.co.uk>
> ---
> hw/core/clock.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/hw/core/clock.c b/hw/core/clock.c
> index a19c7db7df..85421f8b55 100644
> --- a/hw/core/clock.c
> +++ b/hw/core/clock.c
> @@ -101,8 +101,9 @@ static void clock_propagate_period(Clock *clk, bool call_callbacks)
> if (call_callbacks) {
> clock_call_callback(child, ClockUpdate);
> }
> - clock_propagate_period(child, call_callbacks);
> }
> +
> + clock_propagate_period(child, call_callbacks);
> }
> }
>
next prev parent reply other threads:[~2024-04-18 19:44 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-04-18 19:16 [PATCH] hw/core/clock: always iterate through childs in clock_propagate_period Raphael Poggi
2024-04-18 19:43 ` Philippe Mathieu-Daudé [this message]
2024-04-18 20:39 ` Raphael Poggi
2024-04-19 15:08 ` Peter Maydell
2024-04-19 16:08 ` Raphael Poggi
2024-04-19 16:24 ` Peter Maydell
2024-04-19 16:30 ` 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=5b8ce05b-62c6-4362-aa16-a9e845eb4df7@linaro.org \
--to=philmd@linaro.org \
--cc=damien.hedde@dahe.fr \
--cc=luc@lmichel.fr \
--cc=peter.maydell@linaro.org \
--cc=qemu-devel@nongnu.org \
--cc=raphael.poggi@lynxleap.co.uk \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).