All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Cédric Le Goater" <clg@kaod.org>
To: Alexey Kardashevskiy <aik@ozlabs.ru>, <linux-kernel@vger.kernel.org>
Cc: "Marc Zyngier" <maz@kernel.org>,
	x86@kernel.org, linux-gpio@vger.kernel.org,
	"Oliver O'Halloran" <oohall@gmail.com>,
	"Frederic Barrat" <fbarrat@linux.ibm.com>,
	"Thomas Gleixner" <tglx@linutronix.de>,
	"Michal Suchánek" <msuchanek@suse.de>,
	linuxppc-dev@lists.ozlabs.org,
	linux-arm-kernel@lists.infradead.org,
	"Matt Redfearn" <matt.redfearn@mips.com>,
	"Qais Yousef" <qsyousef@gmail.com>,
	linux-mips@linux-mips.org
Subject: Re: [PATCH kernel v4 1/8] genirq/ipi: Simplify irq_reserve_ipi
Date: Tue, 24 Nov 2020 17:54:16 +0100	[thread overview]
Message-ID: <d12fcee6-f83a-5b09-6208-face2ea5ec39@kaod.org> (raw)
In-Reply-To: <20201124061720.86766-2-aik@ozlabs.ru>

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@ozlabs.ru>

LGTM,

