[PATCH v3 2/3] iommu/arm-smmu-v3: Enable an optional clock
From: Arun Iyengar via B4 Relay
Date: Fri Nov 13 2026 - 12:53:18 EST
From: Arun Iyengar <aiyengar1990@xxxxxxxxx>
On the RK3588 the PCIe SMMU's clock is gated as unused when no PCIe
controller holds it, and the next register access (the CR0 write at
shutdown) hangs. Enable the clock from the firmware node, if there is
one, while the driver is bound.
Do it first in probe, as the firmware probe may take a Tegra CMDQV
reference that only arm_smmu_impl_probe() releases.
Signed-off-by: Arun Iyengar <aiyengar1990@xxxxxxxxx>
---
drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c | 11 +++++++++++
1 file changed, 11 insertions(+)
diff --git a/drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c b/drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c
index 6d4520c47308..d3f42316b0d6 100644
--- a/drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c
+++ b/drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c
@@ -12,6 +12,7 @@
#include <linux/acpi.h>
#include <linux/acpi_iort.h>
#include <linux/bitops.h>
+#include <linux/clk.h>
#include <linux/crash_dump.h>
#include <linux/delay.h>
#include <linux/err.h>
@@ -5786,12 +5787,22 @@ static int arm_smmu_device_probe(struct platform_device *pdev)
resource_size_t ioaddr;
struct arm_smmu_device *smmu;
struct device *dev = &pdev->dev;
+ struct clk *clk;
smmu = devm_kzalloc(dev, sizeof(*smmu), GFP_KERNEL);
if (!smmu)
return -ENOMEM;
smmu->dev = dev;
+ /*
+ * Before the firmware probe: it may take a reference on the Tegra
+ * CMDQV device that only arm_smmu_impl_probe() releases.
+ */
+ clk = devm_clk_get_optional_enabled(dev, NULL);
+ if (IS_ERR(clk))
+ return dev_err_probe(dev, PTR_ERR(clk),
+ "failed to enable clock\n");
+
if (dev->of_node) {
ret = arm_smmu_device_dt_probe(pdev, smmu);
} else {
--
2.55.0