public inbox for linux-ia64@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] fix HPET time_interpolator registration
@ 2004-11-03 17:24 Bjorn Helgaas
  2004-11-04  2:57 ` Andrew Morton
  0 siblings, 1 reply; 4+ messages in thread
From: Bjorn Helgaas @ 2004-11-03 17:24 UTC (permalink / raw)
  To: Andrew Morton
  Cc: Bob Picco, Venkatesh Pallipadi, linux-kernel, linux-ia64,
	Christoph Lameter

[-- Attachment #1: Type: text/plain, Size: 208 bytes --]

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.

[-- Attachment #2: hpet-mask.patch --]
[-- Type: text/x-diff, Size: 619 bytes --]

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

Signed-off-by: Bjorn Helgaas <bjorn.helgaas@hp.com>

===== 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;
 
 	hpetp->hp_interpolator = ti;
 	register_time_interpolator(ti);

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] fix HPET time_interpolator registration
  2004-11-03 17:24 [PATCH] fix HPET time_interpolator registration Bjorn Helgaas
@ 2004-11-04  2:57 ` Andrew Morton
  2004-11-04  3:52   ` Christoph Lameter
  0 siblings, 1 reply; 4+ messages in thread
From: Andrew Morton @ 2004-11-04  2:57 UTC (permalink / raw)
  To: Bjorn Helgaas
  Cc: Robert.Picco, venkatesh.pallipadi, linux-kernel, linux-ia64,
	clameter

Bjorn Helgaas <bjorn.helgaas@hp.com> wrote:
>
>  Fixup after mid-air collision between Christoph adding time_interpolator.mask,
>  and me removing a static time_interpolator struct from hpet.
> 
>  Signed-off-by: Bjorn Helgaas <bjorn.helgaas@hp.com>
> 
>  === 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;
>   
>   	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.


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] fix HPET time_interpolator registration
  2004-11-04  2:57 ` Andrew Morton
@ 2004-11-04  3:52   ` Christoph Lameter
  2004-11-04  4:47     ` Andrew Morton
  0 siblings, 1 reply; 4+ messages in thread
From: Christoph Lameter @ 2004-11-04  3:52 UTC (permalink / raw)
  To: Andrew Morton
  Cc: Bjorn Helgaas, Robert.Picco, venkatesh.pallipadi, linux-kernel,
	linux-ia64

On Wed, 3 Nov 2004, Andrew Morton wrote:

> Bjorn Helgaas <bjorn.helgaas@hp.com> wrote:
> >
> >  Fixup after mid-air collision between Christoph adding time_interpolator.mask,
> >  and me removing a static time_interpolator struct from hpet.
> >
> >  Signed-off-by: Bjorn Helgaas <bjorn.helgaas@hp.com>
> >
> >  === 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;
> >
> >   	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.

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

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] fix HPET time_interpolator registration
  2004-11-04  3:52   ` Christoph Lameter
@ 2004-11-04  4:47     ` Andrew Morton
  0 siblings, 0 replies; 4+ messages in thread
From: Andrew Morton @ 2004-11-04  4:47 UTC (permalink / raw)
  To: Christoph Lameter
  Cc: bjorn.helgaas, Robert.Picco, venkatesh.pallipadi, linux-kernel,
	linux-ia64

Christoph Lameter <clameter@sgi.com> wrote:
>
> On Wed, 3 Nov 2004, Andrew Morton wrote:
> 
> > Bjorn Helgaas <bjorn.helgaas@hp.com> wrote:
> > >
> > >  Fixup after mid-air collision between Christoph adding time_interpolator.mask,
> > >  and me removing a static time_interpolator struct from hpet.
> > >
> > >  Signed-off-by: Bjorn Helgaas <bjorn.helgaas@hp.com>
> > >
> > >  === 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;
> > >
> > >   	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.
> 
> 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.



^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2004-11-04  4:47 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-11-03 17:24 [PATCH] fix HPET time_interpolator registration Bjorn Helgaas
2004-11-04  2:57 ` Andrew Morton
2004-11-04  3:52   ` Christoph Lameter
2004-11-04  4:47     ` Andrew Morton

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox