* Re: [PATCH 1/2] x86/platform: add a wallclock_init func to x86_platforms ops
[not found] <20110125153813.4aa1e7cc@lxorguk.ukuu.org.uk>
@ 2011-01-26 3:03 ` Feng Tang
2011-01-26 12:26 ` Thomas Gleixner
0 siblings, 1 reply; 4+ messages in thread
From: Feng Tang @ 2011-01-26 3:03 UTC (permalink / raw)
To: tglx, Alan Cox; +Cc: x86, linux-kernel
> Date: Tue, 25 Jan 2011 16:20:17 +0100 (CET)
> From: Thomas Gleixner <tglx@linutronix.de>
> To: Alan Cox <alan@lxorguk.ukuu.org.uk>
> Cc: x86@kernel.org, linux-kernel@vger.kernel.org
> Subject: Re: [PATCH 1/2] x86/platform: add a wallclock_init func to
> x86_platforms ops
>
>
> On Tue, 25 Jan 2011, Alan Cox wrote:
>
> > From: Feng Tang <feng.tang@intel.com>
> >
> > Some wall clock devices use MMIO based HW register, this new
> > function will give them a chance to do some initialization work
> > before their get/set_time service get called.
> >
> > Signed-off-by: Feng Tang <feng.tang@intel.com>
> > Signed-off-by: Jacob Pan <jacob.jun.pan@linux.intel.com>
> > Signed-off-by: Alan Cox <alan@linux.intel.com>
> > ---
> >
> > arch/x86/include/asm/x86_init.h | 2 ++
> > arch/x86/kernel/setup.c | 2 ++
> > arch/x86/kernel/x86_init.c | 2 ++
> > 3 files changed, 6 insertions(+), 0 deletions(-)
> >
> >
> > diff --git a/arch/x86/include/asm/x86_init.h
> > b/arch/x86/include/asm/x86_init.h index 64642ad..f7fa2e7 100644
> > --- a/arch/x86/include/asm/x86_init.h
> > +++ b/arch/x86/include/asm/x86_init.h
> > @@ -138,6 +138,7 @@ struct x86_cpuinit_ops {
> > /**
> > * struct x86_platform_ops - platform specific runtime functions
> > * @calibrate_tsc: calibrate TSC
> > + * @wallclock_init: init the wallclock device
>
> That's a one time called init function, so it should go into
> x86_init_ops.
>
> Thanks,
>
> tglx
>
Hi Thomas,
Here is the updated one, if you think it's ok, I'll update the second patch later.
Thanks,
Feng
-------------
>From b305dc1ae5db882ac8ab49248096f96dd16bdd9a Mon Sep 17 00:00:00 2001
From: Feng Tang <feng.tang@intel.com>
Date: Wed, 26 Jan 2011 10:41:25 +0800
Subject: [PATCH] x86/platform: add a wallclock_init func to x86_init.timers ops
Some wall clock devices use MMIO based HW register, this new
function will give them a chance to do some initialization work
before their get/set_time service get called, which is usually
called in early kernel boot phase.
Signed-off-by: Feng Tang <feng.tang@intel.com>
Signed-off-by: Jacob Pan <jacob.jun.pan@linux.intel.com>
Signed-off-by: Alan Cox <alan@linux.intel.com>
---
arch/x86/include/asm/x86_init.h | 2 ++
arch/x86/kernel/setup.c | 2 ++
arch/x86/kernel/x86_init.c | 1 +
3 files changed, 5 insertions(+), 0 deletions(-)
diff --git a/arch/x86/include/asm/x86_init.h b/arch/x86/include/asm/x86_init.h
index 64642ad..643ebf2 100644
--- a/arch/x86/include/asm/x86_init.h
+++ b/arch/x86/include/asm/x86_init.h
@@ -83,11 +83,13 @@ struct x86_init_paging {
* boot cpu
* @tsc_pre_init: platform function called before TSC init
* @timer_init: initialize the platform timer (default PIT/HPET)
+ * @wallclock_init: init the wallclock device
*/
struct x86_init_timers {
void (*setup_percpu_clockev)(void);
void (*tsc_pre_init)(void);
void (*timer_init)(void);
+ void (*wallclock_init)(void);
};
/**
diff --git a/arch/x86/kernel/setup.c b/arch/x86/kernel/setup.c
index a25ce88..8b1cd72 100644
--- a/arch/x86/kernel/setup.c
+++ b/arch/x86/kernel/setup.c
@@ -1066,6 +1066,8 @@ void __init setup_arch(char **cmdline_p)
#endif
x86_init.oem.banner();
+ x86_init.timers.wallclock_init();
+
mcheck_init();
local_irq_save(flags);
diff --git a/arch/x86/kernel/x86_init.c b/arch/x86/kernel/x86_init.c
index ceb2911..c11514e 100644
--- a/arch/x86/kernel/x86_init.c
+++ b/arch/x86/kernel/x86_init.c
@@ -70,6 +70,7 @@ struct x86_init_ops x86_init __initdata = {
.setup_percpu_clockev = setup_boot_APIC_clock,
.tsc_pre_init = x86_init_noop,
.timer_init = hpet_time_init,
+ .wallclock_init = x86_init_noop,
},
.iommu = {
--
1.7.0.4
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH 1/2] x86/platform: add a wallclock_init func to x86_platforms ops
2011-01-26 3:03 ` [PATCH 1/2] x86/platform: add a wallclock_init func to x86_platforms ops Feng Tang
@ 2011-01-26 12:26 ` Thomas Gleixner
0 siblings, 0 replies; 4+ messages in thread
From: Thomas Gleixner @ 2011-01-26 12:26 UTC (permalink / raw)
To: Feng Tang; +Cc: Alan Cox, x86, linux-kernel
On Wed, 26 Jan 2011, Feng Tang wrote:
> Hi Thomas,
>
> Here is the updated one, if you think it's ok, I'll update the second patch later.
Looks good. Thanks,
tglx
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH 1/2] x86/platform: add a wallclock_init func to x86_platforms ops
2011-01-25 14:26 Alan Cox
@ 2011-01-25 15:20 ` Thomas Gleixner
0 siblings, 0 replies; 4+ messages in thread
From: Thomas Gleixner @ 2011-01-25 15:20 UTC (permalink / raw)
To: Alan Cox; +Cc: x86, linux-kernel
On Tue, 25 Jan 2011, Alan Cox wrote:
> From: Feng Tang <feng.tang@intel.com>
>
> Some wall clock devices use MMIO based HW register, this new function will
> give them a chance to do some initialization work before their get/set_time
> service get called.
>
> Signed-off-by: Feng Tang <feng.tang@intel.com>
> Signed-off-by: Jacob Pan <jacob.jun.pan@linux.intel.com>
> Signed-off-by: Alan Cox <alan@linux.intel.com>
> ---
>
> arch/x86/include/asm/x86_init.h | 2 ++
> arch/x86/kernel/setup.c | 2 ++
> arch/x86/kernel/x86_init.c | 2 ++
> 3 files changed, 6 insertions(+), 0 deletions(-)
>
>
> diff --git a/arch/x86/include/asm/x86_init.h b/arch/x86/include/asm/x86_init.h
> index 64642ad..f7fa2e7 100644
> --- a/arch/x86/include/asm/x86_init.h
> +++ b/arch/x86/include/asm/x86_init.h
> @@ -138,6 +138,7 @@ struct x86_cpuinit_ops {
> /**
> * struct x86_platform_ops - platform specific runtime functions
> * @calibrate_tsc: calibrate TSC
> + * @wallclock_init: init the wallclock device
That's a one time called init function, so it should go into
x86_init_ops.
Thanks,
tglx
^ permalink raw reply [flat|nested] 4+ messages in thread
* [PATCH 1/2] x86/platform: add a wallclock_init func to x86_platforms ops
@ 2011-01-25 14:26 Alan Cox
2011-01-25 15:20 ` Thomas Gleixner
0 siblings, 1 reply; 4+ messages in thread
From: Alan Cox @ 2011-01-25 14:26 UTC (permalink / raw)
To: x86, linux-kernel
From: Feng Tang <feng.tang@intel.com>
Some wall clock devices use MMIO based HW register, this new function will
give them a chance to do some initialization work before their get/set_time
service get called.
Signed-off-by: Feng Tang <feng.tang@intel.com>
Signed-off-by: Jacob Pan <jacob.jun.pan@linux.intel.com>
Signed-off-by: Alan Cox <alan@linux.intel.com>
---
arch/x86/include/asm/x86_init.h | 2 ++
arch/x86/kernel/setup.c | 2 ++
arch/x86/kernel/x86_init.c | 2 ++
3 files changed, 6 insertions(+), 0 deletions(-)
diff --git a/arch/x86/include/asm/x86_init.h b/arch/x86/include/asm/x86_init.h
index 64642ad..f7fa2e7 100644
--- a/arch/x86/include/asm/x86_init.h
+++ b/arch/x86/include/asm/x86_init.h
@@ -138,6 +138,7 @@ struct x86_cpuinit_ops {
/**
* struct x86_platform_ops - platform specific runtime functions
* @calibrate_tsc: calibrate TSC
+ * @wallclock_init: init the wallclock device
* @get_wallclock: get time from HW clock like RTC etc.
* @set_wallclock: set time back to HW clock
* @is_untracked_pat_range exclude from PAT logic
@@ -146,6 +147,7 @@ struct x86_cpuinit_ops {
*/
struct x86_platform_ops {
unsigned long (*calibrate_tsc)(void);
+ void (*wallclock_init)(void);
unsigned long (*get_wallclock)(void);
int (*set_wallclock)(unsigned long nowtime);
void (*iommu_shutdown)(void);
diff --git a/arch/x86/kernel/setup.c b/arch/x86/kernel/setup.c
index d3cfe26..c204fd5 100644
--- a/arch/x86/kernel/setup.c
+++ b/arch/x86/kernel/setup.c
@@ -1066,6 +1066,8 @@ void __init setup_arch(char **cmdline_p)
#endif
x86_init.oem.banner();
+ x86_platform.wallclock_init();
+
mcheck_init();
local_irq_save(flags);
diff --git a/arch/x86/kernel/x86_init.c b/arch/x86/kernel/x86_init.c
index ceb2911..fc3f0e6 100644
--- a/arch/x86/kernel/x86_init.c
+++ b/arch/x86/kernel/x86_init.c
@@ -27,6 +27,7 @@ void __init x86_init_uint_noop(unsigned int unused) { }
void __init x86_init_pgd_noop(pgd_t *unused) { }
int __init iommu_init_noop(void) { return 0; }
void iommu_shutdown_noop(void) { }
+void wallclock_init_noop(void) { }
/*
* The platform setup functions are preset with the default functions
@@ -92,6 +93,7 @@ static int default_i8042_detect(void) { return 1; };
struct x86_platform_ops x86_platform = {
.calibrate_tsc = native_calibrate_tsc,
+ .wallclock_init = wallclock_init_noop,
.get_wallclock = mach_get_cmos_time,
.set_wallclock = mach_set_rtc_mmss,
.iommu_shutdown = iommu_shutdown_noop,
^ permalink raw reply related [flat|nested] 4+ messages in thread
end of thread, other threads:[~2011-01-26 12:26 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
[not found] <20110125153813.4aa1e7cc@lxorguk.ukuu.org.uk>
2011-01-26 3:03 ` [PATCH 1/2] x86/platform: add a wallclock_init func to x86_platforms ops Feng Tang
2011-01-26 12:26 ` Thomas Gleixner
2011-01-25 14:26 Alan Cox
2011-01-25 15:20 ` Thomas Gleixner
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.