[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <87turjjkjr.wl-maz@kernel.org>
Date:   Thu, 14 Jan 2021 21:06:00 +0000
From:   Marc Zyngier <maz@...nel.org>
To:     Samuel Holland <samuel@...lland.org>
Cc:     Thomas Gleixner <tglx@...utronix.de>,
        Rob Herring <robh+dt@...nel.org>,
        Maxime Ripard <mripard@...nel.org>,
        Chen-Yu Tsai <wens@...e.org>,
        Jernej Skrabec <jernej.skrabec@...l.net>,
        Ondrej Jirman <megous@...ous.com>, devicetree@...r.kernel.org,
        linux-arm-kernel@...ts.infradead.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH v4 03/10] irqchip/sun6i-r: Use a stacked irqchip driver
Hi Samuel,
On 2021-01-12 05:59, Samuel Holland wrote:
[...]
> +static void sun6i_r_intc_ack_nmi(void)
> +{
> +	writel(SUN6I_NMI_BIT, base + SUN6I_IRQ_PENDING(0));
writel_relaxed()
> +}
> +
> +static void sun6i_r_intc_nmi_ack(struct irq_data *data)
> +{
> +	if (irqd_get_trigger_type(data) & IRQ_TYPE_EDGE_BOTH)
> +		sun6i_r_intc_ack_nmi();
> +	else
> +		data->chip_data = SUN6I_NMI_NEEDS_ACK;
> +}
> +
> +static void sun6i_r_intc_nmi_eoi(struct irq_data *data)
> +{
> +	/* For oneshot IRQs, delay the ack until the IRQ is unmasked. */
> +	if (data->chip_data == SUN6I_NMI_NEEDS_ACK && !irqd_irq_masked(data)) 
> {
> +		sun6i_r_intc_ack_nmi();
> +		data->chip_data = 0;
nit: NULL rather than 0?
[...]
> +static struct irq_chip sun6i_r_intc_nmi_chip = {
> +	.name			= "sun6i-r-intc",
> +	.irq_ack		= sun6i_r_intc_nmi_ack,
> +	.irq_mask		= irq_chip_mask_parent,
> +	.irq_unmask		= sun6i_r_intc_nmi_unmask,
> +	.irq_eoi		= sun6i_r_intc_nmi_eoi,
> +	.irq_set_affinity	= irq_chip_set_affinity_parent,
> +	.irq_set_type		= sun6i_r_intc_nmi_set_type,
> +	.irq_set_irqchip_state	= sun6i_r_intc_nmi_set_irqchip_state,
You probably also want to wire irq_get_irqchip_state(), while
you're at it.
Otherwise, looks pretty good now.
Thanks,
	M.
-- 
Without deviation from the norm, progress is not possible.
Powered by blists - more mailing lists
 
