> > +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: [email protected]
PathScale, Inc. Phone: +1 650 934 8117
2071 Stierlin Court, Suite 200 Fax: +1 650 428 1969
Mountain View, CA 94043.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
[Index of Archives]
[Kernel Newbies]
[Netfilter]
[Bugtraq]
[Photo]
[Stuff]
[Gimp]
[Yosemite News]
[MIPS Linux]
[ARM Linux]
[Linux Security]
[Linux RAID]
[Video 4 Linux]
[Linux for the blind]
[Linux Resources]