Index: dc390/dc390.h =================================================================== RCS file: /usr/local/cvsroot/dc390/dc390.h,v retrieving revision 2.29 retrieving revision 2.30 diff -u -r2.29 -r2.30 --- dc390/dc390.h 1999/07/05 08:25:11 2.29 +++ dc390/dc390.h 1999/07/05 11:41:35 2.30 @@ -4,7 +4,7 @@ * Description: Device Driver for Tekram DC-390(T) PCI SCSI * * Bus Master Host Adapter * ***********************************************************************/ -/* $Id: dc390.h,v 2.29 1999/07/05 08:25:11 garloff Exp $ */ +/* $Id: dc390.h,v 2.30 1999/07/05 11:41:35 garloff Exp $ */ #include @@ -16,7 +16,7 @@ #define DC390_H #define DC390_BANNER "Tekram DC390/AM53C974" -#define DC390_VERSION "2.0d13 1999/07/05" +#define DC390_VERSION "2.0d14 1999/07/05" #if defined(HOSTS_C) || defined(MODULE) Index: dc390/scsiiom.c =================================================================== RCS file: /usr/local/cvsroot/dc390/scsiiom.c,v retrieving revision 2.41 retrieving revision 2.42 diff -u -r2.41 -r2.42 --- dc390/scsiiom.c 1999/07/05 08:25:11 2.41 +++ dc390/scsiiom.c 1999/07/05 11:41:35 2.42 @@ -4,7 +4,7 @@ * Description: Device Driver for Tekram DC-390 (T) PCI SCSI * * Bus Master Host Adapter * ***********************************************************************/ -/* $Id: scsiiom.c,v 2.41 1999/07/05 08:25:11 garloff Exp $ */ +/* $Id: scsiiom.c,v 2.42 1999/07/05 11:41:35 garloff Exp $ */ static void __inline__ dc390_freetag (PDCB pDCB, PSRB pSRB) @@ -160,7 +160,7 @@ }; if (dstate & DMA_XFER_DONE) { - ULONG residual, xferCnt; int ctr = 50000000; + ULONG residual, xferCnt; int ctr = 6000000; if (! (DC390_read8 (DMA_Cmd) & READ_DIRECTION)) { do @@ -298,7 +298,7 @@ goto unlock; } - else if (istatus & RESELECTED) + if (istatus & RESELECTED) { dc390_Reselect( pACB ); goto unlock; @@ -368,7 +368,7 @@ if( sstatus & COUNT_2_ZERO ) { - int ctr = 50000000; /* only try for about a second */ + int ctr = 6000000; /* only try for about a second */ while( --ctr && !((dstate = DC390_read8 (DMA_Status)) & DMA_XFER_DONE) && pSRB->SGToBeXferLen ); if (!ctr) printk (KERN_CRIT "DC390: Deadlock in DataOut_0: DMA aborted unfinished: %06x bytes remain!!\n", DC390_read32 (DMA_Wk_ByteCntr)); dc390_laststatus &= ~0xff000000; dc390_laststatus |= dstate << 24; @@ -418,7 +418,7 @@ if( sstatus & COUNT_2_ZERO ) { - int ctr = 50000000; /* only try for about a second */ + int ctr = 6000000; /* only try for about a second */ int dstate = 0; while( --ctr && !((dstate = DC390_read8 (DMA_Status)) & DMA_XFER_DONE) && pSRB->SGToBeXferLen ); if (!ctr) printk (KERN_CRIT "DC390: Deadlock in DataIn_0: DMA aborted unfinished: %06x bytes remain!!\n", DC390_read32 (DMA_Wk_ByteCntr)); @@ -1273,7 +1273,7 @@ if (pDCB->pNextDCB == pDCB) pDCB->pNextDCB = 0; pACB->pLinkDCB = pDCB->pNextDCB; if (pACB->pLastDCB == pDCB) pACB->pLastDCB = 0; - if (pACB->pLastDCB) pACB->pLastDCB->pNextDCB = pDCB->pNextDCB; + else if (pACB->pLastDCB) pACB->pLastDCB->pNextDCB = pDCB->pNextDCB; } else { @@ -1284,10 +1284,10 @@ DCBDEBUG(printk (KERN_INFO "DC390: Driver about to free DCB (ID %i, LUN %i): %p\n",\ pDCB->UnitSCSIID, pDCB->UnitSCSILUN, pDCB);) - kfree (pDCB); if (pDCB == pACB->pActiveDCB) pACB->pActiveDCB = 0; if (pDCB == pACB->pLinkDCB) pACB->pLinkDCB = pDCB->pNextDCB; if (pDCB == pACB->pDCBRunRobin) pACB->pDCBRunRobin = pDCB->pNextDCB; + kfree (pDCB); pACB->DCBCnt--; /* pACB->DeviceCnt--; */ }; Index: dc390/tmscsim.c =================================================================== RCS file: /usr/local/cvsroot/dc390/tmscsim.c,v retrieving revision 2.44 retrieving revision 2.46 diff -u -r2.44 -r2.46 --- dc390/tmscsim.c 1999/07/05 08:25:11 2.44 +++ dc390/tmscsim.c 1999/07/05 11:41:35 2.46 @@ -7,7 +7,7 @@ ***********************************************************************/ /* (C) Copyright: put under GNU GPL in 10/96 (see README.tmscsim) * *************************************************************************/ -/* $Id: tmscsim.c,v 2.44 1999/07/05 08:25:11 garloff Exp $ */ +/* $Id: tmscsim.c,v 2.46 1999/07/05 11:41:35 garloff Exp $ */ /* Enhancements and bugfixes by * * Kurt Garloff * ***********************************************************************/ @@ -123,6 +123,7 @@ * 2.0d1199/06/28 KG cmd->result now identical to 2.0d2 * * 2.0d1299/07/04 KG Changed order of processing in IRQ * * 2.0d1399/07/05 KG Don't update DCB fields if removed * + * 2.0d1499/07/05 KG remove_dev: Move kfree() to the end * ***********************************************************************/ /* Uncomment SA_INTERRUPT, if the driver refuses to share its IRQ with other devices */ @@ -871,30 +872,12 @@ /* Moves SRB from Going list to the top of Waiting list */ static void dc390_Going_to_Waiting ( PDCB pDCB, PSRB pSRB ) { - PSRB psrb1; - - pDCB->GoingSRBCnt--; //pDCB->pDCBACB->SelLost++; DEBUG0(printk(KERN_INFO "DC390: Going_to_Waiting (SRB %p) pid = %li\n", pSRB, pSRB->pcmd->pid);) - /* Find SRB in Going */ - psrb1 = pDCB->pGoingSRB; - if( pSRB == psrb1 ) - { - pDCB->pGoingSRB = psrb1->pNextSRB; - } - else - { - /* Scan list */ - while( pSRB != psrb1->pNextSRB ) - psrb1 = psrb1->pNextSRB; - psrb1->pNextSRB = pSRB->pNextSRB; - if( pSRB == pDCB->pGoingLast ) - pDCB->pGoingLast = psrb1; - } - + /* Remove SRB from Going */ + dc390_Going_remove (pDCB, pSRB); /* Insert on top of Waiting */ dc390_Waiting_insert (pDCB, pSRB); - - /* Tag Mask must be freed elsewhere ! (KG, 99/06/18)*/ + /* Tag Mask must be freed elsewhere ! (KG, 99/06/18) */ } /* Moves first SRB from Waiting list to Going list */