Re: busdma/scsi trm(4) related panic

From: Scott Long <scottl_at_freebsd.org>
Date: Sat, 09 Aug 2003 00:46:31 -0600
Jon Kuster wrote:
> On Wed, 2003-08-06 at 06:42, Scott Long wrote:
> 
>>I know what the problem is and I'm working on a patch right now.
>>
>>Scott
> 
> 
> Excellent.  I'll be happy to test it if needed.
> 
> Jon
> 
> 

Attached is an untested patch.  Please let me know if it solves the
problem

Scott

Index: trm.c
===================================================================
RCS file: /home/ncvs/src/sys/dev/trm/trm.c,v
retrieving revision 1.12
diff -u -r1.12 trm.c
--- trm.c	1 Jul 2003 15:52:02 -0000	1.12
+++ trm.c	9 Aug 2003 06:45:05 -0000
_at__at_ -2999,6 +2999,7 _at__at_
 {
     	u_int16_t    i;
 	PSRB    pSRB;
+	int error;
 
 	for (i = 0; i < TRM_MAX_SRB_CNT; i++) {
 	       	pSRB = (PSRB)&pACB->pFreeSRB[i];
_at__at_ -3040,6 +3041,17 _at__at_
 			pSRB->pNextSRB = NULL;
 		}
 		pSRB->TagNumber = i;
+
+		/*
+		 * Create the dmamap.  This is no longer optional!
+		 *
+		 * XXX This is not freed on unload!  None of the other
+		 * allocations in this function are either!
+		 */
+		if ((error = bus_dmamap_create(pACB->buffer_dmat, 0,
+					       &pSRB->dmamap)) != 0)
+			return (error);
+
 	}
 	return (0);
 }
Received on Fri Aug 08 2003 - 21:46:34 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:37:18 UTC