[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAL1qeaH5ZQA8Y=n3uVSy9e+vEweCi_RT2s-ZGRfyJTAcbguyoA@mail.gmail.com>
Date: Fri, 5 Sep 2014 14:50:02 -0700
From: Andrew Bresticker <abrestic@...omium.org>
To: Thomas Gleixner <tglx@...utronix.de>
Cc: Ralf Baechle <ralf@...ux-mips.org>,
Rob Herring <robh+dt@...nel.org>,
Pawel Moll <pawel.moll@....com>,
Mark Rutland <mark.rutland@....com>,
Ian Campbell <ijc+devicetree@...lion.org.uk>,
Kumar Gala <galak@...eaurora.org>,
Jason Cooper <jason@...edaemon.net>,
Jeffrey Deans <jeffrey.deans@...tec.com>,
Markos Chandras <markos.chandras@...tec.com>,
Paul Burton <paul.burton@...tec.com>,
Arnd Bergmann <arnd@...db.de>,
John Crispin <blogic@...nwrt.org>,
David Daney <ddaney.cavm@...il.com>,
Linux-MIPS <linux-mips@...ux-mips.org>,
"devicetree@...r.kernel.org" <devicetree@...r.kernel.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH v2 14/16] irqchip: mips-gic: Support local interrupts
On Fri, Sep 5, 2014 at 12:05 PM, Thomas Gleixner <tglx@...utronix.de> wrote:
> On Fri, 5 Sep 2014, Andrew Bresticker wrote:
>> static void gic_mask_irq(struct irq_data *d)
>> {
>> - GIC_CLR_INTR_MASK(d->irq - gic_irq_base);
>> + unsigned int irq = d->irq - gic_irq_base;
>> +
>> + if (gic_is_local_irq(irq)) {
>> + GICWRITE(GIC_REG(VPE_LOCAL, GIC_VPE_RMASK),
>> + 1 << GIC_INTR_BIT(gic_hw_to_local_irq(irq)));
>> + } else {
>> + GIC_CLR_INTR_MASK(irq);
>> + }
>> }
>>
>> static void gic_unmask_irq(struct irq_data *d)
>> {
>> - GIC_SET_INTR_MASK(d->irq - gic_irq_base);
>> + unsigned int irq = d->irq - gic_irq_base;
>> +
>> + if (gic_is_local_irq(irq)) {
>> + GICWRITE(GIC_REG(VPE_LOCAL, GIC_VPE_SMASK),
>> + 1 << GIC_INTR_BIT(gic_hw_to_local_irq(irq)));
>> + } else {
>> + GIC_SET_INTR_MASK(irq);
>> + }
>
> Why are you adding a conditional in all these functions instead of
> having two interrupt chips with separate callbacks and irqdata?
Ok, I'll use a separate irqchip.
> And looking at GIC_SET_INTR_MASK(irq) makes me shudder even more. The
> whole thing can be replaced with the generic interrupt chip functions.
>
> If you set it up proper, then there is not a single conditional or
> runtime calculation of bitmasks, address offsets etc.
Yes, I'd like to use the generic irqchip library here, but Malta and
SEAD-3 will need to be converted over to using irq domains. Perhaps
I'll do that first - it should get rid of a lot of the other ugliness
here as well.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists