From: Andre Przywara <andre.przywara@linaro.org>
To: Ian Campbell <ian.campbell@citrix.com>
Cc: julien.grall@linaro.org, xen-devel@lists.xen.org,
patches@linaro.org, stefano.stabellini@eu.citrix.com
Subject: Re: [PATCH] PL011: fix reverse logic for interrupt mask register
Date: Wed, 21 Aug 2013 15:58:05 +0200 [thread overview]
Message-ID: <5214C76D.1000409@linaro.org> (raw)
In-Reply-To: <1377079470.31937.43.camel@hastur.hellion.org.uk>
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, then looking at the Linux code...
And honestly I didn't even find the first paragraph, but was wondering
why they repeat that "1 sets the mask, 0 clears it" all over the place
instead of explicitly stating the meaning for the interrupt ;-)
Regards,
Andre.
>> by comparing it with the Linux implementation one can
>> see that the logic is actually reversed to Xen's implementation:
>> A "0" in field means interrupt disabled, a "1" enables it.
>>
>> Therefore we enabled all interrupts instead of disabling them in the
>> beginning and later on masked the wrong interrupts.
>> Unclear how this worked on the Versatile Express, but this fix is
>> needed to get Calxeda Midway running (and works on VExpress, too).
>
> How on earth we got away with this I've idea!
>
>> Signed-off-by: Andre Przywara <andre.przywara@linaro.org>
>
> Ack + applied, thanks!
>
>
next prev parent reply other threads:[~2013-08-21 13:58 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-08-13 15:12 [PATCH] PL011: fix reverse logic for interrupt mask register Andre Przywara
2013-08-20 16:51 ` Andre Przywara
2013-08-21 10:04 ` Ian Campbell
2013-08-21 13:58 ` Andre Przywara [this message]
2013-08-21 14:27 ` Ian Campbell
2013-08-21 14:34 ` Ian Campbell
2013-08-21 16:11 ` Julien Grall
2013-08-22 7:23 ` Ian Campbell
2013-08-26 15:55 ` Julien Grall
2013-08-27 10:37 ` Ian Campbell
2013-08-27 10:45 ` Ian Campbell
2013-08-27 10:58 ` Julien Grall
2013-08-27 11:00 ` Ian Campbell
-- strict thread matches above, loose matches on Subject: below --
2013-08-20 17:27 Ian Campbell
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=5214C76D.1000409@linaro.org \
--to=andre.przywara@linaro.org \
--cc=ian.campbell@citrix.com \
--cc=julien.grall@linaro.org \
--cc=patches@linaro.org \
--cc=stefano.stabellini@eu.citrix.com \
--cc=xen-devel@lists.xen.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.