From: eric.auger@redhat.com (Eric Auger)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v12 06/11] genirq/msi: msi_doorbell_safe
Date: Tue, 2 Aug 2016 17:23:32 +0000 [thread overview]
Message-ID: <1470158617-7022-7-git-send-email-eric.auger@redhat.com> (raw)
In-Reply-To: <1470158617-7022-1-git-send-email-eric.auger@redhat.com>
msi_doorbell_safe returns whether all the registered doorbells
implement irq_remapping.
IRQ remapping is the x86 terminology (IRQ translation used on ARM).
The MSI controller topology is safe if all the registered doorbells
implement IRQ remapping.
This safety notion is used on ARM when assigning PCIe devices. If
any of the MSI doorbell is unsafe, the MSI assignment gets considered
unsafe.
Signed-off-by: Eric Auger <eric.auger@redhat.com>
---
v11 -> v12:
- reword the commit message
---
include/linux/msi-doorbell.h | 13 +++++++++++++
kernel/irq/msi-doorbell.c | 6 ++++++
2 files changed, 19 insertions(+)
diff --git a/include/linux/msi-doorbell.h b/include/linux/msi-doorbell.h
index bbedb3b..696e0bd 100644
--- a/include/linux/msi-doorbell.h
+++ b/include/linux/msi-doorbell.h
@@ -47,6 +47,14 @@ void msi_doorbell_unregister_global(struct msi_doorbell_info *db);
*/
int msi_doorbell_calc_pages(unsigned int order);
+/**
+ * msi_doorbell_safe - return whether all registered doorbells are safe
+ *
+ * Safe doorbells are those which implement irq remapping
+ * Return: true if all doorbells are safe, false otherwise
+ */
+bool msi_doorbell_safe(void);
+
#else
static inline struct msi_doorbell_info *
@@ -64,6 +72,11 @@ static inline int msi_doorbell_calc_pages(unsigned int order)
return 0;
}
+static inline bool
+msi_doorbell_safe(void)
+{
+ return true;
+}
#endif /* CONFIG_MSI_DOORBELL */
#endif
diff --git a/kernel/irq/msi-doorbell.c b/kernel/irq/msi-doorbell.c
index 5c6c2aa..f8f0d24 100644
--- a/kernel/irq/msi-doorbell.c
+++ b/kernel/irq/msi-doorbell.c
@@ -130,3 +130,9 @@ int msi_doorbell_calc_pages(unsigned int order)
return ret;
}
EXPORT_SYMBOL_GPL(msi_doorbell_calc_pages);
+
+bool msi_doorbell_safe(void)
+{
+ return !nb_unsafe_doorbells;
+}
+EXPORT_SYMBOL_GPL(msi_doorbell_safe);
--
1.9.1
next prev parent reply other threads:[~2016-08-02 17:23 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-08-02 17:23 [PATCH v12 00/11] KVM PCIe/MSI passthrough on ARM/ARM64: kernel part 2/3: msi changes Eric Auger
2016-08-02 17:23 ` [PATCH v12 01/11] genirq/msi: export msi_get_domain_info Eric Auger
2016-08-02 17:23 ` [PATCH v12 02/11] genirq/msi: msi_compose wrapper Eric Auger
2016-08-09 9:19 ` Thomas Gleixner
2016-08-10 8:48 ` Auger Eric
2016-08-02 17:23 ` [PATCH v12 03/11] genirq: Introduce irq_get_msi_doorbell_info Eric Auger
2016-08-02 17:23 ` [PATCH v12 04/11] genirq/msi: Allow MSI doorbell (un)registration Eric Auger
2016-08-02 17:23 ` [PATCH v12 05/11] genirq/msi: msi_doorbell_calc_pages Eric Auger
2016-08-02 17:23 ` Eric Auger [this message]
2016-08-02 17:23 ` [PATCH v12 07/11] irqchip/gic-v2m: Register the MSI global doorbell Eric Auger
2016-08-02 17:23 ` [PATCH v12 08/11] irqchip/gicv3-its: " Eric Auger
2016-08-02 17:23 ` [PATCH v12 09/11] genirq/msi: Introduce msi_desc flags Eric Auger
2016-08-09 6:52 ` Auger Eric
2016-08-02 17:23 ` [PATCH v12 10/11] genirq/msi: Map/unmap the MSI doorbells on msi_domain_alloc/free_irqs Eric Auger
2016-08-02 17:23 ` [PATCH v12 11/11] genirq/msi: Use the MSI doorbell's IOVA when requested Eric Auger
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=1470158617-7022-7-git-send-email-eric.auger@redhat.com \
--to=eric.auger@redhat.com \
--cc=linux-arm-kernel@lists.infradead.org \
/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).