From nobody Fri Dec 19 22:03:23 2025 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 75BF732E754; Tue, 21 Oct 2025 12:41:31 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1761050491; cv=none; b=P07/OvWt/0Y1393HFO2AgV2AbU1XnzqrTNfgquhYZWaClVVP6Zq+6ilWY61eOlqv6HescQldKnqHWnP8n/+B4/U/aarrnibJJXO8DsfMflX7LSEOATzaY/HaIU0IOeVeDGwZKozomzNheLV2uyCY9VtTWi9No8It/aAyJTQNGqg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1761050491; c=relaxed/simple; bh=NG4e6thsmTs+tS4vAqcXpl8k/SUzrCPff2en/NEAlIs=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=ZiiMVznbqCRxp/smSNaDAQuaPPzs/0Yb3ZuTVLtelfW1/9oO9/Wn1uTeEQBRk4GnQsgPARFEAmK9LmuxNWbKc5FM6/qvvNN9IkEx561rL2+fA/0bVhX8IJc4ZdT47Scjtp/QOf3G9pNzPmryfmcyMSqyrUVXPTcEJlBv5sWIVT4= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=PyV4Vj00; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="PyV4Vj00" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 82D95C4CEF5; Tue, 21 Oct 2025 12:41:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1761050491; bh=NG4e6thsmTs+tS4vAqcXpl8k/SUzrCPff2en/NEAlIs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=PyV4Vj00JSE9dHMgq5+mweq44ZXS3oBAvJenwdHZoR3yAKZ6m8mppRde7nDnEgkWn jsPriWl0ODqyceq5hu8CzNajIC37GJuGGivY9xoyMrzfL+0VG9AyJb9hw+1+2OYhUh OcnjxMIPJ3VLVR9TYdwKiJXzJ9EzXCwYCdSw53oRsxXJfMM/Wyh07GD3LIIHwLiBL3 W3dEila7lPO9kfyrIk2v12ypt+G9ZGSBexV+xfaBSc4tUyzG/XhW8aReXQciKGaYAP mm4rB772/7kNbPdFa4xQZc+GwD7OlWX3Qs212aUiLdyNNO1BYJBusoIDHHNuwpzum8 B5KQNjcR8uXaw== From: Lorenzo Pieralisi To: linux-kernel@vger.kernel.org Cc: linux-arm-kernel@lists.infradead.org, devicetree@vger.kernel.org, linux-pci@vger.kernel.org, Frank Li , Scott Branden , Bjorn Helgaas , Rob Herring , Ray Jui , Manivannan Sadhasivam , =?UTF-8?q?Krzysztof=20Wilczy=C5=84ski?= , Sascha Bischoff , Thomas Gleixner , Marc Zyngier Subject: [PATCH v4 4/5] PCI: iproc: Implement MSI controller node detection with of_msi_xlate() Date: Tue, 21 Oct 2025 14:41:02 +0200 Message-ID: <20251021124103.198419-5-lpieralisi@kernel.org> X-Mailer: git-send-email 2.50.1 In-Reply-To: <20251021124103.198419-1-lpieralisi@kernel.org> References: <20251021124103.198419-1-lpieralisi@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable The functionality implemented in the iproc driver in order to detect an OF MSI controller node is now fully implemented in of_msi_xlate(). Replace the current msi-map/msi-parent parsing code with of_msi_xlate(). Since of_msi_xlate() is also a deviceID mapping API, pass in a fictitious 0 as deviceID - the driver only requires detecting the OF MSI controller node not the deviceID mapping per-se (of_msi_xlate() return value is ignored for the same reason). Signed-off-by: Lorenzo Pieralisi Reviewed-by: Frank Li Cc: Scott Branden Cc: Bjorn Helgaas Cc: Rob Herring Cc: Ray Jui Cc: Manivannan Sadhasivam Cc: "Krzysztof Wilczy=C5=84ski" Acked-by: Bjorn Helgaas --- drivers/pci/controller/pcie-iproc.c | 22 +++++----------------- 1 file changed, 5 insertions(+), 17 deletions(-) diff --git a/drivers/pci/controller/pcie-iproc.c b/drivers/pci/controller/p= cie-iproc.c index 22134e95574b..ccf71993ea35 100644 --- a/drivers/pci/controller/pcie-iproc.c +++ b/drivers/pci/controller/pcie-iproc.c @@ -17,6 +17,7 @@ #include #include #include +#include #include #include #include @@ -1337,29 +1338,16 @@ static int iproc_pcie_msi_steer(struct iproc_pcie *= pcie, =20 static int iproc_pcie_msi_enable(struct iproc_pcie *pcie) { - struct device_node *msi_node; + struct device_node *msi_node =3D NULL; int ret; =20 /* * Either the "msi-parent" or the "msi-map" phandle needs to exist * for us to obtain the MSI node. */ - - msi_node =3D of_parse_phandle(pcie->dev->of_node, "msi-parent", 0); - if (!msi_node) { - const __be32 *msi_map =3D NULL; - int len; - u32 phandle; - - msi_map =3D of_get_property(pcie->dev->of_node, "msi-map", &len); - if (!msi_map) - return -ENODEV; - - phandle =3D be32_to_cpup(msi_map + 1); - msi_node =3D of_find_node_by_phandle(phandle); - if (!msi_node) - return -ENODEV; - } + of_msi_xlate(pcie->dev, &msi_node, 0); + if (!msi_node) + return -ENODEV; =20 /* * Certain revisions of the iProc PCIe controller require additional --=20 2.50.1