Skip to contentSkip to conversation

fix HPET time_interpolator registration

PATCH In review Bjorn Helgaas 3 participants 4 messages Nov 3, 2004 – Nov 4, 2004

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 fix HPET time_interpolator registration

Fixup after mid-air collision between Christoph adding time_interpolator.mask, and me removing a static time_interpolator struct from hpet.c. This causes a boot-time BUG() on boxes that use the hpet driver.

Fixup after mid-air collision between Christoph adding time_interpolator.mask, and me removing a static time_interpolator struct from hpet.

===== drivers/char/hpet.c 1.14 vs edited =====

drivers/char/hpet.c +1 -0
@@ -712,6 +712,7 @@
 	ti->addr = &hpetp->hp_hpet->hpet_mc;
 	ti->frequency = hpet_time_div(hpets->hp_period);
 	ti->drift = ti->frequency * HPET_DRIFT / 1000000;
+	ti->mask = 0xffffffffffffffffLL;
 
 	hpetp->hp_interpolator = ti;
 	register_time_interpolator(ti);
#1 lore raw
Quoted 14 lines · Bjorn Helgaas

Fixup after mid-air collision between Christoph adding time_interpolator.mask, and me removing a static time_interpolator struct from hpet.

=== drivers/char/hpet.c 1.14 vs edited ==> --- 1.14/drivers/char/hpet.c 2004-11-02 07:40:42 -07:00
+++ edited/drivers/char/hpet.c 2004-11-03 10:05:26 -07:00
@@ -712,6 +712,7 @@
ti->addr = &hpetp->hp_hpet->hpet_mc; ti->frequency = hpet_time_div(hpets->hp_period); ti->drift = ti->frequency * HPET_DRIFT / 1000000;
+ ti->mask = 0xffffffffffffffffLL;

Quoted 3 lines
  	hpetp->hp_interpolator = ti;
  	register_time_interpolator(ti);

ti->mask is u64, and on some architectures u64 is `long'. Compilers might
whine about this. I'll make it

	ti->mask = -1;

which just works.

#2 lore raw
Quoted 19 lines · Andrew Morton
Quoted 14 lines · Bjorn Helgaas

Fixup after mid-air collision between Christoph adding time_interpolator.mask, and me removing a static time_interpolator struct from hpet.

=== drivers/char/hpet.c 1.14 vs edited ==> > --- 1.14/drivers/char/hpet.c 2004-11-02 07:40:42 -07:00
+++ edited/drivers/char/hpet.c 2004-11-03 10:05:26 -07:00
@@ -712,6 +712,7 @@
ti->addr = &hpetp->hp_hpet->hpet_mc; ti->frequency = hpet_time_div(hpets->hp_period); ti->drift = ti->frequency * HPET_DRIFT / 1000000;
+ ti->mask = 0xffffffffffffffffLL;

Quoted 3 lines
  	hpetp->hp_interpolator = ti;
  	register_time_interpolator(ti);
Quoted 6 lines

ti->mask is u64, and on some architectures u64 is `long'. Compilers might
whine about this. I'll make it

	ti->mask = -1;

which just works.

Hmmm... How do you then specify a 64 bit mask without running into issues with the compilers?

#3 lore raw
Quoted 25 lines · Christoph Lameter
Quoted 22 lines · Andrew Morton
Quoted 14 lines · Bjorn Helgaas

Fixup after mid-air collision between Christoph adding time_interpolator.mask, and me removing a static time_interpolator struct from hpet.

=== drivers/char/hpet.c 1.14 vs edited ==> > > --- 1.14/drivers/char/hpet.c 2004-11-02 07:40:42 -07:00
+++ edited/drivers/char/hpet.c 2004-11-03 10:05:26 -07:00
@@ -712,6 +712,7 @@
ti->addr = &hpetp->hp_hpet->hpet_mc; ti->frequency = hpet_time_div(hpets->hp_period); ti->drift = ti->frequency * HPET_DRIFT / 1000000;
+ ti->mask = 0xffffffffffffffffLL;

Quoted 3 lines
  	hpetp->hp_interpolator = ti;
  	register_time_interpolator(ti);

ti->mask is u64, and on some architectures u64 is `long'. Compilers might
whine about this. I'll make it

Quoted 6 lines
Quoted 3 lines
	ti->mask = -1;

which just works.

Hmmm... How do you then specify a 64 bit mask without running into issues with the compilers?

Well with 0xffffffff[ffffffff] it's easy: use -1 and sign extension.

The only problem I can see is if you want to propagate a bit pattern across the scalar but you don't know its size. Say 0x5a5a5a5a versus 0x5a5a5a5a5a5a5a5a. But nobody ever wants to do that.