Re: [PATCH 07/13] [RFC] ipath core misc files

Robert Walsh
2005-12-17T21:29:30Z

> > +void ipath_init_picotime(void)
> > +{
> > + int i;
> > + u_int64_t ts, te, delta = -1ULL;
> > +
> > + for (i = 0; i < 5; i++) {
> > + ts = get_cycles();
> > + udelay(250);
> > + te = get_cycles();
> > + if ((te - ts) < delta)
> > + delta = te - ts;
> > + yield();
> > + }
> > + _ipath_pico_per_cycle = 250000000 / delta;
> > +}
>
> hm, I hope this is debug code which is going away. If not, we should take
> a look at what it's trying to do here.

This isn't debug code. It's used to calculate the roughly number
picoseconds per cycle. This is used in the driver to make sure
HyperTransport reads haven't timed out (see ipath_snap_cntr in
ipath_driver.c) when reading chip counters. If you can think of a
better way of figuring out whether a read took greater than a certain
length of time, I'd be interested in knowing it.

Regards,
Robert.

--
Robert Walsh Email: rjwalsh@pathscale.com
PathScale, Inc. Phone: +1 650 934 8117
2071 Stierlin Court, Suite 200 Fax: +1 650 428 1969
Mountain View, CA 94043.