linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Vineet Gupta <Vineet.Gupta1@synopsys.com>
To: Noam Camus <noamc@ezchip.com>, <linux-snps-arc@lists.infradead.org>
Cc: <linux-kernel@vger.kernel.org>, <cmetcalf@ezchip.com>,
	<daniel.lezcano@linaro.org>, <marc.zyngier@arm.com>
Subject: Re: [PATCH v5 11/20] ARC: IPI: do not use generic IRQ domain
Date: Wed, 30 Dec 2015 15:43:15 +0530	[thread overview]
Message-ID: <5683AE3B.900@synopsys.com> (raw)
In-Reply-To: <1451222619-3610-12-git-send-email-noamc@ezchip.com>

On Sunday 27 December 2015 06:53 PM, Noam Camus wrote:
> From: Noam Camus <noamc@ezchip.com>
> 
> This behaviour is the desired one as been seen on other arch's.
> 
> We do not use generic irq domain and hence hwirq number is used
> directly by our code without any mapping to virq.
> In order to add IPI status to /proc/interrupts we use
> hardirq macros also we define arch_show_interrupts().
> 
> Signed-off-by: Noam Camus <noamc@ezchip.com>
> ---
>  arch/arc/include/asm/Kbuild    |    1 -
>  arch/arc/include/asm/hardirq.h |   22 ++++++++++++++++++++++
>  arch/arc/include/asm/smp.h     |    6 ++++++
>  arch/arc/kernel/irq.c          |   13 ++++++++++++-
>  arch/arc/kernel/smp.c          |   27 +++++++++++++++++++++++++++
>  5 files changed, 67 insertions(+), 2 deletions(-)
>  create mode 100644 arch/arc/include/asm/hardirq.h
> 
> diff --git a/arch/arc/include/asm/Kbuild b/arch/arc/include/asm/Kbuild
> index 0b10ef2..bbc3e4a 100644
> --- a/arch/arc/include/asm/Kbuild
> +++ b/arch/arc/include/asm/Kbuild
> @@ -10,7 +10,6 @@ generic-y += errno.h
>  generic-y += fb.h
>  generic-y += fcntl.h
>  generic-y += ftrace.h
> -generic-y += hardirq.h

So this is going backwards - copy/paste generic code into arch header
I don't understand why you need this !


