SCCS-vsn: sys/vax/uba/up.c 3.6
+int trc = -1;
+int trcw = 0;
+#define D(i) if (trc&(1<<i)) { if (trcw&(1<<i)) DELAY(1000); } else
+int csdel0 = 0;
+int csdel1 = 1000;
+int csdel2 = 2000;
int asdel = 500;
int csdel3 = 100;
int asdel = 500;
int csdel3 = 100;
/*
* Emulex UNIBUS disk driver with overlapped seeks and ECC recovery.
/*
* Emulex UNIBUS disk driver with overlapped seeks and ECC recovery.
(void) spl5();
disksort(dp, bp);
#ifdef UTRACE
(void) spl5();
disksort(dp, bp);
#ifdef UTRACE
- ttime();
- trace("upstrat bn %d unit %d\n", bp->b_blkno, unit);
+D(1) ttime();
+D(2) trace("upstrat bn %d unit %d\n", bp->b_blkno, unit);
#endif
if (dp->b_active == 0) {
(void) upustart(unit);
#endif
if (dp->b_active == 0) {
(void) upustart(unit);
if (unit >= NUP)
goto out;
#ifdef UTRACE
if (unit >= NUP)
goto out;
#ifdef UTRACE
- ttime();
- trace("upustart %d active %d", unit, uputab[unit].b_active);
+D(3) ttime();
+D(4) trace("upustart %d active %d", unit, uputab[unit].b_active);
#endif
/*
* Whether or not it was before, this unit is no longer busy.
#endif
/*
* Whether or not it was before, this unit is no longer busy.
*/
if ((upaddr->upds & VV) == 0) {
#ifdef UTRACE
*/
if ((upaddr->upds & VV) == 0) {
#ifdef UTRACE
#endif
upaddr->upcs1 = IE|DCLR|GO;
DELAY(idelay);
#endif
upaddr->upcs1 = IE|DCLR|GO;
DELAY(idelay);
- trace(" search %d@%d to %d@%d", upaddr->updc, (upaddr->upla>>6),
+D(6) trace(" search %d@%d to %d@%d", upaddr->updc, (upaddr->upla>>6),
cn, sn);
#endif
upaddr->updc = cn;
cn, sn);
#endif
upaddr->updc = cn;
dk_busy |= 1<<unit;
dk_numb[unit]++;
}
dk_busy |= 1<<unit;
dk_numb[unit]++;
}
+ if (csdel0) DELAY(csdel0);
* and link us onto the chain of ready disks.
*/
#ifdef UTRACE
* and link us onto the chain of ready disks.
*/
#ifdef UTRACE
#endif
dp->b_active = 2;
dp->b_forw = NULL;
#endif
dp->b_active = 2;
dp->b_forw = NULL;
+ if (csdel1) DELAY(csdel1);
int dn, sn, tn, cn, cmd;
loop:
int dn, sn, tn, cn, cmd;
loop:
+ if (csdel2) DELAY(csdel2);
- ttime();
- trace("upstart");
+D(9) ttime();
+D(10) trace("upstart");
#endif
/*
* Pick a drive off the queue of ready drives, and
#endif
/*
* Pick a drive off the queue of ready drives, and
*/
if ((dp = uptab.b_actf) == NULL) {
#ifdef UTRACE
*/
if ((dp = uptab.b_actf) == NULL) {
#ifdef UTRACE
sn %= NSECT;
upaddr = UPADDR;
#ifdef UTRACE
sn %= NSECT;
upaddr = UPADDR;
#ifdef UTRACE
+D(12) trace(" unit %d", dn);
#endif
if ((upaddr->upcs2 & 07) != dn) {
#ifdef UTRACE
#endif
if ((upaddr->upcs2 & 07) != dn) {
#ifdef UTRACE
#endif
upaddr->upcs2 = dn;
DELAY(sdelay);
#endif
upaddr->upcs2 = dn;
DELAY(sdelay);
*/
if ((upaddr->upds & (DPR|MOL)) != (DPR|MOL)) {
#ifdef UTRACE
*/
if ((upaddr->upds & (DPR|MOL)) != (DPR|MOL)) {
#ifdef UTRACE
- trace(" !(DPR && MOL)");
+D(14) trace(" !(DPR && MOL)");
#endif
uptab.b_active = 0;
uptab.b_errcnt = 0;
#endif
uptab.b_active = 0;
uptab.b_errcnt = 0;
*/
if (uptab.b_errcnt >= 16) {
#ifdef UTRACE
*/
if (uptab.b_errcnt >= 16) {
#ifdef UTRACE
#endif
upaddr->upof = up_offset[uptab.b_errcnt & 017] | FMT22;
upaddr->upcs1 = IE|OFFSET|GO;
#endif
upaddr->upof = up_offset[uptab.b_errcnt & 017] | FMT22;
upaddr->upcs1 = IE|OFFSET|GO;
* returned by ubasetup() for the cs1 register bits 8 and 9.
*/
#ifdef UTRACE
* returned by ubasetup() for the cs1 register bits 8 and 9.
*/
#ifdef UTRACE
- trace(" %s %d.%d@%d cnt %d ba %x\n",
+D(16) trace(" %s %d.%d@%d cnt %d ba %x\n",
(bp->b_flags&B_READ) ? "read" : "write",
cn, tn, sn, bp->b_bcount, up_ubinfo & 0x3ffff);
#endif
(bp->b_flags&B_READ) ? "read" : "write",
cn, tn, sn, bp->b_bcount, up_ubinfo & 0x3ffff);
#endif
int needie = 1;
#ifdef UTRACE
int needie = 1;
#ifdef UTRACE
- ttime();
- trace("upintr as %d act %d %d %d;", as, uptab.b_active, uputab[0].b_active, uputab[1].b_active);
+D(17) ttime();
+D(18) trace("upintr as %d act %d %d %d;", as, uptab.b_active, uputab[0].b_active, uputab[1].b_active);
#endif
if (uptab.b_active) {
/*
#endif
if (uptab.b_active) {
/*
*/
if ((upaddr->upcs1 & RDY) == 0) {
#ifdef UTRACE
*/
if ((upaddr->upcs1 & RDY) == 0) {
#ifdef UTRACE
#endif
printf("!RDY in upintr: cs1 %o\n", upaddr->upcs1);
printf("as=%d act %d %d %d\n", as, uptab.b_active, uputab[0].b_active, uputab[1].b_active);
#endif
printf("!RDY in upintr: cs1 %o\n", upaddr->upcs1);
printf("as=%d act %d %d %d\n", as, uptab.b_active, uputab[0].b_active, uputab[1].b_active);
dk_busy &= ~(1<<(DK_N+unit));
if (upaddr->upcs1 & TRE) {
#ifdef UTRACE
dk_busy &= ~(1<<(DK_N+unit));
if (upaddr->upcs1 & TRE) {
#ifdef UTRACE
#endif
/*
* An error occurred, indeed. Select this unit
#endif
/*
* An error occurred, indeed. Select this unit
*/
if (uptab.b_active) {
#ifdef UTRACE
*/
if (uptab.b_active) {
#ifdef UTRACE
- trace(" unit %d", unit);
+D(21) trace(" unit %d", unit);
#endif
if ((upaddr->upcs2 & 07) != unit) {
#ifdef UTRACE
#endif
if ((upaddr->upcs2 & 07) != unit) {
#ifdef UTRACE
#endif
upaddr->upcs2 = unit;
DELAY(sdelay);
#endif
upaddr->upcs2 = unit;
DELAY(sdelay);
neasycs2++;
if (uptab.b_errcnt >= 16) {
#ifdef UTRACE
neasycs2++;
if (uptab.b_errcnt >= 16) {
#ifdef UTRACE
#endif
upaddr->upcs1 = RTC|GO|IE;
DELAY(idelay);
#endif
upaddr->upcs1 = RTC|GO|IE;
DELAY(idelay);
else {
if (upaddr->upcs1 & TRE) {
#ifdef UTRACE
else {
if (upaddr->upcs1 & TRE) {
#ifdef UTRACE
#endif
upaddr->upcs1 = TRE;
DELAY(idelay);
#endif
upaddr->upcs1 = TRE;
DELAY(idelay);
* start it if any drives are now ready to transfer.
*/
#ifdef UTRACE
* start it if any drives are now ready to transfer.
*/
#ifdef UTRACE
#endif
for (unit = 0; unit < NUP; unit++)
if (as & (1<<unit))
if (uputab[unit].b_active == 1) {
upaddr->upas = 1<<unit;
#ifdef UTRACE
#endif
for (unit = 0; unit < NUP; unit++)
if (as & (1<<unit))
if (uputab[unit].b_active == 1) {
upaddr->upas = 1<<unit;
#ifdef UTRACE
- trace("as clear %d\n", unit);
+D(26) trace("as clear %d\n", unit);
#endif
if (asdel) DELAY(asdel);
if (upustart(unit))
#endif
if (asdel) DELAY(asdel);
if (upustart(unit))
} else {
upaddr->upas = 1<<unit;
#ifdef UTRACE
} else {
upaddr->upas = 1<<unit;
#ifdef UTRACE
- trace("spurious as clear %d\n", unit);
+D(27) trace("spurious as clear %d\n", unit);
out:
if (needie) {
#ifdef UTRACE
out:
if (needie) {
#ifdef UTRACE
- trace("upintr set IE\n");
+D(28) trace("upintr set IE\n");
#endif
upaddr->upcs1 = IE;
}
#endif
upaddr->upcs1 = IE;
}