Re: busdma/scsi trm(4) related panic

From: Scott Long <scottl_at_freebsd.org>
Date: Sat, 09 Aug 2003 00:53:57 -0600
Ruslan Ermilov wrote:
> On Wed, Aug 06, 2003 at 07:42:06AM -0600, Scott Long wrote:
> 
>>I know what the problem is and I'm working on a patch right now.
>>
> 
> I have the same problem with amd(4) and this commit to busdma_machdep.c.
> 
> 
> Cheers,

Attached is an untested patch for amd(4).  Please let me know if it
fixes your problem.

Scott

Index: amd.c
===================================================================
RCS file: /home/ncvs/src/sys/dev/amd/amd.c,v
retrieving revision 1.22
diff -u -r1.22 amd.c
--- amd.c	31 Jul 2003 16:55:44 -0000	1.22
+++ amd.c	9 Aug 2003 06:44:28 -0000
_at__at_ -2115,12 +2115,26 _at__at_
 {
 	u_int16_t  count, i;
 	struct amd_srb *psrb;
+	int error;
 
 	count = amd->SRBCount;
 
 	for (i = 0; i < count; i++) {
 		psrb = (struct amd_srb *)&amd->SRB_array[i];
 		psrb->TagNumber = i;
+
+		/*
+		 * Create the dmamap.  This is no longer optional!
+		 *
+		 * XXX Since there is no detach method in this driver,
+		 * this does not get freed!
+		 */
+		if ((error = bus_dmamap_create(amd->buffer_dmat, 0,
+					       &psrb->dmamap)) != 0) {
+			device_printf(amd->dev, "Error %d creating buffer "
+				      "dmamap!\n", error);
+			return;
+		}
 		TAILQ_INSERT_TAIL(&amd->free_srbs, psrb, links);
 	}
 }
Received on Fri Aug 08 2003 - 21:53:59 UTC

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