[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <848a116f-2f1b-e764-fea2-7816640c6dc4@lechnology.com>
Date: Mon, 4 Feb 2019 16:02:11 -0600
From: David Lechner <david@...hnology.com>
To: Bartosz Golaszewski <brgl@...ev.pl>, Sekhar Nori <nsekhar@...com>,
Kevin Hilman <khilman@...nel.org>,
Thomas Gleixner <tglx@...utronix.de>,
Jason Cooper <jason@...edaemon.net>,
Marc Zyngier <marc.zyngier@....com>
Cc: Bartosz Golaszewski <bgolaszewski@...libre.com>,
linux-kernel@...r.kernel.org, linux-arm-kernel@...ts.infradead.org
Subject: Re: [PATCH 02/35] ARM: davinci: select GENERIC_IRQ_MULTI_HANDLER
On 1/31/19 7:38 AM, Bartosz Golaszewski wrote:
> From: Bartosz Golaszewski <bgolaszewski@...libre.com>
>
> In order to support SPARSE_IRQ we first need to make davinci use the
> generic irq handler for ARM. Translate the legacy assembly to C and
> put the irq handlers into their respective drivers (aintc and cp-intc).
>
> Signed-off-by: Bartosz Golaszewski <bgolaszewski@...libre.com>
> ---
...
> diff --git a/arch/arm/mach-davinci/cp_intc.c b/arch/arm/mach-davinci/cp_intc.c
...
> @@ -97,6 +98,16 @@ static struct irq_chip cp_intc_irq_chip = {
>
> static struct irq_domain *cp_intc_domain;
>
> +static asmlinkage void __exception_irq_entry
> +cp_intc_handle_irq(struct pt_regs *regs)
> +{
> + int irqnr = cp_intc_read(CP_INTC_PRIO_IDX);
> +
> + irqnr &= 0xff;
What does applying the 0xff mask do? (perhaps needs a code
comment if it is important and not obvious).
> +
> + handle_domain_irq(cp_intc_domain, irqnr, regs);
> +}
> +
> static int cp_intc_host_map(struct irq_domain *h, unsigned int virq,
> irq_hw_number_t hw)
> {
...
> diff --git a/arch/arm/mach-davinci/irq.c b/arch/arm/mach-davinci/irq.c
...
> @@ -69,6 +76,19 @@ davinci_alloc_gc(void __iomem *base, unsigned int irq_start, unsigned int num)
> IRQ_NOREQUEST | IRQ_NOPROBE, 0);
> }
>
> +static asmlinkage void __exception_irq_entry
> +davinci_handle_irq(struct pt_regs *regs)
> +{
> + int irqnr = davinci_irq_readl(IRQ_IRQENTRY_OFFSET);
> + struct pt_regs *old_regs = set_irq_regs(regs);
> +
> + irqnr >>= 2;
> + irqnr -= 1;
Same here. It is not obvious to me what sort of conversion
is going on here.
> +
> + generic_handle_irq(irqnr);
> + set_irq_regs(old_regs);
> +}
> +
> /* ARM Interrupt Controller Initialization */
> void __init davinci_irq_init(void)
> {
Powered by blists - more mailing lists