From owner-freebsd-drivers@freebsd.org Sun Sep 6 13:54:03 2015 Return-Path: Delivered-To: freebsd-drivers@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 9134B9CC70E for ; Sun, 6 Sep 2015 13:54:03 +0000 (UTC) (envelope-from leonardofogel@yahoo.com.br) Received: from nm18-vm4.bullet.mail.ne1.yahoo.com (nm18-vm4.bullet.mail.ne1.yahoo.com [98.138.91.178]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 542D0D20 for ; Sun, 6 Sep 2015 13:54:02 +0000 (UTC) (envelope-from leonardofogel@yahoo.com.br) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com.br; s=s2048; t=1441547636; bh=hVaKTLHPssS6m+8TfOc3+fdRWi82HxiM9qQaCQ+r+q8=; h=Date:From:Subject:To:In-Reply-To:From:Subject; b=FaF5AG0Hl275oSnto7sBqhCe50kC2xGSy7uHx+p0ABCTiF8xA6/PL9ezk52WRQxx+4MARkGSZPruyz8lgkif/+x+xaAXKxagjHcfuSToXuTFQ4DUkUBEKfgFDxX6jnSNRTRUI8qGXEY/UecbCQf5mBkc/CpKbl6p5WAQQ+35SGAFpG/xeG/HWwHguCf8Nmp9JpqQqhp1Dr0U29D93YlxHX6tCdbeVYv3zm2pldDivazVpandKZ79eslKtdBiVzRZ6R1j1N9AcjrMy9KxqrOhu9DVcFMB2EjEL/I4WRIs7Z4+AeGZvdLgImOOcNAJVrQ3HvaLXJ/DcYyMwrp+5Yc9ww== Received: from [98.138.100.102] by nm18.bullet.mail.ne1.yahoo.com with NNFMP; 06 Sep 2015 13:53:56 -0000 Received: from [98.138.89.245] by tm101.bullet.mail.ne1.yahoo.com with NNFMP; 06 Sep 2015 13:53:56 -0000 Received: from [127.0.0.1] by omp1059.mail.ne1.yahoo.com with NNFMP; 06 Sep 2015 13:53:56 -0000 X-Yahoo-Newman-Property: ymail-3 X-Yahoo-Newman-Id: 765148.14349.bm@omp1059.mail.ne1.yahoo.com Received: (qmail 87774 invoked by uid 60001); 6 Sep 2015 13:53:56 -0000 X-YMail-OSG: zOfNEQkVM1m9qG5rBQ9VKjfWC.6NWOH8gWa7YmQ_AlLeGSr KB7FSyUPyZmnMXSNw2NQm8U7LLZCV3TCj22Wb_jj_JpAl9WbaKLYmy_IFfpl 1OdqyxZl2xVK8iwnMa1N4ICfBExPYrXYSwuNtT1c0.dnTKMmZot6ZnL5sNv2 rdJ.wP3pM2mcEHVxWJl42y26MPeesBM8o3vfAFCigYowjbvoshLvPgP1u_P0 hV13xEJdBHwCE9Nd4BymNPU.SRl9h_6CZJPngb.f4nqIAKtoo_.5mbMd5zDR o75lgOdhKfmFIWE1fXpVUoGndKUQnT60nwVI2TptKLYY3Mbcawss3jGkcQW1 ntueVPTmAIn_escw4xi1RFchdMTGT5C_QN8yWD3ubHdwlu8YzJ.fEt.ch386 yCyFli2nwZnvIPNvDiraMSuTEdvhqli8g66h9B1idXWAHgDCcM5Dkqeh.WdD S7ZVenWIKJB.7RwFvMwFB5nJ1yLYg.jZyaHGupkyTHcixqe8D_1mlipwrBEI P_FBk5e5P8NwxKIbj6q5zRLMg7AO_jsehgFaUVJCVEvsLG88QTSsfNF1tC53 Og0MzOSKvVN5wsT0- Received: from [189.60.224.8] by web120801.mail.ne1.yahoo.com via HTTP; Sun, 06 Sep 2015 06:53:56 PDT X-Rocket-MIMEInfo: 002.001, SGkuDQpQbGVhc2UsIHdoYXQgYXJlIHRoZSBjb3JyZWN0IGJhcnJpZXJzIGZvciB0aGUgZm9sbG93aW5nIGNhc2VzPw0KDQpDYXNlIDE6DQogICBidXNfd3JpdGVfMShyZWdpb25fMCwgLi4uKTsNCiAgIC8qIGJhcnJpZXIgaGVyZSAqLw0KICAgREVMQVkoc29tZV90aW1lKTsNCg0KQ2FzZSAyOg0KICAgYnVzX3dyaXRlXzEocmVnaW9uXzAsIC4uLik7DQogICAvKiBiYXJyaWVyIGhlcmUgKi8NCiAgIGJ1c193cml0ZV8xKHJlZ2lvbl8yLCAuLi4pOw0KDQpJbiB0aGUgZmlyc3Qgb25lLCBJIHdhbnQgdGhlIHdyaXQBMAEBAQE- X-Mailer: YahooMailBasic/651 YahooMailWebService/0.8.203.813 Message-ID: <1441547636.78646.YahooMailBasic@web120801.mail.ne1.yahoo.com> Date: Sun, 6 Sep 2015 06:53:56 -0700 From: Leonardo Fogel Subject: Memory barrier To: freebsd-drivers@freebsd.org In-Reply-To: <2149458.2Hg3JbBXY3@ralph.baldwin.cx> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-BeenThere: freebsd-drivers@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: Writing device drivers for FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 06 Sep 2015 13:54:03 -0000 Hi. Please, what are the correct barriers for the following cases? Case 1: bus_write_1(region_0, ...); /* barrier here */ DELAY(some_time); Case 2: bus_write_1(region_0, ...); /* barrier here */ bus_write_1(region_2, ...); In the first one, I want the write to reach the device before the thread bu= sy-waits. As I understand it, bus_space_barrier(9) is not adequate, because= it does not prevent the processor from executing instructions (or load/sto= re to RAM) before the write completes. In the second one, I want the write to a device (e.g. power management) to = complete before the write to another starts/completes. Again, bus_space_bar= rier() seems not to be adequate because it can not cover two regions. Thank you for your time. Leonardo