From owner-freebsd-sparc Mon Jan 20 1:52:24 2003 Delivered-To: freebsd-sparc@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 562C137B401; Mon, 20 Jan 2003 01:52:23 -0800 (PST) Received: from mailhub.fokus.gmd.de (mailhub.fokus.gmd.de [193.174.154.14]) by mx1.FreeBSD.org (Postfix) with ESMTP id 0A59643F3F; Mon, 20 Jan 2003 01:52:18 -0800 (PST) (envelope-from brandt@fokus.gmd.de) Received: from beagle (beagle [193.175.132.100]) by mailhub.fokus.gmd.de (8.11.6/8.11.6) with ESMTP id h0K9qBM19617; Mon, 20 Jan 2003 10:52:11 +0100 (MET) Date: Mon, 20 Jan 2003 10:52:11 +0100 (CET) From: Harti Brandt To: Thomas Moestl Cc: sparc@freebsd.org Subject: Re: Problem with iommu_dvmamap_create In-Reply-To: <20030117173303.GD304@crow.dom2ip.de> Message-ID: <20030120103814.X45050@beagle.fokus.gmd.de> References: <20030117151958.U715@beagle.fokus.gmd.de> <20030117160857.GB304@crow.dom2ip.de> <20030117171317.F44530@beagle.fokus.gmd.de> <20030117171111.GC304@crow.dom2ip.de> <20030117181111.R45050@beagle.fokus.gmd.de> <20030117173303.GD304@crow.dom2ip.de> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-sparc@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org On Fri, 17 Jan 2003, Thomas Moestl wrote: TM>On Fri, 2003/01/17 at 18:19:59 +0100, Harti Brandt wrote: TM>> On Fri, 17 Jan 2003, Thomas Moestl wrote: TM>> TM>BUS_DMAMAP_NSEGS (and BUS_SPACE_MAXSIZE) is pretty arbitrary, the only TM>> TM>thing to limit is the stack space used by the segment array. In the TM>> TM>current setting, 272 bytes are used at most, which is less than 1.5 TM>> TM>minimal function frames. Values such as 64 should still be OK. TM>> TM>> Would it be possible if you change it just there? TM> TM>Yes, I'll do that with the next update. Thanks. Just while I could not sleep last night, it occured to me, that the code should work without even this change when the kernel is compiled with gcc. The code in iommu.c and bus_machdep.c use #ifdef __GNUC__ to use dynamic arrays on stack that have size ddmat->dt_nsegements size. So if I create a tag with a number of segments large enough, the arrays should be large enough. The only problem should be, that the size check around line 823 in iommu.c should also be conditionalized (for __GCC__ BUS_DMAMAP_NSEGS should not be checked.) Well, for some reason, that seems not to work. TM>So do I. Can you maybe put the full code of the driver in question TM>somewhere for download? Ok, I've put if_hatm.tar.bz into ftp://ftp.fokus.gmd.de/pub/cats/usr/harti/ngatm. Beware, this is my working code. The tag in question is the tx_tag and is created in if_hatm.c:1699. The DMAMAPs with this tag are create in if_hatm.c:465. They are used then in if_hatm_tx.c. The bug is triggered, however, even by only creating them. The first sign of the bug is that the card does not update the interrupt status words. These are dma-ed into the queue controlled by the irq_0 member of struct hatm_softc. I suppose the DMA goes somewhere else, because soon after that usually something bad happens to the system. harti -- harti brandt, http://www.fokus.gmd.de/research/cc/cats/employees/hartmut.brandt/private brandt@fokus.gmd.de, brandt@fokus.fhg.de To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-sparc" in the body of the message