--- linux-2.4.19-orig/drivers/scsi/aic7xxx/aic7xxx_core.c Wed Sep 25 13:28:27 2002 +++ linux-2.4.19/drivers/scsi/aic7xxx/aic7xxx_core.c Wed Sep 25 13:26:31 2002 @@ -788,8 +788,10 @@ */ u_int scbindex = ahc_inb(ahc, SCB_TAG); u_int lastphase = ahc_inb(ahc, LASTPHASE); + u_int flg = ahc_inb(ahc, SEQ_FLAGS); u_int i; + ahc->overruns++; scb = ahc_lookup_scb(ahc, scbindex); for (i = 0; i < num_phases; i++) { if (lastphase == ahc_phase_table[i].phase) @@ -802,7 +804,7 @@ scb->hscb->tag); ahc_print_path(ahc, scb); printf("%s seen Data Phase. Length = %ld. NumSGs = %d.\n", - ahc_inb(ahc, SEQ_FLAGS) & DPHASE ? "Have" : "Haven't", + (flg & DPHASE ? "Have" : "Haven't"), ahc_get_transfer_length(scb), scb->sg_count); if (scb->sg_count > 0) { for (i = 0; i < scb->sg_count; i++) { @@ -848,6 +850,17 @@ ahc_outb(ahc, HADDR, 0); ahc_outb(ahc, DSCOMMAND1, dscommand1); } + if (lastphase == P_DATAIN && (flg & DPHASE)) { + int found; + /* Gets here if SAF-TE hot-insertion occurs. + * Would reset later anyway after multiple timeouts. + */ + found = ahc_reset_channel(ahc, devinfo.channel, + /*initiate reset*/TRUE); + printf(KERN_ERR "%s: Issued Channel %c Bus Reset. " + "%d SCBs aborted\n", ahc_name(ahc), devinfo.channel, + found); + } break; } case MKMSG_FAILED: @@ -1028,6 +1041,7 @@ curphase = ahc_inb(ahc, SCSISIGI) & PHASE_MASK; sstat2 = ahc_inb(ahc, SSTAT2); ahc_outb(ahc, CLRSINT1, CLRSCSIPERR); + ahc->parityerrs++; /* * For all phases save DATA, the sequencer won't * automatically ack a byte that has a parity error @@ -5773,6 +5787,7 @@ ahc_delay(AHC_BUSRESET_DELAY); /* Turn off the bus reset */ ahc_outb(ahc, SCSISEQ, scsiseq & ~SCSIRSTO); + ahc->resets++; /* bus_reset tally */ ahc_clear_intstat(ahc); @@ -5829,6 +5844,7 @@ /* * Reset the bus if we are initiating this reset */ + ahc->resets++; /* bus_reset tally */ sblkctl = ahc_inb(ahc, SBLKCTL); cur_channel = 'A'; if ((ahc->features & AHC_TWIN) != 0 --- linux-2.4.19-orig/drivers/scsi/aic7xxx/aic7xxx.h Fri Aug 2 20:39:44 2002 +++ linux-2.4.19/drivers/scsi/aic7xxx/aic7xxx.h Wed Sep 25 13:23:39 2002 @@ -1032,6 +1032,11 @@ uint16_t user_discenable;/* Disconnection allowed */ uint16_t user_tagenable;/* Tagged Queuing allowed */ + + /* Error tallies */ + int overruns; + int parityerrs; + int resets; }; TAILQ_HEAD(ahc_softc_tailq, ahc_softc);