All of lore.kernel.org
 help / color / mirror / Atom feed
From: Damien Hedde <damien.hedde@greensocs.com>
To: Alistair Francis <alistair23@gmail.com>
Cc: "Peter Maydell" <peter.maydell@linaro.org>,
	"Daniel P. Berrange" <berrange@redhat.com>,
	"Eduardo Habkost" <ehabkost@redhat.com>,
	"Alistair Francis" <alistair@alistair23.me>,
	"Mark Burton" <mark.burton@greensocs.com>,
	"qemu-devel@nongnu.org Developers" <qemu-devel@nongnu.org>,
	qemu-arm <qemu-arm@nongnu.org>,
	"Marc-André Lureau" <marcandre.lureau@redhat.com>,
	"Paolo Bonzini" <pbonzini@redhat.com>,
	"Philippe Mathieu-Daudé" <philmd@redhat.com>,
	"Edgar Iglesias" <edgar.iglesias@gmail.com>
Subject: Re: [PATCH v7 1/9] hw/core/clock: introduce clock object
Date: Tue, 25 Feb 2020 10:48:45 +0100	[thread overview]
Message-ID: <51fcca2b-2258-80d7-a29d-7d7da8551ebd@greensocs.com> (raw)
In-Reply-To: <CAKmqyKP1LR3e5TmUvNWKub21sA7q6u2fK=saEH93i64furcpTQ@mail.gmail.com>



On 2/25/20 1:02 AM, Alistair Francis wrote:
> On Mon, Feb 24, 2020 at 9:05 AM Damien Hedde <damien.hedde@greensocs.com> wrote:
>>
>> This object may be used to represent a clock inside a clock tree.
>>
>> A clock may be connected to another clock so that it receives update,
>> through a callback, whenever the source/parent clock is updated.
>>
>> Although only the root clock of a clock tree controls the values
>> (represented as periods) of all clocks in tree, each clock holds
>> a local state containing the current value so that it can be fetched
>> independently. It will allows us to fullfill migration requirements
>> by migrating each clock independently of others.
>>
>> This is based on the original work of Frederic Konrad.
>>
>> Signed-off-by: Damien Hedde <damien.hedde@greensocs.com>
>> --
>>
>> v7:
>> + merge ClockIn & ClockOut into a single type Clock
>> + switch clock state to a period with 2^-32ns unit
>> + add some Hz and ns helpers
>> + propagate clock period when setting the source so that
>>   clocks with fixed period are easy to handle.
>> ---
>>  include/hw/clock.h    | 216 ++++++++++++++++++++++++++++++++++++++++++
>>  hw/core/clock.c       | 131 +++++++++++++++++++++++++
>>  hw/core/Makefile.objs |   2 +
>>  hw/core/trace-events  |   7 ++
>>  4 files changed, 356 insertions(+)
>>  create mode 100644 include/hw/clock.h
>>  create mode 100644 hw/core/clock.c
>>
>> diff --git a/include/hw/clock.h b/include/hw/clock.h
>> new file mode 100644
>> index 0000000000..30ac9a9946
>> --- /dev/null
>> +++ b/include/hw/clock.h
>> @@ -0,0 +1,216 @@

[...]

> 
>> +    clock_disconnect(clk);
>> +
>> +    g_free(clk->canonical_path);
>> +    clk->canonical_path = NULL;
> 
> You shouldn't need to set this to NULL.

ok.

> 
>> +}
>> +
>> +static const TypeInfo clock_info = {
>> +    .name              = TYPE_CLOCK,
>> +    .parent            = TYPE_OBJECT,
>> +    .instance_size     = sizeof(Clock),
>> +    .instance_init     = clock_initfn,
>> +    .instance_finalize = clock_finalizefn,
>> +};
>> +
>> +static void clock_register_types(void)
>> +{
>> +    type_register_static(&clock_info);
>> +}
>> +
>> +type_init(clock_register_types)
>> diff --git a/hw/core/Makefile.objs b/hw/core/Makefile.objs
>> index 6215e7c208..d7080edf89 100644
>> --- a/hw/core/Makefile.objs
>> +++ b/hw/core/Makefile.objs
>> @@ -7,10 +7,12 @@ common-obj-y += hotplug.o
>>  common-obj-y += vmstate-if.o
>>  # irq.o needed for qdev GPIO handling:
>>  common-obj-y += irq.o
>> +common-obj-y += clock.o
>>
>>  common-obj-$(CONFIG_SOFTMMU) += reset.o
>>  common-obj-$(CONFIG_SOFTMMU) += qdev-fw.o
>>  common-obj-$(CONFIG_SOFTMMU) += fw-path-provider.o
>> +common-obj-$(CONFIG_SOFTMMU) += hotplug.o
> 
> I don't think this should be here.
Oops, I missed this rebase artifact.

Thanks,
Damien


  reply	other threads:[~2020-02-25  9:51 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-02-24 17:02 [PATCH v7 0/9] Clock framework API Damien Hedde
2020-02-24 17:02 ` [PATCH v7 1/9] hw/core/clock: introduce clock object Damien Hedde
2020-02-25  0:02   ` Alistair Francis
2020-02-25  9:48     ` Damien Hedde [this message]
2020-02-24 17:02 ` [PATCH v7 2/9] hw/core/clock-vmstate: define a vmstate entry for clock state Damien Hedde
2020-02-25  0:05   ` Alistair Francis
2020-02-24 17:02 ` [PATCH v7 3/9] qdev: add clock input&output support to devices Damien Hedde
2020-02-25  1:27   ` Alistair Francis
2020-02-25 10:04     ` Damien Hedde
2020-02-24 17:02 ` [PATCH v7 4/9] qdev-clock: introduce an init array to ease the device construction Damien Hedde
2020-02-24 17:02 ` [PATCH v7 5/9] docs/clocks: add device's clock documentation Damien Hedde
2020-02-24 17:02 ` [PATCH v7 6/9] hw/misc/zynq_slcr: add clock generation for uarts Damien Hedde
2020-02-24 17:02 ` [PATCH v7 7/9] hw/char/cadence_uart: add clock support Damien Hedde
2020-02-24 17:03 ` [PATCH v7 8/9] hw/arm/xilinx_zynq: connect uart clocks to slcr Damien Hedde
2020-02-24 17:03 ` [PATCH v7 9/9] qdev-monitor: print the device's clock with info qtree Damien Hedde
2020-02-24 18:05 ` [PATCH v7 0/9] Clock framework API no-reply
2020-02-24 19:16 ` no-reply

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=51fcca2b-2258-80d7-a29d-7d7da8551ebd@greensocs.com \
    --to=damien.hedde@greensocs.com \
    --cc=alistair23@gmail.com \
    --cc=alistair@alistair23.me \
    --cc=berrange@redhat.com \
    --cc=edgar.iglesias@gmail.com \
    --cc=ehabkost@redhat.com \
    --cc=marcandre.lureau@redhat.com \
    --cc=mark.burton@greensocs.com \
    --cc=pbonzini@redhat.com \
    --cc=peter.maydell@linaro.org \
    --cc=philmd@redhat.com \
    --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.