DragonFly BSD
DragonFly kernel List (threaded) for 2004-10
[Date Prev][Date Next]  [Thread Prev][Thread Next]  [Date Index][Thread Index]

Re: Boot panic w/HEAD sources from ~4 hours ago. (amd related me thinks)


From: Matthew Dillon <dillon@xxxxxxxxxxxxxxxxxxxx>
Date: Tue, 19 Oct 2004 11:02:35 -0700 (PDT)

    Try this patch.  The amd device was not creating the dmamap, which is
    necessary due to the delayed segments allocation.

    And yes, to Joerg:  I agree that we have to back that delayed-segments
    allocation out and go back to allocating it when the tag is created,
    changing the nsegments argument for non-allocating tags to 0 and
    conditionalizing the malloc.  Sigh.

    Basically the problem is that FreeBSD has gone off on a tangent with the
    busdma architecture.  They are adding hacks rather then cleaning up the
    mess they already have.  We are definitely going to be making some big
    changes there.

						-Matt

Index: amd.c
===================================================================
RCS file: /cvs/src/sys/dev/disk/amd/amd.c,v
retrieving revision 1.5
diff -u -r1.5 amd.c
--- amd.c	17 Sep 2004 03:39:39 -0000	1.5
+++ amd.c	19 Oct 2004 17:58:14 -0000
@@ -2099,14 +2099,25 @@
 void 
 amd_linkSRB(struct amd_softc *amd)
 {
-	u_int16_t  count, i;
+	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!
+		 */
+		error = bus_dmamap_create(amd->buffer_dmat, 0, &psrb->dmamap);
+		if (error) {
+			device_printf(amd->dev, "Error %d creating buffer "
+					"dmamap!\n", error);
+			break;
+		}
 		TAILQ_INSERT_TAIL(&amd->free_srbs, psrb, links);
 	}
 }



[Date Prev][Date Next]  [Thread Prev][Thread Next]  [Date Index][Thread Index]