All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2] irqchip/renesas-intc-irqpin: Use platform_get_irq_optional() to get the interrupt
@ 2021-12-16 18:21 Lad Prabhakar
  2021-12-16 18:21 ` [PATCH v2] irqchip/renesas-irqc: " Lad Prabhakar
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Lad Prabhakar @ 2021-12-16 18:21 UTC (permalink / raw)
  To: Thomas Gleixner, Marc Zyngier, Geert Uytterhoeven
  Cc: Rob Herring, linux-kernel, Prabhakar, Lad Prabhakar

platform_get_resource(pdev, IORESOURCE_IRQ, ..) relies on static
allocation of IRQ resources in DT core code, this causes an issue
when using hierarchical interrupt domains using "interrupts" property
in the node as this bypassed the hierarchical setup and messed up the
irq chaining.

In preparation for removal of static setup of IRQ resource from DT core
code use platform_get_irq_optional().

Signed-off-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>
---
v1->v2
* Check for -ENXIO in case of missing interrupt resource
---
 drivers/irqchip/irq-renesas-intc-irqpin.c | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/drivers/irqchip/irq-renesas-intc-irqpin.c b/drivers/irqchip/irq-renesas-intc-irqpin.c
index cb7f60b3b4a9..37f9a4499fdb 100644
--- a/drivers/irqchip/irq-renesas-intc-irqpin.c
+++ b/drivers/irqchip/irq-renesas-intc-irqpin.c
@@ -375,7 +375,6 @@ static int intc_irqpin_probe(struct platform_device *pdev)
 	struct intc_irqpin_priv *p;
 	struct intc_irqpin_iomem *i;
 	struct resource *io[INTC_IRQPIN_REG_NR];
-	struct resource *irq;
 	struct irq_chip *irq_chip;
 	void (*enable_fn)(struct irq_data *d);
 	void (*disable_fn)(struct irq_data *d);
@@ -418,12 +417,14 @@ static int intc_irqpin_probe(struct platform_device *pdev)
 
 	/* allow any number of IRQs between 1 and INTC_IRQPIN_MAX */
 	for (k = 0; k < INTC_IRQPIN_MAX; k++) {
-		irq = platform_get_resource(pdev, IORESOURCE_IRQ, k);
-		if (!irq)
+		ret = platform_get_irq_optional(pdev, k);
+		if (ret == -ENXIO)
 			break;
+		if (ret < 0)
+			goto err0;
 
 		p->irq[k].p = p;
-		p->irq[k].requested_irq = irq->start;
+		p->irq[k].requested_irq = ret;
 	}
 
 	nirqs = k;
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [PATCH v2] irqchip/renesas-irqc: Use platform_get_irq_optional() to get the interrupt
  2021-12-16 18:21 [PATCH v2] irqchip/renesas-intc-irqpin: Use platform_get_irq_optional() to get the interrupt Lad Prabhakar
@ 2021-12-16 18:21 ` Lad Prabhakar
  2021-12-17  8:12   ` Geert Uytterhoeven
  2021-12-20 14:07   ` [irqchip: irq/irqchip-next] " irqchip-bot for Lad Prabhakar
  2021-12-17  8:12 ` [PATCH v2] irqchip/renesas-intc-irqpin: " Geert Uytterhoeven
  2021-12-20 14:07 ` [irqchip: irq/irqchip-next] " irqchip-bot for Lad Prabhakar
  2 siblings, 2 replies; 6+ messages in thread
From: Lad Prabhakar @ 2021-12-16 18:21 UTC (permalink / raw)
  To: Thomas Gleixner, Marc Zyngier, Geert Uytterhoeven
  Cc: Rob Herring, linux-kernel, Prabhakar, Lad Prabhakar

platform_get_resource(pdev, IORESOURCE_IRQ, ..) relies on static
allocation of IRQ resources in DT core code, this causes an issue
when using hierarchical interrupt domains using "interrupts" property
in the node as this bypassed the hierarchical setup and messed up the
irq chaining.

In preparation for removal of static setup of IRQ resource from DT core
code use platform_get_irq_optional().

Signed-off-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>
---
v1->v2
* Check for -ENXIO in case of missing interrupt resource
---
 drivers/irqchip/irq-renesas-irqc.c | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/drivers/irqchip/irq-renesas-irqc.c b/drivers/irqchip/irq-renesas-irqc.c
index 07a6d8b42b63..909325f88239 100644
--- a/drivers/irqchip/irq-renesas-irqc.c
+++ b/drivers/irqchip/irq-renesas-irqc.c
@@ -126,7 +126,6 @@ static int irqc_probe(struct platform_device *pdev)
 	struct device *dev = &pdev->dev;
 	const char *name = dev_name(dev);
 	struct irqc_priv *p;
-	struct resource *irq;
 	int ret;
 	int k;
 
@@ -142,13 +141,15 @@ static int irqc_probe(struct platform_device *pdev)
 
 	/* allow any number of IRQs between 1 and IRQC_IRQ_MAX */
 	for (k = 0; k < IRQC_IRQ_MAX; k++) {
-		irq = platform_get_resource(pdev, IORESOURCE_IRQ, k);
-		if (!irq)
+		ret = platform_get_irq_optional(pdev, k);
+		if (ret == -ENXIO)
 			break;
+		if (ret < 0)
+			goto err_runtime_pm_disable;
 
 		p->irq[k].p = p;
 		p->irq[k].hw_irq = k;
-		p->irq[k].requested_irq = irq->start;
+		p->irq[k].requested_irq = ret;
 	}
 
 	p->number_of_irqs = k;
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH v2] irqchip/renesas-intc-irqpin: Use platform_get_irq_optional() to get the interrupt
  2021-12-16 18:21 [PATCH v2] irqchip/renesas-intc-irqpin: Use platform_get_irq_optional() to get the interrupt Lad Prabhakar
  2021-12-16 18:21 ` [PATCH v2] irqchip/renesas-irqc: " Lad Prabhakar
@ 2021-12-17  8:12 ` Geert Uytterhoeven
  2021-12-20 14:07 ` [irqchip: irq/irqchip-next] " irqchip-bot for Lad Prabhakar
  2 siblings, 0 replies; 6+ messages in thread
From: Geert Uytterhoeven @ 2021-12-17  8:12 UTC (permalink / raw)
  To: Lad Prabhakar
  Cc: Thomas Gleixner, Marc Zyngier, Rob Herring,
	Linux Kernel Mailing List, Prabhakar

On Thu, Dec 16, 2021 at 7:21 PM Lad Prabhakar
<prabhakar.mahadev-lad.rj@bp.renesas.com> wrote:
> platform_get_resource(pdev, IORESOURCE_IRQ, ..) relies on static
> allocation of IRQ resources in DT core code, this causes an issue
> when using hierarchical interrupt domains using "interrupts" property
> in the node as this bypassed the hierarchical setup and messed up the
> irq chaining.
>
> In preparation for removal of static setup of IRQ resource from DT core
> code use platform_get_irq_optional().
>
> Signed-off-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>
> ---
> v1->v2
> * Check for -ENXIO in case of missing interrupt resource

Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>

Gr{oetje,eeting}s,

                        Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH v2] irqchip/renesas-irqc: Use platform_get_irq_optional() to get the interrupt
  2021-12-16 18:21 ` [PATCH v2] irqchip/renesas-irqc: " Lad Prabhakar
@ 2021-12-17  8:12   ` Geert Uytterhoeven
  2021-12-20 14:07   ` [irqchip: irq/irqchip-next] " irqchip-bot for Lad Prabhakar
  1 sibling, 0 replies; 6+ messages in thread
From: Geert Uytterhoeven @ 2021-12-17  8:12 UTC (permalink / raw)
  To: Lad Prabhakar
  Cc: Thomas Gleixner, Marc Zyngier, Rob Herring,
	Linux Kernel Mailing List, Prabhakar

