From owner-freebsd-arm@FreeBSD.ORG Wed Jan 28 10:37:06 2009 Return-Path: Delivered-To: arm@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 21E571065672 for ; Wed, 28 Jan 2009 10:37:06 +0000 (UTC) (envelope-from gjb@semihalf.com) Received: from semihalf.com (semihalf.com [206.130.101.55]) by mx1.freebsd.org (Postfix) with ESMTP id D8C7A8FC1D for ; Wed, 28 Jan 2009 10:37:05 +0000 (UTC) (envelope-from gjb@semihalf.com) Received: from mail.semihalf.com (mail.semihalf.com [83.15.139.206]) by semihalf.com (8.13.1/8.13.1) with ESMTP id n0SAb0Ux029496; Wed, 28 Jan 2009 03:37:00 -0700 Message-ID: <4980356A.4090403@semihalf.com> Date: Wed, 28 Jan 2009 11:37:30 +0100 From: Grzegorz Bernacki MIME-Version: 1.0 To: Mark Tinguely , arm@freebsd.org References: <200901071955.n07Jthqu057051@casselton.net> In-Reply-To: <200901071955.n07Jthqu057051@casselton.net> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: Subject: Re: svn commit: r186730 - in head... X-BeenThere: freebsd-arm@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Porting FreeBSD to the StrongARM Processor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 Jan 2009 10:37:06 -0000 Mark Tinguely wrote: > Here is the "svn diff" from a week or so ago. The url is below in case > the inclusion adds some extra characters. > > http://www.casselton.net/~tinguely/arm_pmap_unmanage.diff > Mark, I downloaded your patch and applied it (after a few modification to get rid of compile errors). However, when I boot the board with new code it hangs. The problem is with uma allocator for pv_entries. When there is no more entries available it create new ones. It includes mapping memory into kernel using pmap_qenter. And then recurrence starts, pmap_qenter calls pmap_kenter which tries to allocate pv_entry and so on. I think that pv_entries for pmap_kenter should be allocated from some special pool to avoid this problem. Or some threshold could be set for uma allocator to force allocation of new pv_entries if number of free entries drops below the threshold, but I am not sure if it is possible without extending uma interface. Grzesiek From owner-freebsd-arm@FreeBSD.ORG Wed Jan 28 14:15:32 2009 Return-Path: Delivered-To: arm@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 764301065672 for ; Wed, 28 Jan 2009 14:15:32 +0000 (UTC) (envelope-from tinguely@casselton.net) Received: from casselton.net (casselton.net [63.165.140.2]) by mx1.freebsd.org (Postfix) with ESMTP id 331808FC22 for ; Wed, 28 Jan 2009 14:15:32 +0000 (UTC) (envelope-from tinguely@casselton.net) Received: from casselton.net (localhost [127.0.0.1]) by casselton.net (8.14.2/8.14.2) with ESMTP id n0SEFVYh075472; Wed, 28 Jan 2009 08:15:31 -0600 (CST) (envelope-from tinguely@casselton.net) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=casselton.net; s=ccnMail; t=1233152131; bh=RILcY2Jh+sl5oSVrwEU0fo/hAxcoDuo4Mxpr6th LkyI=; h=Date:From:Message-Id:To:Subject:In-Reply-To; b=R4UNHJcECYP cvMMvmUk4rl6ExQeYlCUcVtvpXDb0V/D6Gf031qS3s00ILBjjg2qEM3l+7BcenU5oN3 5b/1oPYCDD3xAVgjqJMRVb1fCWkSDtnSc/vf8XBQ5BMRuRimfYnHh+2IlU92LM1aUno MVZayS+Y9ETDtnu48o9SsfH4YM= Received: (from tinguely@localhost) by casselton.net (8.14.2/8.14.2/Submit) id n0SEFVsG075471; Wed, 28 Jan 2009 08:15:31 -0600 (CST) (envelope-from tinguely) Date: Wed, 28 Jan 2009 08:15:31 -0600 (CST) From: Mark Tinguely Message-Id: <200901281415.n0SEFVsG075471@casselton.net> To: arm@freebsd.org, gjb@semihalf.com, tinguely@casselton.net In-Reply-To: <4980356A.4090403@semihalf.com> Cc: Subject: Re: svn commit: r186730 - in head... X-BeenThere: freebsd-arm@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Porting FreeBSD to the StrongARM Processor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 Jan 2009 14:15:32 -0000 > I downloaded your patch and applied it (after a few modification to get rid of compile errors). However, when I boot the board with new code it hangs. The problem is with uma allocator for pv_entries. When there is no more entries available it create new ones. It includes mapping memory into kernel using pmap_qenter. And then recurrence starts, pmap_qenter calls pmap_kenter which tries to allocate pv_entry and so on. > I think that pv_entries for pmap_kenter should be allocated from some special pool to avoid this problem. Or some threshold could be set for uma allocator to force allocation of new pv_entries if number of free entries drops below the threshold, but I am not sure if it is possible without extending uma interface. > > Grzesiek Thank-you for the feedback. I should have anticipated that. If mapping the kernel mappings is the correct thing to do, we may add a map/virtual address entry to the md_page to remember the first mapping and then only manage on the duplicate kernel mapping. The extra check should be less overhead than managing every kernel mapping. --Mark Tinguely From owner-freebsd-arm@FreeBSD.ORG Fri Jan 30 07:56:30 2009 Return-Path: Delivered-To: arm@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 520C310656C0 for ; Fri, 30 Jan 2009 07:56:30 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from pele.citylink.co.nz (pele.citylink.co.nz [202.8.44.226]) by mx1.freebsd.org (Postfix) with ESMTP id EACBA8FC12 for ; Fri, 30 Jan 2009 07:56:29 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from localhost (localhost [127.0.0.1]) by pele.citylink.co.nz (Postfix) with ESMTP id 13365FF05 for ; Fri, 30 Jan 2009 20:26:54 +1300 (NZDT) X-Virus-Scanned: Debian amavisd-new at citylink.co.nz Received: from pele.citylink.co.nz ([127.0.0.1]) by localhost (pele.citylink.co.nz [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id hy+A1D2CmLoH for ; Fri, 30 Jan 2009 20:26:50 +1300 (NZDT) Received: from citylink.fud.org.nz (unknown [202.8.44.45]) by pele.citylink.co.nz (Postfix) with ESMTP for ; Fri, 30 Jan 2009 20:26:50 +1300 (NZDT) Received: by citylink.fud.org.nz (Postfix, from userid 1001) id E58451142C; Fri, 30 Jan 2009 20:26:49 +1300 (NZDT) Date: Thu, 29 Jan 2009 23:26:49 -0800 From: Andrew Thompson To: arm@freebsd.org Message-ID: <20090130072649.GF73709@citylink.fud.org.nz> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.17 (2007-11-01) Cc: Subject: busdma problem X-BeenThere: freebsd-arm@freebsd.org X-Mailman-Version: 2.1.5 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, 30 Jan 2009 07:56:30 -0000 Hi, I am having an issue with busdma when bounce buffers are used. I have patched _bus_dmamap_sync_bp() to print out the details when a bounce happens and also print the driver buffer before and after. During normal dma everything is fine, Before: 0xc7c1ab40 data=c1:4b:a4:80:c0:5d:ed:78:00:00:08:0d:c1:1f:46:78:00:00:20:02:00:00:20:02: [...do dma...] After: 0xc7c1ab40 data=2c:03:4e:00:6f:00:76:00:61:00:74:00:65:00:6c:00:20:00:57:00:69:00:72:00: The buffer 2c:03:4e:00:... is the correct response from the hardware. When a bounce buffer is used I see the correct data come in and be bcopy'd to my memory region but it is not visible when read later. Before: 0xc7c29b40 data=c1:50:19:00:c0:5d:ed:f8:00:00:08:0d:c1:1f:46:78:00:00:20:02:00:00:20:02: dma bounced 0x1271000 -> 0xc7c29b40 len=193 data=2c:03:4e:00:6f:00:76:00:61:00:74:00:65:00:6c:00:20:00:57:00:69:00:72:00: After: 0xc7c29b40 data=c1:50:19:00:c0:5d:ed:f8:00:00:08:0d:c1:1f:46:78:00:00:20:02:00:00:20:02: This is on an xscale ixp425 with 128m memory, the PCI dma tag is limited to 64m. Andrew Index: src/sys/arm/arm/busdma_machdep.c =================================================================== --- src/sys/arm/arm/busdma_machdep.c (revision 13717) +++ src/sys/arm/arm/busdma_machdep.c (working copy) @@ -1128,6 +1128,19 @@ } static void +dbgprint_safe(const uint8_t *buf, int len) +{ + const uint8_t *p; + int i; + + if (len > 24) + len = 24; + + for (i = 0, p = buf; i < len; i++, p++) + printf("%02x:", *p); +} + +static void _bus_dmamap_sync_bp(bus_dma_tag_t dmat, bus_dmamap_t map, bus_dmasync_op_t op) { struct bounce_page *bpage; @@ -1144,6 +1157,7 @@ cpu_l2cache_wb_range(bpage->vaddr, bpage->datacount); } + dmat->bounce_zone->total_bounced++; } if (op & BUS_DMASYNC_POSTREAD) { if (bpage->vaddr_nocache == 0) { @@ -1155,6 +1169,12 @@ bcopy((void *)(bpage->vaddr_nocache != 0 ? bpage->vaddr_nocache : bpage->vaddr), (void *)bpage->datavaddr, bpage->datacount); + printf("dma bounced %p -> %p len=%d data=", + (void *)bpage->busaddr, (void *)bpage->datavaddr, + bpage->datacount); + dbgprint_safe((void *)bpage->datavaddr, bpage->datacount); + printf("\n"); + dmat->bounce_zone->total_bounced++; } } } From owner-freebsd-arm@FreeBSD.ORG Fri Jan 30 17:31:52 2009 Return-Path: Delivered-To: arm@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9A27C106568A; Fri, 30 Jan 2009 17:31:52 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from pele.citylink.co.nz (pele.citylink.co.nz [202.8.44.226]) by mx1.freebsd.org (Postfix) with ESMTP id 5E0F68FC22; Fri, 30 Jan 2009 17:31:52 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from localhost (localhost [127.0.0.1]) by pele.citylink.co.nz (Postfix) with ESMTP id 93988FF14; Sat, 31 Jan 2009 06:31:51 +1300 (NZDT) X-Virus-Scanned: Debian amavisd-new at citylink.co.nz Received: from pele.citylink.co.nz ([127.0.0.1]) by localhost (pele.citylink.co.nz [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id WcIjGH0KKF5o; Sat, 31 Jan 2009 06:31:48 +1300 (NZDT) Received: from citylink.fud.org.nz (unknown [202.8.44.45]) by pele.citylink.co.nz (Postfix) with ESMTP; Sat, 31 Jan 2009 06:31:48 +1300 (NZDT) Received: by citylink.fud.org.nz (Postfix, from userid 1001) id AB82A1142A; Sat, 31 Jan 2009 06:31:47 +1300 (NZDT) Date: Fri, 30 Jan 2009 09:31:47 -0800 From: Andrew Thompson To: Sam Leffler Message-ID: <20090130173147.GC2160@citylink.fud.org.nz> References: <20090130072649.GF73709@citylink.fud.org.nz> <49833653.60509@freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <49833653.60509@freebsd.org> User-Agent: Mutt/1.5.17 (2007-11-01) Cc: arm@freebsd.org Subject: Re: busdma problem X-BeenThere: freebsd-arm@freebsd.org X-Mailman-Version: 2.1.5 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, 30 Jan 2009 17:31:53 -0000 On Fri, Jan 30, 2009 at 09:18:11AM -0800, Sam Leffler wrote: > Andrew Thompson wrote: >> Hi, >> >> >> I am having an issue with busdma when bounce buffers are used. I have >> patched _bus_dmamap_sync_bp() to print out the details when a bounce >> happens and also print the driver buffer before and after. >> >> During normal dma everything is fine, >> >> Before: 0xc7c1ab40 data=c1:4b:a4:80:c0:5d:ed:78:00:00:08:0d:c1:1f:46:78:00:00:20:02:00:00:20:02: >> [...do dma...] >> After: 0xc7c1ab40 data=2c:03:4e:00:6f:00:76:00:61:00:74:00:65:00:6c:00:20:00:57:00:69:00:72:00: >> >> The buffer 2c:03:4e:00:... is the correct response from the hardware. >> When a bounce buffer is used I see the correct data come in and be >> bcopy'd to my memory region but it is not visible when read later. >> >> Before: 0xc7c29b40 data=c1:50:19:00:c0:5d:ed:f8:00:00:08:0d:c1:1f:46:78:00:00:20:02:00:00:20:02: >> dma bounced 0x1271000 -> 0xc7c29b40 len=193 data=2c:03:4e:00:6f:00:76:00:61:00:74:00:65:00:6c:00:20:00:57:00:69:00:72:00: >> After: 0xc7c29b40 data=c1:50:19:00:c0:5d:ed:f8:00:00:08:0d:c1:1f:46:78:00:00:20:02:00:00:20:02: >> >> >> This is on an xscale ixp425 with 128m memory, the PCI dma tag is limited >> to 64m. >> > What device is involved? Is this on HEAD? This is usb/ehci. The specific function I am looking at is usbd_get_string() in usbdi.c, it does a usb request to fill usb_string_descriptor_t that is a stack variable. This is on HEAD, a simple way to see it is to run 'usbdevs -v' and see the vendor/product strings as garbage (sometimes). I have committed a fix so that total_bounces is actually incremented. Andrew From owner-freebsd-arm@FreeBSD.ORG Fri Jan 30 17:45:18 2009 Return-Path: Delivered-To: arm@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B81D31065675 for ; Fri, 30 Jan 2009 17:45:18 +0000 (UTC) (envelope-from sam@freebsd.org) Received: from ebb.errno.com (ebb.errno.com [69.12.149.25]) by mx1.freebsd.org (Postfix) with ESMTP id 91D3F8FC14 for ; Fri, 30 Jan 2009 17:45:18 +0000 (UTC) (envelope-from sam@freebsd.org) Received: from trouble.errno.com (trouble.errno.com [10.0.0.248]) (authenticated bits=0) by ebb.errno.com (8.13.6/8.12.6) with ESMTP id n0UHIBW3047550 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Fri, 30 Jan 2009 09:18:12 -0800 (PST) (envelope-from sam@freebsd.org) Message-ID: <49833653.60509@freebsd.org> Date: Fri, 30 Jan 2009 09:18:11 -0800 From: Sam Leffler Organization: FreeBSD Project User-Agent: Thunderbird 2.0.0.18 (X11/20081209) MIME-Version: 1.0 To: Andrew Thompson References: <20090130072649.GF73709@citylink.fud.org.nz> In-Reply-To: <20090130072649.GF73709@citylink.fud.org.nz> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-DCC-sonic.net-Metrics: ebb.errno.com; whitelist Cc: arm@freebsd.org Subject: Re: busdma problem X-BeenThere: freebsd-arm@freebsd.org X-Mailman-Version: 2.1.5 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, 30 Jan 2009 17:45:19 -0000 Andrew Thompson wrote: > Hi, > > > I am having an issue with busdma when bounce buffers are used. I have > patched _bus_dmamap_sync_bp() to print out the details when a bounce > happens and also print the driver buffer before and after. > > During normal dma everything is fine, > > Before: 0xc7c1ab40 data=c1:4b:a4:80:c0:5d:ed:78:00:00:08:0d:c1:1f:46:78:00:00:20:02:00:00:20:02: > [...do dma...] > After: 0xc7c1ab40 data=2c:03:4e:00:6f:00:76:00:61:00:74:00:65:00:6c:00:20:00:57:00:69:00:72:00: > > The buffer 2c:03:4e:00:... is the correct response from the hardware. > When a bounce buffer is used I see the correct data come in and be > bcopy'd to my memory region but it is not visible when read later. > > Before: 0xc7c29b40 data=c1:50:19:00:c0:5d:ed:f8:00:00:08:0d:c1:1f:46:78:00:00:20:02:00:00:20:02: > dma bounced 0x1271000 -> 0xc7c29b40 len=193 data=2c:03:4e:00:6f:00:76:00:61:00:74:00:65:00:6c:00:20:00:57:00:69:00:72:00: > After: 0xc7c29b40 data=c1:50:19:00:c0:5d:ed:f8:00:00:08:0d:c1:1f:46:78:00:00:20:02:00:00:20:02: > > > This is on an xscale ixp425 with 128m memory, the PCI dma tag is limited > to 64m. > > What device is involved? Is this on HEAD? Sam From owner-freebsd-arm@FreeBSD.ORG Fri Jan 30 19:29:46 2009 Return-Path: Delivered-To: arm@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 05D3010656FD for ; Fri, 30 Jan 2009 19:29:46 +0000 (UTC) (envelope-from tinguely@casselton.net) Received: from casselton.net (casselton.net [63.165.140.2]) by mx1.freebsd.org (Postfix) with ESMTP id 92CDF8FC37 for ; Fri, 30 Jan 2009 19:29:45 +0000 (UTC) (envelope-from tinguely@casselton.net) Received: from casselton.net (localhost [127.0.0.1]) by casselton.net (8.14.2/8.14.2) with ESMTP id n0UJTiVY020981; Fri, 30 Jan 2009 13:29:44 -0600 (CST) (envelope-from tinguely@casselton.net) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=casselton.net; s=ccnMail; t=1233343784; bh=3oPsStkoJ6j5A6+90ZgDM2UQd40KjF33dMASShz YbRE=; h=Date:From:Message-Id:To:Subject:In-Reply-To; b=mr4tXPN4O4L PNzyknb+7XjGU9XGGU9AIX0oaSZnNf6CXKbkEniYU3+7Vm8OhGVpySMw/gACE7FEu+o zxSVGwB9X404SWJQkAb5HopDZU9ImjxWjELf59+tP9ApDSGZyeoBGPljzGmyNHfohyO YjxV1bjWHwHSGPEXSkNC3QBo4k= Received: (from tinguely@localhost) by casselton.net (8.14.2/8.14.2/Submit) id n0UJTifW020980; Fri, 30 Jan 2009 13:29:44 -0600 (CST) (envelope-from tinguely) Date: Fri, 30 Jan 2009 13:29:44 -0600 (CST) From: Mark Tinguely Message-Id: <200901301929.n0UJTifW020980@casselton.net> To: arm@freebsd.org, gjb@semihalf.com, tinguely@casselton.net In-Reply-To: <4980356A.4090403@semihalf.com> Cc: Subject: Re: svn commit: r186730 - in head... X-BeenThere: freebsd-arm@freebsd.org X-Mailman-Version: 2.1.5 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, 30 Jan 2009 19:29:46 -0000 > Mark Tinguely wrote: > > Here is the "svn diff" from a week or so ago. The url is below in case > > the inclusion adds some extra characters. > > > > http://www.casselton.net/~tinguely/arm_pmap_unmanage.diff > > > > Mark, > > I downloaded your patch and applied it (after a few modification to get rid of compile errors). However, when I boot the board with new code it hangs. The problem is with uma allocator for pv_entries. When there is no more entries available it create new ones. It includes mapping memory into kernel using pmap_qenter. And then recurrence starts, pmap_qenter calls pmap_kenter which tries to allocate pv_entry and so on. > I think that pv_entries for pmap_kenter should be allocated from some special pool to avoid this problem. Or some threshold could be set for uma allocator to force allocation of new pv_entries if number of free entries drops below the threshold, but I am not sure if it is possible without extending uma interface. > > Grzesiek I removed the patch at the above address and replaced it with one that stores the KVA in a the vm_page machine dependant variable pv_kva if this is the first mapping of the page. This pv_kva value should be removed anytime the pv_entry is removed. The vast majority of kernel mappings will never be shared, so this should be more effiecient than my earlier patch, and should not have the pv_entry UMA recursion problem. Now, I should also be able to remove the test to see if the pvzone is allocated since those pages are not shared. I also moved some code around to simply the tests and to avoid a potential error that has been in the pmap.c for a long time, but I just noticed it. at line 3431 of revision 184730 in pmap_enter_locked(), the pve could have been freed in the PG_UNMANAGED | PG_FICTITIOUS pages; the KASSERT in line 3429 would not catch the situation. Disclaimer: This is mostly a concept. I ran cc on this file and removed the syntax errors - sorry about that, but haven't gone much further. I will create a cross compiling machine that runs the emulator. --Mark Tinguely. From owner-freebsd-arm@FreeBSD.ORG Fri Jan 30 22:07:20 2009 Return-Path: Delivered-To: arm@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5D126106564A; Fri, 30 Jan 2009 22:07:20 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from pele.citylink.co.nz (pele.citylink.co.nz [202.8.44.226]) by mx1.freebsd.org (Postfix) with ESMTP id F1EAA8FC14; Fri, 30 Jan 2009 22:07:19 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from localhost (localhost [127.0.0.1]) by pele.citylink.co.nz (Postfix) with ESMTP id DDFB7FF14; Sat, 31 Jan 2009 11:07:18 +1300 (NZDT) X-Virus-Scanned: Debian amavisd-new at citylink.co.nz Received: from pele.citylink.co.nz ([127.0.0.1]) by localhost (pele.citylink.co.nz [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id l-hcH1M0XZTt; Sat, 31 Jan 2009 11:07:15 +1300 (NZDT) Received: from citylink.fud.org.nz (unknown [202.8.44.45]) by pele.citylink.co.nz (Postfix) with ESMTP; Sat, 31 Jan 2009 11:07:15 +1300 (NZDT) Received: by citylink.fud.org.nz (Postfix, from userid 1001) id E3CC91142D; Sat, 31 Jan 2009 11:07:14 +1300 (NZDT) Date: Fri, 30 Jan 2009 14:07:14 -0800 From: Andrew Thompson To: Sam Leffler Message-ID: <20090130220714.GA10743@citylink.fud.org.nz> References: <20090130072649.GF73709@citylink.fud.org.nz> <49833653.60509@freebsd.org> <20090130173147.GC2160@citylink.fud.org.nz> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20090130173147.GC2160@citylink.fud.org.nz> User-Agent: Mutt/1.5.17 (2007-11-01) Cc: arm@freebsd.org Subject: Re: busdma problem X-BeenThere: freebsd-arm@freebsd.org X-Mailman-Version: 2.1.5 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, 30 Jan 2009 22:07:20 -0000 On Fri, Jan 30, 2009 at 09:31:47AM -0800, Andrew Thompson wrote: > On Fri, Jan 30, 2009 at 09:18:11AM -0800, Sam Leffler wrote: > > Andrew Thompson wrote: > >> Hi, > >> > >> > >> I am having an issue with busdma when bounce buffers are used. I have > >> patched _bus_dmamap_sync_bp() to print out the details when a bounce > >> happens and also print the driver buffer before and after. > >> > >> During normal dma everything is fine, > >> > >> Before: 0xc7c1ab40 data=c1:4b:a4:80:c0:5d:ed:78:00:00:08:0d:c1:1f:46:78:00:00:20:02:00:00:20:02: > >> [...do dma...] > >> After: 0xc7c1ab40 data=2c:03:4e:00:6f:00:76:00:61:00:74:00:65:00:6c:00:20:00:57:00:69:00:72:00: > >> > >> The buffer 2c:03:4e:00:... is the correct response from the hardware. > >> When a bounce buffer is used I see the correct data come in and be > >> bcopy'd to my memory region but it is not visible when read later. > >> > >> Before: 0xc7c29b40 data=c1:50:19:00:c0:5d:ed:f8:00:00:08:0d:c1:1f:46:78:00:00:20:02:00:00:20:02: > >> dma bounced 0x1271000 -> 0xc7c29b40 len=193 data=2c:03:4e:00:6f:00:76:00:61:00:74:00:65:00:6c:00:20:00:57:00:69:00:72:00: > >> After: 0xc7c29b40 data=c1:50:19:00:c0:5d:ed:f8:00:00:08:0d:c1:1f:46:78:00:00:20:02:00:00:20:02: > >> > >> > >> This is on an xscale ixp425 with 128m memory, the PCI dma tag is limited > >> to 64m. > >> > > What device is involved? Is this on HEAD? > > This is usb/ehci. The specific function I am looking at is > usbd_get_string() in usbdi.c, it does a usb request to fill > usb_string_descriptor_t that is a stack variable. As suggested by Sam, this works properly when the buffer is malloc'd instead of taken from the stack. So is this now a bug or a feature?? Andrew From owner-freebsd-arm@FreeBSD.ORG Fri Jan 30 23:00:02 2009 Return-Path: Delivered-To: freebsd-arm@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6B3D910657AE for ; Fri, 30 Jan 2009 23:00:02 +0000 (UTC) (envelope-from avinogradovs@clearpathnet.com) Received: from smtp.clearpathnet.com (smtp.clearpathnet.com [74.217.144.10]) by mx1.freebsd.org (Postfix) with ESMTP id 2CFC78FC25 for ; Fri, 30 Jan 2009 23:00:02 +0000 (UTC) (envelope-from avinogradovs@clearpathnet.com) Received: from [10.1.16.109] (la-209-182-100-49 [209.182.100.49] (may be forged)) by smtp.clearpathnet.com (8.13.1/8.13.1) with ESMTP id n0UMfvmH029804 for ; Fri, 30 Jan 2009 14:41:59 -0800 Message-ID: <49838270.7090301@clearpathnet.com> Date: Fri, 30 Jan 2009 14:42:56 -0800 From: Alex Vinogradovs User-Agent: Thunderbird 2.0.0.16 (X11/20080915) MIME-Version: 1.0 To: freebsd-arm@freebsd.org Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: NFS on ARM/IXP435 X-BeenThere: freebsd-arm@freebsd.org X-Mailman-Version: 2.1.5 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, 30 Jan 2009 23:00:04 -0000 Guys, I was able to boot into multiuser on IXP435-based board using CAMBRIA kernel config from 8.0 current. The only problem I ran into was mounting NFS from userspace - it would just hang, although kernel would mount root via NFS without problems. Best regards, Alex Vinogradovs From owner-freebsd-arm@FreeBSD.ORG Sat Jan 31 01:58:32 2009 Return-Path: Delivered-To: freebsd-arm@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 54C701065670 for ; Sat, 31 Jan 2009 01:58:32 +0000 (UTC) (envelope-from sam@freebsd.org) Received: from ebb.errno.com (ebb.errno.com [69.12.149.25]) by mx1.freebsd.org (Postfix) with ESMTP id 176C18FC16 for ; Sat, 31 Jan 2009 01:58:31 +0000 (UTC) (envelope-from sam@freebsd.org) Received: from trouble.errno.com (trouble.errno.com [10.0.0.248]) (authenticated bits=0) by ebb.errno.com (8.13.6/8.12.6) with ESMTP id n0V1wP7E051075 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Fri, 30 Jan 2009 17:58:26 -0800 (PST) (envelope-from sam@freebsd.org) Message-ID: <4983B041.4050200@freebsd.org> Date: Fri, 30 Jan 2009 17:58:25 -0800 From: Sam Leffler Organization: FreeBSD Project User-Agent: Thunderbird 2.0.0.18 (X11/20081209) MIME-Version: 1.0 To: Alex Vinogradovs References: <49838270.7090301@clearpathnet.com> In-Reply-To: <49838270.7090301@clearpathnet.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-DCC-sonic.net-Metrics: ebb.errno.com; whitelist Cc: freebsd-arm@freebsd.org Subject: Re: NFS on ARM/IXP435 X-BeenThere: freebsd-arm@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Porting FreeBSD to the StrongARM Processor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 31 Jan 2009 01:58:32 -0000 Alex Vinogradovs wrote: > Guys, > > I was able to boot into multiuser on IXP435-based board using CAMBRIA > kernel config from > 8.0 current. The only problem I ran into was mounting NFS from > userspace - it would just hang, > although kernel would mount root via NFS without problems. > I've had no problems using nfs-root, cf-root, or mounting nfs filesystems after boot. The only thing to beware is to not use NPE-A as it doesn't work. Sam From owner-freebsd-arm@FreeBSD.ORG Sat Jan 31 02:21:15 2009 Return-Path: Delivered-To: freebsd-arm@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1495E1065675 for ; Sat, 31 Jan 2009 02:21:15 +0000 (UTC) (envelope-from avinogradovs@clearpathnet.com) Received: from smtp.clearpathnet.com (smtp.clearpathnet.com [74.217.144.10]) by mx1.freebsd.org (Postfix) with ESMTP id EFA4C8FC16 for ; Sat, 31 Jan 2009 02:21:14 +0000 (UTC) (envelope-from avinogradovs@clearpathnet.com) Received: from [10.1.16.109] (la-209-182-100-49 [209.182.100.49] (may be forged)) by smtp.clearpathnet.com (8.13.1/8.13.1) with ESMTP id n0V2LBXJ030948; Fri, 30 Jan 2009 18:21:13 -0800 Message-ID: <4983B5D2.9040500@clearpathnet.com> Date: Fri, 30 Jan 2009 18:22:10 -0800 From: Alex Vinogradovs User-Agent: Thunderbird 2.0.0.16 (X11/20080915) MIME-Version: 1.0 To: Sam Leffler References: <49838270.7090301@clearpathnet.com> <4983B041.4050200@freebsd.org> In-Reply-To: <4983B041.4050200@freebsd.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: freebsd-arm@freebsd.org Subject: Re: NFS on ARM/IXP435 X-BeenThere: freebsd-arm@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Porting FreeBSD to the StrongARM Processor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 31 Jan 2009 02:21:15 -0000 Sam Leffler wrote: > > I've had no problems using nfs-root, cf-root, or mounting nfs > filesystems after boot. The only thing to beware is to not use NPE-A > as it doesn't work. > > Sam > Yeah, my situation is kind of odd... I've got operational network, but whether it is during startup (via fstab), or manually later on, mount_nfs just hangs, while / is mounted via NFS by kernel. But since there is no proc/truss, I'm clueless how to see what is it doing... Indeed I've noticed I've only got one interface out of two, so you've answered my question ahead of time :D just in case, here are my boot messages: KDB: debugger backends: ddb KDB: current backend: ddb Copyright (c) 1992-2009 The FreeBSD Project. Copyright (c) 1979, 1980, 1983, 1986, 1988, 1989, 1991, 1992, 1993, 1994 The Regents of the University of California. All rights reserved. FreeBSD is a registered trademark of The FreeBSD Foundation. FreeBSD 8.0-CURRENT #6: Fri Jan 30 13:47:27 PST 2009 alexv@alexv:/usr/src.2/sys/arm/compile/flex100 CPU: IXP435 rev 1 (ARMv5TE) (XScale core) DC enabled IC enabled WB enabled LABT branch prediction enabled 32KB/32B 32-way Instruction cache 32KB/32B 32-way write-back-locking Data cache real memory = 134217728 (128 MB) avail memory = 125263872 (119 MB) ixp0: on motherboard ixp0: 37fff ixpclk0: on ixp0 ixpiic0: on ixp0 iicbb0: on ixpiic0 iicbus0: on iicbb0 master-only iic0: on iicbus0 iicbus0: at addr 0x5a ad74180: at addr 0x50 on iicbus0 ds16720: at addr 0xd0 on iicbus0 ixpwdog0: on ixp0 uart0: on ixp0 uart0: [FILTER] uart0: console (115200,n,8,1) ixpqmgr0: on ixp0 ixpqmgr0: [ITHREAD] ixpqmgr0: [ITHREAD] npe0: on ixp0 npe0: [ITHREAD] npe0: MAC at 0xc800a000 npe0: MII at 0xc800a000 npe0: load fw image IXP425.NPE-C Func 0x5 Rev 2.1 miibus0: on npe0 ukphy0: PHY 1 on miibus0 ukphy0: 10baseT, 10baseT-FDX, 100baseTX, 100baseTX-FDX, auto npe0: Ethernet address: 00:03:47:df:32:a8 ata_avila0: on ixp0 ata_avila0: [ITHREAD] ata0: on ata_avila0 ata0: [ITHREAD] ehci0: on ixp0 ehci0: [GIANT-LOCKED] ehci0: [ITHREAD] usb0: set host controller mode usb0: set big-endian mode usb0: EHCI version 1.0 usb0: stop timeout usb0: set host controller mode usb0: set big-endian mode usb0 on ehci0 usb0: USB revision 2.0 uhub0: on usb0 uhub0: 1 port with 1 removable, self powered ehci1: on ixp0 ehci1: [GIANT-LOCKED] ehci1: [ITHREAD] usb1: set host controller mode usb1: set big-endian mode usb1: EHCI version 1.0 usb1: stop timeout usb1: set host controller mode usb1: set big-endian mode usb1 on ehci1 usb1: USB revision 2.0 uhub1: on usb1 uhub1: 1 port with 1 removable, self powered ixpclk0: [FILTER] Timecounter "IXP4XX Timer" frequency 66666600 Hz quality 1000 Timecounters tick every 10.000 msec bootpc_init: wired to interface 'npe0' Sending DHCP Discover packet from interface npe0 (00:03:47:df:32:a8) Received DHCP Offer packet on npe0 from 10.1.16.109 (accepted) (no root path) Received DHCP Offer packet on npe0 from 10.1.8.100 via 10.1.16.2 (ignored) (no root path) Received DHCP Offer packet on npe0 from 10.1.8.100 via 10.1.16.3 (ignored) (no root path) Sending DHCP Request packet from interface npe0 (00:03:47:df:32:a8) Received DHCP Ack packet on npe0 from 10.1.16.109 (accepted) (got root path) npe0 at 10.1.16.114 server 10.1.16.109 boot file /tftpboot/flex100 subnet mask 255.255.255.0 router 10.1.16.1 rootfs 10.1.16.109:/armroot hostname flex100 Adjusted interface npe0 Trying to mount root from nfs: NFS ROOT: 10.1.16.109:/armroot 10.1.16.109:/armroot on / (nfs, read-only) devfs on /dev (devfs, local) /dev/md0 on /var (ufs, local) /dev/md1 on /tmp (ufs, local) npe0: flags=8843 metric 0 mtu 1500 ether 00:03:47:df:32:a8 inet 10.1.16.114 netmask 0xffffff00 broadcast 10.1.16.255 media: Ethernet autoselect (100baseTX ) status: active