diff mbox series

irqchip/sifive-plic: Remove incorrect requirement about number of irq contexts

Message ID 20200512172636.96299-1-atish.patra@wdc.com (mailing list archive)
State New, archived
Headers show
Series irqchip/sifive-plic: Remove incorrect requirement about number of irq contexts | expand

Commit Message

Atish Patra May 12, 2020, 5:26 p.m. UTC
From: "Wesley W. Terpstra" <wesley@sifive.com>

A PLIC may not be connected to all the cores. In that case, nr_contexts
may be less than num_possible_cpus. This requirement is only valid a single
PLIC is the only interrupt controller for the whole system.

Signed-off-by: Atish Patra <atish.patra@wdc.com>
[Atish: Modified the commit text]
Signed-off-by: "Wesley W. Terpstra" <wesley@sifive.com>
---
 drivers/irqchip/irq-sifive-plic.c | 2 --
 1 file changed, 2 deletions(-)

Comments

Palmer Dabbelt May 13, 2020, 9:34 p.m. UTC | #1
On Tue, 12 May 2020 10:26:36 PDT (-0700), Atish Patra wrote:
> From: "Wesley W. Terpstra" <wesley@sifive.com>
>
> A PLIC may not be connected to all the cores. In that case, nr_contexts
> may be less than num_possible_cpus. This requirement is only valid a single
> PLIC is the only interrupt controller for the whole system.
>
> Signed-off-by: Atish Patra <atish.patra@wdc.com>
> [Atish: Modified the commit text]
> Signed-off-by: "Wesley W. Terpstra" <wesley@sifive.com>
> ---
>  drivers/irqchip/irq-sifive-plic.c | 2 --
>  1 file changed, 2 deletions(-)
>
> diff --git a/drivers/irqchip/irq-sifive-plic.c b/drivers/irqchip/irq-sifive-plic.c
> index d0a71febdadc..822e074c0600 100644
> --- a/drivers/irqchip/irq-sifive-plic.c
> +++ b/drivers/irqchip/irq-sifive-plic.c
> @@ -301,8 +301,6 @@ static int __init plic_init(struct device_node *node,
>  	nr_contexts = of_irq_count(node);
>  	if (WARN_ON(!nr_contexts))
>  		goto out_iounmap;
> -	if (WARN_ON(nr_contexts < num_possible_cpus()))
> -		goto out_iounmap;
>
>  	error = -ENOMEM;
>  	priv->irqdomain = irq_domain_add_linear(node, nr_irqs + 1,

Reviewed-by: Palmer Dabbelt <palmerdabbelt@google.com>
Acked-by: Palmer Dabbelt <palmerdabbelt@google.com>

I'm assuming this is going through the irqchip tree.

Thanks!
diff mbox series

Patch

diff --git a/drivers/irqchip/irq-sifive-plic.c b/drivers/irqchip/irq-sifive-plic.c
index d0a71febdadc..822e074c0600 100644
--- a/drivers/irqchip/irq-sifive-plic.c
+++ b/drivers/irqchip/irq-sifive-plic.c
@@ -301,8 +301,6 @@  static int __init plic_init(struct device_node *node,
 	nr_contexts = of_irq_count(node);
 	if (WARN_ON(!nr_contexts))
 		goto out_iounmap;
-	if (WARN_ON(nr_contexts < num_possible_cpus()))
-		goto out_iounmap;
 
 	error = -ENOMEM;
 	priv->irqdomain = irq_domain_add_linear(node, nr_irqs + 1,