lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <86y17rl8f1.wl-maz@kernel.org>
Date: Thu, 30 May 2024 14:46:10 +0100
From: Marc Zyngier <maz@...nel.org>
To: "Rob Herring (Arm)" <robh@...nel.org>
Cc: Saravana Kannan <saravanak@...gle.com>,
	Anup Patel <apatel@...tanamicro.com>,
	devicetree@...r.kernel.org,
	linux-kernel@...r.kernel.org,
	linux-arm-kernel@...ts.infradead.org,
	linux-riscv@...ts.infradead.org
Subject: Re: [PATCH v2 1/2] of/irq: Factor out parsing of interrupt-map parent phandle+args from of_irq_parse_raw()

On Wed, 29 May 2024 20:59:20 +0100,
"Rob Herring (Arm)" <robh@...nel.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@...nel.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.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