From nobody Tue Oct 7 15:58:54 2025 Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 2E4B42E7178 for ; Tue, 8 Jul 2025 18:20:27 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=193.142.43.55 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1751998828; cv=none; b=qly5Dy5/JB9oo3HgyX0gUOzPPCwYLkI960ciHIdqDrTvZR0/7/pnfLXHP2qSD9h0hXZLK32dJQKXsy4vKNw8YHRk+vcho22AqbFLxRP+fKw7ms5/vi5pjml65Rd5QFkr9xDccPcQ/97uaqgB9tfNqnX8xFdi18WFIM9eWpWQ4ow= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1751998828; c=relaxed/simple; bh=v4LxCvv8WoskLG6QIetQCGXqVFUw0qQGnp7cVAGaT0g=; h=Date:From:To:Subject:Cc:In-Reply-To:References:MIME-Version: Message-ID:Content-Type; b=GmNZ/8KvMzWOzveMmhSh3Jef/sLW5a9sE8/+X7Ah15yv8IzrnPXHsGcUmnc+Ua2ktfFyvk/ayuWU0Jnnp3gv5mlvhusKQmT4M+lPFdesU6Hrzm0UwAyN5nVjwHHWlpR7zUOkx7EJ/c2P3/vhk2+u/QM5U+1YMItxXbC2FUUsVtQ= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de; spf=pass smtp.mailfrom=linutronix.de; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=IkLv1n/M; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=WLfpmM0b; arc=none smtp.client-ip=193.142.43.55 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linutronix.de Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="IkLv1n/M"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="WLfpmM0b" Date: Tue, 08 Jul 2025 18:20:24 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1751998825; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=/FxpAD7zVLZ4qd8gwTxM8GBK3+ZCm/OxOBD1xLVw8CY=; b=IkLv1n/MP1hyXhNHUdeghJ9sCJl8eGVT2hrkMI/lqCq4nVdqQoov/XOY9cIGsX+ghiYwiZ sucUdbHJSSkfN8RYfYOoh7iAV1jilhne3c+SDH+nNaJJljUst2croG3maXhvbpSX5Atb2G wOydaJvHjmfvYSl1iYa1lLi90lvaPKUO5wYoKTaclwaPk+yFlqx0a7qpMy2IvYbJPb6PoV 74ec7oBMps9liT5V2Hw8My2/ZwBNZ5CQwk0jKBmZk5zWfA6rnKh+sr6spIJUF1t0jAjYtJ YtwUWVZBVata1ZM9rzBMmCxApX3+lP8GU8G2pZIcktZ6S6wCWh15jtwwQwCUZw== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1751998825; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=/FxpAD7zVLZ4qd8gwTxM8GBK3+ZCm/OxOBD1xLVw8CY=; b=WLfpmM0bzoQxDgz0pubP65y7FQaot0JVJoZgYH02QXeLV9fypxH4XJbe5mCu/uOrZRZE2F kx1+v+wSy3ZQWkBQ== From: "irqchip-bot for Lorenzo Pieralisi" Sender: tip-bot2@linutronix.de Reply-to: linux-kernel@vger.kernel.org To: linux-kernel@vger.kernel.org Subject: [irqchip: irq/irqchip-next] of/irq: Add of_msi_xlate() helper function Cc: Lorenzo Pieralisi , Marc Zyngier , Rob Herring , tglx@linutronix.de In-Reply-To: <20250703-gicv5-host-v7-24-12e71f1b3528@kernel.org> References: <20250703-gicv5-host-v7-24-12e71f1b3528@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-ID: <175199882466.406.11089795363838580771.tip-bot2@tip-bot2> Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails Precedence: bulk Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable The following commit has been merged into the irq/irqchip-next branch of ir= qchip: Commit-ID: 31fd3becb920e0b31b99cf202ace637f75dd7e78 Gitweb: https://git.kernel.org/pub/scm/linux/kernel/git/maz/arm-plat= forms/31fd3becb920e0b31b99cf202ace637f75dd7e78 Author: Lorenzo Pieralisi AuthorDate: Thu, 03 Jul 2025 12:25:14 +02:00 Committer: Marc Zyngier CommitterDate: Tue, 08 Jul 2025 18:35:52 +01:00 of/irq: Add of_msi_xlate() helper function Add an of_msi_xlate() helper that maps a device ID and returns the device node of the MSI controller the device ID is mapped to. Required by core functions that need an MSI controller device node pointer at the same time as a mapped device ID, of_msi_map_id() is not sufficient for that purpose. Signed-off-by: Lorenzo Pieralisi Reviewed-by: Marc Zyngier Cc: Rob Herring Cc: Marc Zyngier Reviewed-by: Rob Herring (Arm) Link: https://lore.kernel.org/r/20250703-gicv5-host-v7-24-12e71f1b3528@kern= el.org Signed-off-by: Marc Zyngier --- drivers/of/irq.c | 22 +++++++++++++++++----- include/linux/of_irq.h | 5 +++++ 2 files changed, 22 insertions(+), 5 deletions(-) diff --git a/drivers/of/irq.c b/drivers/of/irq.c index f8ad79b..74aaea6 100644 --- a/drivers/of/irq.c +++ b/drivers/of/irq.c @@ -670,8 +670,20 @@ err: } } =20 -static u32 __of_msi_map_id(struct device *dev, struct device_node **np, - u32 id_in) +/** + * of_msi_xlate - map a MSI ID and find relevant MSI controller node + * @dev: device for which the mapping is to be done. + * @msi_np: Pointer to store the MSI controller node + * @id_in: Device ID. + * + * Walk up the device hierarchy looking for devices with a "msi-map" + * property. If found, apply the mapping to @id_in. @msi_np pointed + * value must be NULL on entry, if an MSI controller is found @msi_np is + * initialized to the MSI controller node with a reference held. + * + * Returns: The mapped MSI id. + */ +u32 of_msi_xlate(struct device *dev, struct device_node **msi_np, u32 id_i= n) { struct device *parent_dev; u32 id_out =3D id_in; @@ -682,7 +694,7 @@ static u32 __of_msi_map_id(struct device *dev, struct d= evice_node **np, */ for (parent_dev =3D dev; parent_dev; parent_dev =3D parent_dev->parent) if (!of_map_id(parent_dev->of_node, id_in, "msi-map", - "msi-map-mask", np, &id_out)) + "msi-map-mask", msi_np, &id_out)) break; return id_out; } @@ -700,7 +712,7 @@ static u32 __of_msi_map_id(struct device *dev, struct d= evice_node **np, */ u32 of_msi_map_id(struct device *dev, struct device_node *msi_np, u32 id_i= n) { - return __of_msi_map_id(dev, &msi_np, id_in); + return of_msi_xlate(dev, &msi_np, id_in); } =20 /** @@ -719,7 +731,7 @@ struct irq_domain *of_msi_map_get_device_domain(struct = device *dev, u32 id, { struct device_node *np =3D NULL; =20 - __of_msi_map_id(dev, &np, id); + of_msi_xlate(dev, &np, id); return irq_find_matching_host(np, bus_token); } =20 diff --git a/include/linux/of_irq.h b/include/linux/of_irq.h index 6337ad4..a480063 100644 --- a/include/linux/of_irq.h +++ b/include/linux/of_irq.h @@ -54,6 +54,7 @@ extern struct irq_domain *of_msi_map_get_device_domain(st= ruct device *dev, u32 id, u32 bus_token); extern void of_msi_configure(struct device *dev, const struct device_node = *np); +extern u32 of_msi_xlate(struct device *dev, struct device_node **msi_np, u= 32 id_in); u32 of_msi_map_id(struct device *dev, struct device_node *msi_np, u32 id_i= n); #else static inline void of_irq_init(const struct of_device_id *matches) @@ -100,6 +101,10 @@ static inline struct irq_domain *of_msi_map_get_device= _domain(struct device *dev static inline void of_msi_configure(struct device *dev, struct device_node= *np) { } +static inline u32 of_msi_xlate(struct device *dev, struct device_node **ms= i_np, u32 id_in) +{ + return id_in; +} static inline u32 of_msi_map_id(struct device *dev, struct device_node *msi_np, u32 id_in) {