qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Philippe Mathieu-Daudé" <philmd@linaro.org>
To: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>,
	qemu-devel@nongnu.org, Peter Maydell <peter.maydell@linaro.org>
Cc: Thomas Huth <thuth@redhat.com>,
	qemu-arm@nongnu.org, Sergey Kambalin <serg.oker@gmail.com>
Subject: Re: [PATCH 15/15] hw/timer/arm_timer: QOM'ify ARM_TIMER
Date: Mon, 5 Jun 2023 12:20:56 +0200	[thread overview]
Message-ID: <33d6d99f-5a75-9891-b43f-c9caf40a62de@linaro.org> (raw)
In-Reply-To: <43f014f5-6dd7-7c46-eea4-ed9cffe8ec48@ilande.co.uk>

On 3/6/23 20:07, Mark Cave-Ayland wrote:
> On 31/05/2023 21:35, Philippe Mathieu-Daudé wrote:
> 
>> Introduce the ARM_TIMER sysbus device.
>>
>> arm_timer_new() is converted as QOM instance init()/finalize()
>> handlers. Note in arm_timer_finalize() we release a ptimer handle
>> which was previously leaked.
>>
>> ArmTimerState is directly embedded into SP804State/IcpPitState,
>> and is initialized as a QOM child.
>>
>> Since the timer frequency belongs to ARM_TIMER, have it hold the
>> QOM property. SP804State/IcpPitState directly access it.
>>
>> Similarly the SP804State/IcpPitState input IRQ becomes the
>> ARM_TIMER sysbus output IRQ.
>>
>> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
>> ---
>>   hw/timer/arm_timer.c | 109 +++++++++++++++++++++++++++----------------
>>   1 file changed, 70 insertions(+), 39 deletions(-)


>> -static void arm_timer_reset(ArmTimerState *s)
>> +static void arm_timer_reset(DeviceState *dev)
>>   {
>> +    ArmTimerState *s = ARM_TIMER(dev);
>> +
>>       s->control = TIMER_CTRL_IE;
>>   }
> 
> If you're currently set up to test the ARM timers with these changes, is 
> it worth considering converting this to use the Resettable interface at 
> the same time?

Good point. Then ARM_TIMER doesn't need to inherit from SysBus: if the
parent device resets it explicitly, it can be a plan QDev.

Peter, what do you think?

Even generically, I wonder if a QDev could resets all its QOM children,
propagating each ResetType.


  parent reply	other threads:[~2023-06-05 10:22 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20230531203559.29140-1-philmd@linaro.org>
     [not found] ` <20230531203559.29140-16-philmd@linaro.org>
2023-06-03 18:07   ` [PATCH 15/15] hw/timer/arm_timer: QOM'ify ARM_TIMER Mark Cave-Ayland
2023-06-03 18:12     ` Mark Cave-Ayland
2023-06-05 10:16       ` Philippe Mathieu-Daudé
2023-06-05 10:20     ` Philippe Mathieu-Daudé [this message]
2023-06-05 10:28       ` Peter Maydell
     [not found] ` <20230531203559.29140-2-philmd@linaro.org>
2023-06-08 14:35   ` [PATCH 01/15] hw/timer/arm_timer: Declare QOM types using DEFINE_TYPES() macro Peter Maydell
     [not found] ` <20230531203559.29140-3-philmd@linaro.org>
2023-06-08 14:36   ` [PATCH 02/15] hw/timer/arm_timer: Move SP804 code around Peter Maydell
     [not found] ` <20230531203559.29140-4-philmd@linaro.org>
2023-06-08 14:41   ` [PATCH 03/15] hw/timer/arm_timer: Add missing sp804_unrealize() handler Peter Maydell
2023-07-04 14:43     ` Philippe Mathieu-Daudé
     [not found] ` <20230531203559.29140-5-philmd@linaro.org>
2023-06-08 14:41   ` [PATCH 04/15] hw/timer/arm_timer: Remove pointless cast from void * Peter Maydell
     [not found] ` <20230531203559.29140-6-philmd@linaro.org>
2023-06-08 14:42   ` [PATCH 05/15] hw/timer/arm_timer: CamelCase rename icp_pit_state -> IntegratorPitState Peter Maydell
     [not found] ` <20230531203559.29140-7-philmd@linaro.org>
2023-06-08 14:44   ` [PATCH 06/15] hw/timer/arm_timer: CamelCase rename arm_timer_state -> ArmTimerState Peter Maydell
     [not found] ` <20230531203559.29140-8-philmd@linaro.org>
2023-06-08 14:46   ` [PATCH 07/15] hw/timer/arm_timer: Extract arm_timer_reset() Peter Maydell
2023-07-04 10:01     ` Philippe Mathieu-Daudé
     [not found] ` <20230531203559.29140-9-philmd@linaro.org>
2023-06-08 14:49   ` [PATCH 08/15] hw/timer/arm_timer: Rename arm_timer_init() -> arm_timer_new() Peter Maydell
     [not found] ` <20230531203559.29140-10-philmd@linaro.org>
2023-06-08 14:50   ` [PATCH 09/15] hw/timer/arm_timer: Convert ArmTimerState::freq to uint32_t type Peter Maydell
     [not found] ` <20230531203559.29140-11-philmd@linaro.org>
2023-06-08 14:50   ` [PATCH 10/15] hw/timer/arm_timer: Use array of frequency in SP804State Peter Maydell
     [not found] ` <20230531203559.29140-12-philmd@linaro.org>
2023-06-08 14:51   ` [PATCH 11/15] hw/timer/arm_timer: Iterate on timers using for() loop statement Peter Maydell
     [not found] ` <20230531203559.29140-13-philmd@linaro.org>
2023-06-08 15:00   ` [PATCH 12/15] hw/timer/arm_timer: Pass timer output IRQ as parameter to arm_timer_new Peter Maydell
2023-07-04 14:29     ` Philippe Mathieu-Daudé
     [not found] ` <20230531203559.29140-14-philmd@linaro.org>
2023-06-08 15:09   ` [PATCH 13/15] hw/timer/arm_timer: Fix misuse of SysBus IRQ in IcpPitState Peter Maydell
2023-07-04 14:25     ` 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=33d6d99f-5a75-9891-b43f-c9caf40a62de@linaro.org \
    --to=philmd@linaro.org \
    --cc=mark.cave-ayland@ilande.co.uk \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-arm@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    --cc=serg.oker@gmail.com \
    --cc=thuth@redhat.com \
    /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).