Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1245547 > unrolled thread

[RFC v2 PATCH 00/14] Implement generic IPI support mechanism

Started byQais Yousef <qais.yousef@imgtec.com>
First post2015-10-13 12:20 +0200
Last post2015-10-14 17:50 +0200
Articles 15 — 5 participants

Back to article view | Back to linux.kernel


Contents

  [RFC v2 PATCH 00/14] Implement generic IPI support mechanism Qais Yousef <qais.yousef@imgtec.com> - 2015-10-13 12:20 +0200
    [RFC v2 PATCH 03/14] irq: add new struct ipi_mask Qais Yousef <qais.yousef@imgtec.com> - 2015-10-13 12:20 +0200
      Re: [RFC v2 PATCH 03/14] irq: add new struct ipi_mask Thomas Gleixner <tglx@linutronix.de> - 2015-10-13 15:30 +0200
        Re: [RFC v2 PATCH 03/14] irq: add new struct ipi_mask Qais Yousef <qais.yousef@imgtec.com> - 2015-10-13 16:30 +0200
    [RFC v2 PATCH 08/14] irq: implement irq_send_ipi Qais Yousef <qais.yousef@imgtec.com> - 2015-10-13 12:20 +0200
      Re: [RFC v2 PATCH 08/14] irq: implement irq_send_ipi kbuild test robot <lkp@intel.com> - 2015-10-13 13:20 +0200
      Re: [RFC v2 PATCH 08/14] irq: implement irq_send_ipi kbuild test robot <lkp@intel.com> - 2015-10-13 13:40 +0200
      Re: [RFC v2 PATCH 08/14] irq: implement irq_send_ipi Thomas Gleixner <tglx@linutronix.de> - 2015-10-13 15:50 +0200
        Re: [RFC v2 PATCH 08/14] irq: implement irq_send_ipi Qais Yousef <qais.yousef@imgtec.com> - 2015-10-13 16:50 +0200
    Re: [RFC v2 PATCH 00/14] Implement generic IPI support mechanism Thomas Gleixner <tglx@linutronix.de> - 2015-10-13 16:00 +0200
      Re: [RFC v2 PATCH 00/14] Implement generic IPI support mechanism Qais Yousef <qais.yousef@imgtec.com> - 2015-10-13 16:50 +0200
      Re: [RFC v2 PATCH 00/14] Implement generic IPI support mechanism Sergei Shtylyov <sergei.shtylyov@cogentembedded.com> - 2015-10-13 19:30 +0200
        Re: [RFC v2 PATCH 00/14] Implement generic IPI support mechanism Thomas Gleixner <tglx@linutronix.de> - 2015-10-13 19:30 +0200
    Re: [RFC v2 PATCH 00/14] Implement generic IPI support mechanism Davidlohr Bueso <dave@stgolabs.net> - 2015-10-14 17:10 +0200
      Re: [RFC v2 PATCH 00/14] Implement generic IPI support mechanism Qais Yousef <qais.yousef@imgtec.com> - 2015-10-14 17:50 +0200

#1245547 — [RFC v2 PATCH 00/14] Implement generic IPI support mechanism

FromQais Yousef <qais.yousef@imgtec.com>
Date2015-10-13 12:20 +0200
Subject[RFC v2 PATCH 00/14] Implement generic IPI support mechanism
Message-ID<qj4Qx-3vO-3@gated-at.bofh.it>
This RFC series attempts to implement a generic IPI layer for reserving and sending IPIs.

It is based on the discussion in these links

	https://lkml.org/lkml/2015/8/26/713
	https://lkml.org/lkml/2015/9/29/875

In summary. We need a generic IPI layer to allow driver code to send IPIs to coprocessor
without caring about implementation details of the underlying controller.

Also it will help in making SMP IPI support more generic.

The goal is to have a mechanism to dynamically reserve an IPI to destination CPUs and
provide a single virq to send an IPI to any of these CPUs using generic irq_send_ipi()
API.

This v2 addresses the comments from v1 and implements a simpler mapping mechanism and moves
the irq_send_ipi() to be part of irqchip instead of irqdomain.

The implementation falls more natural and fits into place now (hopefully). So hopefully next
series would be non RFC. The only thing I haven't addressed is whether we want to make
request_percpu_irq() enable a coprocessor or defer that to the coprocessor itself.

This series is based on Linus tree. I couldn't compile test it because MIPS compilation was
broken due to other reasons. I expect some brokeness because of the introduction of
struct irq_common_data which is not present on the 4.1 tree I was testing my code on before
porting it to Linus tip. I will fix these issues and introduce proper accessors for accessing
struct ipi_mask given that the concept is approved.

