From: Rich Felker <dalias-8zAoT0mYgF4@public.gmane.org>
To: Mark Rutland <mark.rutland-5wv7dgnIgG8@public.gmane.org>
Cc: linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
linux-sh-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
Jason Cooper <jason-NLaQJdtUoK4Be96aLqz0jA@public.gmane.org>,
Marc Zyngier <marc.zyngier-5wv7dgnIgG8@public.gmane.org>,
Rob Herring <robh+dt-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>,
Thomas Gleixner <tglx-hfZtesqFncYOwBW4kG4KsQ@public.gmane.org>
Subject: Re: [PATCH v4 2/2] irqchip: add J-Core AIC driver
Date: Wed, 27 Jul 2016 09:06:06 -0400 [thread overview]
Message-ID: <20160727130606.GA15995@brightrain.aerifal.cx> (raw)
In-Reply-To: <20160727101235.GC12880@leverpostej>
On Wed, Jul 27, 2016 at 11:12:36AM +0100, Mark Rutland wrote:
> On Wed, Jul 27, 2016 at 05:35:09AM +0000, Rich Felker wrote:
> > +int __init aic_irq_of_init(struct device_node *node, struct device_node *parent)
> > +{
> > + struct aic_data *aic = &aic_data;
> > + unsigned min_irq = 64;
> > +
> > + pr_info("Initializing J-Core AIC\n");
> > +
> > + if (!of_device_is_compatible(node, "jcore,aic2")) {
> > + unsigned cpu;
> > + for_each_possible_cpu(cpu) {
> > + void __iomem *base = of_iomap(node, cpu);
> > + if (!base)
> > + continue;
>
> This sounds like it would be a critical error.
>
> It would be best to at least pr_warn() if you can't map a CPU's AI
> interface.
It's looping over possible cpus (per the kernel configuration for max
cpus) so it's expected that a system with fewer cpus will also have
fewer reg ranges for the aic. This is not an error. If you think
there's a different/better way I should write this code, I'm open to
suggestions.
> > + pr_info("Local AIC1 enable for cpu %u at %p\n",
> > + cpu, base + AIC1_INTPRI);
> > + __raw_writel(0xffffffff, base + AIC1_INTPRI);
> > + }
>
> Here base goes out of scope. If you don't need it, it would be best
> practice to iounmap it (even if that happens to be a no-op on your
> arch).
OK. I can add that.
> > + min_irq = 16;
> > + }
> > +
> > + aic->chip.name = node->name;
>
> It's probably best to give the name explicitly in the driver (e.g.
> "AIC"), rather than taknig whatever happens to be in the DT (which
> should be 'interrupt-controller@<addr>'.
OK.
> > + aic->chip.irq_mask = noop;
> > + aic->chip.irq_unmask = noop;
>
> If the core code wants to mask IRQs, how do you handle that? Can you
> mask your CPU traps?
There's a global imask in the cpu that masks all interrupts that's
used in the trap entry point, spinlocks, etc. already. This is a cpu
standard feature and not logically part of the AIC. My understanding
is that the kernel already keeps a logical mask of disabled irqs in
addition to mask/disable at the irqchip level so there's a fairly fast
path for ignoring/holding (potentially spurious) irqs while they're
supposed to be disabled and deferring them until they're enabled
again.
Rich
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
next prev parent reply other threads:[~2016-07-27 13:06 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-07-27 5:35 [PATCH v4 0/2] J-Core interrupt controller support Rich Felker
2016-07-27 5:35 ` [PATCH v4 2/2] irqchip: add J-Core AIC driver Rich Felker
2016-07-27 10:12 ` Mark Rutland
2016-07-27 13:06 ` Rich Felker [this message]
2016-07-27 13:22 ` Mark Rutland
2016-07-27 17:07 ` Rich Felker
2016-07-27 17:31 ` Mark Rutland
2016-07-27 23:01 ` Rich Felker
[not found] ` <20160727230124.GE15995-C3MtFaGISjmo6RMmaWD+6Sb1p8zYI1N1@public.gmane.org>
2016-07-28 14:02 ` Mark Rutland
2016-07-27 10:15 ` Mark Rutland
2016-07-27 13:08 ` Rich Felker
2016-07-27 13:27 ` Mark Rutland
2016-07-27 17:08 ` Rich Felker
2016-07-27 5:35 ` [PATCH v4 1/2] of: add J-Core interrupt controller bindings Rich Felker
2016-07-27 10:05 ` Mark Rutland
2016-07-27 13:00 ` Rich Felker
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=20160727130606.GA15995@brightrain.aerifal.cx \
--to=dalias-8zaot0mygf4@public.gmane.org \
--cc=devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=jason-NLaQJdtUoK4Be96aLqz0jA@public.gmane.org \
--cc=linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=linux-sh-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=marc.zyngier-5wv7dgnIgG8@public.gmane.org \
--cc=mark.rutland-5wv7dgnIgG8@public.gmane.org \
--cc=robh+dt-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org \
--cc=tglx-hfZtesqFncYOwBW4kG4KsQ@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).