[PATCH v4 2/3] iommu/arm-smmu-v3: Enable an optional clock
From: Arun Iyengar via B4 Relay
Date: Thu Nov 26 2026 - 04:54:48 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 CR0 write at shutdown then hangs. Enable
the clock from the firmware node, if any, while the driver is bound.
Signed-off-by: Arun Iyengar <aiyengar1990@xxxxxxxxx>
---
drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c | 8 ++++++++
1 file changed, 8 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 100b34f07032..beea222dcf57 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,19 @@ 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_obj(dev, *smmu);
if (!smmu)
return -ENOMEM;
smmu->dev = dev;
+ /* Before the firmware probe, which may take a CMDQV reference */
+ 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