[PATCH v3 10/12] iommu/vsi: Deassert the reset lines on probe
Arun Iyengar via B4 Relay
devnull+aiyengar1990.gmail.com at kernel.org
Fri Nov 13 08:40:41 PST 2026
From: Arun Iyengar <aiyengar1990 at gmail.com>
The RK3588 AV1 IOMMU shares its reset lines with the decoder, and its
registers can't be accessed while they are asserted. It writes them on
attach, before the decoder's probe deasserts the resets.
Deassert the resets on probe. They are released exclusive controls,
acquired only for that, so the decoder can still use them.
Suggested-by: Philipp Zabel <p.zabel at pengutronix.de>
Signed-off-by: Arun Iyengar <aiyengar1990 at gmail.com>
---
drivers/iommu/vsi-iommu.c | 16 ++++++++++++++++
1 file changed, 16 insertions(+)
diff --git a/drivers/iommu/vsi-iommu.c b/drivers/iommu/vsi-iommu.c
index 5dac20b143a5..a3ec2fe5ecd5 100644
--- a/drivers/iommu/vsi-iommu.c
+++ b/drivers/iommu/vsi-iommu.c
@@ -33,6 +33,7 @@
#include <linux/of_platform.h>
#include <linux/platform_device.h>
#include <linux/pm_runtime.h>
+#include <linux/reset.h>
#include <linux/slab.h>
#include <linux/spinlock.h>
@@ -669,6 +670,7 @@ MODULE_DEVICE_TABLE(of, vsi_iommu_dt_ids);
static int vsi_iommu_probe(struct platform_device *pdev)
{
struct device *dev = &pdev->dev;
+ struct reset_control *resets;
struct vsi_iommu *iommu;
int err;
@@ -688,6 +690,20 @@ static int vsi_iommu_probe(struct platform_device *pdev)
if (iommu->num_clocks < 0)
return iommu->num_clocks;
+ /* Shared with the decoder. */
+ resets = devm_reset_control_array_get(dev, RESET_CONTROL_OPTIONAL_EXCLUSIVE_RELEASED);
+ if (IS_ERR(resets))
+ return PTR_ERR(resets);
+
+ err = reset_control_acquire(resets);
+ if (err)
+ return err;
+
+ err = reset_control_deassert(resets);
+ reset_control_release(resets);
+ if (err)
+ return err;
+
err = clk_bulk_prepare(iommu->num_clocks, iommu->clocks);
if (err)
return err;
--
2.55.0
More information about the Linux-rockchip
mailing list