fix to silo and bk bug
[unix-history] / usr / src / sys / vax / uba / uba.c
index 06ff3d7..ec450bd 100644 (file)
@@ -1,4 +1,4 @@
-/*     uba.c   4.32    81/06/08        */
+/*     uba.c   4.35    81/07/22        */
 
 #include "../h/param.h"
 #include "../h/systm.h"
 
 #include "../h/param.h"
 #include "../h/systm.h"
@@ -120,8 +120,10 @@ ubasetup(uban, bp, flags)
        npf = btoc(bp->b_bcount + o) + 1;
        a = spl6();
        while ((reg = rmalloc(uh->uh_map, npf)) == 0) {
        npf = btoc(bp->b_bcount + o) + 1;
        a = spl6();
        while ((reg = rmalloc(uh->uh_map, npf)) == 0) {
-               if (flags & UBA_CANTWAIT)
+               if (flags & UBA_CANTWAIT) {
+                       splx(a);
                        return (0);
                        return (0);
+               }
                uh->uh_mrwant++;
                sleep((caddr_t)uh->uh_map, PSWP);
        }
                uh->uh_mrwant++;
                sleep((caddr_t)uh->uh_map, PSWP);
        }
@@ -130,6 +132,7 @@ ubasetup(uban, bp, flags)
                while ((bdp = ffs(uh->uh_bdpfree)) == 0) {
                        if (flags & UBA_CANTWAIT) {
                                rmfree(uh->uh_map, npf, reg);
                while ((bdp = ffs(uh->uh_bdpfree)) == 0) {
                        if (flags & UBA_CANTWAIT) {
                                rmfree(uh->uh_map, npf, reg);
+                               splx(a);
                                return (0);
                        }
                        uh->uh_bdpwant++;
                                return (0);
                        }
                        uh->uh_bdpwant++;
@@ -364,6 +367,7 @@ unhang()
 
                if (up->uba_sr == 0)
                        return;
 
                if (up->uba_sr == 0)
                        return;
+               up->uba_sr = UBASR_CRD|UBASR_LEB;
                uh->uh_hangcnt++;
                if (uh->uh_hangcnt > 5*hz) {
                        uh->uh_hangcnt = 0;
                uh->uh_hangcnt++;
                if (uh->uh_hangcnt > 5*hz) {
                        uh->uh_hangcnt = 0;
@@ -393,6 +397,8 @@ ubawatch()
        }
 }
 
        }
 }
 
+int    ubawedgecnt = 10;
+int    ubacrazy = 500;
 /*
  * This routine is called by the locore code to
  * process a UBA error on an 11/780.  The arguments are passed
 /*
  * This routine is called by the locore code to
  * process a UBA error on an 11/780.  The arguments are passed
@@ -434,6 +440,14 @@ ubaerror(uban, uh, xx, uvec, uba)
        splx(s);
        uba->uba_sr = sr;
        uvec &= UBABRRVR_DIV;
        splx(s);
        uba->uba_sr = sr;
        uvec &= UBABRRVR_DIV;
+       if (++uh->uh_errcnt % ubawedgecnt == 0) {
+               if (uh->uh_errcnt > ubacrazy)
+                       panic("uba crazy");
+               printf("ERROR LIMIT ");
+               ubareset(uban);
+               uvec = 0;
+               return;
+       }
        return;
 }
 #endif
        return;
 }
 #endif