public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Mason <slash.tmp@free.fr>
To: Mans Rullgard <mans@mansr.com>
Cc: linux-kernel@vger.kernel.org,
	Thomas Gleixner <tglx@linutronix.de>,
	Jason Cooper <jason@lakedaemon.net>,
	Marc Zyngier <marc.zyngier@arm.com>
Subject: Re: [PATCH 2/2] irqchip: add support for Sigma Designs SMP86xx interrupt controller
Date: Thu, 26 Nov 2015 11:25:55 +0100	[thread overview]
Message-ID: <5656DE33.4040400@free.fr> (raw)
In-Reply-To: <yw1x7fl6qnut.fsf@unicorn.mansr.com>

On 25/11/2015 13:12, Måns Rullgård wrote:

> Mason writes:
> 
>>> +	status_lo = intc_readl(chip, chip->ctl + IRQ_STATUS);
>>> +	status_hi = intc_readl(chip, chip->ctl + IRQ_CTL_HI + IRQ_STATUS);
>>
>> In my local branch, I wrote:
>>
>> #define IRQ_CTL_LO	0
>>
>> 	status_lo = intc_readl(chip, chip->ctl + IRQ_CTL_LO + IRQ_STATUS);
>> 	status_hi = intc_readl(chip, chip->ctl + IRQ_CTL_HI + IRQ_STATUS);
>>
>> (I'm a sucker for symmetry)
> 
> Nothing wrong with a little symmetry, though in this case I think the
> extra macro only confuses matters.

It's your call :-)

In my mind, the fact that the status_lo register sits at offset 0 is
just an accident. It's just that something has to sit at offset 0.
(Maybe I should tell the HW guys to put nothing at offset 0, and start
the actual register block at offset 4. /That/ would be unexpected.)

Another way to look at it is:

There are two 4-register blocks (LO and HI) each containing registers
{status,rawstat,enableset,enableclr}.

Block LO starts at offset 0x0
Block HI starts at offset 0x18

and then there are the intra offsets for the 4 registers in the block.

There! I got the bike-shedding out of my system ;-)

Regards.


  reply	other threads:[~2015-11-26 10:26 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-11-19 18:33 [PATCH 0/2] Support for Sigma Designs SMP86xx interrupt controller Mans Rullgard
2015-11-19 18:33 ` [PATCH 1/2] devicetree: add binding " Mans Rullgard
2015-11-20 16:23   ` Rob Herring
2015-11-20 16:27     ` Måns Rullgård
2015-11-19 18:33 ` [PATCH 2/2] irqchip: add support " Mans Rullgard
2015-11-20 10:13   ` Marc Zyngier
2015-11-20 12:00     ` Måns Rullgård
2015-11-20 12:03   ` Mason
2015-11-20 12:15     ` Måns Rullgård
2015-11-25 10:31   ` Mason
2015-11-25 12:10     ` Mason
2015-11-25 12:12       ` Måns Rullgård
2015-11-26 10:25         ` Mason [this message]
2015-11-26 10:50           ` Måns Rullgård
2015-11-25 12:11     ` Måns Rullgård

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=5656DE33.4040400@free.fr \
    --to=slash.tmp@free.fr \
    --cc=jason@lakedaemon.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mans@mansr.com \
    --cc=marc.zyngier@arm.com \
    --cc=tglx@linutronix.de \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox