* [PATCH 0/2] irqchip/ls-extirq: various fixes
@ 2026-02-24 11:36 Ioana Ciornei
2026-02-24 11:36 ` [PATCH 1/2] Revert "irqchip/ls-extirq: Use for_each_of_imap_item iterator" Ioana Ciornei
2026-02-24 11:36 ` [PATCH 2/2] irqchip/ls-extirq: fix devm_of_iomap() error check Ioana Ciornei
0 siblings, 2 replies; 8+ messages in thread
From: Ioana Ciornei @ 2026-02-24 11:36 UTC (permalink / raw)
To: Thomas Gleixner, Linus Walleij, Geert Uytterhoeven, herve.codina,
Alexander Stein, linux-kernel
The first patch in this set reverts commit 3ac6dfe3d7a2
("irqchip/ls-extirq: Use for_each_of_imap_item iterator") which
essentially broke the ls-extirq functionality by using the
for_each_of_imap_item() iterator on a non-conforming interrupt-map
property.
The second patch fixes the devm_of_iomap() error check by using IS_ERR
instead of just checking its return value.
Ioana Ciornei (2):
Revert "irqchip/ls-extirq: Use for_each_of_imap_item iterator"
irqchip/ls-extirq: fix devm_of_iomap() error check
drivers/irqchip/irq-ls-extirq.c | 52 +++++++++++++++++++++------------
1 file changed, 33 insertions(+), 19 deletions(-)
--
2.25.1
^ permalink raw reply [flat|nested] 8+ messages in thread
* [PATCH 1/2] Revert "irqchip/ls-extirq: Use for_each_of_imap_item iterator"
2026-02-24 11:36 [PATCH 0/2] irqchip/ls-extirq: various fixes Ioana Ciornei
@ 2026-02-24 11:36 ` Ioana Ciornei
2026-02-24 12:47 ` Herve Codina
2026-02-24 17:36 ` [tip: irq/urgent] " tip-bot2 for Ioana Ciornei
2026-02-24 11:36 ` [PATCH 2/2] irqchip/ls-extirq: fix devm_of_iomap() error check Ioana Ciornei
1 sibling, 2 replies; 8+ messages in thread
From: Ioana Ciornei @ 2026-02-24 11:36 UTC (permalink / raw)
To: Thomas Gleixner, Linus Walleij, Geert Uytterhoeven, herve.codina,
Alexander Stein, linux-kernel
This reverts commit 3ac6dfe3d7a2396602b67667249b146504dfbd2a.
The ls-extirq uses interrupt-map but it's a non-standard use documented
in fsl,ls-extirq.yaml:
# The driver(drivers/irqchip/irq-ls-extirq.c) have not use standard DT
# function to parser interrupt-map. So it doesn't consider '#address-size'
# in parent interrupt controller, such as GIC.
#
# When dt-binding verify interrupt-map, item data matrix is spitted at
# incorrect position. Remove interrupt-map restriction because it always
# wrong.
This means that by using for_each_of_imap_item and the underlying
of_irq_parse_imap_parent() on its interrupt-map property will
effectively break its functionality
Revert the patch making use of for_each_of_imap_item() in ls-extirq.
Fixes: 3ac6dfe3d7a2 ("irqchip/ls-extirq: Use for_each_of_imap_item iterator")
Signed-off-by: Ioana Ciornei <ioana.ciornei@nxp.com>
---
drivers/irqchip/irq-ls-extirq.c | 47 +++++++++++++++++++++------------
1 file changed, 30 insertions(+), 17 deletions(-)
diff --git a/drivers/irqchip/irq-ls-extirq.c b/drivers/irqchip/irq-ls-extirq.c
index a7e9c3885b09..96f9c20621cf 100644
--- a/drivers/irqchip/irq-ls-extirq.c
+++ b/drivers/irqchip/irq-ls-extirq.c
@@ -125,32 +125,45 @@ static const struct irq_domain_ops extirq_domain_ops = {
static int
ls_extirq_parse_map(struct ls_extirq_data *priv, struct device_node *node)
{
- struct of_imap_parser imap_parser;
- struct of_imap_item imap_item;
+ const __be32 *map;
+ u32 mapsize;
int ret;
- ret = of_imap_parser_init(&imap_parser, node, &imap_item);
- if (ret)
- return ret;
+ map = of_get_property(node, "interrupt-map", &mapsize);
+ if (!map)
+ return -ENOENT;
+ if (mapsize % sizeof(*map))
+ return -EINVAL;
+ mapsize /= sizeof(*map);
- for_each_of_imap_item(&imap_parser, &imap_item) {
+ while (mapsize) {
struct device_node *ipar;
- u32 hwirq;
- int i;
+ u32 hwirq, intsize, j;
- hwirq = imap_item.child_imap[0];
- if (hwirq >= MAXIRQ) {
- of_node_put(imap_item.parent_args.np);
+ if (mapsize < 3)
+ return -EINVAL;
+ hwirq = be32_to_cpup(map);
+ if (hwirq >= MAXIRQ)
return -EINVAL;
- }
priv->nirq = max(priv->nirq, hwirq + 1);
- ipar = of_node_get(imap_item.parent_args.np);
- priv->map[hwirq].fwnode = of_fwnode_handle(ipar);
+ ipar = of_find_node_by_phandle(be32_to_cpup(map + 2));
+ map += 3;
+ mapsize -= 3;
+ if (!ipar)
+ return -EINVAL;
+ priv->map[hwirq].fwnode = &ipar->fwnode;
+ ret = of_property_read_u32(ipar, "#interrupt-cells", &intsize);
+ if (ret)
+ return ret;
+
+ if (intsize > mapsize)
+ return -EINVAL;
- priv->map[hwirq].param_count = imap_item.parent_args.args_count;
- for (i = 0; i < priv->map[hwirq].param_count; i++)
- priv->map[hwirq].param[i] = imap_item.parent_args.args[i];
+ priv->map[hwirq].param_count = intsize;
+ for (j = 0; j < intsize; ++j)
+ priv->map[hwirq].param[j] = be32_to_cpup(map++);
+ mapsize -= intsize;
}
return 0;
}
--
2.25.1
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [PATCH 2/2] irqchip/ls-extirq: fix devm_of_iomap() error check
2026-02-24 11:36 [PATCH 0/2] irqchip/ls-extirq: various fixes Ioana Ciornei
2026-02-24 11:36 ` [PATCH 1/2] Revert "irqchip/ls-extirq: Use for_each_of_imap_item iterator" Ioana Ciornei
@ 2026-02-24 11:36 ` Ioana Ciornei
2026-02-24 12:53 ` Herve Codina
2026-02-24 17:36 ` [tip: irq/urgent] irqchip/ls-extirq: Fix " tip-bot2 for Ioana Ciornei
1 sibling, 2 replies; 8+ messages in thread
From: Ioana Ciornei @ 2026-02-24 11:36 UTC (permalink / raw)
To: Thomas Gleixner, Linus Walleij, Geert Uytterhoeven, herve.codina,
Alexander Stein, linux-kernel
Cc: Dan Carpenter
The devm_of_iomap() function returns an ERR_PTR() encoded error code on
failure. Replace the incorrect check against NULL with IS_ERR().
Fixes: 05cd654829dd ("irqchip/ls-extirq: Convert to a platform driver to make it work again")
Reported-by: Dan Carpenter <dan.carpenter@linaro.org>
Closes: https://lore.kernel.org/all/aYXvfbfT6w0TMsXS@stanley.mountain/
Signed-off-by: Ioana Ciornei <ioana.ciornei@nxp.com>
---
drivers/irqchip/irq-ls-extirq.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/drivers/irqchip/irq-ls-extirq.c b/drivers/irqchip/irq-ls-extirq.c
index 96f9c20621cf..519a9d89f7f6 100644
--- a/drivers/irqchip/irq-ls-extirq.c
+++ b/drivers/irqchip/irq-ls-extirq.c
@@ -190,8 +190,9 @@ static int ls_extirq_probe(struct platform_device *pdev)
return dev_err_probe(dev, -ENOMEM, "Failed to allocate memory\n");
priv->intpcr = devm_of_iomap(dev, node, 0, NULL);
- if (!priv->intpcr)
- return dev_err_probe(dev, -ENOMEM, "Cannot ioremap OF node %pOF\n", node);
+ if (IS_ERR(priv->intpcr))
+ return dev_err_probe(dev, PTR_ERR(priv->intpcr),
+ "Cannot ioremap OF node %pOF\n", node);
ret = ls_extirq_parse_map(priv, node);
if (ret)
--
2.25.1
^ permalink raw reply related [flat|nested] 8+ messages in thread
* Re: [PATCH 1/2] Revert "irqchip/ls-extirq: Use for_each_of_imap_item iterator"
2026-02-24 11:36 ` [PATCH 1/2] Revert "irqchip/ls-extirq: Use for_each_of_imap_item iterator" Ioana Ciornei
@ 2026-02-24 12:47 ` Herve Codina
2026-02-24 12:53 ` Ioana Ciornei
2026-02-24 17:36 ` [tip: irq/urgent] " tip-bot2 for Ioana Ciornei
1 sibling, 1 reply; 8+ messages in thread
From: Herve Codina @ 2026-02-24 12:47 UTC (permalink / raw)
To: Ioana Ciornei
Cc: Thomas Gleixner, Linus Walleij, Geert Uytterhoeven,
Alexander Stein, linux-kernel
Hi Ioana,
On Tue, 24 Feb 2026 13:36:09 +0200
Ioana Ciornei <ioana.ciornei@nxp.com> wrote:
> This reverts commit 3ac6dfe3d7a2396602b67667249b146504dfbd2a.
>
> The ls-extirq uses interrupt-map but it's a non-standard use documented
> in fsl,ls-extirq.yaml:
>
> # The driver(drivers/irqchip/irq-ls-extirq.c) have not use standard DT
> # function to parser interrupt-map. So it doesn't consider '#address-size'
> # in parent interrupt controller, such as GIC.
> #
> # When dt-binding verify interrupt-map, item data matrix is spitted at
> # incorrect position. Remove interrupt-map restriction because it always
> # wrong.
>
> This means that by using for_each_of_imap_item and the underlying
> of_irq_parse_imap_parent() on its interrupt-map property will
> effectively break its functionality
>
> Revert the patch making use of for_each_of_imap_item() in ls-extirq.
>
> Fixes: 3ac6dfe3d7a2 ("irqchip/ls-extirq: Use for_each_of_imap_item iterator")
> Signed-off-by: Ioana Ciornei <ioana.ciornei@nxp.com>
> ---
> drivers/irqchip/irq-ls-extirq.c | 47 +++++++++++++++++++++------------
> 1 file changed, 30 insertions(+), 17 deletions(-)
Sorry for breaking it when I did 3ac6dfe3d7a2.
I have missed this non-standard usage of interrupt-map.
Acked-by: Herve Codina <herve.codina@bootlin.com>
Best regards,
Hervé
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH 2/2] irqchip/ls-extirq: fix devm_of_iomap() error check
2026-02-24 11:36 ` [PATCH 2/2] irqchip/ls-extirq: fix devm_of_iomap() error check Ioana Ciornei
@ 2026-02-24 12:53 ` Herve Codina
2026-02-24 17:36 ` [tip: irq/urgent] irqchip/ls-extirq: Fix " tip-bot2 for Ioana Ciornei
1 sibling, 0 replies; 8+ messages in thread
From: Herve Codina @ 2026-02-24 12:53 UTC (permalink / raw)
To: Ioana Ciornei
Cc: Thomas Gleixner, Linus Walleij, Geert Uytterhoeven,
Alexander Stein, linux-kernel, Dan Carpenter
Hi Ioana,
On Tue, 24 Feb 2026 13:36:10 +0200
Ioana Ciornei <ioana.ciornei@nxp.com> wrote:
> The devm_of_iomap() function returns an ERR_PTR() encoded error code on
> failure. Replace the incorrect check against NULL with IS_ERR().
>
> Fixes: 05cd654829dd ("irqchip/ls-extirq: Convert to a platform driver to make it work again")
> Reported-by: Dan Carpenter <dan.carpenter@linaro.org>
> Closes: https://lore.kernel.org/all/aYXvfbfT6w0TMsXS@stanley.mountain/
> Signed-off-by: Ioana Ciornei <ioana.ciornei@nxp.com>
Reviewed-by: Herve Codina <herve.codina@bootlin.com>
Best regards,
Hervé
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH 1/2] Revert "irqchip/ls-extirq: Use for_each_of_imap_item iterator"
2026-02-24 12:47 ` Herve Codina
@ 2026-02-24 12:53 ` Ioana Ciornei
0 siblings, 0 replies; 8+ messages in thread
From: Ioana Ciornei @ 2026-02-24 12:53 UTC (permalink / raw)
To: Herve Codina
Cc: Thomas Gleixner, Linus Walleij, Geert Uytterhoeven,
Alexander Stein, linux-kernel
On Tue, Feb 24, 2026 at 01:47:11PM +0100, Herve Codina wrote:
> Hi Ioana,
>
> On Tue, 24 Feb 2026 13:36:09 +0200
> Ioana Ciornei <ioana.ciornei@nxp.com> wrote:
>
> > This reverts commit 3ac6dfe3d7a2396602b67667249b146504dfbd2a.
> >
> > The ls-extirq uses interrupt-map but it's a non-standard use documented
> > in fsl,ls-extirq.yaml:
> >
> > # The driver(drivers/irqchip/irq-ls-extirq.c) have not use standard DT
> > # function to parser interrupt-map. So it doesn't consider '#address-size'
> > # in parent interrupt controller, such as GIC.
> > #
> > # When dt-binding verify interrupt-map, item data matrix is spitted at
> > # incorrect position. Remove interrupt-map restriction because it always
> > # wrong.
> >
> > This means that by using for_each_of_imap_item and the underlying
> > of_irq_parse_imap_parent() on its interrupt-map property will
> > effectively break its functionality
> >
> > Revert the patch making use of for_each_of_imap_item() in ls-extirq.
> >
> > Fixes: 3ac6dfe3d7a2 ("irqchip/ls-extirq: Use for_each_of_imap_item iterator")
> > Signed-off-by: Ioana Ciornei <ioana.ciornei@nxp.com>
> > ---
> > drivers/irqchip/irq-ls-extirq.c | 47 +++++++++++++++++++++------------
> > 1 file changed, 30 insertions(+), 17 deletions(-)
>
> Sorry for breaking it when I did 3ac6dfe3d7a2.
> I have missed this non-standard usage of interrupt-map.
No worries. It's hard to spot.
Ioana
^ permalink raw reply [flat|nested] 8+ messages in thread
* [tip: irq/urgent] irqchip/ls-extirq: Fix devm_of_iomap() error check
2026-02-24 11:36 ` [PATCH 2/2] irqchip/ls-extirq: fix devm_of_iomap() error check Ioana Ciornei
2026-02-24 12:53 ` Herve Codina
@ 2026-02-24 17:36 ` tip-bot2 for Ioana Ciornei
1 sibling, 0 replies; 8+ messages in thread
From: tip-bot2 for Ioana Ciornei @ 2026-02-24 17:36 UTC (permalink / raw)
To: linux-tip-commits
Cc: Dan Carpenter, Ioana Ciornei, Thomas Gleixner, Herve Codina, x86,
linux-kernel, maz
The following commit has been merged into the irq/urgent branch of tip:
Commit-ID: fe5669e363b129cde285bfb4d45abb72d1d77cfc
Gitweb: https://git.kernel.org/tip/fe5669e363b129cde285bfb4d45abb72d1d77cfc
Author: Ioana Ciornei <ioana.ciornei@nxp.com>
AuthorDate: Tue, 24 Feb 2026 13:36:10 +02:00
Committer: Thomas Gleixner <tglx@kernel.org>
CommitterDate: Tue, 24 Feb 2026 18:35:49 +01:00
irqchip/ls-extirq: Fix devm_of_iomap() error check
The devm_of_iomap() function returns an ERR_PTR() encoded error code on
failure. Replace the incorrect check against NULL with IS_ERR().
Fixes: 05cd654829dd ("irqchip/ls-extirq: Convert to a platform driver to make it work again")
Reported-by: Dan Carpenter <dan.carpenter@linaro.org>
Signed-off-by: Ioana Ciornei <ioana.ciornei@nxp.com>
Signed-off-by: Thomas Gleixner <tglx@kernel.org>
Reviewed-by: Herve Codina <herve.codina@bootlin.com>
Link: https://patch.msgid.link/20260224113610.1129022-3-ioana.ciornei@nxp.com
Closes: https://lore.kernel.org/all/aYXvfbfT6w0TMsXS@stanley.mountain/
---
drivers/irqchip/irq-ls-extirq.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/drivers/irqchip/irq-ls-extirq.c b/drivers/irqchip/irq-ls-extirq.c
index 96f9c20..d724fe8 100644
--- a/drivers/irqchip/irq-ls-extirq.c
+++ b/drivers/irqchip/irq-ls-extirq.c
@@ -190,8 +190,10 @@ static int ls_extirq_probe(struct platform_device *pdev)
return dev_err_probe(dev, -ENOMEM, "Failed to allocate memory\n");
priv->intpcr = devm_of_iomap(dev, node, 0, NULL);
- if (!priv->intpcr)
- return dev_err_probe(dev, -ENOMEM, "Cannot ioremap OF node %pOF\n", node);
+ if (IS_ERR(priv->intpcr)) {
+ return dev_err_probe(dev, PTR_ERR(priv->intpcr),
+ "Cannot ioremap OF node %pOF\n", node);
+ }
ret = ls_extirq_parse_map(priv, node);
if (ret)
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [tip: irq/urgent] Revert "irqchip/ls-extirq: Use for_each_of_imap_item iterator"
2026-02-24 11:36 ` [PATCH 1/2] Revert "irqchip/ls-extirq: Use for_each_of_imap_item iterator" Ioana Ciornei
2026-02-24 12:47 ` Herve Codina
@ 2026-02-24 17:36 ` tip-bot2 for Ioana Ciornei
1 sibling, 0 replies; 8+ messages in thread
From: tip-bot2 for Ioana Ciornei @ 2026-02-24 17:36 UTC (permalink / raw)
To: linux-tip-commits
Cc: Ioana Ciornei, Thomas Gleixner, Herve Codina, x86, linux-kernel,
maz
The following commit has been merged into the irq/urgent branch of tip:
Commit-ID: e08f2adcf990b8cf272e90898401a9e481c1c667
Gitweb: https://git.kernel.org/tip/e08f2adcf990b8cf272e90898401a9e481c1c667
Author: Ioana Ciornei <ioana.ciornei@nxp.com>
AuthorDate: Tue, 24 Feb 2026 13:36:09 +02:00
Committer: Thomas Gleixner <tglx@kernel.org>
CommitterDate: Tue, 24 Feb 2026 18:35:48 +01:00
Revert "irqchip/ls-extirq: Use for_each_of_imap_item iterator"
This reverts commit 3ac6dfe3d7a2396602b67667249b146504dfbd2a.
The ls-extirq uses interrupt-map but it's a non-standard use documented
in fsl,ls-extirq.yaml:
# The driver(drivers/irqchip/irq-ls-extirq.c) have not use standard DT
# function to parser interrupt-map. So it doesn't consider '#address-size'
# in parent interrupt controller, such as GIC.
#
# When dt-binding verify interrupt-map, item data matrix is spitted at
# incorrect position. Remove interrupt-map restriction because it always
# wrong.
This means that by using for_each_of_imap_item and the underlying
of_irq_parse_imap_parent() on its interrupt-map property will effectively
break its functionality
Revert the patch making use of for_each_of_imap_item() in ls-extirq.
Fixes: 3ac6dfe3d7a2 ("irqchip/ls-extirq: Use for_each_of_imap_item iterator")
Signed-off-by: Ioana Ciornei <ioana.ciornei@nxp.com>
Signed-off-by: Thomas Gleixner <tglx@kernel.org>
Acked-by: Herve Codina <herve.codina@bootlin.com>
Link: https://patch.msgid.link/20260224113610.1129022-2-ioana.ciornei@nxp.com
---
drivers/irqchip/irq-ls-extirq.c | 47 ++++++++++++++++++++------------
1 file changed, 30 insertions(+), 17 deletions(-)
diff --git a/drivers/irqchip/irq-ls-extirq.c b/drivers/irqchip/irq-ls-extirq.c
index a7e9c38..96f9c20 100644
--- a/drivers/irqchip/irq-ls-extirq.c
+++ b/drivers/irqchip/irq-ls-extirq.c
@@ -125,32 +125,45 @@ static const struct irq_domain_ops extirq_domain_ops = {
static int
ls_extirq_parse_map(struct ls_extirq_data *priv, struct device_node *node)
{
- struct of_imap_parser imap_parser;
- struct of_imap_item imap_item;
+ const __be32 *map;
+ u32 mapsize;
int ret;
- ret = of_imap_parser_init(&imap_parser, node, &imap_item);
- if (ret)
- return ret;
+ map = of_get_property(node, "interrupt-map", &mapsize);
+ if (!map)
+ return -ENOENT;
+ if (mapsize % sizeof(*map))
+ return -EINVAL;
+ mapsize /= sizeof(*map);
- for_each_of_imap_item(&imap_parser, &imap_item) {
+ while (mapsize) {
struct device_node *ipar;
- u32 hwirq;
- int i;
+ u32 hwirq, intsize, j;
- hwirq = imap_item.child_imap[0];
- if (hwirq >= MAXIRQ) {
- of_node_put(imap_item.parent_args.np);
+ if (mapsize < 3)
+ return -EINVAL;
+ hwirq = be32_to_cpup(map);
+ if (hwirq >= MAXIRQ)
return -EINVAL;
- }
priv->nirq = max(priv->nirq, hwirq + 1);
- ipar = of_node_get(imap_item.parent_args.np);
- priv->map[hwirq].fwnode = of_fwnode_handle(ipar);
+ ipar = of_find_node_by_phandle(be32_to_cpup(map + 2));
+ map += 3;
+ mapsize -= 3;
+ if (!ipar)
+ return -EINVAL;
+ priv->map[hwirq].fwnode = &ipar->fwnode;
+ ret = of_property_read_u32(ipar, "#interrupt-cells", &intsize);
+ if (ret)
+ return ret;
+
+ if (intsize > mapsize)
+ return -EINVAL;
- priv->map[hwirq].param_count = imap_item.parent_args.args_count;
- for (i = 0; i < priv->map[hwirq].param_count; i++)
- priv->map[hwirq].param[i] = imap_item.parent_args.args[i];
+ priv->map[hwirq].param_count = intsize;
+ for (j = 0; j < intsize; ++j)
+ priv->map[hwirq].param[j] = be32_to_cpup(map++);
+ mapsize -= intsize;
}
return 0;
}
^ permalink raw reply related [flat|nested] 8+ messages in thread
end of thread, other threads:[~2026-02-24 17:36 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-02-24 11:36 [PATCH 0/2] irqchip/ls-extirq: various fixes Ioana Ciornei
2026-02-24 11:36 ` [PATCH 1/2] Revert "irqchip/ls-extirq: Use for_each_of_imap_item iterator" Ioana Ciornei
2026-02-24 12:47 ` Herve Codina
2026-02-24 12:53 ` Ioana Ciornei
2026-02-24 17:36 ` [tip: irq/urgent] " tip-bot2 for Ioana Ciornei
2026-02-24 11:36 ` [PATCH 2/2] irqchip/ls-extirq: fix devm_of_iomap() error check Ioana Ciornei
2026-02-24 12:53 ` Herve Codina
2026-02-24 17:36 ` [tip: irq/urgent] irqchip/ls-extirq: Fix " tip-bot2 for Ioana Ciornei
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox