Re: [PATCH v4 2/3] iommu/arm-smmu-v3: Enable an optional clock

From: Sebastian Reichel

Date: Thu Nov 26 2026 - 05:14:23 EST


Hi,

On Thu, Nov 26, 2026 at 09:54:14AM +0000, Arun Iyengar via B4 Relay wrote:
> 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>
> ---

Once runtime PM support lands [0], this should move to runtime PM
resume. But at the moment it looks sensible:

Reviewed-by: Sebastian Reichel <sebastian.reichel@xxxxxxxxxxxxx>

Greetings,

-- Sebastian

[0] https://lore.kernel.org/linux-iommu/20260929034510.2023173-1-praan@xxxxxxxxxx/

> 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
>
>

Attachment: signature.asc
Description: PGP signature