From owner-freebsd-arm@FreeBSD.ORG Fri Feb 15 22:29:12 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 C91B8640 for ; Fri, 15 Feb 2013 22:29:12 +0000 (UTC) (envelope-from ThomasSkibo@sbcglobal.net) Received: from nm27-vm0.access.bullet.mail.sp2.yahoo.com (nm27-vm0.access.bullet.mail.sp2.yahoo.com [98.139.44.188]) by mx1.freebsd.org (Postfix) with ESMTP id AAAF09A9 for ; Fri, 15 Feb 2013 22:29:12 +0000 (UTC) Received: from [98.139.44.101] by nm27.access.bullet.mail.sp2.yahoo.com with NNFMP; 15 Feb 2013 22:29:12 -0000 Received: from [67.195.22.113] by tm6.access.bullet.mail.sp2.yahoo.com with NNFMP; 15 Feb 2013 22:29:11 -0000 Received: from [127.0.0.1] by smtp115.sbc.mail.gq1.yahoo.com with NNFMP; 15 Feb 2013 22:29:11 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sbcglobal.net; s=s1024; t=1360967351; bh=+6OyZ8OuG66aEMDlhuLfuLP+XQ43SjgyCXHxkKIMbLA=; h=X-Yahoo-Newman-Id:X-Yahoo-Newman-Property:X-YMail-OSG:X-Yahoo-SMTP:Received:Message-ID:Date:From:User-Agent:MIME-Version:To:Subject:Content-Type:Content-Transfer-Encoding; b=wR2bTr8XK0RTyKj7CJm3PNXiBhdE+HgPfYfLpNLz27YcaBuK2f4Hs+sQRkkhLo//hW62t8iB5dNaKRYoJd3/ta4sbFIjX56Plz3O4L566hqJoIHEyc63/8nXdr4jy6hrQfm2vdSJ2nq6Z/QBa/n8gDxKt5XNwdJuacVjZdJBBJU= X-Yahoo-Newman-Id: 875714.15361.bm@smtp115.sbc.mail.gq1.yahoo.com X-Yahoo-Newman-Property: ymail-3 X-YMail-OSG: pZTU0UYVM1l7O2haQoQhz4kK7fkH8vd0I6lXlXm3n5l6ghb 7Ul4UmtLqiC6O5ac78FazUN9hwSOWNehwJPggpKhRyBiGCgJLn88kMpFiqQz kctEbsCit.xZztiMmGVKcq0UP1L0hTcJd9OcmmB6vYHFpyETOJgJ37rewUyu rWFPgEwHZOYtJ1wsz1mo90TBaOTU8n3HMVW9DY4A9bQu1pfgI3Ggsznx1Aoz wOl7Js6SyWEvFDIUP3_z2RS2jml4Xf4MSwTeCBB5ZKLZwY3qh5EJbAAfPC3_ OLEZ6SK6_wpngXYRlr8r5PO.efVDkF1hHxPZcKVu9DRP1HLL6xycara5CMk_ h2WoL3wbcseZvnf__.IvYtmGffdld1ZFrGdckBMnPsLTanPP.981cZGmjZUm Qwq8oY4qXb1.tl0wDHxSKHHD0xPxQ4CBVIxW.KuJx03czAkNaKddS_yb.cwH x8hYdUj5qO0GHWcwM_qNOBV9.Am00mHr_SQt6udc- X-Yahoo-SMTP: tUxoRneswBA21azLM.3ybMESf0mC2bFhTbmt0VU5ervH0kqi5lo- Received: from [192.168.1.9] (ThomasSkibo@71.139.168.220 with plain) by smtp115.sbc.mail.gq1.yahoo.com with SMTP; 15 Feb 2013 14:29:11 -0800 PST Message-ID: <511EB6B9.3020902@sbcglobal.net> Date: Fri, 15 Feb 2013 14:29:13 -0800 From: Thomas Skibo User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.8; rv:17.0) Gecko/20130107 Thunderbird/17.0.2 MIME-Version: 1.0 To: freebsd-arm@freebsd.org Subject: Panic when calling _bus_dmamap_load_buffer() with BUS_DMA_COULD_BOUNCE (armv6) Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit 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 22:29:12 -0000 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; --Thomas vm_fault(0xc04fae94, 0, 1, 0) -> 1 Fatal kernel mode data abort: 'Translation Fault (S)' trapframe: 0xc0526ab8 FSR=00000005, FAR=00000010, spsr=000000d3 r0 =c04fabb0, r1 =00000004, r2 =00000004, r3 =00000010 r4 =00000000, r5 =c2dd9000, r6 =c2dda000, r7 =c2dd9000 r8 =c2dd5580, r9 =c2dd55cc, r10=00001000, r11=c0526b1c r12=c04fabb0, ssp=c0526b04, slr=c041c41c, pc =c0424b90 [ thread pid 0 tid 100000 ] Stopped at pmap_extract+0x30: ldrex r14, [r3] db> bt Tracing pid 0 tid 100000 td 0xc04fabb0 db_trace_self() at db_trace_self+0xc scp=0xc041e6d8 rlv=0xc041e724 (db_trace_thread+0x38) rsp=0xc05267cc rfp=0xc05267d8 db_trace_thread() at db_trace_thread+0xc scp=0xc041e6f8 rlv=0xc012b6f8 (db_command_init+0x354) rsp=0xc05267dc rfp=0xc05267f8 db_command_init() at db_command_init+0x27c scp=0xc012b620 rlv=0xc012b0fc (db_skip_to_eol+0x4a0) rsp=0xc05267fc rfp=0xc05268a0 r5=0x00000000 r4=0xc04cc258 db_skip_to_eol() at db_skip_to_eol+0x1d4 scp=0xc012ae30 rlv=0xc012b268 (db_command_loop+0x60) rsp=0xc05268a4 rfp=0xc05268b0 r10=0x600001d3 r8=0x00000005 r7=0x00000000 r6=0x00000010 r5=0xc04cc520 r4=0xc05268bc db_command_loop() at db_command_loop+0xc scp=0xc012b214 rlv=0xc012d748 (X_db_sym_numargs+0xf4) rsp=0xc05268b4 rfp=0xc05269d0 X_db_sym_numargs() at X_db_sym_numargs+0x14 scp=0xc012d668 rlv=0xc0285a80 (kdb_trap+0xa4) rsp=0xc05269d4 rfp=0xc05269f8 r4=0xc0526ab8 kdb_trap() at kdb_trap+0xc scp=0xc02859e8 rlv=0xc042d934 (badaddr_read+0x284) rsp=0xc05269fc rfp=0xc0526a18 r10=0x00000000 r8=0xc0526ab8 r7=0xc04fabb0 r6=0x00000010 r5=0x00000005 r4=0xc0526ab8 badaddr_read() at badaddr_read+0xfc scp=0xc042d7ac rlv=0xc042de70 (data_abort_handler+0x4e4) rsp=0xc0526a1c rfp=0xc0526ab4 r6=0xc0526ef8 r5=0xc04fa8c8 r4=0x00000000 data_abort_handler() at data_abort_handler+0xc scp=0xc042d998 rlv=0xc041fedc (address_exception_entry+0x50) rsp=0xc0526ab8 rfp=0xc0526b1c r10=0x00001000 r9=0xc2dd55cc r8=0xc2dd5580 r7=0xc2dd9000 r6=0xc2dda000 r5=0xc2dd9000 r4=0x00000000 pmap_extract() at pmap_extract+0xc scp=0xc0424b6c rlv=0xc041c41c (_bus_dmamap_load_buffer+0x7c) rsp=0xc0526b20 rfp=0xc0526b50 r5=0xc2dd5480 r4=0xc2dd9000 _bus_dmamap_load_buffer() at _bus_dmamap_load_buffer+0xc scp=0xc041c3ac rlv=0xc0281ca8 (bus_dmamap_load+0xac) rsp=0xc0526b54 rfp=0xc0526bb4 r10=0xc2dad040 r9=0xc0146108 r8=0x00001000 r7=0x00000000 r6=0xc2dd5580 r5=0xc2dd5480 r4=0xc2dd9000 bus_dmamap_load() at bus_dmamap_load+0xc scp=0xc0281c08 rlv=0xc0149354 (sdhci_init_slot+0x100) rsp=0xc0526bb8 rfp=0xc0526c08 r10=0x00000001 r9=0xc2d58700 r8=0x00000000 r7=0xc2d89580 r6=0xc2dad0d4 r5=0xc2dad018 r4=0x00000000 sdhci_init_slot() at sdhci_init_slot+0xc scp=0xc0149260 rlv=0xc0439670 (zy7_slcr_init_postload_pl+0x3ce8) rsp=0xc0526c0c rfp=0xc0526c44 r10=0x00000001 r9=0xc2d58700 r8=0x00000000 r7=0xc2d89580 r6=0x00000000 r5=0xc2dad000 r4=0xc2dad000 db> -- -------- Thomas Skibo ThomasSkibo@sbcglobal.net