From owner-freebsd-arch@FreeBSD.ORG Sun Oct 16 01:48:27 2011 Return-Path: Delivered-To: freebsd-arch@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E4325106566B for ; Sun, 16 Oct 2011 01:48:27 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: from mail-yx0-f177.google.com (mail-yx0-f177.google.com [209.85.213.177]) by mx1.freebsd.org (Postfix) with ESMTP id A9D868FC0C for ; Sun, 16 Oct 2011 01:48:27 +0000 (UTC) Received: by mail-yx0-f177.google.com with SMTP id 36so2552719yxk.8 for ; Sat, 15 Oct 2011 18:48:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:sender:date:x-google-sender-auth:message-id:subject :from:to:content-type; bh=mNuiRtPHawLPNvk73unSZIi990alq8tObq9CXM0Gfeg=; b=YBiwNBoi3hDBBKAoBtathTXpqGK4XvyjoXJ/sWhRyyFtYAGrurq8cYq4OJS4O/NVwl B8RVZ3Ft79X38Nx9XD4BwNfczuC1clpIQJ5Rr3TkekmF87RO6LwVWXz0fJnJvZHIbXgV faSn09qR2Pvi0C1sztdrz4mG3OFs0fp0PnuwU= MIME-Version: 1.0 Received: by 10.236.175.195 with SMTP id z43mr19630812yhl.66.1318729707321; Sat, 15 Oct 2011 18:48:27 -0700 (PDT) Sender: adrian.chadd@gmail.com Received: by 10.236.95.147 with HTTP; Sat, 15 Oct 2011 18:48:27 -0700 (PDT) Date: Sun, 16 Oct 2011 09:48:27 +0800 X-Google-Sender-Auth: 11XRBFbn1E0UC797-CQNBVkv_ag Message-ID: From: Adrian Chadd To: freebsd-arch@freebsd.org Content-Type: text/plain; charset=ISO-8859-1 Subject: newbus bus access routines and bus_space_barrier() X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 16 Oct 2011 01:48:28 -0000 Hi all, I'm not clued up on the way of the bus API, so please excuse the newbie questions. Nathan and I found that ath(4) wasn't working for a user because of a missing bus barrier. Ath trips it up because it does lots of loops of register reads/writes through the bus stream API rather than the normal bus API. It does this because it handles the register value swapping in hardware rather than in software. The correct fix is to teach ath(4) to use bus_space_barrier() calls when doing stream calls, which I can do, but the newbus documentation points out that both normal and stream bus access doesn't enforce ordering, and barrier calls are needed. But I don't see lots of bus_space_barrier() calls everywhere. Why's that? Thanks, Adrian