From nobody Wed Oct 8 17:29:44 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 1B7AE25B678; Thu, 26 Jun 2025 10:28:49 +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=1750933730; cv=none; b=I6MBzYsVkZL0IIMcHnvULBs0oqNVqFLs+pXCq2yjcBrlI4BE1faGQzv1RMO4I2rp+yJ5L04HQUFbzJdozGRGMz7NolImGUoiv+W8ng4TNOJU27Zg7of5r/68hlFcOMatQ+h1YLU6+lH6+WguqAN2TA/FJDJG1MtCtF4giBBY+7Y= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1750933730; c=relaxed/simple; bh=qQUoYRDsuGgB8vCzbvbRUy/RkIeih4RsG46sVkq+6kI=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=IQanUVAH05R/FOoI9tdCVhWDsnWAy6V/pbPNc3EvlP9spTe8hU1Gt/OxGza28Ym8GC0rqo/qHQPRegCbBAAUlV9rJALaaCiBrsU8s0cFyBPusHICwOYqB3IfzVmBv5yuxdn7qnkK1RlTnSUWHw148YbKV4VNh2qOYJh+wLyQN+4= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=nhksvSFz; 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="nhksvSFz" Received: by smtp.kernel.org (Postfix) with ESMTPSA id E7416C4CEEF; Thu, 26 Jun 2025 10:28:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1750933729; bh=qQUoYRDsuGgB8vCzbvbRUy/RkIeih4RsG46sVkq+6kI=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=nhksvSFzXRN+TKFDSpqakiEQuYMf0nrMn8e/Crho+x+7CpfIf1L6RuonQzTqh+9UJ DMu9gmVnKPAsrwyVbELQfoIjc/GWunHPi6mVg2gLQt+u9M5b1YGwhrAjWTHijsKNzN zUopEj7hSAVaH5oiMiqIMutAgFQEN+yrz6O5jm7RPf5/+c1tqoPC8upmJkLqnHZjif dsp67vEKjfrQszIUjFtGAuD/VJ4Wzn5zoru3tYcf0vVEkirl3cQiXWRLvmcxarzoaW AVEjkvQk8SzILg0BZYrJEazVXLDZrGg5Zo6qfv+cFVZAE+WQOAu/fTJ/Mr7HSAo2Gp N4Il5UWwOixZQ== From: Lorenzo Pieralisi Date: Thu, 26 Jun 2025 12:26:18 +0200 Subject: [PATCH v6 27/31] irqchip/msi-lib: Add IRQ_DOMAIN_FLAG_FWNODE_PARENT handling 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 Message-Id: <20250626-gicv5-host-v6-27-48e046af4642@kernel.org> References: <20250626-gicv5-host-v6-0-48e046af4642@kernel.org> In-Reply-To: <20250626-gicv5-host-v6-0-48e046af4642@kernel.org> To: Marc Zyngier , Thomas Gleixner , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Catalin Marinas , Will Deacon Cc: Arnd Bergmann , Sascha Bischoff , Jonathan Cameron , Timothy Hayes , Bjorn Helgaas , "Liam R. Howlett" , Peter Maydell , Mark Rutland , Jiri Slaby , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, linux-pci@vger.kernel.org, Lorenzo Pieralisi X-Mailer: b4 0.15-dev-6f78e In some irqchip implementations the fwnode representing the IRQdomain and the MSI controller fwnode do not match; in particular the IRQdomain fwnode is the MSI controller fwnode parent. To support selecting such IRQ domains, add a flag in core IRQ domain code that explicitly tells the MSI lib to use the parent fwnode while carrying out IRQ domain selection. Update the msi-lib select callback with the resulting logic. Signed-off-by: Lorenzo Pieralisi Cc: Thomas Gleixner Cc: Marc Zyngier --- drivers/irqchip/irq-msi-lib.c | 5 ++++- include/linux/irqdomain.h | 3 +++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/drivers/irqchip/irq-msi-lib.c b/drivers/irqchip/irq-msi-lib.c index 246c30205af4..454c7f16dd4d 100644 --- a/drivers/irqchip/irq-msi-lib.c +++ b/drivers/irqchip/irq-msi-lib.c @@ -133,11 +133,14 @@ int msi_lib_irq_domain_select(struct irq_domain *d, s= truct irq_fwspec *fwspec, { const struct msi_parent_ops *ops =3D d->msi_parent_ops; u32 busmask =3D BIT(bus_token); + struct fwnode_handle *fwh; =20 if (!ops) return 0; =20 - if (fwspec->fwnode !=3D d->fwnode || fwspec->param_count !=3D 0) + fwh =3D d->flags & IRQ_DOMAIN_FLAG_FWNODE_PARENT ? fwnode_get_parent(fwsp= ec->fwnode) + : fwspec->fwnode; + if (fwh !=3D d->fwnode || fwspec->param_count !=3D 0) return 0; =20 /* Handle pure domain searches */ diff --git a/include/linux/irqdomain.h b/include/linux/irqdomain.h index 7387d183029b..25c7cbeed393 100644 --- a/include/linux/irqdomain.h +++ b/include/linux/irqdomain.h @@ -212,6 +212,9 @@ enum { /* Address and data pair is mutable when irq_set_affinity() */ IRQ_DOMAIN_FLAG_MSI_IMMUTABLE =3D (1 << 11), =20 + /* IRQ domain requires parent fwnode matching */ + IRQ_DOMAIN_FLAG_FWNODE_PARENT =3D (1 << 12), + /* * Flags starting from IRQ_DOMAIN_FLAG_NONCORE are reserved * for implementation specific purposes and ignored by the --=20 2.48.0