mirror of
https://github.com/xen-project/xen.git
synced 2026-10-29 18:50:05 +01:00
[POWERPC][XEN] Quiet timebase synchronization at boot.
Signed-off-by: Hollis Blanchard <hollisb@us.ibm.com>
This commit is contained in:
1 parent
48fd46e71f
commit
79bbad27d3
1 file changed
+12
-5
@@ -32,6 +32,13 @@
|
||||
|
||||
#define NUM_ITER 300
|
||||
|
||||
#undef DEBUG
|
||||
#ifdef DEBUG
|
||||
#define DBG(fmt...) printk(fmt)
|
||||
#else
|
||||
#define DBG(fmt...)
|
||||
#endif
|
||||
|
||||
enum {
|
||||
kExit=0, kSetAndTest, kTest
|
||||
};
|
||||
@@ -128,7 +135,7 @@ void __devinit smp_generic_give_timebase(void)
|
||||
{
|
||||
int i, score, score2, old, min=0, max=5000, offset=1000;
|
||||
|
||||
printk("Synchronizing timebase\n");
|
||||
printk("Synchronizing timebase...\n");
|
||||
|
||||
/* if this fails then this kernel won't work anyway... */
|
||||
tbsync = kmalloc( sizeof(*tbsync), GFP_KERNEL );
|
||||
@@ -139,13 +146,13 @@ void __devinit smp_generic_give_timebase(void)
|
||||
while (!tbsync->ack)
|
||||
barrier();
|
||||
|
||||
printk("Got ack\n");
|
||||
DBG("Got ack\n");
|
||||
|
||||
/* binary search */
|
||||
for (old = -1; old != offset ; offset = (min+max) / 2) {
|
||||
score = start_contest(kSetAndTest, offset, NUM_ITER);
|
||||
|
||||
printk("score %d, offset %d\n", score, offset );
|
||||
DBG("score %d, offset %d\n", score, offset );
|
||||
|
||||
if( score > 0 )
|
||||
max = offset;
|
||||
@@ -156,7 +163,7 @@ void __devinit smp_generic_give_timebase(void)
|
||||
score = start_contest(kSetAndTest, min, NUM_ITER);
|
||||
score2 = start_contest(kSetAndTest, max, NUM_ITER);
|
||||
|
||||
printk("Min %d (score %d), Max %d (score %d)\n",
|
||||
DBG("Min %d (score %d), Max %d (score %d)\n",
|
||||
min, score, max, score2);
|
||||
score = abs(score);
|
||||
score2 = abs(score2);
|
||||
@@ -171,7 +178,7 @@ void __devinit smp_generic_give_timebase(void)
|
||||
if (score2 <= score || score2 < 20)
|
||||
break;
|
||||
}
|
||||
printk("Final offset: %d (%d/%d)\n", offset, score2, NUM_ITER );
|
||||
DBG("Final offset: %d (%d/%d)\n", offset, score2, NUM_ITER );
|
||||
|
||||
/* exiting */
|
||||
tbsync->cmd = kExit;
|
||||
|
||||