Reviewed-by: Cédric Le Goater <clg@kaod.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;
>  }
>  
>  /**
> 


WARNING: multiple messages have this Message-ID (diff)
From: "Cédric Le Goater" <clg@kaod.org>
To: Alexey Kardashevskiy <aik@ozlabs.ru>, <linux-kernel@vger.kernel.org>
Cc: linux-mips@linux-mips.org,
	"Matt Redfearn" <matt.redfearn@mips.com>,
	"Qais Yousef" <qsyousef@gmail.com>,
	"Marc Zyngier" <maz@kernel.org>,
	x86@kernel.org, linux-gpio@vger.kernel.org,
	"Oliver O'Halloran" <oohall@gmail.com>,
	"Frederic Barrat" <fbarrat@linux.ibm.com>,
	"Thomas Gleixner" <tglx@linutronix.de>,
	"Michal Suchánek" <msuchanek@suse.de>,
	linuxppc-dev@lists.ozlabs.org,
	linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH kernel v4 1/8] genirq/ipi: Simplify irq_reserve_ipi
Date: Tue, 24 Nov 2020 17:54:16 +0100	[thread overview]
Message-ID: <d12fcee6-f83a-5b09-6208-face2ea5ec39@kaod.org> (raw)
In-Reply-To: <20201124061720.86766-2-aik@ozlabs.ru>

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@ozlabs.ru>

LGTM,

Reviewed-by: Cédric Le Goater <clg@kaod.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;
>  }
>  
>  /**
> 


WARNING: multiple messages have this Message-ID (diff)
From: "Cédric Le Goater" <clg@kaod.org>
To: Alexey Kardashevskiy <aik@ozlabs.ru>, <linux-kernel@vger.kernel.org>
Cc: linux-mips@linux-mips.org,
	"Matt Redfearn" <matt.redfearn@mips.com>,
	"Qais Yousef" <qsyousef@gmail.com>,
	"Marc Zyngier" <maz@kernel.org>,
	x86@kernel.org, linux-gpio@vger.kernel.org,
	"Oliver O'Halloran" <oohall@gmail.com>,
	"Frederic Barrat" <fbarrat@linux.ibm.com>,
	"Thomas Gleixner" <tglx@linutronix.de>,
	"Michal Suchánek" <msuchanek@suse.de>,
	linuxppc-dev@lists.ozlabs.org,
	linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH kernel v4 1/8] genirq/ipi: Simplify irq_reserve_ipi
Date: Tue, 24 Nov 2020 17:54:16 +0100	[thread overview]
Message-ID: <d12fcee6-f83a-5b09-6208-face2ea5ec39@kaod.org> (raw)
In-Reply-To: <20201124061720.86766-2-aik@ozlabs.ru>

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@ozlabs.ru>

LGTM,

Reviewed-by: Cédric Le Goater <clg@kaod.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;
>  }
>  
>  /**
> 


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

  reply	other threads:[~2020-11-24 17:32 UTC|newest]

Thread overview: 51+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-11-24  6:17 [PATCH kernel v4 0/8] genirq/irqdomain: Add reference counting to IRQs Alexey Kardashevskiy
2020-11-24  6:17 ` Alexey Kardashevskiy
2020-11-24  6:17 ` Alexey Kardashevskiy
2020-11-24  6:17 ` [PATCH kernel v4 1/8] genirq/ipi: Simplify irq_reserve_ipi Alexey Kardashevskiy
2020-11-24  6:17   ` Alexey Kardashevskiy
2020-11-24  6:17   ` Alexey Kardashevskiy
2020-11-24 16:54   ` Cédric Le Goater [this message]
2020-11-24 16:54     ` Cédric Le Goater
2020-11-24 16:54     ` Cédric Le Goater
2020-11-24  6:17 ` [PATCH kernel v4 2/8] genirq/irqdomain: Clean legacy IRQ allocation Alexey Kardashevskiy
2020-11-24  6:17   ` Alexey Kardashevskiy
2020-11-24  6:17   ` Alexey Kardashevskiy
2020-11-24  9:19   ` Andy Shevchenko
2020-11-24  9:19     ` Andy Shevchenko
2020-11-24  9:19     ` Andy Shevchenko
2020-11-24 10:56     ` Alexey Kardashevskiy
2020-11-24 10:56       ` Alexey Kardashevskiy
2020-11-24 10:56       ` Alexey Kardashevskiy
2020-11-30 21:41   ` Thomas Gleixner
2020-11-30 21:41     ` Thomas Gleixner
2020-11-30 21:41     ` Thomas Gleixner
2020-11-24  6:17 ` [PATCH kernel v4 3/8] genirq/irqdomain: Drop unused realloc parameter from __irq_domain_alloc_irqs Alexey Kardashevskiy
2020-11-24  6:17   ` Alexey Kardashevskiy
2020-11-24  6:17   ` Alexey Kardashevskiy
2020-11-24  6:17 ` [PATCH kernel v4 4/8] genirq: Free IRQ descriptor via embedded kobject Alexey Kardashevskiy
2020-11-24  6:17   ` Alexey Kardashevskiy
2020-11-24  6:17   ` Alexey Kardashevskiy
2020-11-24  6:17 ` [PATCH kernel v4 5/8] genirq: Add free_irq hook for IRQ descriptor and use for mapping disposal Alexey Kardashevskiy
2020-11-24  6:17   ` Alexey Kardashevskiy
2020-11-24  6:17   ` Alexey Kardashevskiy
2020-11-30 22:18   ` Thomas Gleixner
2020-11-30 22:18     ` Thomas Gleixner
2020-11-30 22:18     ` Thomas Gleixner
2020-11-30 22:33     ` Thomas Gleixner
2020-11-30 22:33       ` Thomas Gleixner
2020-11-30 22:33       ` Thomas Gleixner
2020-11-24  6:17 ` [PATCH kernel v4 6/8] genirq/irqdomain: Move hierarchical IRQ cleanup to kobject_release Alexey Kardashevskiy
2020-11-24  6:17   ` Alexey Kardashevskiy
2020-11-24  6:17   ` Alexey Kardashevskiy
2020-11-24  8:12   ` kernel test robot
2020-11-24  8:12     ` kernel test robot
2020-11-24  8:12     ` kernel test robot
2020-11-30 23:13   ` Thomas Gleixner
2020-11-30 23:13     ` Thomas Gleixner
2020-11-30 23:13     ` Thomas Gleixner
2020-11-24  6:17 ` [PATCH kernel v4 7/8] genirq/irqdomain: Reference irq_desc for already mapped irqs Alexey Kardashevskiy
2020-11-24  6:17   ` Alexey Kardashevskiy
2020-11-24  6:17   ` Alexey Kardashevskiy
2020-11-24  6:17 ` [PATCH kernel v4 8/8] powerpc/pci: Remove LSI mappings on device teardown Alexey Kardashevskiy
2020-11-24  6:17   ` Alexey Kardashevskiy
2020-11-24  6:17   ` Alexey Kardashevskiy

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=d12fcee6-f83a-5b09-6208-face2ea5ec39@kaod.org \
    --to=clg@kaod.org \
    --cc=aik@ozlabs.ru \
    --cc=fbarrat@linux.ibm.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-gpio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mips@linux-mips.org \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=matt.redfearn@mips.com \
    --cc=maz@kernel.org \
    --cc=msuchanek@suse.de \
    --cc=oohall@gmail.com \
    --cc=qsyousef@gmail.com \
    --cc=tglx@linutronix.de \
    --cc=x86@kernel.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.