From: Qais Yousef <qais.yousef@imgtec.com>
To: <linux-kernel@vger.kernel.org>
Cc: <tglx@linutronix.de>, <jason@lakedaemon.net>,
<marc.zyngier@arm.com>, <jiang.liu@linux.intel.com>,
<ralf@linux-mips.org>, <linux-mips@linux-mips.org>,
Qais Yousef <qais.yousef@imgtec.com>,
"Jonathan Corbet" <corbet@lwn.net>, <linux-doc@vger.kernel.org>
Subject: [PATCH 14/14] Docs: IRQ: Add new IRQ-ipi.txt
Date: Tue, 3 Nov 2015 11:13:01 +0000 [thread overview]
Message-ID: <1446549181-31788-15-git-send-email-qais.yousef@imgtec.com> (raw)
In-Reply-To: <1446549181-31788-1-git-send-email-qais.yousef@imgtec.com>
The new file describes how to use the new generic IPI support API and implement
the support in the irqchip driver.
Signed-off-by: Qais Yousef <qais.yousef@imgtec.com>
Cc: Jonathan Corbet <corbet@lwn.net>
Cc: linux-doc@vger.kernel.org
---
Documentation/IRQ-ipi.txt | 81 +++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 81 insertions(+)
create mode 100644 Documentation/IRQ-ipi.txt
diff --git a/Documentation/IRQ-ipi.txt b/Documentation/IRQ-ipi.txt
new file mode 100644
index 000000000000..07e5d9abdf38
--- /dev/null
+++ b/Documentation/IRQ-ipi.txt
@@ -0,0 +1,81 @@
+Generic IPI allocation and sending
+
+
+We now have a generic IPI mechanism to allocate and send IPIs which can be used
+to implement ARCH's SMP IPIs or by the driver to exchange IPIs with a coprocessor
+it's talking to.
+
+
+=====
+ API
+=====
+
+Structs:
+
+ -- struct ipi_mask --
+
+ Similar to cpumask but can handle CPUs outside NR_CPU range.
+
+Functions:
+
+ -- irq_reserve_ipi() --
+
+ Dynamically allocate an IPI from an IPI irq_domain registered by the
+ system. An IPI mask must be passed specifying the destination CPUs this
+ IPI will target.
+
+ On success it will return a virq that can be used to send an IPI to one
+ subset of CPUs in the passed IPI mask.
+
+ This function is not exported. Ideally the IPI should be requested from
+ device tree which will use this function indirectly.
+
+ -- irq_send_ipi() --
+
+ To be used by drivers to send an IPI. It takesthe virq that was
+ returned by irq_reserve_ipi() and an IPI mask containing a subset of the
+ IPI mask used to allocate the IPI.
+
+ This function is exported to allow drivers to use it.
+
+ -- __irq_desc_send_ipi() --
+
+ To be used by ARCH code to send SMP IPIs. It takes a desc instead of virq
+ to save having to do desc lookup on this common case.
+
+ This function is not exported as it's meant for ARCH code use only.
+
+
+=========================================
+ Adding support into your irqchip driver
+=========================================
+
+For this new feature to be used, you need to have an irqchip driver that provides
+an IPI domain.
+
+The IPI domain must be a Hierarchy Domain with IRQ_DOMAIN_FLAG_IPI set and
+domain bust set to DOMAIN_BUS_IPI to allow the system to identify it.
+
+structs:
+
+ -- struct ipi_mapping --
+
+ This struct is provided to aid in creating a CPU to HWIRQ mapping when
+ allocating an IPI and perform the lookup when sending one.
+
+functions:
+
+ -- irq_domain_ops->alloc() --
+
+ This function should be used to implement the hardware specific mechanism
+ to reserve an IPI.
+
+ The generic layer will allocate a virq for each CPU in the IPI mask
+ passed in the call to irq_reserve_ipi() which the driver can freely
+ choose to use or ignore depends if it needs to have a one to one mapping
+ between virq and hwirq or one virq is enough to identify multiple hwirqs.
+
+ -- irqchip->irq_send_ipi() --
+
+ The generic layer will call this irqchip function after doing some sanity
+ checking for the driver to perform the actual IPI kick.
--
2.1.0
prev parent reply other threads:[~2015-11-03 11:13 UTC|newest]
Thread overview: 38+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-11-03 11:12 [PATCH 00/14] Implement generic IPI support mechanism Qais Yousef
2015-11-03 11:12 ` [PATCH 01/14] genirq: Add new IRQ_DOMAIN_FLAGS_IPI Qais Yousef
2015-11-03 11:12 ` [PATCH 02/14] genirq: Add DOMAIN_BUS_IPI Qais Yousef
2015-11-03 11:12 ` [PATCH 03/14] genirq: Add GENERIC_IRQ_IPI Kconfig symbol Qais Yousef
2015-11-03 11:12 ` [PATCH 04/14] genirq: Add new struct ipi_mask and helper functions Qais Yousef
2015-11-07 12:05 ` Thomas Gleixner
2015-11-03 11:12 ` [PATCH 05/14] genirq: Add struct ipi_mask to irq_data Qais Yousef
2015-11-03 11:12 ` [PATCH 06/14] genirq: Add struct ipi_mapping and its helper functions Qais Yousef
2015-11-07 12:09 ` Thomas Gleixner
2015-11-09 10:05 ` Qais Yousef
2015-11-03 11:12 ` [PATCH 07/14] genirq: Add a new generic IPI reservation code to irq core Qais Yousef
2015-11-03 12:06 ` kbuild test robot
2015-11-07 12:11 ` Thomas Gleixner
2015-11-07 13:31 ` Thomas Gleixner
2015-11-09 10:07 ` Qais Yousef
2015-11-16 15:09 ` Thomas Gleixner
2015-11-03 11:12 ` [PATCH 08/14] genirq: Add a new irq_send_ipi() to irq_chip Qais Yousef
2015-11-03 11:12 ` [PATCH 09/14] genirq: Implement irq_send_ipi() to be used by drivers Qais Yousef
2015-11-03 12:09 ` kbuild test robot
2015-11-07 12:14 ` Thomas Gleixner
2015-11-03 11:12 ` [PATCH 10/14] irqchip/mips-gic: Add a IPI hierarchy domain Qais Yousef
2015-11-07 14:51 ` Thomas Gleixner
2015-11-09 11:10 ` Qais Yousef
2015-11-16 17:17 ` Thomas Gleixner
2015-11-17 10:08 ` Qais Yousef
2015-11-17 10:11 ` Thomas Gleixner
2015-11-17 10:30 ` Qais Yousef
2015-11-20 10:48 ` Qais Yousef
2015-11-20 20:39 ` [PATCH 10/14] irqchip/mips-gic: Add a IPI hierarchy domaind Thomas Gleixner
2015-11-23 16:55 ` Qais Yousef
2015-11-12 15:12 ` [PATCH 10/14] irqchip/mips-gic: Add a IPI hierarchy domain Qais Yousef
2015-11-16 17:24 ` Thomas Gleixner
2015-11-17 10:24 ` Qais Yousef
2015-11-17 10:30 ` Thomas Gleixner
2015-11-03 11:12 ` [PATCH 11/14] MIPS: Add generic SMP IPI support Qais Yousef
2015-11-03 11:12 ` [PATCH 12/14] MIPS: Make smp CMP, CPS and MT use the new generic IPI functions Qais Yousef
2015-11-03 11:13 ` [PATCH 13/14] MIPS: Delete smp-gic.c Qais Yousef
2015-11-03 11:13 ` Qais Yousef [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=1446549181-31788-15-git-send-email-qais.yousef@imgtec.com \
--to=qais.yousef@imgtec.com \
--cc=corbet@lwn.net \
--cc=jason@lakedaemon.net \
--cc=jiang.liu@linux.intel.com \
--cc=linux-doc@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mips@linux-mips.org \
--cc=marc.zyngier@arm.com \
--cc=ralf@linux-mips.org \
--cc=tglx@linutronix.de \
/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).