Complete SCB invalid

ian j hart ianjhart at
Tue Nov 25 11:39:56 PST 2003

gamma> sed -n 500,514p aic79xx.c
        scbid = ahd_inw(ahd, COMPLETE_SCB_HEAD);
        while (!SCBID_IS_NULL(scbid)) {

                ahd_set_scbptr(ahd, scbid);
                next_scbid = ahd_inw_scbram(ahd, SCB_NEXT_COMPLETE);
                scb = ahd_lookup_scb(ahd, scbid);
                if (scb == NULL) {
                        printf("%s: Warning - Complete SCB %d invalid\n",
                               ahd_name(ahd), scbid);

                ahd_complete_scb(ahd, scb);
                scbid = next_scbid;

gamma> sed -n 713,725p aic79xx_inline.h
static __inline struct scb *
ahd_lookup_scb(struct ahd_softc *ahd, u_int tag)
        struct scb* scb;

        if (tag >= AHD_SCB_MAX)
                return (NULL);
        scb = ahd->scb_data.scbindex[tag];
        if (scb != NULL)
                ahd_sync_scb(ahd, scb,
        return (scb);

If scbid >= AHD_SCB_MAX but doesn't match SCBID_IS_NULL
this appears to loop forever.

Is it safe to panic instead? (At least while I'm testing)

Of course I could be smoking crack.

ian j hart

More information about the freebsd-scsi mailing list