[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <d12fcee6-f83a-5b09-6208-face2ea5ec39@kaod.org>
Date: Tue, 24 Nov 2020 17:54:16 +0100
From: Cédric Le Goater <clg@...d.org>
To: Alexey Kardashevskiy <aik@...abs.ru>,
<linux-kernel@...r.kernel.org>
CC: Marc Zyngier <maz@...nel.org>, <x86@...nel.org>,
<linux-gpio@...r.kernel.org>, Oliver O'Halloran <oohall@...il.com>,
Frederic Barrat <fbarrat@...ux.ibm.com>,
Thomas Gleixner <tglx@...utronix.de>,
Michal Suchánek <msuchanek@...e.de>,
<linuxppc-dev@...ts.ozlabs.org>,
<linux-arm-kernel@...ts.infradead.org>,
Matt Redfearn <matt.redfearn@...s.com>,
Qais Yousef <qsyousef@...il.com>, <linux-mips@...ux-mips.org>
Subject: Re: [PATCH kernel v4 1/8] genirq/ipi: Simplify irq_reserve_ipi
On 11/24/20 7:17 AM, Alexey Kardashevskiy wrote:
> __irq_domain_alloc_irqs() can already handle virq==-1 and free
> descriptors if it failed allocating hardware interrupts so let's skip
> this extra step.
>
> Signed-off-by: Alexey Kardashevskiy <aik@...abs.ru>
LGTM,
Reviewed-by: Cédric Le Goater <clg@...d.org>
Copying the MIPS folks since the IPI interface is only used under arch/mips.
C.
> ---
> kernel/irq/ipi.c | 16 +++-------------
> 1 file changed, 3 insertions(+), 13 deletions(-)
>
> diff --git a/kernel/irq/ipi.c b/kernel/irq/ipi.c
> index 43e3d1be622c..1b2807318ea9 100644
> --- a/kernel/irq/ipi.c
> +++ b/kernel/irq/ipi.c
> @@ -75,18 +75,12 @@ int irq_reserve_ipi(struct irq_domain *domain,
> }
> }
>
> - virq = irq_domain_alloc_descs(-1, nr_irqs, 0, NUMA_NO_NODE, NULL);
> - if (virq <= 0) {
> - pr_warn("Can't reserve IPI, failed to alloc descs\n");
> - return -ENOMEM;
> - }
> -
> - virq = __irq_domain_alloc_irqs(domain, virq, nr_irqs, NUMA_NO_NODE,
> - (void *) dest, true, NULL);
> + virq = __irq_domain_alloc_irqs(domain, -1, nr_irqs, NUMA_NO_NODE,
> + (void *) dest, false, NULL);
>
> if (virq <= 0) {
> pr_warn("Can't reserve IPI, failed to alloc hw irqs\n");
> - goto free_descs;
> + return -EBUSY;
> }
>
> for (i = 0; i < nr_irqs; i++) {
> @@ -96,10 +90,6 @@ int irq_reserve_ipi(struct irq_domain *domain,
> irq_set_status_flags(virq + i, IRQ_NO_BALANCING);
> }
> return virq;
> -
> -free_descs:
> - irq_free_descs(virq, nr_irqs);
> - return -EBUSY;
> }
>
> /**
>
Powered by blists - more mailing lists