From: Ian Campbell Subject: Re: [PATCH] PL011: fix reverse logic for interrupt mask register Date: Wed, 21 Aug 2013 15:27:21 +0100 Message-ID: <1377095241.31937.74.camel@hastur.hellion.org.uk> References: <1376406755-23703-1-git-send-email-andre.przywara@linaro.org> <1377079470.31937.43.camel@hastur.hellion.org.uk> <5214C76D.1000409@linaro.org> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <5214C76D.1000409@linaro.org> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Andre Przywara Cc: julien.grall@linaro.org, xen-devel@lists.xen.org, patches@linaro.org, stefano.stabellini@eu.citrix.com List-Id: xen-devel@lists.xenproject.org On Wed, 2013-08-21 at 15:58 +0200, Andre Przywara wrote: > On 08/21/2013 12:04 PM, Ian Campbell wrote: > > On Tue, 2013-08-13 at 17:12 +0200, Andre Przywara wrote: > >> The PL011 IMSC register description is somehow fuzzy in the > >> documentation; > > > > OMG pl011 docs r1p5 issue g says: > > On a read this register returns the current value of the mask on > > the relevant interrupt. On a write of 1 to the particular bit, > > it sets the corresponding mask of that interrupt. A write of 0 > > clears the corresponding mask. > > > > Which is perfectly obvious if you read it understanding "mask an > > interrupt" in the normal way, but in the introduction to the section on > > interrupts it says: > > > > You can enable or disable the individual interrupts by changing > > the mask bits in the Interrupt Mask Set/Clear Register, UARTIMSC > > on page 3-17. Setting the appropriate mask bit HIGH enables the > > interrupt. > > > > So IMSC is actually the "mask" of the interrupts which are enabled. > > > > What crappy docs! > > I agree, I stumbled on this by reading IMSC and wondered how it could be > just 0 in the first place, I wondered that too, but dismissed it as "mad hardware" without thinking carefully enough! Ian.