Received: with ECARTIS (v1.0.0; list linux-mips); Tue, 12 Jan 2016 01:42:20 +0100 (CET) Received: from localhost.localdomain ([127.0.0.1]:49844 "EHLO localhost" rhost-flags-OK-OK-OK-OK) by eddie.linux-mips.org with ESMTP id S27009041AbcALAmOGiH3j (ORCPT ); Tue, 12 Jan 2016 01:42:14 +0100 Date: Tue, 12 Jan 2016 00:42:14 +0000 (GMT) From: "Maciej W. Rozycki" To: Ralf Baechle cc: Petri Gynther , linux-mips@linux-mips.org, f.fainelli@gmail.com, cernekee@gmail.com Subject: Re: [PATCH] MIPS: switch BMIPS5000 to use r4k_wait_irqoff() In-Reply-To: <20151109092412.GA2775@linux-mips.org> Message-ID: References: <1445280264-42016-1-git-send-email-pgynther@google.com> <20151109092412.GA2775@linux-mips.org> User-Agent: Alpine 2.20 (LFD 67 2015-01-07) 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: 51065 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 On Mon, 9 Nov 2015, Ralf Baechle wrote: > > Programming notes: > > The WAIT instruction should be executed while interrupts are disabled > > by the IE bit in the Status register. This avoids a potential timing > > hazard, which occurs if an interrupt is taken between testing the counter > > and executing the WAIT instruction. In this hazard case, the interrupt > > will have been completed before the WAIT instruction is executed, so > > the processor will remain indefinitely in wait state until the next > > interrupt. > > Note that this is the opposite restriction than many older MIPS CPUs > where it is undefined if an interrupt will restart execution of > instructions if interrupts are disabled. So this might be a violation > of the architecture specification. However I rather have it the BMIPS > way than the other way ... It's been implementation-dependent since MIPSr1 whether a non-enabled interrupt breaks out of WAIT, so no architecture specification violation here. Maciej