mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Thomas Gleixner <tglx@linutronix.de>
To: "Uwe Kleine-König" <u.kleine-koenig@pengutronix.de>
Cc: kernel@pengutronix.de, linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org,
	Jonathan Austin <jonathan.austin@arm.com>,
	Catalin Marinas <catalin.marinas@arm.com>,
	Arnd Bergmann <arnd@arndb.de>
Subject: Re: [PATCH v4] irqchip: Add support for ARMv7-M's NVIC
Date: Tue, 25 Jun 2013 23:29:37 +0200 (CEST)	[thread overview]
Message-ID: <alpine.DEB.2.02.1306252316470.4013@ionos.tec.linutronix.de> (raw)
In-Reply-To: <1371073835-10639-1-git-send-email-u.kleine-koenig@pengutronix.de>

[-- Attachment #1: Type: TEXT/PLAIN, Size: 1531 bytes --]

On Wed, 12 Jun 2013, Uwe Kleine-König wrote:

> This interrupt controller is found on Cortex-M3 and Cortex-M4 machines.

I don't think that anyone is searching for interrupt controllers as
they are simply an essential part of the M3/4 SoCs.
 
>     
>     This depends on the stuff currently in tip/irq/for-arm
> 
>  arch/arm/kernel/entry-v7m.S |   2 +-

This is not depending on my tree. I can take the patch if

 - you drop the arm related change and do that cleanup later

or

 - the relevant maintainers provide their ACK.

> +	for (i = 0; i < numbanks; ++i) {
> +		struct irq_chip_generic *gc =
> +			irq_get_domain_generic_chip(nvic_irq_domain, 32 * i);
> +		gc->reg_base = nvic_base + 4 * i;
> +		gc->chip_types[0].regs.enable = NVIC_ISER;
> +		gc->chip_types[0].regs.disable = NVIC_ICER;
> +		gc->chip_types[0].chip.irq_mask = irq_gc_mask_disable_reg;
> +		gc->chip_types[0].chip.irq_unmask = irq_gc_unmask_enable_reg;
> +		gc->chip_types[0].chip.irq_eoi = nvic_eoi;
> +	}
> +
> +	/* Disable all interrupts */
> +	for (i = 0; i < irqs; i += 32)
> +		writel_relaxed(~0, nvic_base + NVIC_ICER + i * 4 / 32);

So this is another, slightly different loop than the previous one

> +	for (i = 0; i < numbanks; ++i) {

This time based on irqs and increasing the irq number per loop by a
full bank. Why not doing this in the above loop which does exaclty the
same and you don't have to do the odd register base math. A simple

	writel_relaxed(~0, gc->reg_base + NVIC_ICER);

in the banks loop is sufficient, right?

Thanks,

	tglx

      parent reply	other threads:[~2013-06-25 21:29 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-06-12 21:50 Uwe Kleine-König
2013-06-12 22:00 ` Uwe Kleine-König
2013-06-14  9:40 ` Catalin Marinas
2013-06-14 14:24 ` Arnd Bergmann
     [not found] ` <20130615004149.D85B13E0A2E@localhost>
2013-06-16  9:21   ` Uwe Kleine-König
2013-06-25 10:34 ` Uwe Kleine-König
2013-06-25 11:04   ` Grant Likely
2013-06-25 12:23     ` Thomas Gleixner
2013-06-25 21:29 ` Thomas Gleixner [this message]

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=alpine.DEB.2.02.1306252316470.4013@ionos.tec.linutronix.de \
    --to=tglx@linutronix.de \
    --cc=arnd@arndb.de \
    --cc=catalin.marinas@arm.com \
    --cc=jonathan.austin@arm.com \
    --cc=kernel@pengutronix.de \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=u.kleine-koenig@pengutronix.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

all inboxes | Powered by JetHome®