On Thu, Dec 16, 2021 at 7:21 PM Lad Prabhakar
<prabhakar.mahadev-lad.rj@bp.renesas.com> wrote:
> platform_get_resource(pdev, IORESOURCE_IRQ, ..) relies on static
> allocation of IRQ resources in DT core code, this causes an issue
> when using hierarchical interrupt domains using "interrupts" property
> in the node as this bypassed the hierarchical setup and messed up the
> irq chaining.
>
> In preparation for removal of static setup of IRQ resource from DT core
> code use platform_get_irq_optional().
>
> Signed-off-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>
> ---
> v1->v2
> * Check for -ENXIO in case of missing interrupt resource

Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>

Gr{oetje,eeting}s,

                        Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [irqchip: irq/irqchip-next] irqchip/renesas-intc-irqpin: Use platform_get_irq_optional() to get the interrupt
  2021-12-16 18:21 [PATCH v2] irqchip/renesas-intc-irqpin: Use platform_get_irq_optional() to get the interrupt Lad Prabhakar
  2021-12-16 18:21 ` [PATCH v2] irqchip/renesas-irqc: " Lad Prabhakar
  2021-12-17  8:12 ` [PATCH v2] irqchip/renesas-intc-irqpin: " Geert Uytterhoeven
@ 2021-12-20 14:07 ` irqchip-bot for Lad Prabhakar
  2 siblings, 0 replies; 6+ messages in thread
From: irqchip-bot for Lad Prabhakar @ 2021-12-20 14:07 UTC (permalink / raw)
  To: linux-kernel; +Cc: Lad Prabhakar, Geert Uytterhoeven, Marc Zyngier, tglx

The following commit has been merged into the irq/irqchip-next branch of irqchip:

Commit-ID:     31bd548f40cd0b754ed80a372bc2019e7c4fa31d
Gitweb:        https://git.kernel.org/pub/scm/linux/kernel/git/maz/arm-platforms/31bd548f40cd0b754ed80a372bc2019e7c4fa31d
Author:        Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>
AuthorDate:    Thu, 16 Dec 2021 18:21:20 
Committer:     Marc Zyngier <maz@kernel.org>
CommitterDate: Mon, 20 Dec 2021 12:21:50 

irqchip/renesas-intc-irqpin: Use platform_get_irq_optional() to get the interrupt

platform_get_resource(pdev, IORESOURCE_IRQ, ..) relies on static
allocation of IRQ resources in DT core code, this causes an issue
when using hierarchical interrupt domains using "interrupts" property
in the node as this bypassed the hierarchical setup and messed up the
irq chaining.

In preparation for removal of static setup of IRQ resource from DT core
code use platform_get_irq_optional().

Signed-off-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>
Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
Signed-off-by: Marc Zyngier <maz@kernel.org>
Link: https://lore.kernel.org/r/20211216182121.5323-1-prabhakar.mahadev-lad.rj@bp.renesas.com
---
 drivers/irqchip/irq-renesas-intc-irqpin.c |  9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/drivers/irqchip/irq-renesas-intc-irqpin.c b/drivers/irqchip/irq-renesas-intc-irqpin.c
index cb7f60b..37f9a44 100644
--- a/drivers/irqchip/irq-renesas-intc-irqpin.c
+++ b/drivers/irqchip/irq-renesas-intc-irqpin.c
@@ -375,7 +375,6 @@ static int intc_irqpin_probe(struct platform_device *pdev)
 	struct intc_irqpin_priv *p;
 	struct intc_irqpin_iomem *i;
 	struct resource *io[INTC_IRQPIN_REG_NR];
-	struct resource *irq;
 	struct irq_chip *irq_chip;
 	void (*enable_fn)(struct irq_data *d);
 	void (*disable_fn)(struct irq_data *d);
@@ -418,12 +417,14 @@ static int intc_irqpin_probe(struct platform_device *pdev)
 
 	/* allow any number of IRQs between 1 and INTC_IRQPIN_MAX */
 	for (k = 0; k < INTC_IRQPIN_MAX; k++) {
-		irq = platform_get_resource(pdev, IORESOURCE_IRQ, k);
-		if (!irq)
+		ret = platform_get_irq_optional(pdev, k);
+		if (ret == -ENXIO)
 			break;
+		if (ret < 0)
+			goto err0;
 
 		p->irq[k].p = p;
-		p->irq[k].requested_irq = irq->start;
+		p->irq[k].requested_irq = ret;
 	}
 
 	nirqs = k;

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [irqchip: irq/irqchip-next] irqchip/renesas-irqc: Use platform_get_irq_optional() to get the interrupt
  2021-12-16 18:21 ` [PATCH v2] irqchip/renesas-irqc: " Lad Prabhakar
  2021-12-17  8:12   ` Geert Uytterhoeven
@ 2021-12-20 14:07   ` irqchip-bot for Lad Prabhakar
  1 sibling, 0 replies; 6+ messages in thread