I hope my commit messages aren't too terse.

Credit goes to Thomas for spec'ing and outlining the proper way to get this new API in.

Qais Yousef (14):
  irq: add new IRQ_DOMAIN_FLAGS_IPI
  irq: add GENERIC_IRQ_IPI Kconfig symbol
  irq: add new struct ipi_mask
  irq: add a new irq_send_ipi() to irq_chip
  irq: add struct ipi_mask to irq_data
  irq: add struct ipi_mapping and its helper functions
  irq: add a new generic IPI reservation code to irq core
  irq: implement irq_send_ipi
  MIPS: add support for generic SMP IPI support
  MIPS: make smp CMP, CPS and MT use the new generic IPI functions
  MIPS: delete smp-gic.c
  irqchip: mips-gic: add a IPI hierarchy domain
  irqchip: mips-gic: implement the new irq_send_ipi
  irqchip: mips-gic: remove IPI init code

 arch/mips/Kconfig                |   6 --
 arch/mips/include/asm/smp-ops.h  |   5 +-
 arch/mips/kernel/Makefile        |   1 -
 arch/mips/kernel/smp-cmp.c       |   4 +-
 arch/mips/kernel/smp-cps.c       |   4 +-
 arch/mips/kernel/smp-gic.c       |  64 -----------
 arch/mips/kernel/smp-mt.c        |   2 +-
 arch/mips/kernel/smp.c           | 117 ++++++++++++++++++++
 drivers/irqchip/Kconfig          |   2 +
 drivers/irqchip/irq-mips-gic.c   | 225 ++++++++++++++++++++++++---------------
 include/linux/irq.h              |  43 ++++++++
 include/linux/irqchip/mips-gic.h |   3 -
 include/linux/irqdomain.h        |  19 ++++
 kernel/irq/Kconfig               |   4 +
 kernel/irq/irqdomain.c           |  84 +++++++++++++++
 kernel/irq/manage.c              | 103 ++++++++++++++++++
 16 files changed, 517 insertions(+), 169 deletions(-)
 delete mode 100644 arch/mips/kernel/smp-gic.c

-- 
2.1.0

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [next] | [standalone]


#1245548 — [RFC v2 PATCH 03/14] irq: add new struct ipi_mask

FromQais Yousef <qais.yousef@imgtec.com>
Date2015-10-13 12:20 +0200
Subject[RFC v2 PATCH 03/14] irq: add new struct ipi_mask
Message-ID<qj4QA-3vO-45@gated-at.bofh.it>
In reply to#1245547
cpumask is limited to NR_CPUS. introduce ipi_mask which allows us to address
cpu range that is higher than NR_CPUS which is required for drivers to send
IPIs for coprocessor that are outside Linux CPU range.

Signed-off-by: Qais Yousef <qais.yousef@imgtec.com>
---
 include/linux/irq.h | 15 +++++++++++++++
 1 file changed, 15 insertions(+)

