From owner-freebsd-arm@FreeBSD.ORG Fri Feb 15 23:43:34 2013 Return-Path: Delivered-To: freebsd-arm@FreeBSD.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 4558B4DE for ; Fri, 15 Feb 2013 23:43:34 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from duck.symmetricom.us (duck.symmetricom.us [206.168.13.214]) by mx1.freebsd.org (Postfix) with ESMTP id E5CE9E21 for ; Fri, 15 Feb 2013 23:43:15 +0000 (UTC) Received: from damnhippie.dyndns.org (daffy.symmetricom.us [206.168.13.218]) by duck.symmetricom.us (8.14.6/8.14.6) with ESMTP id r1FNh8fK041788 for ; Fri, 15 Feb 2013 16:43:09 -0700 (MST) (envelope-from ian@FreeBSD.org) Received: from [172.22.42.240] (revolution.hippie.lan [172.22.42.240]) by damnhippie.dyndns.org (8.14.3/8.14.3) with ESMTP id r1FNgka7045686; Fri, 15 Feb 2013 16:42:46 -0700 (MST) (envelope-from ian@FreeBSD.org) Subject: Re: Panic when calling _bus_dmamap_load_buffer() with BUS_DMA_COULD_BOUNCE (armv6) From: Ian Lepore To: Thomas Skibo In-Reply-To: <511EB6B9.3020902@sbcglobal.net> References: <511EB6B9.3020902@sbcglobal.net> Content-Type: text/plain; charset="us-ascii" Date: Fri, 15 Feb 2013 16:42:46 -0700 Message-ID: <1360971766.1164.0.camel@revolution.hippie.lan> Mime-Version: 1.0 X-Mailer: Evolution 2.32.1 FreeBSD GNOME Team Port Content-Transfer-Encoding: 7bit Cc: freebsd-arm@FreeBSD.org X-BeenThere: freebsd-arm@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Porting FreeBSD to the StrongARM Processor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 15 Feb 2013 23:43:34 -0000 On Fri, 2013-02-15 at 14:29 -0800, Thomas Skibo wrote: > Hello: > > This is the Zedboard port which is the armv6 architecture. I integrated > to my project branch late Wednesday which included some big changes to > busdma stuff. Now my kernel panics early in boot-up. > > I'm getting the a vm_fault when a certain driver calls bus_dmamap_load() > with a dma tag with BUS_DMA_COULD_BOUNCE set. > > What appears to be happening is that the code at lines 971-980 in > sys/arm/arm/busdma_machdep-v6.c is calling _bus_dmamap_count_pages() > before map->pmap is set (it's NULL). _bus_dmamap_count_pages() in turn > calls pmap_extract() with a NULL pointer. > > (_bus_dmamap_count_pages() is inlined by the compiler so doesn't show up > in the following back-trace.) > > I patched busdma_machdep-v6.c to get moving again by moving the > "map->pmap = pmap" statement before the BUS_DMA_COULD_BOUNCE check. I'm > not suggesting that's the right fix at all. > > ==== //depot/user/skibo/skibo_zynq/sys/arm/arm/busdma_machdep-v6.c#2 - > /home/skibo/p4/skibo_zynq/sys/arm/arm/busdma_machdep-v6.c ==== > 970a971,972 > > map->pmap = pmap; > > > 982d983 > < map->pmap = pmap; Yep, that was exactly the right fix, commited as r246859. Thanks! -- Ian