devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Marc Zyngier <maz@kernel.org>
To: Saravana Kannan <saravanak@google.com>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Rob Herring <robh+dt@kernel.org>,
	Frank Rowand <frowand.list@gmail.com>,
	Kevin Hilman <khilman@baylibre.com>,
	kernel-team@android.com, devicetree@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] of: property: Add device link support for interrupts
Date: Mon, 21 Dec 2020 09:30:45 +0000	[thread overview]
Message-ID: <2a6dbcc83d5aca7a3340e0cf4d751cdc@kernel.org> (raw)
In-Reply-To: <20201218210750.3455872-1-saravanak@google.com>

On 2020-12-18 21:07, Saravana Kannan wrote:
> Add support for creating device links out of interrupts property.
> 
> Cc: Marc Zyngier <maz@kernel.org>
> Cc: Kevin Hilman <khilman@baylibre.com>
> Signed-off-by: Saravana Kannan <saravanak@google.com>
> ---
> Rob/Greg,
> 
> This might need to go into driver-core to avoid conflict
> due to fw_devlink refactor series that merged there.
> 
> Thanks,
> Saravana
> 
> 
>  drivers/of/property.c | 17 +++++++++++++++++
>  1 file changed, 17 insertions(+)
> 
> diff --git a/drivers/of/property.c b/drivers/of/property.c
> index 5f9eed79a8aa..e56a5eae0a0b 100644
> --- a/drivers/of/property.c
> +++ b/drivers/of/property.c
> @@ -1271,6 +1271,22 @@ static struct device_node
> *parse_iommu_maps(struct device_node *np,
>  	return of_parse_phandle(np, prop_name, (index * 4) + 1);
>  }
> 
> +static struct device_node *parse_interrupts(struct device_node *np,
> +					    const char *prop_name, int index)
> +{
> +	struct device_node *sup;
> +
> +	if (strcmp(prop_name, "interrupts") || index)
> +		return NULL;
> +
> +	of_node_get(np);
> +	while (np && !(sup = of_parse_phandle(np, "interrupt-parent", 0)))
> +		np = of_get_next_parent(np);
> +	of_node_put(np);
> +
> +	return sup;
> +}
> +
>  static const struct supplier_bindings of_supplier_bindings[] = {
>  	{ .parse_prop = parse_clocks, },
>  	{ .parse_prop = parse_interconnects, },
> @@ -1296,6 +1312,7 @@ static const struct supplier_bindings
> of_supplier_bindings[] = {
>  	{ .parse_prop = parse_pinctrl6, },
>  	{ .parse_prop = parse_pinctrl7, },
>  	{ .parse_prop = parse_pinctrl8, },
> +	{ .parse_prop = parse_interrupts, },
>  	{ .parse_prop = parse_regulators, },
>  	{ .parse_prop = parse_gpio, },
>  	{ .parse_prop = parse_gpios, },

You don't really describe what this is for so I'm only guessing
from the context. If you want to follow the interrupt hierarchy,
"interrupt-parent" isn't enough. You also need to track
things like interrupt-map, or anything that carries a phandle
to an interrupt controller.

Thanks,

         M.
-- 
Jazz is not dead. It just smells funny...

  reply	other threads:[~2020-12-21  9:50 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-12-18 21:07 [PATCH] of: property: Add device link support for interrupts Saravana Kannan
2020-12-21  9:30 ` Marc Zyngier [this message]
2020-12-31 21:12   ` Rob Herring
2021-01-02 11:36     ` Marc Zyngier
2021-01-06 18:52       ` Saravana Kannan
2021-01-07  1:25         ` Saravana Kannan
2021-01-07 16:47           ` Rob Herring
2021-01-07 17:08             ` Saravana Kannan
2021-01-07 17:17               ` Marc Zyngier
2021-01-07 18:39         ` Rob Herring
2021-01-07 19:09           ` Saravana Kannan
2021-01-07 19:33             ` Rob Herring
2021-01-07 23:13               ` Saravana Kannan
2021-01-08  3:35                 ` Rob Herring
2021-01-08  4:34                   ` Saravana Kannan
2021-01-20  9:53 ` Geert Uytterhoeven
2021-01-20 10:04   ` Marc Zyngier
2021-01-20 14:28   ` Geert Uytterhoeven
2021-01-20 17:15     ` Saravana Kannan

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=2a6dbcc83d5aca7a3340e0cf4d751cdc@kernel.org \
    --to=maz@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=frowand.list@gmail.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=kernel-team@android.com \
    --cc=khilman@baylibre.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=robh+dt@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).