>  generic-y += hw_irq.h
>  generic-y += ioctl.h
>  generic-y += ioctls.h
> diff --git a/arch/arc/include/asm/hardirq.h b/arch/arc/include/asm/hardirq.h
> new file mode 100644
> index 0000000..e83aa88
> --- /dev/null
> +++ b/arch/arc/include/asm/hardirq.h
> @@ -0,0 +1,22 @@
> +#ifndef __ASM_ARC_HARDIRQ_H
> +#define __ASM_ARC_HARDIRQ_H
> +
> +#include <linux/cache.h>
> +#include <linux/threads.h>
> +
> +typedef struct {
> +	unsigned int __softirq_pending;
> +#ifdef CONFIG_SMP
> +	unsigned int ipi_irqs;
> +#endif
> +} ____cacheline_aligned irq_cpustat_t;
> +
> +#include <linux/irq_cpustat.h>	/* Standard mappings for irq_cpustat_t above */
> +#include <linux/irq.h>
> +
> +static inline void ack_bad_irq(unsigned int irq)
> +{
> +	printk(KERN_CRIT "unexpected IRQ trap at vector %02x\n", irq);
> +}
> +
> +#endif /* __ASM_ARC_HARDIRQ_H */
> diff --git a/arch/arc/include/asm/smp.h b/arch/arc/include/asm/smp.h
> index 9913804..9e4ec48 100644
> --- a/arch/arc/include/asm/smp.h
> +++ b/arch/arc/include/asm/smp.h
> @@ -14,12 +14,16 @@
>  #include <linux/types.h>
>  #include <linux/init.h>
>  #include <linux/threads.h>
> +#include <asm/ptrace.h>
>  
>  #define raw_smp_processor_id() (current_thread_info()->cpu)
>  
>  /* including cpumask.h leads to cyclic deps hence this Forward declaration */
>  struct cpumask;
>  
> +/* including seq_file.h leads to cyclic deps hence this Forward declaration */
> +struct seq_file;
> +
>  /*
>   * APIs provided by arch SMP code to generic code
>   */
> @@ -32,6 +36,8 @@ extern void arch_send_call_function_ipi_mask(const struct cpumask *mask);
>  extern void __init smp_init_cpus(void);
>  extern void first_lines_of_secondary(void);
>  extern const char *arc_platform_smp_cpuinfo(void);
> +extern void arch_do_IPI(unsigned int irq, struct pt_regs *regs);
> +extern void show_ipi_list(struct seq_file *, int);
>  
>  /*
>   * API expected BY platform smp code (FROM arch smp code)
> diff --git a/arch/arc/kernel/irq.c b/arch/arc/kernel/irq.c
> index 7ae5411..c8d3c3d 100644
> --- a/arch/arc/kernel/irq.c
> +++ b/arch/arc/kernel/irq.c
> @@ -55,7 +55,10 @@ void arch_do_IRQ(unsigned int irq, struct pt_regs *regs)
>  void (*handle_arch_irq)(unsigned int hwirq, struct pt_regs *) = NULL;
>  void arch_do_IRQ(unsigned int irq, struct pt_regs *regs)
>  {
> -	handle_arch_irq(irq, regs);
> +	if (irq == IPI_IRQ)
> +		arch_do_IPI(irq, regs);
> +	else
> +		handle_arch_irq(irq, regs);
>  }
>  
>  void __init set_handle_irq(void (*handle_irq)(unsigned int hwirq,
> @@ -65,6 +68,14 @@ void __init set_handle_irq(void (*handle_irq)(unsigned int hwirq,
>  }
>  #endif
>  
> +int arch_show_interrupts(struct seq_file *p, int prec)
> +{
> +#ifdef CONFIG_SMP
> +	show_ipi_list(p, prec);
> +#endif
> +	return 0;
> +}
> +
>  /*
>   * API called for requesting percpu interrupts - called by each CPU
>   *  - For boot CPU, actually request the IRQ with genirq core + enables
> diff --git a/arch/arc/kernel/smp.c b/arch/arc/kernel/smp.c
> index ec6a5c1..8d37906 100644
> --- a/arch/arc/kernel/smp.c
> +++ b/arch/arc/kernel/smp.c
> @@ -22,6 +22,7 @@
>  #include <linux/atomic.h>
>  #include <linux/cpumask.h>
>  #include <linux/reboot.h>
> +#include <linux/seq_file.h>
>  #include <asm/processor.h>
>  #include <asm/setup.h>
>  #include <asm/mach_desc.h>
> @@ -349,6 +350,32 @@ irqreturn_t do_IPI(int irq, void *dev_id)
>  	return IRQ_HANDLED;
>  }
>  
> +void arch_do_IPI(unsigned int irq, struct pt_regs *regs)
> +{
> +	struct pt_regs *old_regs = set_irq_regs(regs);
> +	unsigned int cpu = smp_processor_id();
> +
> +	__IRQ_STAT(cpu, ipi_irqs)++;
> +
> +	irq_enter();
> +	do_IPI(irq, NULL);
> +	irq_exit();
> +
> +	set_irq_regs(old_regs);
> +}

WHY ?


> +
> +void show_ipi_list(struct seq_file *p, int prec)
> +{
> +	unsigned int cpu;
> +
> +	seq_printf(p, "%*s: ", prec - 1, "IPI");
> +
> +	for_each_online_cpu(cpu)
> +		seq_printf(p, "%10u ", __IRQ_STAT(cpu, ipi_irqs));
> +
> +	seq_printf(p, " %s\n", "IPI");
> +}
> +
>  /*
>   * API called by platform code to hookup arch-common ISR to their IPI IRQ
>   */
> 


  reply	other threads:[~2015-12-30 10:13 UTC|newest]

