From mboxrd@z Thu Jan 1 00:00:00 1970 Received: with ECARTIS (v1.0.0; list linux-mips); Wed, 21 Jan 2015 01:58:50 +0100 (CET) Received: from localhost.localdomain ([127.0.0.1]:51535 "EHLO localhost.localdomain" rhost-flags-OK-OK-OK-OK) by eddie.linux-mips.org with ESMTP id S27011961AbbAUA6sJ5l1w (ORCPT ); Wed, 21 Jan 2015 01:58:48 +0100 Date: Wed, 21 Jan 2015 00:58:48 +0000 (GMT) From: "Maciej W. Rozycki" To: Ralf Baechle cc: David Daney , Markos Chandras , linux-mips@linux-mips.org, Matthew Fortune Subject: Re: [PATCH RFC v2 24/70] MIPS: asm: spinlock: Replace sub instruction with addiu In-Reply-To: <20150120222028.GI1205@linux-mips.org> Message-ID: References: <1421405389-15512-1-git-send-email-markos.chandras@imgtec.com> <1421405389-15512-25-git-send-email-markos.chandras@imgtec.com> <54BE3BFD.5070108@imgtec.com> <54BE8DC7.4030009@gmail.com> <20150120222028.GI1205@linux-mips.org> User-Agent: Alpine 2.11 (LFD 23 2013-08-11) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Return-Path: X-Envelope-To: <"|/home/ecartis/ecartis -s linux-mips"> (uid 0) X-Orcpt: rfc822;linux-mips@linux-mips.org Original-Recipient: rfc822;linux-mips@linux-mips.org X-archive-position: 45384 X-ecartis-version: Ecartis v1.0.0 Sender: linux-mips-bounce@linux-mips.org Errors-to: linux-mips-bounce@linux-mips.org X-original-sender: macro@linux-mips.org Precedence: bulk List-help: List-unsubscribe: List-software: Ecartis version 1.0.0 List-Id: linux-mips X-List-ID: linux-mips List-subscribe: List-owner: List-post: List-archive: X-list: linux-mips Ralf, > > According to a comment on another thread from Ralf, this has been observed > > in the wild only once. We can simplify the code and remove that comment. > > Why not just use the ADDIU and be done with it? > > > > There are many locking and atomic primitives that don't have any such error > > checking. What makes the read lock so special that it needs this extra > > protection? > > Because I was desparate to find a use for the signed add ;-) > > Honestly, it's nice to have such a safeguard if it's available at no > runtime overhead at all but these days are such nice lock debugging tools > that the loss won't be missed. So (cut'n'paste): > > Why not just use the ADDIU and be done with it? Given David's comment I meant to defer to you on this as the originator of this bit, but since you have spoken, I think we've come to a conclusion now. :) Maciej