Convert ticks to milliseconds.
The 33 milliseconds in the timeout_add_msec(9) call will be truncated
to 3 ticks, but that was already the case with the current (hz / 30)
code so this is no worse.
ok?
Index: isa/fd.c
===================================================================
RCS file: /cvs/src/sys/dev/isa/fd.c,v
retrieving revision 1.106
diff -u -p -r1.106 fd.c
--- isa/fd.c 30 Dec 2017 23:08:29 -0000 1.106
+++ isa/fd.c 7 Jan 2020 04:16:01 -0000
@@ -210,11 +210,11 @@ fdprobe(struct device *parent, void *mat
/* select drive and turn on motor */
bus_space_write_1(iot, ioh, fdout, drive | FDO_FRST | FDO_MOEN(drive));
/* wait for motor to spin up */
- tsleep(fdc, 0, "fdprobe", 250 * hz / 1000);
+ tsleep_nsec(fdc, 0, "fdprobe", MSEC_TO_NSEC(250));
out_fdc(iot, ioh, NE7CMD_RECAL);
out_fdc(iot, ioh, drive);
/* wait for recalibrate */
- tsleep(fdc, 0, "fdprobe", 2000 * hz / 1000);
+ tsleep_nsec(fdc, 0, "fdprobe", MSEC_TO_NSEC(2000));
out_fdc(iot, ioh, NE7CMD_SENSEI);
n = fdcresult(fdc);
#ifdef FD_DEBUG
@@ -228,7 +228,7 @@ fdprobe(struct device *parent, void *mat
#endif
/* turn off motor */
- tsleep(fdc, 0, "fdprobe", 250 * hz / 1000);
+ tsleep_nsec(fdc, 0, "fdprobe", MSEC_TO_NSEC(250));
bus_space_write_1(iot, ioh, fdout, FDO_FRST);
/* flags & 0x20 forces the drive to be found even if it won't probe */
@@ -900,7 +900,7 @@ loop:
timeout_del(&fd->fdtimeout_to);
fdc->sc_state = RECALCOMPLETE;
/* allow 1/30 second for heads to settle */
- timeout_add(&fdc->fdcpseudointr_to, hz / 30);
+ timeout_add_msec(&fdc->fdcpseudointr_to, 33);
return 1; /* will return later */
case RECALCOMPLETE: