From owner-freebsd-mips@FreeBSD.ORG Wed Oct 9 20:46:28 2013 Return-Path: Delivered-To: freebsd-mips@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id DD1BAADB for ; Wed, 9 Oct 2013 20:46:27 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from mail-ie0-f170.google.com (mail-ie0-f170.google.com [209.85.223.170]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id ABA4C24A3 for ; Wed, 9 Oct 2013 20:46:27 +0000 (UTC) Received: by mail-ie0-f170.google.com with SMTP id x13so3258687ief.29 for ; Wed, 09 Oct 2013 13:46:20 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:subject:mime-version:content-type:from :in-reply-to:date:cc:content-transfer-encoding:message-id:references :to; bh=R7Y8sbn1SCMpxRaGVlkUI0IkZqwROXPM506IPRbPR9Y=; b=TKRkDpC+4i/Jp+AEQ0LsvbOWUMWyOuXvEdkndD6UJ+XmfLXw/ARQFQQkKIzBIyi2fg 2ssh9LW4IELqO9Mne3OCnord09cKrfgZcA88pDBjTbpoXPs8QZAqOnKJdGTnPqjbCv/t q7oO1pQ3OLc4xVgNWDXJYZDIadrUsBDrybQe+lH/0lraUlmiBQmaFawlyJcPqcVDWT42 zOUBJZJXwuy/zoXDWqA8iY6LM4GUGtdW7WbFR8463YtCooJWAMBbH6vGGYV2eYVSxc2U EeDCtFC+uhmVb6vUudbAgmtqRJxzswKlxm3EpSwx2INzIqkO8H5W9Bln6EVzhEUiWQ0r gEoQ== X-Gm-Message-State: ALoCoQlJ0N+Kd0Y7JH2xS99qJouwCZm/RYx+SaHORWcSn6L2jHsDkhbOGufPMCMTAx8QTMGpCFmS X-Received: by 10.50.61.205 with SMTP id s13mr3650993igr.29.1381351580803; Wed, 09 Oct 2013 13:46:20 -0700 (PDT) Received: from [10.0.0.53] (50-78-194-198-static.hfc.comcastbusiness.net. [50.78.194.198]) by mx.google.com with ESMTPSA id y10sm9450575igl.4.1969.12.31.16.00.00 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 09 Oct 2013 13:46:20 -0700 (PDT) Sender: Warner Losh Subject: Re: [rfc] implement busdma barrier operation Mime-Version: 1.0 (Apple Message framework v1085) Content-Type: text/plain; charset=us-ascii From: Warner Losh In-Reply-To: Date: Wed, 9 Oct 2013 14:46:16 -0600 Content-Transfer-Encoding: quoted-printable Message-Id: <0ABAE1CE-C4C3-4A3E-843E-E9B450559012@bsdimp.com> References: To: Adrian Chadd X-Mailer: Apple Mail (2.1085) 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 20:46:28 -0000 On Oct 8, 2013, at 6:33 PM, Adrian Chadd wrote: >=20 > 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. >=20 > 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. >=20 > I'd like to bounce this to re@ ASAP to get the approval to commit. >=20 > Thanks, >=20 >=20 > -adrian >=20 >=20 > Index: sys/mips/mips/bus_space_generic.c > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > --- 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"