summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSunil V L <sunilvl@oss.qualcomm.com>2026-03-03 11:46:05 +0530
committerPaul Walmsley <pjw@kernel.org>2026-04-04 18:38:03 -0600
commit9156585280f161fc1c3552cf1860559edb2bb7e3 (patch)
tree4d0b027cc080371223a0d8dd2c241a07ce7fe5f6
parent511361fe7a8856e2f415010942808c237a1b8061 (diff)
ACPI: RIMT: Add dependency between iommu and devices
EPROBE_DEFER ensures IOMMU devices are probed before the devices that depend on them. During shutdown, however, the IOMMU may be removed first, leading to issues. To avoid this, a device link is added which enforces the correct removal order. Fixes: 8f7729552582 ("ACPI: RISC-V: Add support for RIMT") Signed-off-by: Sunil V L <sunilvl@oss.qualcomm.com> Link: https://patch.msgid.link/20260303061605.722949-1-sunilvl@oss.qualcomm.com Signed-off-by: Paul Walmsley <pjw@kernel.org>
-rw-r--r--drivers/acpi/riscv/rimt.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/drivers/acpi/riscv/rimt.c b/drivers/acpi/riscv/rimt.c
index 229c4a0d47a3..906282b0e63c 100644
--- a/drivers/acpi/riscv/rimt.c
+++ b/drivers/acpi/riscv/rimt.c
@@ -263,6 +263,13 @@ static int rimt_iommu_xlate(struct device *dev, struct acpi_rimt_node *node, u32
if (!rimt_fwnode)
return -EPROBE_DEFER;
+ /*
+ * EPROBE_DEFER ensures IOMMU is probed before the devices that
+ * depend on them. During shutdown, however, the IOMMU may be removed
+ * first, leading to issues. To avoid this, a device link is added
+ * which enforces the correct removal order.
+ */
+ device_link_add(dev, rimt_fwnode->dev, DL_FLAG_AUTOREMOVE_CONSUMER);
return acpi_iommu_fwspec_init(dev, deviceid, rimt_fwnode);
}