Linux MIPS Architecture development
 help / color / mirror / Atom feed
From: Qais Yousef <qais.yousef@imgtec.com>
To: Andrew Bresticker <abrestic@chromium.org>,
	Ralf Baechle <ralf@linux-mips.org>,
	Thomas Gleixner <tglx@linutronix.de>,
	Jason Cooper <jason@lakedaemon.net>
Cc: Jeffrey Deans <jeffrey.deans@imgtec.com>,
	Markos Chandras <markos.chandras@imgtec.com>,
	Paul Burton <paul.burton@imgtec.com>,
	"Jonas Gorski" <jogo@openwrt.org>,
	John Crispin <blogic@openwrt.org>,
	David Daney <ddaney.cavm@gmail.com>, <linux-mips@linux-mips.org>,
	<linux-kernel@vger.kernel.org>
Subject: Re: [PATCH 14/24] irqchip: mips-gic: Implement generic irq_ack/irq_eoi callbacks
Date: Wed, 17 Sep 2014 10:14:50 +0100	[thread overview]
Message-ID: <5419510A.3000300@imgtec.com> (raw)
In-Reply-To: <1410825087-5497-15-git-send-email-abrestic@chromium.org>

Hi Andrew,

On 09/16/2014 12:51 AM, Andrew Bresticker wrote:
> There's no need for platforms to have their own GIC irq_ack/irq_eoi
> callbacks.  Move them to the GIC irqchip driver.
>
> Signed-off-by: Andrew Bresticker <abrestic@chromium.org>
> ---
>   arch/mips/include/asm/gic.h     |  2 --
>   arch/mips/mti-malta/malta-int.c | 16 ----------------
>   arch/mips/mti-sead3/sead3-int.c | 21 ---------------------
>   drivers/irqchip/irq-mips-gic.c  | 15 ++++++++++++---
>   4 files changed, 12 insertions(+), 42 deletions(-)
>
> diff --git a/arch/mips/include/asm/gic.h b/arch/mips/include/asm/gic.h
> index 022d831..1bf7985 100644
> --- a/arch/mips/include/asm/gic.h
> +++ b/arch/mips/include/asm/gic.h
> @@ -376,7 +376,5 @@ extern void gic_bind_eic_interrupt(int irq, int set);
>   extern unsigned int gic_get_timer_pending(void);
>   extern void gic_get_int_mask(unsigned long *dst, const unsigned long *src);
>   extern unsigned int gic_get_int(void);
> -extern void gic_irq_ack(struct irq_data *d);
> -extern void gic_finish_irq(struct irq_data *d);
>   extern void gic_platform_init(int irqs, struct irq_chip *irq_controller);
>   #endif /* _ASM_GICREGS_H */
> diff --git a/arch/mips/mti-malta/malta-int.c b/arch/mips/mti-malta/malta-int.c
> index 5c31208..b60adfd 100644
> --- a/arch/mips/mti-malta/malta-int.c
> +++ b/arch/mips/mti-malta/malta-int.c
> @@ -715,22 +715,6 @@ int malta_be_handler(struct pt_regs *regs, int is_fixup)
>   	return retval;
>   }
>   
> -void gic_irq_ack(struct irq_data *d)
> -{
> -	int irq = (d->irq - gic_irq_base);
> -
> -	GIC_CLR_INTR_MASK(irq);
> -
> -	if (gic_irq_flags[irq] & GIC_TRIG_EDGE)
> -		GICWRITE(GIC_REG(SHARED, GIC_SH_WEDGE), irq);
> -}
> -
> -void gic_finish_irq(struct irq_data *d)
> -{
> -	/* Enable interrupts. */
> -	GIC_SET_INTR_MASK(d->irq - gic_irq_base);
> -}
> -
>   void __init gic_platform_init(int irqs, struct irq_chip *irq_controller)
>   {
>   	int i;
> diff --git a/arch/mips/mti-sead3/sead3-int.c b/arch/mips/mti-sead3/sead3-int.c
> index 9d5b5bd..03f9865 100644
> --- a/arch/mips/mti-sead3/sead3-int.c
> +++ b/arch/mips/mti-sead3/sead3-int.c
> @@ -85,27 +85,6 @@ void __init arch_init_irq(void)
>   			ARRAY_SIZE(gic_intr_map), MIPS_GIC_IRQ_BASE);
>   }
>   
> -void gic_irq_ack(struct irq_data *d)
> -{
> -	GIC_CLR_INTR_MASK(d->irq - gic_irq_base);
> -}
> -
> -void gic_finish_irq(struct irq_data *d)
> -{
> -	unsigned int irq = (d->irq - gic_irq_base);
> -	unsigned int i, irq_source;
> -
> -	/* Clear edge detectors. */
> -	for (i = 0; i < gic_shared_intr_map[irq].num_shared_intr; i++) {
> -		irq_source = gic_shared_intr_map[irq].intr_list[i];
> -		if (gic_irq_flags[irq_source] & GIC_TRIG_EDGE)
> -			GICWRITE(GIC_REG(SHARED, GIC_SH_WEDGE), irq_source);
> -	}
> -
> -	/* Enable interrupts. */
> -	GIC_SET_INTR_MASK(irq);
> -}
> -
>   void __init gic_platform_init(int irqs, struct irq_chip *irq_controller)
>   {
>   	int i;
> diff --git a/drivers/irqchip/irq-mips-gic.c b/drivers/irqchip/irq-mips-gic.c
> index 9e9d8b9..0dc2972 100644
> --- a/drivers/irqchip/irq-mips-gic.c
> +++ b/drivers/irqchip/irq-mips-gic.c
> @@ -237,6 +237,15 @@ static void gic_unmask_irq(struct irq_data *d)
>   	GIC_SET_INTR_MASK(d->irq - gic_irq_base);
>   }
>   
> +static void gic_ack_irq(struct irq_data *d)
> +{
> +	GIC_CLR_INTR_MASK(d->irq - gic_irq_base);
> +
> +	/* Clear edge detector */
> +	if (gic_irq_flags[d->irq - gic_irq_base] & GIC_TRIG_EDGE)
> +		GICWRITE(GIC_REG(SHARED, GIC_SH_WEDGE), d->irq - gic_irq_base);
> +}
> +
>   #ifdef CONFIG_SMP
>   static DEFINE_SPINLOCK(gic_lock);
>   
> @@ -272,11 +281,11 @@ static int gic_set_affinity(struct irq_data *d, const struct cpumask *cpumask,
>   
>   static struct irq_chip gic_irq_controller = {
>   	.name			=	"MIPS GIC",
> -	.irq_ack		=	gic_irq_ack,
> +	.irq_ack		=	gic_ack_irq,
>   	.irq_mask		=	gic_mask_irq,
> -	.irq_mask_ack		=	gic_mask_irq,
> +	.irq_mask_ack		=	gic_ack_irq,
>   	.irq_unmask		=	gic_unmask_irq,
> -	.irq_eoi		=	gic_finish_irq,
> +	.irq_eoi		=	gic_unmask_irq,
>   #ifdef CONFIG_SMP
>   	.irq_set_affinity	=	gic_set_affinity,
>   #endif

I'm no expert in irq_chip api but I think providing irq_mask_ack and 
irq_eoi makes no sense to GIC and can be removed.

Qais

WARNING: multiple messages have this Message-ID (diff)
From: Qais Yousef <qais.yousef@imgtec.com>
To: Andrew Bresticker <abrestic@chromium.org>,
	Ralf Baechle <ralf@linux-mips.org>,
	Thomas Gleixner <tglx@linutronix.de>,
	Jason Cooper <jason@lakedaemon.net>
Cc: Jeffrey Deans <jeffrey.deans@imgtec.com>,
	Markos Chandras <markos.chandras@imgtec.com>,
	Paul Burton <paul.burton@imgtec.com>,
	Jonas Gorski <jogo@openwrt.org>,
	John Crispin <blogic@openwrt.org>,
	David Daney <ddaney.cavm@gmail.com>,
	linux-mips@linux-mips.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 14/24] irqchip: mips-gic: Implement generic irq_ack/irq_eoi callbacks
Date: Wed, 17 Sep 2014 10:14:50 +0100	[thread overview]
Message-ID: <5419510A.3000300@imgtec.com> (raw)
Message-ID: <20140917091450.1POHZ5hbNOa9oEXcl0FzR8XCb-biOStVxVleGBG7UxA@z> (raw)
In-Reply-To: <1410825087-5497-15-git-send-email-abrestic@chromium.org>

Hi Andrew,

On 09/16/2014 12:51 AM, Andrew Bresticker wrote:
> There's no need for platforms to have their own GIC irq_ack/irq_eoi
> callbacks.  Move them to the GIC irqchip driver.
>
> Signed-off-by: Andrew Bresticker <abrestic@chromium.org>
> ---
>   arch/mips/include/asm/gic.h     |  2 --
>   arch/mips/mti-malta/malta-int.c | 16 ----------------
>   arch/mips/mti-sead3/sead3-int.c | 21 ---------------------
>   drivers/irqchip/irq-mips-gic.c  | 15 ++++++++++++---
>   4 files changed, 12 insertions(+), 42 deletions(-)
>
> diff --git a/arch/mips/include/asm/gic.h b/arch/mips/include/asm/gic.h
> index 022d831..1bf7985 100644
> --- a/arch/mips/include/asm/gic.h
> +++ b/arch/mips/include/asm/gic.h
> @@ -376,7 +376,5 @@ extern void gic_bind_eic_interrupt(int irq, int set);
>   extern unsigned int gic_get_timer_pending(void);
>   extern void gic_get_int_mask(unsigned long *dst, const unsigned long *src);
>   extern unsigned int gic_get_int(void);
> -extern void gic_irq_ack(struct irq_data *d);
> -extern void gic_finish_irq(struct irq_data *d);
>   extern void gic_platform_init(int irqs, struct irq_chip *irq_controller);
>   #endif /* _ASM_GICREGS_H */
> diff --git a/arch/mips/mti-malta/malta-int.c b/arch/mips/mti-malta/malta-int.c
> index 5c31208..b60adfd 100644
> --- a/arch/mips/mti-malta/malta-int.c
> +++ b/arch/mips/mti-malta/malta-int.c
> @@ -715,22 +715,6 @@ int malta_be_handler(struct pt_regs *regs, int is_fixup)
>   	return retval;
>   }
>   
> -void gic_irq_ack(struct irq_data *d)
> -{
> -	int irq = (d->irq - gic_irq_base);
> -
> -	GIC_CLR_INTR_MASK(irq);
> -
> -	if (gic_irq_flags[irq] & GIC_TRIG_EDGE)
> -		GICWRITE(GIC_REG(SHARED, GIC_SH_WEDGE), irq);
> -}
> -
> -void gic_finish_irq(struct irq_data *d)
> -{
> -	/* Enable interrupts. */
> -	GIC_SET_INTR_MASK(d->irq - gic_irq_base);
> -}
> -
>   void __init gic_platform_init(int irqs, struct irq_chip *irq_controller)
>   {
>   	int i;
> diff --git a/arch/mips/mti-sead3/sead3-int.c b/arch/mips/mti-sead3/sead3-int.c
> index 9d5b5bd..03f9865 100644
> --- a/arch/mips/mti-sead3/sead3-int.c
> +++ b/arch/mips/mti-sead3/sead3-int.c
> @@ -85,27 +85,6 @@ void __init arch_init_irq(void)
>   			ARRAY_SIZE(gic_intr_map), MIPS_GIC_IRQ_BASE);
>   }
>   
> -void gic_irq_ack(struct irq_data *d)
> -{
> -	GIC_CLR_INTR_MASK(d->irq - gic_irq_base);
> -}
> -
> -void gic_finish_irq(struct irq_data *d)
> -{
> -	unsigned int irq = (d->irq - gic_irq_base);
> -	unsigned int i, irq_source;
> -
> -	/* Clear edge detectors. */
> -	for (i = 0; i < gic_shared_intr_map[irq].num_shared_intr; i++) {
> -		irq_source = gic_shared_intr_map[irq].intr_list[i];
> -		if (gic_irq_flags[irq_source] & GIC_TRIG_EDGE)
> -			GICWRITE(GIC_REG(SHARED, GIC_SH_WEDGE), irq_source);
> -	}
> -
> -	/* Enable interrupts. */
> -	GIC_SET_INTR_MASK(irq);
> -}
> -
>   void __init gic_platform_init(int irqs, struct irq_chip *irq_controller)
>   {
>   	int i;
> diff --git a/drivers/irqchip/irq-mips-gic.c b/drivers/irqchip/irq-mips-gic.c
> index 9e9d8b9..0dc2972 100644
> --- a/drivers/irqchip/irq-mips-gic.c
> +++ b/drivers/irqchip/irq-mips-gic.c
> @@ -237,6 +237,15 @@ static void gic_unmask_irq(struct irq_data *d)
>   	GIC_SET_INTR_MASK(d->irq - gic_irq_base);
>   }
>   
> +static void gic_ack_irq(struct irq_data *d)
> +{
> +	GIC_CLR_INTR_MASK(d->irq - gic_irq_base);
> +
> +	/* Clear edge detector */
> +	if (gic_irq_flags[d->irq - gic_irq_base] & GIC_TRIG_EDGE)
> +		GICWRITE(GIC_REG(SHARED, GIC_SH_WEDGE), d->irq - gic_irq_base);
> +}
> +
>   #ifdef CONFIG_SMP
>   static DEFINE_SPINLOCK(gic_lock);
>   
> @@ -272,11 +281,11 @@ static int gic_set_affinity(struct irq_data *d, const struct cpumask *cpumask,
>   
>   static struct irq_chip gic_irq_controller = {
>   	.name			=	"MIPS GIC",
> -	.irq_ack		=	gic_irq_ack,
> +	.irq_ack		=	gic_ack_irq,
>   	.irq_mask		=	gic_mask_irq,
> -	.irq_mask_ack		=	gic_mask_irq,
> +	.irq_mask_ack		=	gic_ack_irq,
>   	.irq_unmask		=	gic_unmask_irq,
> -	.irq_eoi		=	gic_finish_irq,
> +	.irq_eoi		=	gic_unmask_irq,
>   #ifdef CONFIG_SMP
>   	.irq_set_affinity	=	gic_set_affinity,
>   #endif

I'm no expert in irq_chip api but I think providing irq_mask_ack and 
irq_eoi makes no sense to GIC and can be removed.

Qais

  reply	other threads:[~2014-09-17  9:15 UTC|newest]

Thread overview: 46+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-09-15 23:51 [PATCH 00/24] MIPS GIC cleanup, part 1 Andrew Bresticker
2014-09-15 23:51 ` [PATCH 01/24] MIPS: Always use IRQ domains for CPU IRQs Andrew Bresticker
2014-09-15 23:51 ` [PATCH 02/24] MIPS: Rename mips_cpu_intc_init() -> mips_cpu_irq_of_init() Andrew Bresticker
2014-09-15 23:51 ` [PATCH 03/24] MIPS: Provide a generic plat_irq_dispatch Andrew Bresticker
2014-09-17  8:56   ` Qais Yousef
2014-09-17  8:56     ` Qais Yousef
2014-09-17 16:36     ` Andrew Bresticker
2014-09-15 23:51 ` [PATCH 04/24] MIPS: Set vint handler when mapping CPU interrupts Andrew Bresticker
2014-09-15 23:51 ` [PATCH 05/24] MIPS: i8259: Use IRQ domains Andrew Bresticker
2014-09-15 23:51 ` [PATCH 06/24] MIPS: Add hook to get C0 performance counter interrupt Andrew Bresticker
2014-09-15 23:51 ` [PATCH 07/24] MIPS: smp-cps: Enable all hardware interrupts on secondary CPUs Andrew Bresticker
2014-09-15 23:51 ` [PATCH 08/24] MIPS: Remove gic_{enable,disable}_interrupt() Andrew Bresticker
2014-09-15 23:51 ` [PATCH 09/24] MIPS: sead3: Remove sead3-serial.c Andrew Bresticker
2014-09-15 23:51 ` [PATCH 10/24] MIPS: sead3: Do not overlap CPU/GIC IRQ ranges Andrew Bresticker
2014-09-15 23:51 ` [PATCH 11/24] MIPS: Malta: Move MSC01 interrupt base Andrew Bresticker
2014-09-15 23:51 ` [PATCH 12/24] MIPS: Move MIPS_GIC_IRQ_BASE into platform irq.h Andrew Bresticker
2014-09-15 23:51 ` [PATCH 13/24] MIPS: Move GIC to drivers/irqchip/ Andrew Bresticker
2014-09-15 23:51 ` [PATCH 14/24] irqchip: mips-gic: Implement generic irq_ack/irq_eoi callbacks Andrew Bresticker
2014-09-17  9:14   ` Qais Yousef [this message]
2014-09-17  9:14     ` Qais Yousef
2014-09-17 17:14     ` Andrew Bresticker
2014-09-15 23:51 ` [PATCH 15/24] irqchip: mips-gic: Implement irq_set_type callback Andrew Bresticker
2014-09-15 23:51 ` [PATCH 16/24] irqchip: mips-gic: Fix gic_set_affinity() return value Andrew Bresticker
2014-09-15 23:51 ` [PATCH 17/24] irqchip: mips-gic: Use IRQ domains Andrew Bresticker
2014-09-15 23:51 ` [PATCH 18/24] irqchip: mips-gic: Stop using per-platform mapping tables Andrew Bresticker
2014-09-17  9:21   ` Qais Yousef
2014-09-17  9:21     ` Qais Yousef
2014-09-15 23:51 ` [PATCH 19/24] irqchip: mips-gic: Probe for number of external interrupts Andrew Bresticker
2014-09-15 23:51 ` [PATCH 20/24] irqchip: mips-gic: Use separate edge/level irq_chips Andrew Bresticker
2014-09-17  9:24   ` Qais Yousef
2014-09-17  9:24     ` Qais Yousef
2014-09-17 17:15     ` Andrew Bresticker
2014-09-15 23:51 ` [PATCH 21/24] irqchip: mips-gic: Support local interrupts Andrew Bresticker
2014-09-17  9:50   ` Qais Yousef
2014-09-17  9:50     ` Qais Yousef
2014-09-17 17:40     ` Andrew Bresticker
2014-09-17 21:09       ` Andrew Bresticker
2014-09-18  6:57       ` Qais Yousef
2014-09-15 23:51 ` [PATCH 22/24] irqchip: mips-gic: Remove unnecessary globals Andrew Bresticker
2014-09-15 23:51 ` [PATCH 23/24] MIPS: Malta: Use generic plat_irq_dispatch Andrew Bresticker
2014-09-15 23:51 ` [PATCH 24/24] MIPS: sead3: " Andrew Bresticker
2014-09-17 10:20 ` [PATCH 00/24] MIPS GIC cleanup, part 1 Qais Yousef
2014-09-17 10:20   ` Qais Yousef
2014-09-17 17:42   ` Andrew Bresticker
2014-09-18  7:08     ` Qais Yousef
2014-09-17 14:07 ` Jason Cooper

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=5419510A.3000300@imgtec.com \
    --to=qais.yousef@imgtec.com \
    --cc=abrestic@chromium.org \
    --cc=blogic@openwrt.org \
    --cc=ddaney.cavm@gmail.com \
    --cc=jason@lakedaemon.net \
    --cc=jeffrey.deans@imgtec.com \
    --cc=jogo@openwrt.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mips@linux-mips.org \
    --cc=markos.chandras@imgtec.com \
    --cc=paul.burton@imgtec.com \
    --cc=ralf@linux-mips.org \
    --cc=tglx@linutronix.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