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


Groups > linux.kernel > #1281714 > unrolled thread

[PATCH v3 14/19] irqchip/mips-gic: Use gic_vpes instead of NR_CPUS

Started byQais Yousef <qais.yousef@imgtec.com>
First post2015-12-02 13:30 +0100
Last post2015-12-03 11:00 +0100
Articles 3 — 2 participants

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  [PATCH v3 14/19] irqchip/mips-gic: Use gic_vpes instead of NR_CPUS Qais Yousef <qais.yousef@imgtec.com> - 2015-12-02 13:30 +0100
    Re: [PATCH v3 14/19] irqchip/mips-gic: Use gic_vpes instead of  NR_CPUS Sergei Shtylyov <sergei.shtylyov@cogentembedded.com> - 2015-12-02 19:30 +0100
      Re: [PATCH v3 14/19] irqchip/mips-gic: Use gic_vpes instead of  NR_CPUS Qais Yousef <qais.yousef@imgtec.com> - 2015-12-03 11:00 +0100

#1281714 — [PATCH v3 14/19] irqchip/mips-gic: Use gic_vpes instead of NR_CPUS

FromQais Yousef <qais.yousef@imgtec.com>
Date2015-12-02 13:30 +0100
Subject[PATCH v3 14/19] irqchip/mips-gic: Use gic_vpes instead of NR_CPUS
Message-ID<qBeHM-76w-7@gated-at.bofh.it>
NR_CPUS is set by Kconfig and could be much higher than what actually is in the
system.

gic_vpes should be a true representitives of the number of cpus in the system,
so use it instead.

Signed-off-by: Qais Yousef <qais.yousef@imgtec.com>
---
 drivers/irqchip/irq-mips-gic.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/irqchip/irq-mips-gic.c b/drivers/irqchip/irq-mips-gic.c
index 41ccc84c68ba..c24feb739bb3 100644
--- a/drivers/irqchip/irq-mips-gic.c
+++ b/drivers/irqchip/irq-mips-gic.c
@@ -452,7 +452,7 @@ static int gic_set_affinity(struct irq_data *d, const struct cpumask *cpumask,
 	gic_map_to_vpe(irq, mips_cm_vp_id(cpumask_first(&tmp)));
 
 	/* Update the pcpu_masks */
-	for (i = 0; i < NR_CPUS; i++)
+	for (i = 0; i < gic_vpes; i++)
 		clear_bit(irq, pcpu_masks[i].pcpu_mask);
 	set_bit(irq, pcpu_masks[cpumask_first(&tmp)].pcpu_mask);
 
@@ -1084,7 +1084,7 @@ static void __init __gic_init(unsigned long gic_base_addr,
 	gic_ipi_domain->bus_token = DOMAIN_BUS_IPI;
 
 	/* Make the last 2 * NR_CPUS available for IPIs */
-	bitmap_set(ipi_resrv, gic_shared_intrs - 2 * NR_CPUS, 2 * NR_CPUS);
+	bitmap_set(ipi_resrv, gic_shared_intrs - 2 * gic_vpes, 2 * gic_vpes);
 
 	gic_basic_init();
 
-- 
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]


#1282248 — Re: [PATCH v3 14/19] irqchip/mips-gic: Use gic_vpes instead of NR_CPUS

FromSergei Shtylyov <sergei.shtylyov@cogentembedded.com>
Date2015-12-02 19:30 +0100
SubjectRe: [PATCH v3 14/19] irqchip/mips-gic: Use gic_vpes instead of NR_CPUS
Message-ID<qBkk9-2qa-1@gated-at.bofh.it>
In reply to#1281714
Hello.

On 12/02/2015 03:21 PM, Qais Yousef wrote:

> NR_CPUS is set by Kconfig and could be much higher than what actually is in the
> system.
>
> gic_vpes should be a true representitives of the number of cpus in the system,
> so use it instead.
>
> Signed-off-by: Qais Yousef <qais.yousef@imgtec.com>
> ---
>   drivers/irqchip/irq-mips-gic.c | 4 ++--
>   1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/irqchip/irq-mips-gic.c b/drivers/irqchip/irq-mips-gic.c
> index 41ccc84c68ba..c24feb739bb3 100644
> --- a/drivers/irqchip/irq-mips-gic.c
> +++ b/drivers/irqchip/irq-mips-gic.c
[...]
> @@ -1084,7 +1084,7 @@ static void __init __gic_init(unsigned long gic_base_addr,
>   	gic_ipi_domain->bus_token = DOMAIN_BUS_IPI;
>
>   	/* Make the last 2 * NR_CPUS available for IPIs */

    Looks like you forgot to also change this comment...

> -	bitmap_set(ipi_resrv, gic_shared_intrs - 2 * NR_CPUS, 2 * NR_CPUS);
> +	bitmap_set(ipi_resrv, gic_shared_intrs - 2 * gic_vpes, 2 * gic_vpes);
>
>   	gic_basic_init();
>

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]


#1282876 — Re: [PATCH v3 14/19] irqchip/mips-gic: Use gic_vpes instead of NR_CPUS

FromQais Yousef <qais.yousef@imgtec.com>
Date2015-12-03 11:00 +0100
SubjectRe: [PATCH v3 14/19] irqchip/mips-gic: Use gic_vpes instead of NR_CPUS
Message-ID<qByQ9-3g4-5@gated-at.bofh.it>
In reply to#1282248
On 12/02/2015 06:28 PM, Sergei Shtylyov wrote:
>
>> @@ -1084,7 +1084,7 @@ static void __init __gic_init(unsigned long 
>> gic_base_addr,
>>       gic_ipi_domain->bus_token = DOMAIN_BUS_IPI;
>>
>>       /* Make the last 2 * NR_CPUS available for IPIs */
>
>    Looks like you forgot to also change this comment...

This code changes again in a later patch with the correct comment on. 
I'll fix it in the next series.

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