diff --git a/include/linux/irq.h b/include/linux/irq.h
index 11bf09288ddb..4b537e4d393b 100644
--- a/include/linux/irq.h
+++ b/include/linux/irq.h
@@ -125,6 +125,21 @@ enum {
 struct msi_desc;
 struct irq_domain;
 
+ /**
+ * struct ipi_mask - IPI mask information
+ * @cpumask: bitmap of cpumasks
+ * @nbits: number of bits in cpumask
+ * @global: whether the mask is SMP IPI ie: subset of cpu_possible_mask or not
+ *
+ * ipi_mask is similar to cpumask, but it provides nbits that's configurable
+ * rather than fixed to NR_CPUS.
+ */
+struct ipi_mask {
+	unsigned long	*cpumask;
+	unsigned int	nbits;
+	bool		global;
+};
+
 /**
  * struct irq_common_data - per irq data shared by all irqchips
  * @state_use_accessors: status information for irq chip functions.
-- 
2.1.0

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [next] | [standalone]


#1245708 — Re: [RFC v2 PATCH 03/14] irq: add new struct ipi_mask

FromThomas Gleixner <tglx@linutronix.de>
Date2015-10-13 15:30 +0200
SubjectRe: [RFC v2 PATCH 03/14] irq: add new struct ipi_mask
Message-ID<qj7Oq-7Q1-35@gated-at.bofh.it>
In reply to#1245548
On Tue, 13 Oct 2015, Qais Yousef wrote:
> cpumask is limited to NR_CPUS. introduce ipi_mask which allows us to address
> cpu range that is higher than NR_CPUS which is required for drivers to send
> IPIs for coprocessor that are outside Linux CPU range.
> 
> Signed-off-by: Qais Yousef <qais.yousef@imgtec.com>
> ---
>  include/linux/irq.h | 15 +++++++++++++++
>  1 file changed, 15 insertions(+)
> 
> diff --git a/include/linux/irq.h b/include/linux/irq.h
> index 11bf09288ddb..4b537e4d393b 100644
> --- a/include/linux/irq.h
> +++ b/include/linux/irq.h
> @@ -125,6 +125,21 @@ enum {
>  struct msi_desc;
>  struct irq_domain;
>  
> + /**
> + * struct ipi_mask - IPI mask information
> + * @cpumask: bitmap of cpumasks
> + * @nbits: number of bits in cpumask
> + * @global: whether the mask is SMP IPI ie: subset of cpu_possible_mask or not
> + *
> + * ipi_mask is similar to cpumask, but it provides nbits that's configurable
> + * rather than fixed to NR_CPUS.
> + */
> +struct ipi_mask {
> +	unsigned long	*cpumask;
> +	unsigned int	nbits;
> +	bool		global;
> +};

Can you make that:

struct ipi_mask {
	unsigned int	nbits;
	bool		global;
	unsigned long	cpu_bitmap[];
};

That allows you to allocate the data structure in one go. So the
ipi_mask in irq_data_common becomes a pointer which is only filled in
when ipi_mask is actually used.

Note, I renamed cpumask to cpu_bitmap to avoid confusion with
cpumasks.

We also want a helper function

   struct cpumask *irq_data_get_ipi_mask(struct irq_data *data);

so we can use normal cpumask operations for the majority of cases.

Thanks,

	tglx

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [next] | [standalone]


#1245781 — Re: [RFC v2 PATCH 03/14] irq: add new struct ipi_mask

FromQais Yousef <qais.yousef@imgtec.com>
Date2015-10-13 16:30 +0200
SubjectRe: [RFC v2 PATCH 03/14] irq: add new struct ipi_mask
Message-ID<qj8Kv-KS-27@gated-at.bofh.it>
In reply to#1245708
On 10/13/2015 02:26 PM, Thomas Gleixner wrote:
> On Tue, 13 Oct 2015, Qais Yousef wrote:
>> cpumask is limited to NR_CPUS. introduce ipi_mask which allows us to address
>> cpu range that is higher than NR_CPUS which is required for drivers to send
>> IPIs for coprocessor that are outside Linux CPU range.
>>
>> Signed-off-by: Qais Yousef <qais.yousef@imgtec.com>
>> ---
>>   include/linux/irq.h | 15 +++++++++++++++
>>   1 file changed, 15 insertions(+)
>>
>> diff --git a/include/linux/irq.h b/include/linux/irq.h
>> index 11bf09288ddb..4b537e4d393b 100644
>> --- a/include/linux/irq.h
>> +++ b/include/linux/irq.h
>> @@ -125,6 +125,21 @@ enum {
>>   struct msi_desc;
>>   struct irq_domain;
>>   
>> + /**
>> + * struct ipi_mask - IPI mask information
>> + * @cpumask: bitmap of cpumasks
>> + * @nbits: number of bits in cpumask
>> + * @global: whether the mask is SMP IPI ie: subset of cpu_possible_mask or not
>> + *
>> + * ipi_mask is similar to cpumask, but it provides nbits that's configurable
>> + * rather than fixed to NR_CPUS.
>> + */
>> +struct ipi_mask {
>> +	unsigned long	*cpumask;
>> +	unsigned int	nbits;
>> +	bool		global;
>> +};
> Can you make that:
>
> struct ipi_mask {
> 	unsigned int	nbits;
> 	bool		global;
> 	unsigned long	cpu_bitmap[];
> };
>
> That allows you to allocate the data structure in one go. So the
> ipi_mask in irq_data_common becomes a pointer which is only filled in
> when ipi_mask is actually used.
>
> Note, I renamed cpumask to cpu_bitmap to avoid confusion with
> cpumasks.
>
> We also want a helper function
>
>     struct cpumask *irq_data_get_ipi_mask(struct irq_data *data);
>
> so we can use normal cpumask operations for the majority of cases.
>
>

Will do.

Thanks,
Qais
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [next] | [standalone]


#1245550 — [RFC v2 PATCH 08/14] irq: implement irq_send_ipi

FromQais Yousef <qais.yousef@imgtec.com>
Date2015-10-13 12:20 +0200
Subject[RFC v2 PATCH 08/14] irq: implement irq_send_ipi
Message-ID<qj4QA-3vO-47@gated-at.bofh.it>
In reply to#1245547
There are 2 variants. __irq_desc_send_ipi() is meant to be used by arch code to
save the desc lookup when doing SMP IPIs.

irq_send_ipi() is meant for drivers that want to send IPIs to coprocessors they
interact with.

Signed-off-by: Qais Yousef <qais.yousef@imgtec.com>
---
 include/linux/irq.h |  3 +++
 kernel/irq/manage.c | 44 ++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 47 insertions(+)

diff --git a/include/linux/irq.h b/include/linux/irq.h
index c3d0f26c3eff..32c740ac95b4 100644
--- a/include/linux/irq.h
+++ b/include/linux/irq.h
@@ -985,4 +985,7 @@ int irq_map_ipi(struct ipi_mapping *map,
 int irq_unmap_ipi(struct ipi_mapping *map,
 		  unsigned int cpu, irq_hw_number_t *hwirq);
 
+int __irq_desc_send_ipi(struct irq_desc *desc, const struct ipi_mask *dest);
+int irq_send_ipi(unsigned int virq, const struct ipi_mask *dest);
+
 #endif /* _LINUX_IRQ_H */
diff --git a/kernel/irq/manage.c b/kernel/irq/manage.c
index 9a9bc0822c8f..f2425116a243 100644
--- a/kernel/irq/manage.c
+++ b/kernel/irq/manage.c
@@ -1983,3 +1983,47 @@ int irq_unmap_ipi(struct ipi_mapping *map,
 
 	return 0;
 }
+
+int __irq_desc_send_ipi(struct irq_desc *desc, const struct ipi_mask *dest)
+{
+	struct irq_data *data = irq_desc_get_irq_data(desc);
+	struct irq_chip *chip = irq_data_get_irq_chip(data);
+
+	if (!chip || !chip->irq_send_ipi)
+		return -EINVAL;
+
+	/*
+	 * Do not validate the mask for IPIs marked global. These are
+	 * regular IPIs so we can avoid the operation as their target
+	 * mask is the cpu_possible_mask.
+	 */
+	if (!dest->global) {
+		if (!bitmap_subset(dest->cpumask, data->ipi_mask.cpumask,
+				   dest->nbits))
+			return -EINVAL;
+	}
+
+	chip->irq_send_ipi(data, dest);
+	return 0;
+}
+
+/**
+ * irq_send_ipi() - send an IPI to target CPU(s)
+ * @irq: linux irq number from irq_reserve_ipi()
+ * @dest: dest CPU(s), must be the same or a subset of the mask passed to
+ *	  irq_reserve_ipi()
+ *
+ * Sends an IPI to all cpus in dest mask.
+ *
+ * Returns 0 on success and errno otherwise..
+ */
+int irq_send_ipi(unsigned int virq, const struct ipi_mask *dest)
+{
+	struct irq_desc *desc = irq_to_desc(virq);
+
+	if (!desc)
+		return -EINVAL;
+
+	return __irq_desc_send_ipi(desc, dest);
+}
+EXPORT_SYMBOL(irq_send_ipi);
-- 
2.1.0

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [next] | [standalone]


#1245604 — Re: [RFC v2 PATCH 08/14] irq: implement irq_send_ipi

Fromkbuild test robot <lkp@intel.com>
Date2015-10-13 13:20 +0200
SubjectRe: [RFC v2 PATCH 08/14] irq: implement irq_send_ipi
Message-ID<qj5MC-4UT-11@gated-at.bofh.it>
In reply to#1245550

[Multipart message — attachments visible in raw view] — view raw

Hi Qais,

[auto build test ERROR on v4.3-rc5 -- if it's inappropriate base, please suggest rules for selecting the more suitable base]

url:    https://github.com/0day-ci/linux/commits/Qais-Yousef/Implement-generic-IPI-support-mechanism/20151013-182314
config: x86_64-allnoconfig (attached as .config)
reproduce:
        # save the attached .config to linux build tree
        make ARCH=x86_64 

All errors (new ones prefixed by >>):

   kernel/irq/manage.c: In function '__irq_desc_send_ipi':
>> kernel/irq/manage.c:2001:41: error: 'struct irq_data' has no member named 'ipi_mask'
      if (!bitmap_subset(dest->cpumask, data->ipi_mask.cpumask,
                                            ^

vim +2001 kernel/irq/manage.c

  1995		/*
  1996		 * Do not validate the mask for IPIs marked global. These are
  1997		 * regular IPIs so we can avoid the operation as their target
  1998		 * mask is the cpu_possible_mask.
  1999		 */
  2000		if (!dest->global) {
> 2001			if (!bitmap_subset(dest->cpumask, data->ipi_mask.cpumask,
  2002					   dest->nbits))
  2003				return -EINVAL;
  2004		}

---
0-DAY kernel test infrastructure                Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all                   Intel Corporation

[toc] | [prev] | [next] | [standalone]


#1245619 — Re: [RFC v2 PATCH 08/14] irq: implement irq_send_ipi

Fromkbuild test robot <lkp@intel.com>
Date2015-10-13 13:40 +0200
SubjectRe: [RFC v2 PATCH 08/14] irq: implement irq_send_ipi
Message-ID<qj65X-5h7-11@gated-at.bofh.it>
In reply to#1245550

[Multipart message — attachments visible in raw view] — view raw

Hi Qais,

[auto build test WARNING on v4.3-rc5 -- if it's inappropriate base, please suggest rules for selecting the more suitable base]

url:    https://github.com/0day-ci/linux/commits/Qais-Yousef/Implement-generic-IPI-support-mechanism/20151013-182314
config: x86_64-randconfig-s0-10131828 (attached as .config)
reproduce:
        # save the attached .config to linux build tree
        make ARCH=x86_64 

All warnings (new ones prefixed by >>):

   In file included from include/uapi/linux/stddef.h:1:0,
                    from include/linux/stddef.h:4,
                    from include/uapi/linux/posix_types.h:4,
                    from include/uapi/linux/types.h:13,
                    from include/linux/types.h:5,
                    from include/linux/smp.h:10,
                    from include/linux/irq.h:12,
                    from kernel/irq/manage.c:12:
   kernel/irq/manage.c: In function '__irq_desc_send_ipi':
   kernel/irq/manage.c:2001:41: error: 'struct irq_data' has no member named 'ipi_mask'
      if (!bitmap_subset(dest->cpumask, data->ipi_mask.cpumask,
                                            ^
   include/linux/compiler.h:147:28: note: in definition of macro '__trace_if'
     if (__builtin_constant_p((cond)) ? !!(cond) :   \
                               ^
>> kernel/irq/manage.c:2001:3: note: in expansion of macro 'if'
      if (!bitmap_subset(dest->cpumask, data->ipi_mask.cpumask,
      ^
   kernel/irq/manage.c:2001:41: error: 'struct irq_data' has no member named 'ipi_mask'
      if (!bitmap_subset(dest->cpumask, data->ipi_mask.cpumask,
                                            ^
   include/linux/compiler.h:147:40: note: in definition of macro '__trace_if'
     if (__builtin_constant_p((cond)) ? !!(cond) :   \
                                           ^
>> kernel/irq/manage.c:2001:3: note: in expansion of macro 'if'
      if (!bitmap_subset(dest->cpumask, data->ipi_mask.cpumask,
      ^
   kernel/irq/manage.c:2001:41: error: 'struct irq_data' has no member named 'ipi_mask'
      if (!bitmap_subset(dest->cpumask, data->ipi_mask.cpumask,
                                            ^
   include/linux/compiler.h:158:16: note: in definition of macro '__trace_if'
      ______r = !!(cond);     \
                   ^
>> kernel/irq/manage.c:2001:3: note: in expansion of macro 'if'
      if (!bitmap_subset(dest->cpumask, data->ipi_mask.cpumask,
      ^

vim +/if +2001 kernel/irq/manage.c

  1985	}
  1986	
  1987	int __irq_desc_send_ipi(struct irq_desc *desc, const struct ipi_mask *dest)
  1988	{
  1989		struct irq_data *data = irq_desc_get_irq_data(desc);
  1990		struct irq_chip *chip = irq_data_get_irq_chip(data);
  1991	
  1992		if (!chip || !chip->irq_send_ipi)
  1993			return -EINVAL;
  1994	
  1995		/*
  1996		 * Do not validate the mask for IPIs marked global. These are
  1997		 * regular IPIs so we can avoid the operation as their target
  1998		 * mask is the cpu_possible_mask.
  1999		 */
  2000		if (!dest->global) {
> 2001			if (!bitmap_subset(dest->cpumask, data->ipi_mask.cpumask,
  2002					   dest->nbits))
  2003				return -EINVAL;
  2004		}
  2005	
  2006		chip->irq_send_ipi(data, dest);
  2007		return 0;
  2008	}
  2009	

---
0-DAY kernel test infrastructure                Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all                   Intel Corporation

[toc] | [prev] | [next] | [standalone]


#1245723 — Re: [RFC v2 PATCH 08/14] irq: implement irq_send_ipi

FromThomas Gleixner <tglx@linutronix.de>
Date2015-10-13 15:50 +0200
SubjectRe: [RFC v2 PATCH 08/14] irq: implement irq_send_ipi
Message-ID<qj87M-8dT-5@gated-at.bofh.it>
In reply to#1245550
On Tue, 13 Oct 2015, Qais Yousef wrote:

Lacks kerneldoc

> +int __irq_desc_send_ipi(struct irq_desc *desc, const struct ipi_mask *dest)
> +{
> +	struct irq_data *data = irq_desc_get_irq_data(desc);
> +	struct irq_chip *chip = irq_data_get_irq_chip(data);
> +
> +	if (!chip || !chip->irq_send_ipi)
> +		return -EINVAL;
> +
> +	/*
> +	 * Do not validate the mask for IPIs marked global. These are
> +	 * regular IPIs so we can avoid the operation as their target
> +	 * mask is the cpu_possible_mask.
> +	 */
> +	if (!dest->global) {
> +		if (!bitmap_subset(dest->cpumask, data->ipi_mask.cpumask,
> +				   dest->nbits))
> +			return -EINVAL;
> +	}

This looks half thought out. You rely on the caller getting the global
bit right. There should be a sanity check for this versus
data->ipi_mask and also you need to validate nbits.

> +EXPORT_SYMBOL(irq_send_ipi);

EXPORT_SYMBOL_GPL please

Thanks,

	tglx
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [next] | [standalone]


#1245806 — Re: [RFC v2 PATCH 08/14] irq: implement irq_send_ipi

FromQais Yousef <qais.yousef@imgtec.com>
Date2015-10-13 16:50 +0200
SubjectRe: [RFC v2 PATCH 08/14] irq: implement irq_send_ipi
Message-ID<qj93R-18p-41@gated-at.bofh.it>
In reply to#1245723
On 10/13/2015 02:40 PM, Thomas Gleixner wrote:
> On Tue, 13 Oct 2015, Qais Yousef wrote:
>
> Lacks kerneldoc
>
>> +int __irq_desc_send_ipi(struct irq_desc *desc, const struct ipi_mask *dest)
>> +{
>> +	struct irq_data *data = irq_desc_get_irq_data(desc);
>> +	struct irq_chip *chip = irq_data_get_irq_chip(data);
>> +
>> +	if (!chip || !chip->irq_send_ipi)
>> +		return -EINVAL;
>> +
>> +	/*
>> +	 * Do not validate the mask for IPIs marked global. These are
>> +	 * regular IPIs so we can avoid the operation as their target
>> +	 * mask is the cpu_possible_mask.
>> +	 */
>> +	if (!dest->global) {
>> +		if (!bitmap_subset(dest->cpumask, data->ipi_mask.cpumask,
>> +				   dest->nbits))
>> +			return -EINVAL;
>> +	}
> This looks half thought out. You rely on the caller getting the global
> bit right. There should be a sanity check for this versus
> data->ipi_mask and also you need to validate nbits.

Yes I might have rushed this part as I did it last. I'll improve it.

>
>> +EXPORT_SYMBOL(irq_send_ipi);
> EXPORT_SYMBOL_GPL please
>
>

OK.

Thanks,
Qais
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [next] | [standalone]


#1245746

FromThomas Gleixner <tglx@linutronix.de>
Date2015-10-13 16:00 +0200
Message-ID<qj8hs-8pd-31@gated-at.bofh.it>
In reply to#1245547
On Tue, 13 Oct 2015, Qais Yousef wrote:

> This series is based on Linus tree. I couldn't compile test it
> because MIPS compilation was broken due to other reasons. I expect
> some brokeness because of the introduction of struct irq_common_data
> which is not present on the 4.1 tree I was testing my code on before
> porting it to Linus tip. I will fix these issues and introduce
> proper accessors for accessing struct ipi_mask given that the
> concept is approved.

Please base it on 4.1-rc5 + irq/core.
 
>   irq: add new IRQ_DOMAIN_FLAGS_IPI

The proper prefix for the core parts is 'genirq:'. Please start the
sentence after the prefix with an uppercase letter

>   irq: add GENERIC_IRQ_IPI Kconfig symbol
>   irq: add new struct ipi_mask
>   irq: add a new irq_send_ipi() to irq_chip
>   irq: add struct ipi_mask to irq_data
>   irq: add struct ipi_mapping and its helper functions
>   irq: add a new generic IPI reservation code to irq core
>   irq: implement irq_send_ipi
>   MIPS: add support for generic SMP IPI support
>   MIPS: make smp CMP, CPS and MT use the new generic IPI functions
>   MIPS: delete smp-gic.c
>   irqchip: mips-gic: add a IPI hierarchy domain

Please make that

irqchip/mips-gic: Add ....

Thanks,

	tglx
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [next] | [standalone]


#1245804

FromQais Yousef <qais.yousef@imgtec.com>
Date2015-10-13 16:50 +0200
Message-ID<qj93Q-18p-31@gated-at.bofh.it>
In reply to#1245746
On 10/13/2015 02:53 PM, Thomas Gleixner wrote:
> On Tue, 13 Oct 2015, Qais Yousef wrote:
>
>> This series is based on Linus tree. I couldn't compile test it
>> because MIPS compilation was broken due to other reasons. I expect
>> some brokeness because of the introduction of struct irq_common_data
>> which is not present on the 4.1 tree I was testing my code on before
>> porting it to Linus tip. I will fix these issues and introduce
>> proper accessors for accessing struct ipi_mask given that the
>> concept is approved.
> Please base it on 4.1-rc5 + irq/core.
>   
>>    irq: add new IRQ_DOMAIN_FLAGS_IPI
> The proper prefix for the core parts is 'genirq:'. Please start the
> sentence after the prefix with an uppercase letter
>
>>    irq: add GENERIC_IRQ_IPI Kconfig symbol
>>    irq: add new struct ipi_mask
>>    irq: add a new irq_send_ipi() to irq_chip
>>    irq: add struct ipi_mask to irq_data
>>    irq: add struct ipi_mapping and its helper functions
>>    irq: add a new generic IPI reservation code to irq core
>>    irq: implement irq_send_ipi
>>    MIPS: add support for generic SMP IPI support
>>    MIPS: make smp CMP, CPS and MT use the new generic IPI functions
>>    MIPS: delete smp-gic.c
>>    irqchip: mips-gic: add a IPI hierarchy domain
> Please make that
>
> irqchip/mips-gic: Add ....
>
>


Will do. Thanks a lot for the review and all the pointers. I need to 
revive the DT binding discussion now, in the proper list this time.

Thanks,
Qais
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [next] | [standalone]


#1245938

FromSergei Shtylyov <sergei.shtylyov@cogentembedded.com>
Date2015-10-13 19:30 +0200
Message-ID<qjbyF-4SC-9@gated-at.bofh.it>
In reply to#1245746
Hello.

On 10/13/2015 04:53 PM, Thomas Gleixner wrote:

>> This series is based on Linus tree. I couldn't compile test it
>> because MIPS compilation was broken due to other reasons. I expect
>> some brokeness because of the introduction of struct irq_common_data
>> which is not present on the 4.1 tree I was testing my code on before
>> porting it to Linus tip. I will fix these issues and introduce
>> proper accessors for accessing struct ipi_mask given that the
>> concept is approved.
>
> Please base it on 4.1-rc5 + irq/core.

    On 4.3-rc5, you mean?

MBR, Sergei

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [next] | [standalone]


#1245943

FromThomas Gleixner <tglx@linutronix.de>
Date2015-10-13 19:30 +0200
Message-ID<qjbyG-4SC-27@gated-at.bofh.it>
In reply to#1245938
On Tue, 13 Oct 2015, Sergei Shtylyov wrote:
> On 10/13/2015 04:53 PM, Thomas Gleixner wrote:
> > 
> > Please base it on 4.1-rc5 + irq/core.
> 
>    On 4.3-rc5, you mean?

Indeed!


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [next] | [standalone]


#1246873

FromDavidlohr Bueso <dave@stgolabs.net>
Date2015-10-14 17:10 +0200
Message-ID<qjvQK-2a2-15@gated-at.bofh.it>
In reply to#1245547
On Tue, 13 Oct 2015, Qais Yousef wrote:

>Qais Yousef (14):
>  irq: add new IRQ_DOMAIN_FLAGS_IPI
>  irq: add GENERIC_IRQ_IPI Kconfig symbol
>  irq: add new struct ipi_mask
>  irq: add a new irq_send_ipi() to irq_chip
>  irq: add struct ipi_mask to irq_data
>  irq: add struct ipi_mapping and its helper functions
>  irq: add a new generic IPI reservation code to irq core
>  irq: implement irq_send_ipi
>  MIPS: add support for generic SMP IPI support
>  MIPS: make smp CMP, CPS and MT use the new generic IPI functions
>  MIPS: delete smp-gic.c
>  irqchip: mips-gic: add a IPI hierarchy domain
>  irqchip: mips-gic: implement the new irq_send_ipi
>  irqchip: mips-gic: remove IPI init code
>
> arch/mips/Kconfig                |   6 --
> arch/mips/include/asm/smp-ops.h  |   5 +-
> arch/mips/kernel/Makefile        |   1 -
> arch/mips/kernel/smp-cmp.c       |   4 +-
> arch/mips/kernel/smp-cps.c       |   4 +-
> arch/mips/kernel/smp-gic.c       |  64 -----------
> arch/mips/kernel/smp-mt.c        |   2 +-
> arch/mips/kernel/smp.c           | 117 ++++++++++++++++++++
> drivers/irqchip/Kconfig          |   2 +
> drivers/irqchip/irq-mips-gic.c   | 225 ++++++++++++++++++++++++---------------
> include/linux/irq.h              |  43 ++++++++
> include/linux/irqchip/mips-gic.h |   3 -
> include/linux/irqdomain.h        |  19 ++++
> kernel/irq/Kconfig               |   4 +
> kernel/irq/irqdomain.c           |  84 +++++++++++++++
> kernel/irq/manage.c              | 103 ++++++++++++++++++
> 16 files changed, 517 insertions(+), 169 deletions(-)
> delete mode 100644 arch/mips/kernel/smp-gic.c

It strikes me that Documentation/ should at least get _some_ love. Perhaps IRQ-ipi.txt? I dunno...

Thanks,
Davidlohr
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [next] | [standalone]


#1246928

FromQais Yousef <qais.yousef@imgtec.com>
Date2015-10-14 17:50 +0200
Message-ID<qjwts-2XK-27@gated-at.bofh.it>
In reply to#1246873
On 10/14/2015 04:04 PM, Davidlohr Bueso wrote:
> On Tue, 13 Oct 2015, Qais Yousef wrote:
>
>> Qais Yousef (14):
>>  irq: add new IRQ_DOMAIN_FLAGS_IPI
>>  irq: add GENERIC_IRQ_IPI Kconfig symbol
>>  irq: add new struct ipi_mask
>>  irq: add a new irq_send_ipi() to irq_chip
>>  irq: add struct ipi_mask to irq_data
>>  irq: add struct ipi_mapping and its helper functions
>>  irq: add a new generic IPI reservation code to irq core
>>  irq: implement irq_send_ipi
>>  MIPS: add support for generic SMP IPI support
>>  MIPS: make smp CMP, CPS and MT use the new generic IPI functions
>>  MIPS: delete smp-gic.c
>>  irqchip: mips-gic: add a IPI hierarchy domain
>>  irqchip: mips-gic: implement the new irq_send_ipi
>>  irqchip: mips-gic: remove IPI init code
>>
>> arch/mips/Kconfig                |   6 --
>> arch/mips/include/asm/smp-ops.h  |   5 +-
>> arch/mips/kernel/Makefile        |   1 -
>> arch/mips/kernel/smp-cmp.c       |   4 +-
>> arch/mips/kernel/smp-cps.c       |   4 +-
>> arch/mips/kernel/smp-gic.c       |  64 -----------
>> arch/mips/kernel/smp-mt.c        |   2 +-
>> arch/mips/kernel/smp.c           | 117 ++++++++++++++++++++
>> drivers/irqchip/Kconfig          |   2 +
>> drivers/irqchip/irq-mips-gic.c   | 225 
>> ++++++++++++++++++++++++---------------
>> include/linux/irq.h              |  43 ++++++++
>> include/linux/irqchip/mips-gic.h |   3 -
>> include/linux/irqdomain.h        |  19 ++++
>> kernel/irq/Kconfig               |   4 +
>> kernel/irq/irqdomain.c           |  84 +++++++++++++++
>> kernel/irq/manage.c              | 103 ++++++++++++++++++
>> 16 files changed, 517 insertions(+), 169 deletions(-)
>> delete mode 100644 arch/mips/kernel/smp-gic.c
>
> It strikes me that Documentation/ should at least get _some_ love. 
> Perhaps IRQ-ipi.txt? I dunno...

Since this was an RFC I didn't update documentation without first making 
sure the changes are OK. In the next series I'll add the documentation 
changes.

Thanks for pointing it out though. I could have missed it in the next 
series to be honest as I'm getting more focused on the small details :)

Thanks,
Qais
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web