[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CY4PR1201MB0120EDD4173511912A9FC99EA1C60@CY4PR1201MB0120.namprd12.prod.outlook.com>
Date: Wed, 24 Jul 2019 10:47:31 +0000
From: Alexey Brodkin <Alexey.Brodkin@...opsys.com>
To: Mischa Jonker <Mischa.Jonker@...opsys.com>
CC: Vineet Gupta <Vineet.Gupta1@...opsys.com>,
"kstewart@...uxfoundation.org" <kstewart@...uxfoundation.org>,
"tglx@...utronix.de" <tglx@...utronix.de>,
"robh+dt@...nel.org" <robh+dt@...nel.org>,
"linux-snps-arc@...ts.infradead.org"
<linux-snps-arc@...ts.infradead.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
"devicetree@...r.kernel.org" <devicetree@...r.kernel.org>
Subject: RE: [PATCH 1/2] ARCv2: IDU-intc: Add support for edge-triggered
interrupts
Hi Mischa,
> -----Original Message-----
> From: Mischa Jonker <mischa.jonker@...opsys.com>
> Sent: Tuesday, July 23, 2019 1:26 PM
> To: Vineet Gupta <vgupta@...opsys.com>; Alexey Brodkin <abrodkin@...opsys.com>;
> kstewart@...uxfoundation.org; tglx@...utronix.de; robh+dt@...nel.org; linux-snps-
> arc@...ts.infradead.org; linux-kernel@...r.kernel.org; devicetree@...r.kernel.org
> Cc: Mischa Jonker <mischa.jonker@...opsys.com>
> Subject: [PATCH 1/2] ARCv2: IDU-intc: Add support for edge-triggered interrupts
>
> This adds support for an optional extra interrupt cell to specify edge
> vs level triggered. It is backward compatible with dts files with only
> one cell, and will default to level-triggered in such a case.
In general LGTM. Still a couple of comments.
It might be useful to explain changes
made to idu_irq_set_affinity() as it's not immediately clear what affinity
has to do with IRQ modes (in theory it should be orthogonal).
But what happens we're actually fixing previously implemented short-cut
when instead of a separately set IRQ mode we were doing it together with
setup of distribution since it's done with the same one command
(anyways we relied on the one and only IRQ type being supported).
And now we have a proper implementation with separated setup of IRQ mode and
affinity.
> static int
> idu_irq_set_affinity(struct irq_data *data, const struct cpumask *cpumask,
> bool force)
> @@ -263,13 +285,32 @@ idu_irq_set_affinity(struct irq_data *data, const struct cpumask *cpumask,
> else
> distribution_mode = IDU_M_DISTRI_RR;
>
> - idu_set_mode(data->hwirq, IDU_M_TRIG_LEVEL, distribution_mode);
> + idu_set_mode(data->hwirq, false, 0, true, distribution_mode);
>
> raw_spin_unlock_irqrestore(&mcip_lock, flags);
>
> return IRQ_SET_MASK_OK;
> }
>
> +static int idu_irq_set_type(struct irq_data *data, u32 type)
> +{
> + unsigned long flags;
> +
> + if (type & ~(IRQ_TYPE_EDGE_RISING | IRQ_TYPE_LEVEL_HIGH))
> + return -EINVAL;
Maybe add an explanation why only these types are supported?
-Alexey
Powered by blists - more mailing lists