All of lore.kernel.org
 help / color / mirror / Atom feed
From: "irqchip-bot for Marc Zyngier" <tip-bot2@linutronix.de>
To: linux-kernel@vger.kernel.org
Cc: Marc Zyngier <maz@kernel.org>, John Garry <john.garry@huawei.com>,
	tglx@linutronix.de
Subject: [irqchip: irq/irqchip-next] platform-msi: Track shared domain allocation
Date: Fri, 11 Dec 2020 14:58:42 -0000	[thread overview]
Message-ID: <160769872273.3364.3717006232182382204.tip-bot2@tip-bot2> (raw)
In-Reply-To: <20201129135208.680293-2-maz@kernel.org>

The following commit has been merged into the irq/irqchip-next branch of irqchip:

Commit-ID:     91f90daa4fb2b77db7aa25ef2e0206f2e3962665
Gitweb:        https://git.kernel.org/pub/scm/linux/kernel/git/maz/arm-platforms/91f90daa4fb2b77db7aa25ef2e0206f2e3962665
Author:        Marc Zyngier <maz@kernel.org>
AuthorDate:    Sun, 29 Nov 2020 13:52:06 
Committer:     Marc Zyngier <maz@kernel.org>
CommitterDate: Fri, 11 Dec 2020 14:47:50 

platform-msi: Track shared domain allocation

We have two flavours of platform-MSI:

- MSIs generated by devices for themselves (the usual case)

- MSIs generated on behalf of other devices, as the generating
  device is some form of bridge (either a wire-to-MSI bridge,
  or even a non-transparent PCI bridge that repaints the PCI
  requester ID).

In the latter case, the underlying interrupt architecture may need
to track this in order to keep the mapping alive even when no MSI
are currently being generated.

Add a set of flags to the generic msi_alloc_info_t structure, as
well as the MSI_ALLOC_FLAGS_PROXY_DEVICE flag that will get
advertized by the platform-MSI code when allocating an irqdomain
for a device.

Signed-off-by: Marc Zyngier <maz@kernel.org>
Tested-by: John Garry <john.garry@huawei.com>
Link: https://lore.kernel.org/r/20201129135208.680293-2-maz@kernel.org
---
 drivers/base/platform-msi.c | 7 +++++++
 include/asm-generic/msi.h   | 4 ++++
 2 files changed, 11 insertions(+)

diff --git a/drivers/base/platform-msi.c b/drivers/base/platform-msi.c
index c4a17e5..2c1e2e0 100644
--- a/drivers/base/platform-msi.c
+++ b/drivers/base/platform-msi.c
@@ -59,9 +59,15 @@ static int platform_msi_init(struct irq_domain *domain,
 	return irq_domain_set_hwirq_and_chip(domain, virq, hwirq,
 					     info->chip, info->chip_data);
 }
+
+static void platform_msi_set_proxy_dev(msi_alloc_info_t *arg)
+{
+	arg->flags |= MSI_ALLOC_FLAGS_PROXY_DEVICE;
+}
 #else
 #define platform_msi_set_desc		NULL
 #define platform_msi_init		NULL
+#define platform_msi_set_proxy_dev(x)	do {} while(0)
 #endif
 
 static void platform_msi_update_dom_ops(struct msi_domain_info *info)
@@ -343,6 +349,7 @@ __platform_msi_create_device_domain(struct device *dev,
 	if (!domain)
 		goto free_priv;
 
+	platform_msi_set_proxy_dev(&data->arg);
 	err = msi_domain_prepare_irqs(domain->parent, dev, nvec, &data->arg);
 	if (err)
 		goto free_domain;
diff --git a/include/asm-generic/msi.h b/include/asm-generic/msi.h
index e6795f0..1010e74 100644
--- a/include/asm-generic/msi.h
+++ b/include/asm-generic/msi.h
@@ -22,12 +22,16 @@ struct msi_desc;
 typedef struct msi_alloc_info {
 	struct msi_desc			*desc;
 	irq_hw_number_t			hwirq;
+	unsigned long			flags;
 	union {
 		unsigned long		ul;
 		void			*ptr;
 	} scratchpad[NUM_MSI_ALLOC_SCRATCHPAD_REGS];
 } msi_alloc_info_t;
 
+/* Device generating MSIs is proxying for another device */
+#define MSI_ALLOC_FLAGS_PROXY_DEVICE	(1UL << 0)
+
 #define GENERIC_MSI_DOMAIN_OPS		1
 
 #endif

  reply	other threads:[~2020-12-11 15:28 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-11-29 13:52 [PATCH 0/3] MSI: Track device proxying when allocating MSIs Marc Zyngier
2020-11-29 13:52 ` [PATCH 1/3] platform-msi: Track shared domain allocation Marc Zyngier
2020-12-11 14:58   ` irqchip-bot for Marc Zyngier [this message]
2020-11-29 13:52 ` [PATCH 2/3] irqchip/gic-v3-its: Tag ITS device as shared if allocating for a proxy device Marc Zyngier
2020-12-11 14:58   ` [irqchip: irq/irqchip-next] " irqchip-bot for Marc Zyngier
2020-11-29 13:52 ` [PATCH 3/3] irqchip/gic-v3-its: Flag device allocation as proxied if behind a PCI bridge Marc Zyngier
2020-12-11 14:58   ` [irqchip: irq/irqchip-next] " irqchip-bot for Marc Zyngier
2020-11-30 13:14 ` [PATCH 0/3] MSI: Track device proxying when allocating MSIs John Garry

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=160769872273.3364.3717006232182382204.tip-bot2@tip-bot2 \
    --to=tip-bot2@linutronix.de \
    --cc=john.garry@huawei.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=maz@kernel.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.