From: Marc Zyngier <maz@kernel.org>
To: "Rob Herring (Arm)" <robh@kernel.org>
Cc: Saravana Kannan <saravanak@google.com>,
Anup Patel <apatel@ventanamicro.com>,
devicetree@vger.kernel.org, linux-kernel@vger.kernel.org,
linux-arm-kernel@lists.infradead.org,
linux-riscv@lists.infradead.org
Subject: Re: [PATCH v2 1/2] of/irq: Factor out parsing of interrupt-map parent phandle+args from of_irq_parse_raw()
Date: Thu, 30 May 2024 14:46:10 +0100 [thread overview]
Message-ID: <86y17rl8f1.wl-maz@kernel.org> (raw)
In-Reply-To: <20240529-dt-interrupt-map-fix-v2-1-ef86dc5bcd2a@kernel.org>
On Wed, 29 May 2024 20:59:20 +0100,
"Rob Herring (Arm)" <robh@kernel.org> wrote:
>
> Factor out the parsing of interrupt-map interrupt parent phandle and its
> arg cells to a separate function, of_irq_parse_imap_parent(), so that it
> can be used in other parsing scenarios (e.g. fw_devlink).
>
> There was a refcount leak on non-matching entries when iterating thru
> "interrupt-map" which is fixed.
>
> Signed-off-by: Rob Herring (Arm) <robh@kernel.org>
> ---
> drivers/of/irq.c | 127 +++++++++++++++++++++++++++++-------------------
> drivers/of/of_private.h | 3 ++
> 2 files changed, 79 insertions(+), 51 deletions(-)
>
> diff --git a/drivers/of/irq.c b/drivers/of/irq.c
> index 174900072c18..a7cdb892991e 100644
> --- a/drivers/of/irq.c
> +++ b/drivers/of/irq.c
> @@ -25,6 +25,8 @@
> #include <linux/string.h>
> #include <linux/slab.h>
>
> +#include "of_private.h"
> +
> /**
> * irq_of_parse_and_map - Parse and map an interrupt into linux virq space
> * @dev: Device node of the device whose interrupt is to be mapped
> @@ -96,6 +98,59 @@ static const char * const of_irq_imap_abusers[] = {
> NULL,
> };
>
> +const __be32 *of_irq_parse_imap_parent(const __be32 *imap, int len, struct of_phandle_args *out_irq)
> +{
> + u32 intsize, addrsize;
> + struct device_node *np;
> +
> + /* Get the interrupt parent */
> + if (of_irq_workarounds & OF_IMAP_NO_PHANDLE)
> + np = of_node_get(of_irq_dflt_pic);
> + else
> + np = of_find_node_by_phandle(be32_to_cpup(imap));
> + imap++;
> +
> + /* Check if not found */
> + if (!np) {
> + pr_debug(" -> imap parent not found !\n");
> + return NULL;
> + }
> +
> + /* Get #interrupt-cells and #address-cells of new
> + * parent
> + */
nit: funky formatting.
M.
--
Without deviation from the norm, progress is not possible.
_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv
WARNING: multiple messages have this Message-ID (diff)
From: Marc Zyngier <maz@kernel.org>
To: "Rob Herring (Arm)" <robh@kernel.org>
Cc: Saravana Kannan <saravanak@google.com>,
Anup Patel <apatel@ventanamicro.com>,
devicetree@vger.kernel.org, linux-kernel@vger.kernel.org,
linux-arm-kernel@lists.infradead.org,
linux-riscv@lists.infradead.org
Subject: Re: [PATCH v2 1/2] of/irq: Factor out parsing of interrupt-map parent phandle+args from of_irq_parse_raw()
Date: Thu, 30 May 2024 14:46:10 +0100 [thread overview]
Message-ID: <86y17rl8f1.wl-maz@kernel.org> (raw)
In-Reply-To: <20240529-dt-interrupt-map-fix-v2-1-ef86dc5bcd2a@kernel.org>
On Wed, 29 May 2024 20:59:20 +0100,
"Rob Herring (Arm)" <robh@kernel.org> wrote:
>
> Factor out the parsing of interrupt-map interrupt parent phandle and its
> arg cells to a separate function, of_irq_parse_imap_parent(), so that it
> can be used in other parsing scenarios (e.g. fw_devlink).
>
> There was a refcount leak on non-matching entries when iterating thru
> "interrupt-map" which is fixed.
>
> Signed-off-by: Rob Herring (Arm) <robh@kernel.org>
> ---
> drivers/of/irq.c | 127 +++++++++++++++++++++++++++++-------------------
> drivers/of/of_private.h | 3 ++
> 2 files changed, 79 insertions(+), 51 deletions(-)
>
> diff --git a/drivers/of/irq.c b/drivers/of/irq.c
> index 174900072c18..a7cdb892991e 100644
> --- a/drivers/of/irq.c
> +++ b/drivers/of/irq.c
> @@ -25,6 +25,8 @@
> #include <linux/string.h>
> #include <linux/slab.h>
>
> +#include "of_private.h"
> +
> /**
> * irq_of_parse_and_map - Parse and map an interrupt into linux virq space
> * @dev: Device node of the device whose interrupt is to be mapped
> @@ -96,6 +98,59 @@ static const char * const of_irq_imap_abusers[] = {
> NULL,
> };
>
> +const __be32 *of_irq_parse_imap_parent(const __be32 *imap, int len, struct of_phandle_args *out_irq)
> +{
> + u32 intsize, addrsize;
> + struct device_node *np;
> +
> + /* Get the interrupt parent */
> + if (of_irq_workarounds & OF_IMAP_NO_PHANDLE)
> + np = of_node_get(of_irq_dflt_pic);
> + else
> + np = of_find_node_by_phandle(be32_to_cpup(imap));
> + imap++;
> +
> + /* Check if not found */
> + if (!np) {
> + pr_debug(" -> imap parent not found !\n");
> + return NULL;
> + }
> +
> + /* Get #interrupt-cells and #address-cells of new
> + * parent
> + */
nit: funky formatting.
M.
--
Without deviation from the norm, progress is not possible.
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
WARNING: multiple messages have this Message-ID (diff)
From: Marc Zyngier <maz@kernel.org>
To: "Rob Herring (Arm)" <robh@kernel.org>
Cc: Saravana Kannan <saravanak@google.com>,
Anup Patel <apatel@ventanamicro.com>,
devicetree@vger.kernel.org, linux-kernel@vger.kernel.org,
linux-arm-kernel@lists.infradead.org,
linux-riscv@lists.infradead.org
Subject: Re: [PATCH v2 1/2] of/irq: Factor out parsing of interrupt-map parent phandle+args from of_irq_parse_raw()
Date: Thu, 30 May 2024 14:46:10 +0100 [thread overview]
Message-ID: <86y17rl8f1.wl-maz@kernel.org> (raw)
In-Reply-To: <20240529-dt-interrupt-map-fix-v2-1-ef86dc5bcd2a@kernel.org>
On Wed, 29 May 2024 20:59:20 +0100,
"Rob Herring (Arm)" <robh@kernel.org> wrote:
>
> Factor out the parsing of interrupt-map interrupt parent phandle and its
> arg cells to a separate function, of_irq_parse_imap_parent(), so that it
> can be used in other parsing scenarios (e.g. fw_devlink).
>
> There was a refcount leak on non-matching entries when iterating thru
> "interrupt-map" which is fixed.
>
> Signed-off-by: Rob Herring (Arm) <robh@kernel.org>
> ---
> drivers/of/irq.c | 127 +++++++++++++++++++++++++++++-------------------
> drivers/of/of_private.h | 3 ++
> 2 files changed, 79 insertions(+), 51 deletions(-)
>
> diff --git a/drivers/of/irq.c b/drivers/of/irq.c
> index 174900072c18..a7cdb892991e 100644
> --- a/drivers/of/irq.c
> +++ b/drivers/of/irq.c
> @@ -25,6 +25,8 @@
> #include <linux/string.h>
> #include <linux/slab.h>
>
> +#include "of_private.h"
> +
> /**
> * irq_of_parse_and_map - Parse and map an interrupt into linux virq space
> * @dev: Device node of the device whose interrupt is to be mapped
> @@ -96,6 +98,59 @@ static const char * const of_irq_imap_abusers[] = {
> NULL,
> };
>
> +const __be32 *of_irq_parse_imap_parent(const __be32 *imap, int len, struct of_phandle_args *out_irq)
> +{
> + u32 intsize, addrsize;
> + struct device_node *np;
> +
> + /* Get the interrupt parent */
> + if (of_irq_workarounds & OF_IMAP_NO_PHANDLE)
> + np = of_node_get(of_irq_dflt_pic);
> + else
> + np = of_find_node_by_phandle(be32_to_cpup(imap));
> + imap++;
> +
> + /* Check if not found */
> + if (!np) {
> + pr_debug(" -> imap parent not found !\n");
> + return NULL;
> + }
> +
> + /* Get #interrupt-cells and #address-cells of new
> + * parent
> + */
nit: funky formatting.
M.
--
Without deviation from the norm, progress is not possible.
next prev parent reply other threads:[~2024-05-30 13:46 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-05-29 19:59 [PATCH v2 0/2] of: Fix interrupt-map for fw_devlink Rob Herring (Arm)
2024-05-29 19:59 ` Rob Herring (Arm)
2024-05-29 19:59 ` Rob Herring (Arm)
2024-05-29 19:59 ` [PATCH v2 1/2] of/irq: Factor out parsing of interrupt-map parent phandle+args from of_irq_parse_raw() Rob Herring (Arm)
2024-05-29 19:59 ` Rob Herring (Arm)
2024-05-29 19:59 ` Rob Herring (Arm)
2024-05-30 13:46 ` Marc Zyngier [this message]
2024-05-30 13:46 ` Marc Zyngier
2024-05-30 13:46 ` Marc Zyngier
2024-05-29 19:59 ` [PATCH v2 2/2] of: property: Fix fw_devlink handling of interrupt-map Rob Herring (Arm)
2024-05-29 19:59 ` Rob Herring (Arm)
2024-05-29 19:59 ` Rob Herring (Arm)
2024-05-30 13:54 ` [PATCH v2 0/2] of: Fix interrupt-map for fw_devlink Marc Zyngier
2024-05-30 13:54 ` Marc Zyngier
2024-05-30 13:54 ` Marc Zyngier
2024-05-30 14:52 ` Anup Patel
2024-05-30 14:52 ` Anup Patel
2024-05-30 14:52 ` Anup Patel
-- strict thread matches above, loose matches on Subject: below --
2024-07-29 15:21 [PATCH v2 1/2] of/irq: Factor out parsing of interrupt-map parent phandle+args from of_irq_parse_raw() WHR
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=86y17rl8f1.wl-maz@kernel.org \
--to=maz@kernel.org \
--cc=apatel@ventanamicro.com \
--cc=devicetree@vger.kernel.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-riscv@lists.infradead.org \
--cc=robh@kernel.org \
--cc=saravanak@google.com \
/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.