From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S964865AbcHaO23 (ORCPT ); Wed, 31 Aug 2016 10:28:29 -0400 Received: from bombadil.infradead.org ([198.137.202.9]:44303 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934861AbcHaO21 (ORCPT ); Wed, 31 Aug 2016 10:28:27 -0400 Date: Wed, 31 Aug 2016 16:28:21 +0200 From: Peter Zijlstra To: Matt Redfearn Cc: Ralf Baechle , linux-mips@linux-mips.org, Adam Buchbinder , Arnd Bergmann , Masahiro Yamada , linux-kernel@vger.kernel.org, "Michael S. Tsirkin" , Markos Chandras , Paul Burton Subject: Re: [PATCH 06/10] MIPS: pm-cps: Use MIPS standard lightweight ordering barrier Message-ID: <20160831142821.GF10138@twins.programming.kicks-ass.net> References: <1472640279-26593-1-git-send-email-matt.redfearn@imgtec.com> <1472640279-26593-7-git-send-email-matt.redfearn@imgtec.com> <20160831114847.GB10153@twins.programming.kicks-ass.net> <4c91d6c3-8141-594a-562c-96ea56776d2e@imgtec.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4c91d6c3-8141-594a-562c-96ea56776d2e@imgtec.com> User-Agent: Mutt/1.5.23.1 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Aug 31, 2016 at 02:36:26PM +0100, Matt Redfearn wrote: > > The code previously had 0x10 as a magic number, this patch just replaces > that with a #defined name. The value is documented in the MIPS64 instruction > set manual, https://imgtec.com/?do-download=4302, table 6.5. > > This sync type has been standard since MIPSr2. That document also states > that "If an implementation does not use one of these non-zero values to > define a different synchronization behavior, then that non-zero value of > stype must act the same as stype zero completion barrier." As such, > stype_ordering can always be set to this sync type rather than setting it > only for certain CPUs. Right. We all had a bunch of fun trying to decode that manual a while back, and IIRC were left with a bunch of questions on what it all meant in 3+ CPU scenarios. In anycase, not sure why I was Cc'ed to this patch, but in general I have low confidence in barrier patches that lack lots of detail. And the code in question has woefully inadequate comments: /* Ordering barrier */ uasm_i_sync(&p, stype_ordering); Order what against what and why? Is my first question. A comment really should explain. In any case, you've removed the only (runtime) assignment to the variable, it can become 'const'.