From owner-freebsd-arm@freebsd.org Wed Jul 15 16:55:38 2015 Return-Path: Delivered-To: freebsd-arm@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5FB529A227F for ; Wed, 15 Jul 2015 16:55:38 +0000 (UTC) (envelope-from ian@freebsd.org) Received: from outbound3.ore.mailhop.org (erouter6.ore.mailhop.org [54.187.213.119]) by mx1.freebsd.org (Postfix) with SMTP id 2357F104F for ; Wed, 15 Jul 2015 16:55:37 +0000 (UTC) (envelope-from ian@freebsd.org) Received: from ilsoft.org (unknown [73.34.117.227]) by outbound3.ore.mailhop.org (Halon Mail Gateway) with ESMTPSA; Wed, 15 Jul 2015 16:54:05 +0000 (UTC) Received: from rev (rev [172.22.42.240]) by ilsoft.org (8.14.9/8.14.9) with ESMTP id t6FGtY5f052206; Wed, 15 Jul 2015 10:55:34 -0600 (MDT) (envelope-from ian@freebsd.org) Message-ID: <1436979334.1334.345.camel@freebsd.org> Subject: Re: Performance issues with raspberry pi 2 From: Ian Lepore To: Hans Petter Selasky Cc: Daisuke Aoyama , Andreas Andersson , freebsd-arm@freebsd.org Date: Wed, 15 Jul 2015 10:55:34 -0600 In-Reply-To: <55A6830B.2050505@selasky.org> References: <3AB5ECCF20894591B4DF5FCBA8CA49BB@ad.peach.ne.jp> <2D17B16DBC5F452D8DAC721E17BBF1B7@ad.peach.ne.jp> <55A6830B.2050505@selasky.org> 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-BeenThere: freebsd-arm@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "Porting FreeBSD to ARM processors." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 15 Jul 2015 16:55:38 -0000 On Wed, 2015-07-15 at 17:58 +0200, Hans Petter Selasky wrote: > On 05/18/15 00:02, Daisuke Aoyama wrote: > > > > Previous subset does not work correctly in ratecheck. > > I don't know a reason but same code from ODROID-C1 version works. > > I re-create the patch as dwc_otg-rpi2-20150518.patch. > > > > http://www.peach.ne.jp/archives/rpi/patch/dwc_otg-rpi2-20150518.patch > > Hi, > > I've finally had time to look at your patch, and it has some clever new > ideas to optimise the DWC OTG performance. I like it and will do some > work to integrate your patches like promised this week. It might be too > late for the coming 10.x release, but will for sure hit 10-stable when > the next 10.x is out. Thank you! > > One question though: Are the WMB's and RMB's strictly needed? Isn't the > I/O memory mapped coherently? > > Did you consider enabling the TXFIFOEMPTY IRQs instead of spinning? I've been saying for years that you cannot assume that COHERENT means "no sync operations needed", and that's more true than ever with armv6. It is especially true of DEVICE mappings for arm memory-mapped IO: the region is uncached and inelligible for write-combining, but write access is still buffered (and dmb()/dsb() is insufficient to ensure that the write buffers are flushed on all hardware; bus_space_barrier() does the right thing). Using inline barriers like that in bus_space IO code isn't right though; that's what bus_space_barrier() is for. Doing the barriers on every bus_space access is probably overkill; typically when you need barriers it's in a few specific places after a group of reads or writes, and especially at places like the exit border in interrupt handling, or the interlock points if interrupt handlers and non-interrupt code share access to hardware registers. -- Ian