From: irqchip-bot for Lad Prabhakar @ 2021-12-20 14:07 UTC (permalink / raw)
  To: linux-kernel; +Cc: Lad Prabhakar, Geert Uytterhoeven, Marc Zyngier, tglx

The following commit has been merged into the irq/irqchip-next branch of irqchip:

Commit-ID:     befbfe6f8f744acb65c4334cc224b855d31aff1b
Gitweb:        https://git.kernel.org/pub/scm/linux/kernel/git/maz/arm-platforms/befbfe6f8f744acb65c4334cc224b855d31aff1b
Author:        Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>
AuthorDate:    Thu, 16 Dec 2021 18:21:21 
Committer:     Marc Zyngier <maz@kernel.org>
CommitterDate: Mon, 20 Dec 2021 12:18:46 

irqchip/renesas-irqc: Use platform_get_irq_optional() to get the interrupt

platform_get_resource(pdev, IORESOURCE_IRQ, ..) relies on static
allocation of IRQ resources in DT core code, this causes an issue
when using hierarchical interrupt domains using "interrupts" property
in the node as this bypassed the hierarchical setup and messed up the
irq chaining.

In preparation for removal of static setup of IRQ resource from DT core
code use platform_get_irq_optional().

Signed-off-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>
Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
Signed-off-by: Marc Zyngier <maz@kernel.org>
Link: https://lore.kernel.org/r/20211216182121.5323-2-prabhakar.mahadev-lad.rj@bp.renesas.com
---
 drivers/irqchip/irq-renesas-irqc.c |  9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/drivers/irqchip/irq-renesas-irqc.c b/drivers/irqchip/irq-renesas-irqc.c
index 07a6d8b..909325f 100644
--- a/drivers/irqchip/irq-renesas-irqc.c
+++ b/drivers/irqchip/irq-renesas-irqc.c
@@ -126,7 +126,6 @@ static int irqc_probe(struct platform_device *pdev)
 	struct device *dev = &pdev->dev;
 	const char *name = dev_name(dev);
 	struct irqc_priv *p;
-	struct resource *irq;
 	int ret;
 	int k;
 
@@ -142,13 +141,15 @@ static int irqc_probe(struct platform_device *pdev)
 
 	/* allow any number of IRQs between 1 and IRQC_IRQ_MAX */
 	for (k = 0; k < IRQC_IRQ_MAX; k++) {
-		irq = platform_get_resource(pdev, IORESOURCE_IRQ, k);
-		if (!irq)
+		ret = platform_get_irq_optional(pdev, k);
+		if (ret == -ENXIO)
 			break;
+		if (ret < 0)
+			goto err_runtime_pm_disable;
 
 		p->irq[k].p = p;
 		p->irq[k].hw_irq = k;
-		p->irq[k].requested_irq = irq->start;
+		p->irq[k].requested_irq = ret;
 	}
 
 	p->number_of_irqs = k;

^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2021-12-20 14:07 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-12-16 18:21 [PATCH v2] irqchip/renesas-intc-irqpin: Use platform_get_irq_optional() to get the interrupt Lad Prabhakar
2021-12-16 18:21 ` [PATCH v2] irqchip/renesas-irqc: " Lad Prabhakar
2021-12-17  8:12   ` Geert Uytterhoeven
2021-12-20 14:07   ` [irqchip: irq/irqchip-next] " irqchip-bot for Lad Prabhakar
2021-12-17  8:12 ` [PATCH v2] irqchip/renesas-intc-irqpin: " Geert Uytterhoeven
2021-12-20 14:07 ` [irqchip: irq/irqchip-next] " irqchip-bot for Lad Prabhakar

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.