From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: stable@vger.kernel.org
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
patches@lists.linux.dev,
Diana Craciun <diana.craciun@oss.nxp.com>,
Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>,
Rob Herring <robh@kernel.org>,
Bjorn Helgaas <bhelgaas@google.com>,
Rob Herring <robh+dt@kernel.org>, Marc Zyngier <maz@kernel.org>,
Catalin Marinas <catalin.marinas@arm.com>,
Sasha Levin <sashal@kernel.org>
Subject: [PATCH 5.4 11/67] of/irq: make of_msi_map_get_device_domain() bus agnostic
Date: Mon, 11 Dec 2023 19:21:55 +0100 [thread overview]
Message-ID: <20231211182015.571003692@linuxfoundation.org> (raw)
In-Reply-To: <20231211182015.049134368@linuxfoundation.org>
5.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: Diana Craciun <diana.craciun@oss.nxp.com>
[ Upstream commit 6f881aba01109a01a43e4f135673c19190f61133 ]
of_msi_map_get_device_domain() is PCI specific but it need not be and
can be easily changed to be bus agnostic in order to be used by other
busses by adding an IRQ domain bus token as an input parameter.
Signed-off-by: Diana Craciun <diana.craciun@oss.nxp.com>
Signed-off-by: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
Reviewed-by: Rob Herring <robh@kernel.org>
Acked-by: Bjorn Helgaas <bhelgaas@google.com> # pci/msi.c
Cc: Bjorn Helgaas <bhelgaas@google.com>
Cc: Rob Herring <robh+dt@kernel.org>
Cc: Marc Zyngier <maz@kernel.org>
Link: https://lore.kernel.org/r/20200619082013.13661-10-lorenzo.pieralisi@arm.com
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
Stable-dep-of: d79972789d17 ("of: dynamic: Fix of_reconfig_get_state_change() return value documentation")
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/of/irq.c | 8 +++++---
drivers/pci/msi.c | 2 +-
include/linux/of_irq.h | 5 +++--
3 files changed, 9 insertions(+), 6 deletions(-)
diff --git a/drivers/of/irq.c b/drivers/of/irq.c
index d632bc5b3a2de..1005e4f349ef6 100644
--- a/drivers/of/irq.c
+++ b/drivers/of/irq.c
@@ -613,18 +613,20 @@ u32 of_msi_map_rid(struct device *dev, struct device_node *msi_np, u32 rid_in)
* of_msi_map_get_device_domain - Use msi-map to find the relevant MSI domain
* @dev: device for which the mapping is to be done.
* @rid: Requester ID for the device.
+ * @bus_token: Bus token
*
* Walk up the device hierarchy looking for devices with a "msi-map"
* property.
*
* Returns: the MSI domain for this device (or NULL on failure)
*/
-struct irq_domain *of_msi_map_get_device_domain(struct device *dev, u32 rid)
+struct irq_domain *of_msi_map_get_device_domain(struct device *dev, u32 id,
+ u32 bus_token)
{
struct device_node *np = NULL;
- __of_msi_map_rid(dev, &np, rid);
- return irq_find_matching_host(np, DOMAIN_BUS_PCI_MSI);
+ __of_msi_map_rid(dev, &np, id);
+ return irq_find_matching_host(np, bus_token);
}
/**
diff --git a/drivers/pci/msi.c b/drivers/pci/msi.c
index cc863cdd5cc74..392d2ecf7dc89 100644
--- a/drivers/pci/msi.c
+++ b/drivers/pci/msi.c
@@ -1624,7 +1624,7 @@ struct irq_domain *pci_msi_get_device_domain(struct pci_dev *pdev)
u32 rid = pci_dev_id(pdev);
pci_for_each_dma_alias(pdev, get_msi_id_cb, &rid);
- dom = of_msi_map_get_device_domain(&pdev->dev, rid);
+ dom = of_msi_map_get_device_domain(&pdev->dev, rid, DOMAIN_BUS_PCI_MSI);
if (!dom)
dom = iort_get_device_domain(&pdev->dev, rid,
DOMAIN_BUS_PCI_MSI);
diff --git a/include/linux/of_irq.h b/include/linux/of_irq.h
index 1214cabb22479..7142a37227584 100644
--- a/include/linux/of_irq.h
+++ b/include/linux/of_irq.h
@@ -52,7 +52,8 @@ extern struct irq_domain *of_msi_get_domain(struct device *dev,
struct device_node *np,
enum irq_domain_bus_token token);
extern struct irq_domain *of_msi_map_get_device_domain(struct device *dev,
- u32 rid);
+ u32 id,
+ u32 bus_token);
extern void of_msi_configure(struct device *dev, struct device_node *np);
u32 of_msi_map_rid(struct device *dev, struct device_node *msi_np, u32 rid_in);
#else
@@ -85,7 +86,7 @@ static inline struct irq_domain *of_msi_get_domain(struct device *dev,
return NULL;
}
static inline struct irq_domain *of_msi_map_get_device_domain(struct device *dev,
- u32 rid)
+ u32 id, u32 bus_token)
{
return NULL;
}
--
2.42.0
next prev parent reply other threads:[~2023-12-11 18:41 UTC|newest]
Thread overview: 74+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-12-11 18:21 [PATCH 5.4 00/67] 5.4.264-rc1 review Greg Kroah-Hartman
2023-12-11 18:21 ` [PATCH 5.4 01/67] hrtimers: Push pending hrtimers away from outgoing CPU earlier Greg Kroah-Hartman
2023-12-11 18:21 ` [PATCH 5.4 02/67] netfilter: ipset: fix race condition between swap/destroy and kernel side add/del/test Greg Kroah-Hartman
2023-12-11 18:21 ` [PATCH 5.4 03/67] tg3: Move the [rt]x_dropped counters to tg3_napi Greg Kroah-Hartman
2023-12-11 18:21 ` [PATCH 5.4 04/67] tg3: Increment tx_dropped in tg3_tso_bug() Greg Kroah-Hartman
2023-12-11 18:21 ` [PATCH 5.4 05/67] kconfig: fix memory leak from range properties Greg Kroah-Hartman
2023-12-11 18:21 ` [PATCH 5.4 06/67] drm/amdgpu: correct chunk_ptr to a pointer to chunk Greg Kroah-Hartman
2023-12-11 18:21 ` [PATCH 5.4 07/67] of: base: Add of_get_cpu_state_node() to get idle states for a CPU node Greg Kroah-Hartman
2023-12-11 18:21 ` [PATCH 5.4 08/67] ACPI/IORT: Make iort_get_device_domain IRQ domain agnostic Greg Kroah-Hartman
2023-12-11 18:21 ` [PATCH 5.4 09/67] ACPI/IORT: Make iort_msi_map_rid() PCI agnostic Greg Kroah-Hartman
2023-12-11 18:21 ` [PATCH 5.4 10/67] of/iommu: Make of_map_rid() " Greg Kroah-Hartman
2023-12-11 18:21 ` Greg Kroah-Hartman [this message]
2023-12-11 18:21 ` [PATCH 5.4 12/67] of/irq: Make of_msi_map_rid() PCI bus agnostic Greg Kroah-Hartman
2023-12-11 18:21 ` [PATCH 5.4 13/67] of: base: Fix some formatting issues and provide missing descriptions Greg Kroah-Hartman
2023-12-11 18:21 ` [PATCH 5.4 14/67] of: Fix kerneldoc output formatting Greg Kroah-Hartman
2023-12-11 18:21 ` [PATCH 5.4 15/67] of: Add missing Return section in kerneldoc comments Greg Kroah-Hartman
2023-12-11 18:22 ` [PATCH 5.4 16/67] of: dynamic: Fix of_reconfig_get_state_change() return value documentation Greg Kroah-Hartman
2023-12-11 18:22 ` [PATCH 5.4 17/67] ipv6: fix potential NULL deref in fib6_add() Greg Kroah-Hartman
2023-12-11 18:22 ` [PATCH 5.4 18/67] hv_netvsc: rndis_filter needs to select NLS Greg Kroah-Hartman
2023-12-11 18:22 ` [PATCH 5.4 19/67] net: arcnet: Fix RESET flag handling Greg Kroah-Hartman
2023-12-11 18:22 ` [PATCH 5.4 20/67] net: arcnet: com20020 fix error handling Greg Kroah-Hartman
2023-12-11 18:22 ` [PATCH 5.4 21/67] arcnet: restoring support for multiple Sohard Arcnet cards Greg Kroah-Hartman
2023-12-11 18:22 ` [PATCH 5.4 22/67] ipv4: ip_gre: Avoid skb_pull() failure in ipgre_xmit() Greg Kroah-Hartman
2023-12-11 18:22 ` [PATCH 5.4 23/67] net: hns: fix fake link up on xge port Greg Kroah-Hartman
2023-12-11 18:22 ` [PATCH 5.4 24/67] netfilter: xt_owner: Fix for unsafe access of sk->sk_socket Greg Kroah-Hartman
2023-12-11 18:22 ` [PATCH 5.4 25/67] tcp: do not accept ACK of bytes we never sent Greg Kroah-Hartman
2023-12-11 18:22 ` [PATCH 5.4 26/67] bpf: sockmap, updating the sg structure should also update curr Greg Kroah-Hartman
2023-12-11 18:22 ` [PATCH 5.4 27/67] RDMA/bnxt_re: Correct module description string Greg Kroah-Hartman
2023-12-11 18:22 ` [PATCH 5.4 28/67] hwmon: (acpi_power_meter) Fix 4.29 MW bug Greg Kroah-Hartman
2023-12-11 18:22 ` [PATCH 5.4 29/67] ASoC: wm_adsp: fix memleak in wm_adsp_buffer_populate Greg Kroah-Hartman
2023-12-11 18:22 ` [PATCH 5.4 30/67] tracing: Fix a warning when allocating buffered events fails Greg Kroah-Hartman
2023-12-11 18:22 ` [PATCH 5.4 31/67] scsi: be2iscsi: Fix a memleak in beiscsi_init_wrb_handle() Greg Kroah-Hartman
2023-12-11 18:22 ` [PATCH 5.4 32/67] ARM: imx: Check return value of devm_kasprintf in imx_mmdc_perf_init Greg Kroah-Hartman
2023-12-11 18:22 ` [PATCH 5.4 33/67] ARM: dts: imx: make gpt node name generic Greg Kroah-Hartman
2023-12-11 18:22 ` [PATCH 5.4 34/67] ARM: dts: imx7: Declare timers compatible with fsl,imx6dl-gpt Greg Kroah-Hartman
2023-12-11 18:22 ` [PATCH 5.4 35/67] ALSA: pcm: fix out-of-bounds in snd_pcm_state_names Greg Kroah-Hartman
2023-12-11 18:22 ` [PATCH 5.4 36/67] nilfs2: prevent WARNING in nilfs_sufile_set_segment_usage() Greg Kroah-Hartman
2023-12-11 18:22 ` [PATCH 5.4 37/67] tracing: Always update snapshot buffer size Greg Kroah-Hartman
2023-12-11 18:22 ` [PATCH 5.4 38/67] tracing: Fix incomplete locking when disabling buffered events Greg Kroah-Hartman
2023-12-11 18:22 ` [PATCH 5.4 39/67] tracing: Fix a possible race " Greg Kroah-Hartman
2023-12-11 18:22 ` [PATCH 5.4 40/67] packet: Move reference count in packet_sock to atomic_long_t Greg Kroah-Hartman
2023-12-11 18:22 ` [PATCH 5.4 41/67] arm64: dts: mediatek: mt7622: fix memory node warning check Greg Kroah-Hartman
2023-12-11 18:22 ` [PATCH 5.4 42/67] arm64: dts: mediatek: mt8173-evb: Fix regulator-fixed node names Greg Kroah-Hartman
2023-12-11 18:22 ` [PATCH 5.4 43/67] perf/core: Add a new read format to get a number of lost samples Greg Kroah-Hartman
2023-12-11 18:22 ` [PATCH 5.4 44/67] perf: Fix perf_event_validate_size() Greg Kroah-Hartman
2023-12-11 18:22 ` [PATCH 5.4 45/67] gpiolib: sysfs: Fix error handling on failed export Greg Kroah-Hartman
2023-12-11 18:22 ` [PATCH 5.4 46/67] mmc: core: add helpers mmc_regulator_enable/disable_vqmmc Greg Kroah-Hartman
2023-12-11 18:22 ` [PATCH 5.4 47/67] mmc: sdhci-sprd: Fix vqmmc not shutting down after the card was pulled Greg Kroah-Hartman
2023-12-11 18:22 ` [PATCH 5.4 48/67] usb: gadget: f_hid: fix report descriptor allocation Greg Kroah-Hartman
2023-12-11 18:22 ` [PATCH 5.4 49/67] parport: Add support for Brainboxes IX/UC/PX parallel cards Greg Kroah-Hartman
2023-12-11 18:22 ` [PATCH 5.4 50/67] usb: typec: class: fix typec_altmode_put_partner to put plugs Greg Kroah-Hartman
2023-12-11 18:22 ` [PATCH 5.4 51/67] ARM: PL011: Fix DMA support Greg Kroah-Hartman
2023-12-11 18:22 ` [PATCH 5.4 52/67] serial: sc16is7xx: address RX timeout interrupt errata Greg Kroah-Hartman
2023-12-11 18:22 ` [PATCH 5.4 53/67] serial: 8250_omap: Add earlycon support for the AM654 UART controller Greg Kroah-Hartman
2023-12-11 18:22 ` [PATCH 5.4 54/67] x86/CPU/AMD: Check vendor in the AMD microcode callback Greg Kroah-Hartman
2023-12-11 18:22 ` [PATCH 5.4 55/67] KVM: s390/mm: Properly reset no-dat Greg Kroah-Hartman
2023-12-11 18:22 ` [PATCH 5.4 56/67] nilfs2: fix missing error check for sb_set_blocksize call Greg Kroah-Hartman
2023-12-11 18:22 ` [PATCH 5.4 57/67] io_uring/af_unix: disable sending io_uring over sockets Greg Kroah-Hartman
2023-12-11 18:22 ` [PATCH 5.4 58/67] netlink: dont call ->netlink_bind with table lock held Greg Kroah-Hartman
2023-12-11 18:22 ` [PATCH 5.4 59/67] genetlink: add CAP_NET_ADMIN test for multicast bind Greg Kroah-Hartman
2023-12-11 18:22 ` [PATCH 5.4 60/67] psample: Require CAP_NET_ADMIN when joining "packets" group Greg Kroah-Hartman
2023-12-11 18:22 ` [PATCH 5.4 61/67] drop_monitor: Require CAP_SYS_ADMIN when joining "events" group Greg Kroah-Hartman
2023-12-11 18:22 ` [PATCH 5.4 62/67] tools headers UAPI: Sync linux/perf_event.h with the kernel sources Greg Kroah-Hartman
2023-12-11 18:22 ` [PATCH 5.4 63/67] Revert "btrfs: add dmesg output for first mount and last unmount of a filesystem" Greg Kroah-Hartman
2023-12-11 18:22 ` [PATCH 5.4 64/67] cifs: Fix non-availability of dedup breaking generic/304 Greg Kroah-Hartman
2023-12-11 18:22 ` [PATCH 5.4 65/67] smb: client: fix potential NULL deref in parse_dfs_referrals() Greg Kroah-Hartman
2023-12-11 18:22 ` [PATCH 5.4 66/67] devcoredump : Serialize devcd_del work Greg Kroah-Hartman
2023-12-11 18:22 ` [PATCH 5.4 67/67] devcoredump: Send uevent once devcd is ready Greg Kroah-Hartman
2023-12-11 19:04 ` [PATCH 5.4 00/67] 5.4.264-rc1 review Florian Fainelli
2023-12-12 13:23 ` Harshit Mogalapalli
2023-12-12 16:13 ` Shuah Khan
2023-12-12 17:00 ` Guenter Roeck
2023-12-12 17:05 ` Naresh Kamboju
2023-12-12 22:19 ` Jon Hunter
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=20231211182015.571003692@linuxfoundation.org \
--to=gregkh@linuxfoundation.org \
--cc=bhelgaas@google.com \
--cc=catalin.marinas@arm.com \
--cc=diana.craciun@oss.nxp.com \
--cc=lorenzo.pieralisi@arm.com \
--cc=maz@kernel.org \
--cc=patches@lists.linux.dev \
--cc=robh+dt@kernel.org \
--cc=robh@kernel.org \
--cc=sashal@kernel.org \
--cc=stable@vger.kernel.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