From owner-freebsd-current@FreeBSD.ORG Fri Apr 24 13:36:23 2015 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 40FC3304 for ; Fri, 24 Apr 2015 13:36:23 +0000 (UTC) Received: from relay.mailchannels.net (aso-006-i440.relay.mailchannels.net [23.91.64.121]) by mx1.freebsd.org (Postfix) with ESMTP id 9E66D1AF9 for ; Fri, 24 Apr 2015 13:36:21 +0000 (UTC) X-Sender-Id: duocircle|x-authuser|hippie Received: from smtp3.ore.mailhop.org (ip-10-229-11-165.us-west-2.compute.internal [10.229.11.165]) by relay.mailchannels.net (Postfix) with ESMTPA id 90550A10D4; Fri, 24 Apr 2015 13:29:51 +0000 (UTC) X-Sender-Id: duocircle|x-authuser|hippie Received: from smtp3.ore.mailhop.org (smtp3.ore.mailhop.org [10.83.15.107]) (using TLSv1 with cipher DHE-RSA-AES256-SHA) by 0.0.0.0:2500 (trex/5.4.8); Fri, 24 Apr 2015 13:29:52 +0000 X-MC-Relay: Neutral X-MailChannels-SenderId: duocircle|x-authuser|hippie X-MailChannels-Auth-Id: duocircle X-MC-Loop-Signature: 1429882191759:4233535000 X-MC-Ingress-Time: 1429882191759 Received: from c-73-34-117-227.hsd1.co.comcast.net ([73.34.117.227] helo=ilsoft.org) by smtp3.ore.mailhop.org with esmtpsa (TLSv1.2:DHE-RSA-AES256-GCM-SHA384:256) (Exim 4.82) (envelope-from ) id 1Yldfy-0006CR-Ql; Fri, 24 Apr 2015 13:29:51 +0000 Received: from revolution.hippie.lan (revolution.hippie.lan [172.22.42.240]) by ilsoft.org (8.14.9/8.14.9) with ESMTP id t3ODTmRl038216; Fri, 24 Apr 2015 07:29:48 -0600 (MDT) (envelope-from ian@freebsd.org) X-Mail-Handler: DuoCircle Outbound SMTP X-Originating-IP: 73.34.117.227 X-Report-Abuse-To: abuse@duocircle.com (see https://support.duocircle.com/support/solutions/articles/5000540958-duocircle-standard-smtp-abuse-information for abuse reporting information) X-MHO-User: U2FsdGVkX1+D13QurlkR1ihRcfiohtqs Message-ID: <1429882188.1157.2.camel@freebsd.org> Subject: Re: [patch] fix add_bounce_page() for BUS_DMA_KEEP_PG_OFFSET From: Ian Lepore To: Svatopluk Kraus Cc: freebsd-current@freebsd.org Date: Fri, 24 Apr 2015 07:29:48 -0600 In-Reply-To: References: Content-Type: text/plain; charset="us-ascii" X-Mailer: Evolution 3.12.10 FreeBSD GNOME Team Port Mime-Version: 1.0 Content-Transfer-Encoding: 7bit X-AuthUser: hippie 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: Fri, 24 Apr 2015 13:36:23 -0000 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). -- Ian