Thread overview: 36+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-12-27 13:23 [PATCH v5 00/20] Adding plat-eznps to ARC Noam Camus
2015-12-27 13:23 ` [PATCH v5 01/20] Documentation: Add EZchip vendor to binding list Noam Camus
2015-12-27 13:23 ` [PATCH v5 02/20] soc: Support for EZchip SoC Noam Camus
2015-12-27 13:23 ` [PATCH v5 03/20] ARC: [plat-eznps] define IPI_IRQ Noam Camus
2015-12-27 13:23 ` [PATCH v5 04/20] clocksource: Add NPS400 timers driver Noam Camus
2015-12-27 14:55   ` kbuild test robot
2015-12-27 21:41     ` Noam Camus
2015-12-28  9:00       ` Daniel Lezcano
2015-12-28 10:35         ` Vineet Gupta
2015-12-28 10:55           ` Daniel Lezcano
2015-12-28 11:11             ` Vineet Gupta
2016-01-01 10:31   ` Vineet Gupta
2015-12-27 13:23 ` [PATCH v5 05/20] irqchip: add nps Internal and external irqchips Noam Camus
2015-12-30 10:08   ` Vineet Gupta
2015-12-30 10:41   ` Vineet Gupta
2015-12-27 13:23 ` [PATCH v5 06/20] ARC: Set vmalloc size from configuration Noam Camus
2015-12-27 13:23 ` [PATCH v5 07/20] ARC: rwlock: disable interrupts in !LLSC variant Noam Camus
2015-12-27 13:23 ` [PATCH v5 08/20] ARC: Mark secondary cpu online only after all HW setup is done Noam Camus
2015-12-27 13:23 ` [PATCH v5 09/20] ARC: IRQ: use device tree to get timer device configuration Noam Camus
2015-12-28 11:42   ` Vineet Gupta
2015-12-30 11:20   ` Vineet Gupta
2015-12-27 13:23 ` [PATCH v5 10/20] ARC: IRQ: do not use hwirq directly at arch_do_IRQ() Noam Camus
2015-12-30 10:10   ` Vineet Gupta
2015-12-31  5:21     ` Noam Camus
2015-12-27 13:23 ` [PATCH v5 11/20] ARC: IPI: do not use generic IRQ domain Noam Camus
2015-12-30 10:13   ` Vineet Gupta [this message]
2015-12-31  5:14     ` Noam Camus
2015-12-27 13:23 ` [PATCH v5 12/20] ARC: [plat-eznps] Add eznps board defconfig and dts Noam Camus
2015-12-27 13:23 ` [PATCH v5 13/20] ARC: [plat-eznps] Add eznps platform Noam Camus
2015-12-27 13:23 ` [PATCH v5 14/20] ARC: [plat-eznps] Use dedicated user stack top Noam Camus
2015-12-27 13:23 ` [PATCH v5 15/20] ARC: [plat-eznps] Use dedicated atomic/bitops/cmpxchg Noam Camus
2015-12-27 13:23 ` [PATCH v5 16/20] ARC: [plat-eznps] Use dedicated SMP barriers Noam Camus
2015-12-27 13:23 ` [PATCH v5 17/20] ARC: [plat-eznps] Use dedicated identity auxiliary register Noam Camus
2015-12-27 13:23 ` [PATCH v5 18/20] ARC: [plat-eznps] Use dedicated cpu_relax() Noam Camus
2015-12-27 13:23 ` [PATCH v5 19/20] ARC: [plat-eznps] Use dedicated COMMAND_LINE_SIZE Noam Camus
2015-12-27 13:23 ` [PATCH v5 20/20] ARC: Add eznps platform to Kconfig and Makefile Noam Camus

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=5683AE3B.900@synopsys.com \
    --to=vineet.gupta1@synopsys.com \
    --cc=cmetcalf@ezchip.com \
    --cc=daniel.lezcano@linaro.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-snps-arc@lists.infradead.org \
    --cc=marc.zyngier@arm.com \
    --cc=noamc@ezchip.com \
    /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;
as well as URLs for NNTP newsgroup(s).