Date: Tue, 28 Jul 1998 09:10:01 -0700 (PDT) From: Tor.Egge@fast.no To: freebsd-bugs@FreeBSD.ORG Subject: Re: kern/7424: biodone: buffer not busy panics Message-ID: <199807281610.JAA01408@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
The following reply was made to PR kern/7424; it has been noted by GNATS. From: Tor.Egge@fast.no To: dillon@best.net Cc: FreeBSD-gnats-submit@FreeBSD.ORG Subject: Re: kern/7424: biodone: buffer not busy panics Date: Tue, 28 Jul 1998 18:09:00 +0200 > We have also seen this crash on our FreeBSD-current test box. I'm using some patches the the scsi driver in an attempt to track down this bug. --------- Index: scsi/scsi_base.c =================================================================== RCS file: /home/ncvs/src/sys/scsi/scsi_base.c,v retrieving revision 1.54 diff -u -r1.54 scsi_base.c --- scsi_base.c 1998/02/20 13:37:39 1.54 +++ scsi_base.c 1998/02/20 21:48:09 @@ -110,6 +110,7 @@ struct scsi_link *sc_link; /* who to credit for returning it */ u_int32_t flags; { + xs->flags &= ~INUSE; xs->next = next_free_xs; next_free_xs = xs; Index: i386/scsi/aic7xxx.c =================================================================== RCS file: /home/ncvs/src/sys/i386/scsi/aic7xxx.c,v retrieving revision 1.126 diff -u -r1.126 aic7xxx.c --- aic7xxx.c 1997/09/27 19:38:27 1.126 +++ aic7xxx.c 1998/04/07 01:24:50 @@ -769,6 +769,14 @@ qoutcnt); continue; } + if ((scb->flags & SCB_ON_CMPLETE_QUEUE) != 0) { + printf("%s: WARNING " + "scb %d already " + "on cmplete queue\n", + ahc_name(ahc), scb_index); + continue; + } + scb->flags |= SCB_ON_CMPLETE_QUEUE; STAILQ_INSERT_TAIL(&ahc->cmplete_scbs, scb, links); } @@ -786,6 +794,8 @@ } while((scb = ahc->cmplete_scbs.stqh_first) != NULL) { STAILQ_REMOVE_HEAD(&ahc->cmplete_scbs, links); + if ((scb->flags & SCB_ON_CMPLETE_QUEUE) == 0) + panic("ahc_intr: scb not on cmplete_scbs queue"); /* * Save off the residual if there is one. */ @@ -816,6 +826,9 @@ scb->xs->error); ahc_run_done_queue(ahc); } + if ((scb->flags & SCB_ON_CMPLETE_QUEUE) == 0) + panic("ahc_intr: scb not on cmplete_scbs queue"); + scb->flags &= ~SCB_ON_CMPLETE_QUEUE; ahc_done(ahc, scb); } ahc_outb(ahc, CLRINT, CLRCMDINT); @@ -1883,6 +1896,12 @@ * (SCSI_ERR_OK in FreeBSD), we don't have to care this case. */ #endif + if ((xs->flags & ITSDONE) != 0) + panic("ahc_done: scsi_xfer already done"); + if ((xs->flags & INUSE) == 0) + panic("ahc_done: scsi_xfer is unused"); + if ((scb->flags & SCB_ON_CMPLETE_QUEUE) != 0) + panic("ahc_done: scb on cmplete_scbs queue"); xs->flags |= ITSDONE; #ifdef AHC_TAGENABLE /* @@ -2583,6 +2602,8 @@ opri = splbio(); /* Clean up for the next user */ + if (scb->flags & SCB_ON_CMPLETE_QUEUE) + panic("ahc_free_scb: scb on cmplete_scbs queue"); scb->flags = SCB_FREE; hscb->control = 0; hscb->status = 0; @@ -2858,7 +2879,8 @@ DELAY(1000); if (ahc_inb(ahc, INTSTAT) & INT_PEND) break; - } if (wait == 0) { + } + if (wait == 0) { printf("%s: board is not responding\n", ahc_name(ahc)); return (EIO); } Index: i386/scsi/aic7xxx.h =================================================================== RCS file: /home/ncvs/src/sys/i386/scsi/aic7xxx.h,v retrieving revision 1.43 diff -u -r1.43 aic7xxx.h --- aic7xxx.h 1997/08/15 19:27:43 1.43 +++ aic7xxx.h 1997/10/26 18:13:38 @@ -164,7 +164,8 @@ SCB_MSGOUT_SDTR = 0x0400, SCB_MSGOUT_WDTR = 0x0800, SCB_ABORT = 0x1000, - SCB_QUEUED_ABORT = 0x2000 + SCB_QUEUED_ABORT = 0x2000, + SCB_ON_CMPLETE_QUEUE = 0x4000 } scb_flag; /* --------- the result is an occational burst of syslog messages ------ ahc1: WARNING scb 4 already on cmplete queue ahc1: WARNING scb 4 already on cmplete queue ahc1: WARNING scb 4 already on cmplete queue ahc1: WARNING scb 4 already on cmplete queue ahc1: WARNING scb 4 already on cmplete queue ahc1: WARNING scb 4 already on cmplete queue ahc1: WARNING scb 4 already on cmplete queue ahc1: WARNING scb 4 already on cmplete queue ahc1: WARNING scb 4 already on cmplete queue ahc1: WARNING scb 4 already on cmplete queue ahc1: WARNING scb 4 already on cmplete queue ahc1: WARNING scb 4 already on cmplete queue ahc1: WARNING scb 4 already on cmplete queue ahc1: WARNING scb 4 already on cmplete queue ahc1: WARNING no command for scb 4 (cmdcmplt) QOUTCNT == 1 ------ indicating a problem related to the FIFO for completed requests. I've not had problems getting memory dumps when this problem occurs, but this is due to the dump partition being located on a disk connected to ahc0, not ahc1. - Tor Egge To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-bugs" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199807281610.JAA01408>