From owner-freebsd-mips@FreeBSD.ORG Wed Oct 9 22:53:51 2013 Return-Path: Delivered-To: freebsd-mips@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 7FB568B7 for ; Wed, 9 Oct 2013 22:53:51 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: from mail-qa0-x229.google.com (mail-qa0-x229.google.com [IPv6:2607:f8b0:400d:c00::229]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 3F2552C95 for ; Wed, 9 Oct 2013 22:53:51 +0000 (UTC) Received: by mail-qa0-f41.google.com with SMTP id ii20so5474339qab.14 for ; Wed, 09 Oct 2013 15:53:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; bh=C7t7FDVDw195KsPPjFnwmpyyMqcxTLWHyPqnERN8j3k=; b=k3k4GtY6zLUmLUbhUEWQ03Otkg5EpZzoJU2DlMH4hBJWAjYod0Klbx+54o05O56U0R 0+3cysBBxFdLew/7PXm2vA97RIp5O7YwPJVxxFiCTst5i+zUd2eAxYMZoCamfLMgtvz3 yY6RwuYJ/VfoO19OY8S26f7YfvpnbfeuwTJwiE18dsPjewSZc3oME7FZZz1KXfiq2Z71 zNdht7ClR08N0jghRtpDWIorqoE5+SicMSg08b5e6Z+zYPogTuwtNmZWKtlF2HoH/y4J c33xbWyECDvLzFPhIJO0gyJXGg9gxuJNAklSNbOLKsCqYPQ+qOtIFmM6leZUCSq5Xtgt N6Bw== MIME-Version: 1.0 X-Received: by 10.49.103.161 with SMTP id fx1mr356244qeb.68.1381359230468; Wed, 09 Oct 2013 15:53:50 -0700 (PDT) Sender: adrian.chadd@gmail.com Received: by 10.224.207.66 with HTTP; Wed, 9 Oct 2013 15:53:50 -0700 (PDT) In-Reply-To: <0ABAE1CE-C4C3-4A3E-843E-E9B450559012@bsdimp.com> References: <0ABAE1CE-C4C3-4A3E-843E-E9B450559012@bsdimp.com> Date: Wed, 9 Oct 2013 15:53:50 -0700 X-Google-Sender-Auth: eK436JOu4L9C_L8E3jYR5i5Mkww Message-ID: Subject: Re: [rfc] implement busdma barrier operation From: Adrian Chadd To: Warner Losh Content-Type: text/plain; charset=ISO-8859-1 X-Content-Filtered-By: Mailman/MimeDel 2.1.14 Cc: "freebsd-mips@freebsd.org" X-BeenThere: freebsd-mips@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Porting FreeBSD to MIPS List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 Oct 2013 22:53:51 -0000 Committed! -adrian On 9 October 2013 13:46, Warner Losh wrote: > On Oct 8, 2013, at 6:33 PM, Adrian Chadd wrote: > > > > I'd like to implement the busdma barrier operation. > > You'd like to improve the bus space read and write barrier implementation > on MIPS. > > > This is required for > > (at least) correct behaviour of devices on the ar9344 (mips74k) core, as > > now I actually need to care about the order of device operations. > > Yup. We should have had something like this all along. > > You can get rid, I think, of the cache invalidation and write back too, > since that's such a huge hit we'll never do that in a generic > implementation. > > The rest of the change looks good to me. > > Warner > > > This (and some local uncommitted changes) are required for the ar9344 > > ethernet and switchport devices to correctly function. > > > > I've tested this on the other mips24k hardware I have and it works. But > > nothing else (including ath, grr) explicitly uses read/write barriers. > I'll > > eventually add them. > > > > I'd like to bounce this to re@ ASAP to get the approval to commit. > > > > Thanks, > > > > > > -adrian > > > > > > Index: sys/mips/mips/bus_space_generic.c > > =================================================================== > > --- sys/mips/mips/bus_space_generic.c (revision 256173) > > +++ sys/mips/mips/bus_space_generic.c (working copy) > > @@ -749,4 +749,8 @@ > > if (flags & BUS_SPACE_BARRIER_WRITE) > > mips_dcache_wbinv_all(); > > #endif > > + if (flags & BUS_SPACE_BARRIER_READ) > > + rmb(); > > + if (flags & BUS_SPACE_BARRIER_WRITE) > > + wmb(); > > } > > _______________________________________________ > > freebsd-mips@freebsd.org mailing list > > http://lists.freebsd.org/mailman/listinfo/freebsd-mips > > To unsubscribe, send any mail to "freebsd-mips-unsubscribe@freebsd.org" > >