Skip to content

Commit 9156585

Browse files
Sunil V LPaul Walmsley
authored andcommitted
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: 8f77295 ("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>
1 parent 511361f commit 9156585

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

drivers/acpi/riscv/rimt.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -263,6 +263,13 @@ static int rimt_iommu_xlate(struct device *dev, struct acpi_rimt_node *node, u32
263263
if (!rimt_fwnode)
264264
return -EPROBE_DEFER;
265265

266+
/*
267+
* EPROBE_DEFER ensures IOMMU is probed before the devices that
268+
* depend on them. During shutdown, however, the IOMMU may be removed
269+
* first, leading to issues. To avoid this, a device link is added
270+
* which enforces the correct removal order.
271+
*/
272+
device_link_add(dev, rimt_fwnode->dev, DL_FLAG_AUTOREMOVE_CONSUMER);
266273
return acpi_iommu_fwspec_init(dev, deviceid, rimt_fwnode);
267274
}
268275

0 commit comments

Comments
 (0)