From: "Rob Herring (Arm)" <robh@kernel.org>
To: Andrew Jones <ajones@ventanamicro.com>
Cc: loongarch@lists.linux.dev, linux-kernel@vger.kernel.org,
palmer@dabbelt.com, Anup Patel <apatel@ventanamicro.com>,
linux-mips@vger.kernel.org, maz@kernel.org,
linux-riscv@lists.infradead.org, aou@eecs.berkeley.edu,
mark.rutland@arm.com, linux-arm-kernel@lists.infradead.org,
saravanak@google.com, paul.walmsley@sifive.com,
devicetree@vger.kernel.org
Subject: Re: [PATCH v3] of/irq: Support #msi-cells=<0> in of_msi_get_domain
Date: Mon, 19 Aug 2024 12:40:28 -0600 [thread overview]
Message-ID: <172409282414.2143677.12162426898759329021.robh@kernel.org> (raw)
In-Reply-To: <20240817074107.31153-2-ajones@ventanamicro.com>
On Sat, 17 Aug 2024 09:41:08 +0200, Andrew Jones wrote:
> An 'msi-parent' property with a single entry and no accompanying
> '#msi-cells' property is considered the legacy definition as opposed
> to its definition after being expanded with commit 126b16e2ad98
> ("Docs: dt: add generic MSI bindings"). However, the legacy
> definition is completely compatible with the current definition and,
> since of_phandle_iterator_next() tolerates missing and present-but-
> zero *cells properties since commit e42ee61017f5 ("of: Let
> of_for_each_phandle fallback to non-negative cell_count"), there's no
> need anymore to special case the legacy definition in
> of_msi_get_domain().
>
> Indeed, special casing has turned out to be harmful, because, as of
> commit 7c025238b47a ("dt-bindings: irqchip: Describe the IMX MU block
> as a MSI controller"), MSI controller DT bindings have started
> specifying '#msi-cells' as a required property (even when the value
> must be zero) as an effort to make the bindings more explicit. But,
> since the special casing of 'msi-parent' only uses the existence of
> '#msi-cells' for its heuristic, and not whether or not it's also
> nonzero, the legacy path is not taken. Furthermore, the path to
> support the new, broader definition isn't taken either since that
> path has been restricted to the platform-msi bus.
>
> But, neither the definition of 'msi-parent' nor the definition of
> '#msi-cells' is platform-msi-specific (the platform-msi bus was just
> the first bus that needed '#msi-cells'), so remove both the special
> casing and the restriction. The code removal also requires changing
> to of_parse_phandle_with_optional_args() in order to ensure the
> legacy (but compatible) use of 'msi-parent' remains supported. This
> not only simplifies the code but also resolves an issue with PCI
> devices finding their MSI controllers on riscv, as the riscv,imsics
> binding requires '#msi-cells=<0>'.
>
> Signed-off-by: Andrew Jones <ajones@ventanamicro.com>
> ---
> v3:
> - switch to of_for_each_phandle() to further cleanup/simplify the
> code [Rob]
> v2:
> - switch to of_parse_phandle_with_optional_args() to ensure the
> absence of #msi-cells means count=0
>
> drivers/of/irq.c | 35 ++++++++---------------------------
> 1 file changed, 8 insertions(+), 27 deletions(-)
>
Applied, thanks!
prev parent reply other threads:[~2024-08-19 19:45 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-08-17 7:41 [PATCH v3] of/irq: Support #msi-cells=<0> in of_msi_get_domain Andrew Jones
2024-08-18 16:18 ` Rob Herring
2024-08-19 7:35 ` Andrew Jones
2024-08-19 18:40 ` Rob Herring (Arm) [this message]
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=172409282414.2143677.12162426898759329021.robh@kernel.org \
--to=robh@kernel.org \
--cc=ajones@ventanamicro.com \
--cc=aou@eecs.berkeley.edu \
--cc=apatel@ventanamicro.com \
--cc=devicetree@vger.kernel.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mips@vger.kernel.org \
--cc=linux-riscv@lists.infradead.org \
--cc=loongarch@lists.linux.dev \
--cc=mark.rutland@arm.com \
--cc=maz@kernel.org \
--cc=palmer@dabbelt.com \
--cc=paul.walmsley@sifive.com \
--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