Re: [PATCH v3 2/3] iommu/arm-smmu-v3: Enable an optional clock
From: Rob Herring
Date: Wed Nov 18 2026 - 15:32:47 EST
On Fri, Nov 13, 2026 at 08:45:06AM +0000, Arun Iyengar wrote:
> 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");
The primary point of the "optional" flavor of get functions is so the
get function itself can print an error rather than every driver doing
it. So drop the error print here.
Rob