From: Vikash Garodia <vikash.garodia@oss.qualcomm.com>
To: "Joerg Roedel (AMD)" <joro@8bytes.org>,
Vasant Hegde <vasant.hegde@amd.com>,
Suravee Suthikulpanit <suravee.suthikulpanit@amd.com>,
Will Deacon <will@kernel.org>,
Robin Murphy <robin.murphy@arm.com>,
David Woodhouse <dwmw2@infradead.org>,
Lu Baolu <baolu.lu@linux.intel.com>,
Jean-Philippe Brucker <jpb@kernel.org>,
Rob Herring <robh@kernel.org>,
Saravana Kannan <saravanak@kernel.org>,
Tomasz Nowicki <tomasz.nowicki@caviumnetworks.com>,
Eric Auger <eric.auger@redhat.com>,
Bryan O'Donoghue <bryan.odonoghue@linaro.org>,
Joerg Roedel <jroedel@suse.de>,
Srinath Mannam <srinath.mannam@broadcom.com>,
Oza Pawandeep <quic_poza@quicinc.com>,
Lorenzo Pieralisi <lpieralisi@kernel.org>,
Bjorn Helgaas <bhelgaas@google.com>,
Alex Williamson <alex@shazbot.org>
Cc: iommu@lists.linux.dev, linux-kernel@vger.kernel.org,
virtualization@lists.linux.dev, devicetree@vger.kernel.org,
kvm@vger.kernel.org, linux-arm-msm@vger.kernel.org,
linux-media@vger.kernel.org,
Vikash Garodia <vikash.garodia@oss.qualcomm.com>,
Krzysztof Kozlowski <krzk@kernel.org>,
Vishnu Reddy <busanna.reddy@oss.qualcomm.com>
Subject: [PATCH v8 3/4] iommu/of: Make OF_IOMMU depend on OF_ADDRESS
Date: Fri, 20 Nov 2026 16:05:15 +0530 [thread overview]
Message-ID: <20261120-add_iommu_ranges-v8-3-d90486973b73@oss.qualcomm.com> (raw)
In-Reply-To: <20261120-add_iommu_ranges-v8-0-d90486973b73@oss.qualcomm.com>
Currently, the OF_IOMMU code is built when OF and IOMMU_API are enabled.
However, the code also uses OF address parsing helpers, which are only
available when OF_ADDRESS is enabled. Since this dependency is not
expressed in Kconfig, when OF_ADDRESS is disabled the code relies on
CONFIG_OF_ADDRESS guards and a __maybe_unused annotation to avoid
compilation issues.
The only architecture supporting OF without OF_ADDRESS is SPARC, which
does not use OF_IOMMU. Therefore, make the OF_IOMMU code depend on
OF_ADDRESS so that it is built only when the required address parsing
support is available, avoiding the CONFIG_OF_ADDRESS guards and
__maybe_unused annotation in the code. No functional change is intended.
Suggested-by: Rob Herring <robh@kernel.org>
Reviewed-by: Krzysztof Kozlowski <krzk@kernel.org>
Co-developed-by: Vishnu Reddy <busanna.reddy@oss.qualcomm.com>
Signed-off-by: Vishnu Reddy <busanna.reddy@oss.qualcomm.com>
Signed-off-by: Vikash Garodia <vikash.garodia@oss.qualcomm.com>
---
drivers/iommu/Kconfig | 2 +-
drivers/iommu/of_iommu.c | 4 +---
2 files changed, 2 insertions(+), 4 deletions(-)
diff --git a/drivers/iommu/Kconfig b/drivers/iommu/Kconfig
index 85a8d7fdfa30b64e21b8db0db1d5bc268c04f24b..c1e97bd885f933cae45fb7806183477f2d64cd5d 100644
--- a/drivers/iommu/Kconfig
+++ b/drivers/iommu/Kconfig
@@ -147,7 +147,7 @@ endchoice
config OF_IOMMU
def_bool y
- depends on OF && IOMMU_API
+ depends on OF_ADDRESS && IOMMU_API
# IOMMU-agnostic DMA-mapping layer
config IOMMU_DMA
diff --git a/drivers/iommu/of_iommu.c b/drivers/iommu/of_iommu.c
index 5c266511db78910d6fd221af5437cecff4931c22..6675fc900e6c2d55b34c61dc9effaeb48e24f18f 100644
--- a/drivers/iommu/of_iommu.c
+++ b/drivers/iommu/of_iommu.c
@@ -167,7 +167,7 @@ int of_iommu_configure(struct device *dev, struct device_node *master_np,
return err;
}
-static enum iommu_resv_type __maybe_unused
+static enum iommu_resv_type
iommu_resv_region_get_type(struct device *dev,
struct resource *phys,
phys_addr_t start, resource_size_t length)
@@ -203,7 +203,6 @@ iommu_resv_region_get_type(struct device *dev,
*/
void of_iommu_get_resv_regions(struct device *dev, struct list_head *list)
{
-#if IS_ENABLED(CONFIG_OF_ADDRESS)
struct of_phandle_iterator it;
int err;
@@ -265,6 +264,5 @@ void of_iommu_get_resv_regions(struct device *dev, struct list_head *list)
}
}
}
-#endif
}
EXPORT_SYMBOL(of_iommu_get_resv_regions);
--
2.34.1
next prev parent reply other threads:[~2026-11-20 10:36 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-20 10:35 [PATCH v8 0/4] of_iommu: add support for "iommu-ranges" Vikash Garodia
2026-11-20 10:35 ` [PATCH v8 1/4] iommu/dma: Keep reserved regions below the IOVA rbtree anchor Vikash Garodia
2026-11-20 10:35 ` [PATCH v8 2/4] iommu: Use resource_size_t for reserved region length Vikash Garodia
2026-11-20 10:35 ` Vikash Garodia [this message]
2026-11-20 10:35 ` [PATCH v8 4/4] iommu/of: Add support for "iommu-ranges" on a device node Vikash Garodia
2026-11-27 15:39 ` [PATCH v8 0/4] of_iommu: add support for "iommu-ranges" Bryan O'Donoghue
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=20261120-add_iommu_ranges-v8-3-d90486973b73@oss.qualcomm.com \
--to=vikash.garodia@oss.qualcomm.com \
--cc=alex@shazbot.org \
--cc=baolu.lu@linux.intel.com \
--cc=bhelgaas@google.com \
--cc=bryan.odonoghue@linaro.org \
--cc=busanna.reddy@oss.qualcomm.com \
--cc=devicetree@vger.kernel.org \
--cc=dwmw2@infradead.org \
--cc=eric.auger@redhat.com \
--cc=iommu@lists.linux.dev \
--cc=joro@8bytes.org \
--cc=jpb@kernel.org \
--cc=jroedel@suse.de \
--cc=krzk@kernel.org \
--cc=kvm@vger.kernel.org \
--cc=linux-arm-msm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-media@vger.kernel.org \
--cc=lpieralisi@kernel.org \
--cc=quic_poza@quicinc.com \
--cc=robh@kernel.org \
--cc=robin.murphy@arm.com \
--cc=saravanak@kernel.org \
--cc=srinath.mannam@broadcom.com \
--cc=suravee.suthikulpanit@amd.com \
--cc=tomasz.nowicki@caviumnetworks.com \
--cc=vasant.hegde@amd.com \
--cc=virtualization@lists.linux.dev \
--cc=will@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
all inboxes | Powered by JetHome®