From: Julien Grall <julien.grall@linaro.org>
To: Oleksandr Tyshchenko <oleksandr.tyshchenko@globallogic.com>,
xen-devel@lists.xen.org
Cc: tim@xen.org, ian.campbell@citrix.com, stefano.stabellini@eu.citrix.com
Subject: Re: [RFC PATCH v1] xen/arm: split the init_xen_time() in 2 parts
Date: Mon, 26 Jan 2015 13:32:54 +0000 [thread overview]
Message-ID: <54C64206.6000905@linaro.org> (raw)
In-Reply-To: <1422028183-31696-1-git-send-email-oleksandr.tyshchenko@globallogic.com>
Hi Oleksandr,
Thank you for the patch. See few comments below.
On 23/01/15 15:49, Oleksandr Tyshchenko wrote:
> Create preinit_xen_time() and move to it minimum required
> subset of operations needed to properly initialized
> cpu_khz and boot_count vars. This is allow us to use udelay()
> immediately after the call.
>
> Signed-off-by: Oleksandr Tyshchenko <oleksandr.tyshchenko@globallogic.com>
> CC: Julien Grall <julien.grall@linaro.org>
> ---
> xen/arch/arm/setup.c | 2 ++
> xen/arch/arm/time.c | 71 ++++++++++++++++++++++++++++++++------------------
> xen/include/xen/time.h | 1 +
> 3 files changed, 48 insertions(+), 26 deletions(-)
>
> diff --git a/xen/arch/arm/setup.c b/xen/arch/arm/setup.c
> index f49569d..dbd7d5a 100644
> --- a/xen/arch/arm/setup.c
> +++ b/xen/arch/arm/setup.c
> @@ -743,6 +743,8 @@ void __init start_xen(unsigned long boot_phys_offset,
>
> init_IRQ();
>
> + preinit_xen_time();
> +
> dt_uart_init();
> console_init_preirq();
> console_init_ring();
> diff --git a/xen/arch/arm/time.c b/xen/arch/arm/time.c
> index 455f217..b2560db 100644
> --- a/xen/arch/arm/time.c
> +++ b/xen/arch/arm/time.c
> @@ -61,25 +61,56 @@ unsigned int timer_get_irq(enum timer_ppi ppi)
> return muldiv64(ns, 1000 * cpu_khz, SECONDS(1));
> }
>
> -/* Set up the timer on the boot CPU */
> -int __init init_xen_time(void)
> +static __init struct dt_device_node *find_timer_node(void)
> +{
> + static const struct dt_device_match timer_ids[] __initconst =
> + {
> + DT_MATCH_TIMER,
> + { /* sentinel */ },
> + };
> +
> + return dt_find_matching_node(NULL, timer_ids);
> +}
If you store the device tree pointer into a static variable, you won't
able to look at twice the node (in preinit_xen_time and init_xen_time).
> +
> +/* Set up the timer on the boot CPU (early init function) */
> +int __init preinit_xen_time(void)
You always return 0 and never check the return. Please use void.
> {
> - static const struct dt_device_match timer_ids[] __initconst =
> - {
> - DT_MATCH_TIMER,
> - { /* sentinel */ },
> - };
> struct dt_device_node *dev;
> int res;
> - unsigned int i;
> u32 rate;
>
> - dev = dt_find_matching_node(NULL, timer_ids);
> + dev = find_timer_node();
> if ( !dev )
> panic("Unable to find a compatible timer in the device tree");
>
> dt_device_set_used_by(dev, DOMID_XEN);
>
> + res = platform_init_time();
If you move platform_init_time in preinit_xen_time, you also have to
move platform_init before calling preinit_xen_time.
Regards,
--
Julien Grall
next prev parent reply other threads:[~2015-01-26 13:32 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-01-23 15:49 [RFC PATCH v1] xen/arm: split the init_xen_time() in 2 parts Oleksandr Tyshchenko
2015-01-26 13:32 ` Julien Grall [this message]
2015-01-26 13:54 ` Oleksandr Tyshchenko
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=54C64206.6000905@linaro.org \
--to=julien.grall@linaro.org \
--cc=ian.campbell@citrix.com \
--cc=oleksandr.tyshchenko@globallogic.com \
--cc=stefano.stabellini@eu.citrix.com \
--cc=tim@xen.org \
--cc=xen-devel@lists.xen.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.