From owner-freebsd-current@FreeBSD.ORG Sat Apr 25 05:59:06 2015 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 7F8BD3C6; Sat, 25 Apr 2015 05:59:06 +0000 (UTC) Received: from mail.turbocat.net (heidi.turbocat.net [88.198.202.214]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 41987166D; Sat, 25 Apr 2015 05:59:05 +0000 (UTC) Received: from laptop015.home.selasky.org (cm-176.74.213.204.customer.telag.net [176.74.213.204]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.turbocat.net (Postfix) with ESMTPSA id F3D7C1FE023; Sat, 25 Apr 2015 07:59:02 +0200 (CEST) Message-ID: <553B2D56.1000405@selasky.org> Date: Sat, 25 Apr 2015 07:59:50 +0200 From: Hans Petter Selasky User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:31.0) Gecko/20100101 Thunderbird/31.4.0 MIME-Version: 1.0 To: Ian Lepore , Svatopluk Kraus CC: freebsd-current@freebsd.org Subject: Re: [patch] fix add_bounce_page() for BUS_DMA_KEEP_PG_OFFSET References: <1429882188.1157.2.camel@freebsd.org> In-Reply-To: <1429882188.1157.2.camel@freebsd.org> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 25 Apr 2015 05:59:06 -0000 On 04/24/15 15:29, Ian Lepore wrote: > On Fri, 2015-04-24 at 13:34 +0200, Svatopluk Kraus wrote: >> The add_bounce_page() can be called from _bus_dmamap_load_phys(). >> Client virtual address is zero (not valid) in that case. So, client >> physical address must be used to get an offset when >> BUS_DMA_KEEP_PG_OFFSET flag is set. Note that client physical address >> is always valid. >> >> Svatopluk Kraus > > The only user of BUS_DMA_KEEP_PG_OFFSET in the system is USB. If the > flag didn't exist, we could do bouncing with a whole lot more > efficiency, at least in the ARM world. I wonder if it would be possible > to just eliminate the flag (and of course, USB's need for it, which I > fully admit I don't understand even a little bit). > Hi, USB (EHCI/UHCI/OHCI) needs this flag when computing scatter/gather lists. Please ensure it works like expected. The good news is XHCI needs it less than the EHCI. Ian: The patch looks good - will you commit it? --HPS