From: Marc Zyngier <maz@kernel.org>
To: linux-kernel@vger.kernel.org
Cc: "Thomas Gleixner" <tglx@linutronix.de>,
"Michael Ellerman" <mpe@ellerman.id.au>,
"Benjamin Herrenschmidt" <benh@kernel.crashing.org>,
"Paul Mackerras" <paulus@samba.org>,
"Ley Foon Tan" <ley.foon.tan@intel.com>,
"Chris Zankel" <chris@zankel.net>,
"Max Filippov" <jcmvbkbc@gmail.com>,
"Vineet Gupta" <vgupta@synopsys.com>,
"Thomas Bogendoerfer" <tsbogend@alpha.franken.de>,
"Robert Jarzmik" <robert.jarzmik@free.fr>,
"Russell King" <linux@armlinux.org.uk>,
"Krzysztof Kozlowski" <krzysztof.kozlowski@canonical.com>,
"Yoshinori Sato" <ysato@users.sourceforge.jp>,
"Rich Felker" <dalias@libc.org>,
"Geert Uytterhoeven" <geert@linux-m68k.org>,
"Alex Deucher" <alexander.deucher@amd.com>,
"Christian König" <christian.koenig@amd.com>,
"David Airlie" <airlied@linux.ie>,
"Daniel Vetter" <daniel@ffwll.ch>,
"Rob Clark" <robdclark@gmail.com>,
"Linus Walleij" <linus.walleij@linaro.org>,
"Lee Jones" <lee.jones@linaro.org>,
"Lorenzo Pieralisi" <lorenzo.pieralisi@arm.com>,
"Rob Herring" <robh@kernel.org>,
"Bjorn Helgaas" <bhelgaas@google.com>,
"Bartosz Golaszewski" <bgolaszewski@baylibre.com>,
kernel-team@android.com
Subject: [PATCH v2 14/14] Documentation: Update irq_domain.rst with new lookup APIs
Date: Mon, 2 Aug 2021 17:26:30 +0100 [thread overview]
Message-ID: <20210802162630.2219813-15-maz@kernel.org> (raw)
In-Reply-To: <20210802162630.2219813-1-maz@kernel.org>
Catch up with the recent irqdomain updates, and document
{generic_,}handle_domain_irq(), irq_resolve_mapping() as well
as the deprecation of some of the older APIs.
Signed-off-by: Marc Zyngier <maz@kernel.org>
---
Documentation/core-api/irq/irq-domain.rst | 28 ++++++++++++++++++++---
1 file changed, 25 insertions(+), 3 deletions(-)
diff --git a/Documentation/core-api/irq/irq-domain.rst b/Documentation/core-api/irq/irq-domain.rst
index 53283b3729a1..6979b4af2c1f 100644
--- a/Documentation/core-api/irq/irq-domain.rst
+++ b/Documentation/core-api/irq/irq-domain.rst
@@ -55,8 +55,24 @@ exist then it will allocate a new Linux irq_desc, associate it with
the hwirq, and call the .map() callback so the driver can perform any
required hardware setup.
-When an interrupt is received, irq_find_mapping() function should
-be used to find the Linux IRQ number from the hwirq number.
+Once a mapping has been established, it can be retrieved or used via a
+variety of methods:
+
+- irq_resolve_mapping() returns a pointer to the irq_desc structure
+ for a given domain and hwirq number, and NULL if there was no
+ mapping.
+- irq_find_mapping() returns a Linux IRQ number for a given domain and
+ hwirq number, and 0 if there was no mapping
+- irq_linear_revmap() is now identical to irq_find_mapping(), and is
+ deprecated
+- generic_handle_domain_irq() handles an interrupt described by a
+ domain and a hwirq number
+- handle_domain_irq() does the same thing for root interrupt
+ controllers and deals with the set_irq_reg()/irq_enter() sequences
+ that most architecture requires
+
+Note that irq domain lookups must happen in contexts that are
+compatible with a RCU read-side critical section.
The irq_create_mapping() function must be called *atleast once*
before any call to irq_find_mapping(), lest the descriptor will not
@@ -137,7 +153,9 @@ required. Calling irq_create_direct_mapping() will allocate a Linux
IRQ number and call the .map() callback so that driver can program the
Linux IRQ number into the hardware.
-Most drivers cannot use this mapping.
+Most drivers cannot use this mapping, and it is now gated on the
+CONFIG_IRQ_DOMAIN_NOMAP option. Please refrain from introducing new
+users of this API.
Legacy
------
@@ -157,6 +175,10 @@ for IRQ numbers that are passed to struct device registrations. In that
case the Linux IRQ numbers cannot be dynamically assigned and the legacy
mapping should be used.
+As the name implies, the *_legacy() functions are deprecated and only
+exist to ease the support of ancient platforms. No new users should be
+added.
+
The legacy map assumes a contiguous range of IRQ numbers has already
been allocated for the controller and that the IRQ number can be
calculated by adding a fixed offset to the hwirq number, and
--
2.30.2
prev parent reply other threads:[~2021-08-02 16:57 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-08-02 16:26 [PATCH v2 00/14][treewide] irqdomain: Simplify interrupt handling Marc Zyngier
2021-08-02 16:26 ` [PATCH v2 01/14] gpio: Bulk conversion to generic_handle_domain_irq() Marc Zyngier
2021-08-02 16:26 ` [PATCH v2 02/14] pinctrl: " Marc Zyngier
2021-08-02 16:26 ` [PATCH v2 03/14] PCI: " Marc Zyngier
2021-08-02 16:59 ` Bjorn Helgaas
2021-08-02 16:26 ` [PATCH v2 04/14] mfd: " Marc Zyngier
2021-08-02 16:26 ` [PATCH v2 05/14] gpu: " Marc Zyngier
2021-08-02 16:26 ` [PATCH v2 06/14] SH: " Marc Zyngier
2021-08-02 16:26 ` [PATCH v2 07/14] ARM: " Marc Zyngier
2021-08-02 16:26 ` [PATCH v2 08/14] mips: " Marc Zyngier
2021-08-05 9:10 ` Thomas Bogendoerfer
2021-08-02 16:26 ` [PATCH v2 09/14] arc: " Marc Zyngier
2021-08-02 16:26 ` [PATCH v2 10/14] xtensa: " Marc Zyngier
2021-08-02 16:26 ` [PATCH v2 11/14] nios2: " Marc Zyngier
2021-08-02 16:26 ` [PATCH v2 12/14] powerpc: " Marc Zyngier
2021-08-02 16:26 ` [PATCH v2 13/14] EDAC/altera: Convert " Marc Zyngier
2021-08-02 16:26 ` Marc Zyngier [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=20210802162630.2219813-15-maz@kernel.org \
--to=maz@kernel.org \
--cc=airlied@linux.ie \
--cc=alexander.deucher@amd.com \
--cc=benh@kernel.crashing.org \
--cc=bgolaszewski@baylibre.com \
--cc=bhelgaas@google.com \
--cc=chris@zankel.net \
--cc=christian.koenig@amd.com \
--cc=dalias@libc.org \
--cc=daniel@ffwll.ch \
--cc=geert@linux-m68k.org \
--cc=jcmvbkbc@gmail.com \
--cc=kernel-team@android.com \
--cc=krzysztof.kozlowski@canonical.com \
--cc=lee.jones@linaro.org \
--cc=ley.foon.tan@intel.com \
--cc=linus.walleij@linaro.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@armlinux.org.uk \
--cc=lorenzo.pieralisi@arm.com \
--cc=mpe@ellerman.id.au \
--cc=paulus@samba.org \
--cc=robdclark@gmail.com \
--cc=robert.jarzmik@free.fr \
--cc=robh@kernel.org \
--cc=tglx@linutronix.de \
--cc=tsbogend@alpha.franken.de \
--cc=vgupta@synopsys.com \
--cc=ysato@users.sourceforge.jp \
/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).