devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jamie Iles <jamie-wmLquQDDieKakBO8gow8eQ@public.gmane.org>
To: Russell King - ARM Linux <linux-lFZ/pmaqli7XmaaqVzeoHQ@public.gmane.org>
Cc: devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org,
	Rob Herring <rob.herring-bsGFqQB8/DxBDgjK7y7TUQ@public.gmane.org>,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org
Subject: Re: [PATCH 1/2] versatile: sic: add device tree bindings
Date: Fri, 13 Jan 2012 10:58:34 +0000	[thread overview]
Message-ID: <20120113105834.GF14007@page> (raw)
In-Reply-To: <20120113104842.GS1068-l+eeeJia6m9vn6HldHNs0ANdhmdF6hFW@public.gmane.org>

On Fri, Jan 13, 2012 at 10:48:42AM +0000, Russell King - ARM Linux wrote:
> On Fri, Jan 13, 2012 at 12:44:00AM +0000, Jamie Iles wrote:
> > +#ifdef CONFIG_OF
> > +int __init sic_of_init(struct device_node *np, struct device_node *parent)
> > +{
> > +	struct fpga_irq_data *sic_data = kzalloc(sizeof(*sic_data), GFP_KERNEL);
> > +	int err = -ENOMEM, irq;
> > +
> > +	if (WARN_ON(!sic_data))
> > +		return err;
> > +
> > +	sic_data->base = of_iomap(np, 0);
> > +	if (WARN_ON(!sic_data->base))
> > +		goto out_free_data;
> > +
> > +	irq = irq_of_parse_and_map(np, 0);
> > +	if (irq < 0)
> > +		goto out_free_data;
> > +
> > +	sic_data->irq_start = irq_alloc_descs(-1, 0, 32, numa_node_id());
> > +	if (WARN_ON(sic_data->irq_start < 0)) {
> > +		err = sic_data->irq_start;
> > +		goto out_unmap;
> > +	}
> > +	sic_data->domain.of_node = of_node_get(np);
> > +
> > +	fpga_irq_init(irq, ~0, sic_data);
> 
> I notice that you completely ignore the validity mask, and initialize all
> 32 interrupts.  This is wrong.  You don't think I put the validity mask
> there just to obfuscate the code?

OK, that is wrong.  The validity mask is used for the non-DT platforms, 
for the DT one I'll add a property stating the valid mask:

	arm,valid-irq-mask = <0x001fffff>;

to the node in the trees.

> And this shouldn't be called 'sic' at all.  It may be the secondary
> interrupt controller on the Versatile, but it's also the PIC, SIC and
> CIC on Integrator platforms.  Calling anything in this file (which is
> entirely separate of any platform) 'sic' is _wrong_.

OK, I didn't know that.  So fpga-irq is an appropriate name (is it 
always an FPGA?) and arm,versatile-fpga-irq OK for a compatible string?

Jamie

  parent reply	other threads:[~2012-01-13 10:58 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-01-13  0:43 [PATCH 0/2] Full DT IRQ support for versatile Jamie Iles
     [not found] ` <1326415441-17695-1-git-send-email-jamie-wmLquQDDieKakBO8gow8eQ@public.gmane.org>
2012-01-13  0:44   ` [PATCH 1/2] versatile: sic: add device tree bindings Jamie Iles
     [not found]     ` <1326415441-17695-2-git-send-email-jamie-wmLquQDDieKakBO8gow8eQ@public.gmane.org>
2012-01-13  2:29       ` Grant Likely
     [not found]         ` <20120113022932.GB25999-e0URQFbLeQY2iJbIjFUEsiwD8/FfD2ys@public.gmane.org>
2012-01-13 10:35           ` Jamie Iles
2012-01-13 21:00             ` Grant Likely
     [not found]               ` <20120113210041.GD22767-e0URQFbLeQY2iJbIjFUEsiwD8/FfD2ys@public.gmane.org>
2012-01-13 21:19                 ` Russell King - ARM Linux
2012-01-13 10:48     ` Russell King - ARM Linux
     [not found]       ` <20120113104842.GS1068-l+eeeJia6m9vn6HldHNs0ANdhmdF6hFW@public.gmane.org>
2012-01-13 10:58         ` Jamie Iles [this message]
2012-01-13 18:41           ` Grant Likely
     [not found]             ` <20120113184151.GC22767-e0URQFbLeQY2iJbIjFUEsiwD8/FfD2ys@public.gmane.org>
2012-01-13 19:04               ` Russell King - ARM Linux
2012-01-13  0:44   ` [PATCH 2/2] versatile: dt: register interrupt controllers from dt Jamie Iles
2012-01-13  1:20   ` [PATCH 0/2] Full DT IRQ support for versatile Grant Likely
     [not found]     ` <CACxGe6v-gkW+pDP-2hTcf7WqeMBtx+H80Xymj7SqS8nqin9qUA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2012-01-13  1:42       ` Jamie Iles
2012-01-13  2:31         ` Grant Likely

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=20120113105834.GF14007@page \
    --to=jamie-wmlquqddiekakbo8gow8eq@public.gmane.org \
    --cc=devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org \
    --cc=linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org \
    --cc=linux-lFZ/pmaqli7XmaaqVzeoHQ@public.gmane.org \
    --cc=rob.herring-bsGFqQB8/DxBDgjK7y7TUQ@public.gmane.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).