Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 60598
b: refs/heads/master
c: 71712b4
h: refs/heads/master
v: v3
  • Loading branch information
Tony Breeds authored and Paul Mackerras committed Jun 28, 2007
1 parent 3356040 commit 88739f9
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 16 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: a5c631b174e23cab773cf422c1f39b28e7224602
refs/heads/master: 71712b455374a73af042fcfb5002fef5fd25ba44
30 changes: 19 additions & 11 deletions trunk/arch/powerpc/kernel/time.c
Original file line number Diff line number Diff line change
Expand Up @@ -77,9 +77,8 @@
/* keep track of when we need to update the rtc */
time_t last_rtc_update;
#ifdef CONFIG_PPC_ISERIES
unsigned long iSeries_recal_titan = 0;
unsigned long iSeries_recal_tb = 0;
static unsigned long first_settimeofday = 1;
static unsigned long __initdata iSeries_recal_titan;
static signed long __initdata iSeries_recal_tb;
#endif

/* The decrementer counts down by 128 every 128ns on a 601. */
Expand Down Expand Up @@ -556,10 +555,15 @@ EXPORT_SYMBOL(profile_pc);
* returned by the service processor for the timebase frequency.
*/

static void iSeries_tb_recal(void)
static int __init iSeries_tb_recal(void)
{
struct div_result divres;
unsigned long titan, tb;

/* Make sure we only run on iSeries */
if (!firmware_has_feature(FW_FEATURE_ISERIES))
return -ENODEV;

tb = get_tb();
titan = HvCallXm_loadTod();
if ( iSeries_recal_titan ) {
Expand Down Expand Up @@ -600,8 +604,18 @@ static void iSeries_tb_recal(void)
}
iSeries_recal_titan = titan;
iSeries_recal_tb = tb;

return 0;
}
#endif
late_initcall(iSeries_tb_recal);

/* Called from platform early init */
void __init iSeries_time_init_early(void)
{
iSeries_recal_tb = get_tb();
iSeries_recal_titan = HvCallXm_loadTod();
}
#endif /* CONFIG_PPC_ISERIES */

/*
* For iSeries shared processors, we have to let the hypervisor
Expand Down Expand Up @@ -765,12 +779,6 @@ int do_settimeofday(struct timespec *tv)
* to the RTC again, or write to the RTC but then they don't call
* settimeofday to perform this operation.
*/
#ifdef CONFIG_PPC_ISERIES
if (firmware_has_feature(FW_FEATURE_ISERIES) && first_settimeofday) {
iSeries_tb_recal();
first_settimeofday = 0;
}
#endif

/* Make userspace gettimeofday spin until we're done. */
++vdso_data->tb_update_count;
Expand Down
6 changes: 2 additions & 4 deletions trunk/arch/powerpc/platforms/iseries/setup.c
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,6 @@ extern void iSeries_pci_final_fixup(void);
static void iSeries_pci_final_fixup(void) { }
#endif

extern unsigned long iSeries_recal_tb;
extern unsigned long iSeries_recal_titan;

struct MemoryBlock {
unsigned long absStart;
Expand Down Expand Up @@ -292,8 +290,8 @@ static void __init iSeries_init_early(void)
{
DBG(" -> iSeries_init_early()\n");

iSeries_recal_tb = get_tb();
iSeries_recal_titan = HvCallXm_loadTod();
/* Snapshot the timebase, for use in later recalibration */
iSeries_time_init_early();

/*
* Initialize the DMA/TCE management
Expand Down
2 changes: 2 additions & 0 deletions trunk/include/asm-powerpc/time.h
Original file line number Diff line number Diff line change
Expand Up @@ -240,5 +240,7 @@ extern void snapshot_timebases(void);
#define snapshot_timebases() do { } while (0)
#endif

extern void iSeries_time_init_early(void);

#endif /* __KERNEL__ */
#endif /* __POWERPC_TIME_H */

0 comments on commit 88739f9

Please sign in to comment.