From owner-freebsd-mips@FreeBSD.ORG Thu Jan 8 01:03:04 2015 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.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 8F9D9A5F for ; Thu, 8 Jan 2015 01:03:04 +0000 (UTC) Received: from mail-we0-x231.google.com (mail-we0-x231.google.com [IPv6:2a00:1450:400c:c03::231]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2626CBC9 for ; Thu, 8 Jan 2015 01:03:04 +0000 (UTC) Received: by mail-we0-f177.google.com with SMTP id q59so2196775wes.8 for ; Wed, 07 Jan 2015 17:03:02 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:date:message-id:subject:from:to:content-type; bh=IBZeRYMKyI412MVwHAVyTB1xpIaD+xKvMmw2fkGdw8o=; b=RSBTWu8ieLfATcd6CtJKfmKzMHC3+JjF27NjvIWMk5Ic5P/h5ah5xIX530wabY4z1b rrxA2smo9hWYUzu73ImAN6mtYcDoKmr31uql9RwWNPnqNuxvfD4c8DFYOL5Z63tVOo7k DB4U9rE2uXT7Dq4qg/sEAOrkjkKxUiqNruBak9bNF60PYBGy9JUh1TnUDakaLC3+IBXV RVrcMrXjUmS6gsZ+9upZ+5ahuwDQ2EoSE6EvFHMT9DT9VyhvLU3nKtogTD+I4vauvqVv iY4Ol8j3LhHSNNjASQV3W/stxz0T6aP3Yw1p86DU3DaEM/tT1lIJuzoIohQvPLZT5xPu TSng== MIME-Version: 1.0 X-Received: by 10.180.91.193 with SMTP id cg1mr2508643wib.26.1420678982642; Wed, 07 Jan 2015 17:03:02 -0800 (PST) Sender: adrian.chadd@gmail.com Received: by 10.216.41.136 with HTTP; Wed, 7 Jan 2015 17:03:01 -0800 (PST) Date: Wed, 7 Jan 2015 17:03:01 -0800 X-Google-Sender-Auth: i4NgaFm8QHqYpJkX_VuC-k0iIQs Message-ID: Subject: RFC: figuring out bus behaviour on these mips32r2 chips From: Adrian Chadd To: "freebsd-mips@freebsd.org" Content-Type: text/plain; charset=UTF-8 X-BeenThere: freebsd-mips@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: Porting FreeBSD to MIPS List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 08 Jan 2015 01:03:04 -0000 Hi, I found that the new QCA955x chip (and some of the QCA934x things in shipping products versus what I have on my desk at home) behave poorly unless I do ye olde "write to register; read from register to flush" paradigm. In this specific instance, it's the MDIO controller on each MAC - if I do a read-after-write to those registers, everything is peachy. Without it - and even with a call to wmb() - it still barfs. Now, I went digging through the mips code, and wmb() -> mips_sync() -> just a sync operation. It doesn't do any other kind of barrier. So - what's the mips32r2 spec require us to do for ensuring device IO has made it out to devices and we enforce ordering? Are we missing something in our mips_sync() implementation? -adrian