Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 1 May 2003 02:33:42 +0200
From:      Thomas Moestl <t.moestl@tu-bs.de>
To:        Brian Denehy <B.Denehy@90east.com>
Cc:        freebsd-sparc64@freebsd.org
Subject:   Re: E450 panic - SNAP 20030423 5.0-Current
Message-ID:  <20030501003341.GA969@crow.dom2ip.de>
In-Reply-To: <OF86CB579B.BC6D2522-ONCA256D18.0028708A-CA256D18.002904DA@securegate.net>
References:  <OF86CB579B.BC6D2522-ONCA256D18.0028708A-CA256D18.002904DA@securegate.net>

next in thread | previous in thread | raw e-mail | index | archive | help

--/04w6evG8XlLl3ft
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline

On Wed, 2003/04/30 at 17:30:03 +1000, Brian Denehy wrote:
> Hi folks,
> 
> 
> I'm trying to use sparc64 for the first time - any ideas on this problem? 
> The CURRENT hardware release notes suggest it should boot.
> [...]
> Waiting 15 seconds for SCSI devices to settle
> panic: trap: memory address not aligned
> cpuid = 0;
> Debugger("panic")
> Stopped at      Debugger+0x1c:  ta              %xcc, 1
> db> trace
> panic() at panic+0x134
> trap() at trap+0x3a4
> -- memory address not aligned sfar=0xdedeadc0de sfsr=0x40029 
> %o7=0xc0282fd0 --
> iommu_dvmamap_vunload() at iommu_dvmamap_vunload+0x14
> iommu_dvma_vfree() at iommu_dvma_vfree+0x48
> iommu_dvmamap_destroy() at iommu_dvmamap_destroy+0x8
> psycho_dmamap_destroy() at psycho_dmamap_destroy+0x14
> ___dma_getp() at ___dma_getp+0x1b0
> ___sym_malloc() at ___sym_malloc+0x70
> __sym_calloc2() at __sym_calloc2+0xc
> __sym_calloc_dma() at __sym_calloc_dma+0x64
> sym_alloc_ccb() at sym_alloc_ccb+0x24
> sym_get_ccb() at sym_get_ccb+0x68
> sym_action1() at sym_action1+0x154
> sym_action() at sym_action+0x8
> xpt_run_dev_sendq() at xpt_run_dev_sendq+0x208
> xpt_release_devq_device() at xpt_release_devq_device+0xd8
> xpt_release_devq_timeout() at xpt_release_devq_timeout+0xc
> softclock() at softclock+0x190
> ithread_loop() at ithread_loop+0x240
> fork_exit() at fork_exit+0xd8
> fork_trampoline() at fork_trampoline+0xdc
> db>

Looks like you were might have been running out of DVMA; the attached
patch, which I will commit shortly, should fix that (getbaddrcb() in
sym does not detect errors reliably, so this is just an assumption). 

The panic is caused by sym calling bus_dmamap_destroy() on a dmamap
obtained via bus_dmamem_alloc(), after bus_dmamem_free() has been
called on it. The i386 and alpha busdma implementations look like this
is not allowed, and bus_dmamem_free() is supposed to free the map (if
it weren't, map_count would be handled in a wrong way), so that is how
it is implemented for sparc64; maybe that needs to be changed.

	- Thomas

-- 
Thomas Moestl <t.moestl@tu-bs.de>	http://www.tu-bs.de/~y0015675/
              <tmm@FreeBSD.org>		http://people.FreeBSD.org/~tmm/
PGP fingerprint: 1C97 A604 2BD0 E492 51D0  9C0F 1FE6 4F1D 419C 776C

--/04w6evG8XlLl3ft
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename="iommu-space.diff"

Index: sparc64/sparc64/iommu.c
===================================================================
RCS file: /d/ncvs/src/sys/sparc64/sparc64/iommu.c,v
retrieving revision 1.24
diff -u -r1.24 iommu.c
--- sparc64/sparc64/iommu.c	10 Apr 2003 23:03:33 -0000	1.24
+++ sparc64/sparc64/iommu.c	1 May 2003 00:33:10 -0000
@@ -143,7 +143,7 @@
 /*
  * Tuning constants.
  */
-#define	IOMMU_MAX_PRE		(128 * 1024)
+#define	IOMMU_MAX_PRE		(32 * 1024)
 #define	IOMMU_MAX_PRE_SEG	3
 
 MALLOC_DEFINE(M_IOMMU, "dvmamem", "IOMMU DVMA Buffers");
Index: sparc64/pci/psycho.c
===================================================================
RCS file: /d/ncvs/src/sys/sparc64/pci/psycho.c,v
retrieving revision 1.31
diff -u -r1.31 psycho.c
--- sparc64/pci/psycho.c	10 Apr 2003 23:03:33 -0000	1.31
+++ sparc64/pci/psycho.c	1 May 2003 00:33:19 -0000
@@ -571,7 +571,7 @@
 		sc->sc_is->is_sb[1] = 0;
 		if (OF_getproplen(sc->sc_node, "no-streaming-cache") < 0)
 			sc->sc_is->is_sb[0] = sc->sc_pcictl + PCR_STRBUF;
-		psycho_iommu_init(sc, 2);
+		psycho_iommu_init(sc, 3);
 	} else {
 		/* Just copy IOMMU state, config tag and address */
 		sc->sc_is = osc->sc_is;
Index: sparc64/sbus/sbus.c
===================================================================
RCS file: /d/ncvs/src/sys/sparc64/sbus/sbus.c,v
retrieving revision 1.16
diff -u -r1.16 sbus.c
--- sparc64/sbus/sbus.c	12 Apr 2003 06:43:28 -0000	1.16
+++ sparc64/sbus/sbus.c	1 May 2003 00:33:44 -0000
@@ -430,7 +430,7 @@
 	 * DMA pointer will be translated by the first page of the IOTSB.
 	 * To detect bugs we'll allocate and ignore the first entry.
 	 */
-	iommu_init(name, &sc->sc_is, 2, -1, 1);
+	iommu_init(name, &sc->sc_is, 3, -1, 1);
 
 	/* Enable the over-temperature and power-fail intrrupts. */
 	rid = 0;

--/04w6evG8XlLl3ft--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20030501003341.GA969>