[PATCH] iommu/exynos: Initialize lock before requesting IRQ

Robin Murphy robin.murphy at arm.com
Tue Sep 1 06:20:11 PDT 2026


On 01/09/2026 2:05 pm, Runyu Xiao wrote:
> The SysMMU interrupt handler can run as soon as devm_request_irq() is
> called. Initialize the driver lock before registering the handler so an
> early interrupt cannot use an uninitialized lock.

And what about all the _other_ data the handler unconditionally 
dereferences which is also still uninitialised at this point? If you 
think this (clearly theoretical) race is worth fixing then at least 
actually fix it...

Thanks,
Robin.

> Fixes: 2a96536e77b4 ("iommu/exynos: Add iommu driver for EXYNOS Platforms")
> Cc: stable at vger.kernel.org
> Signed-off-by: Runyu Xiao <runyu.xiao at seu.edu.cn>
> Assisted-by: Codex:GPT-5
> ---
>   drivers/iommu/exynos-iommu.c | 3 ++-
>   1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/iommu/exynos-iommu.c b/drivers/iommu/exynos-iommu.c
> index 874d05f4b..e9feb83b3 100644
> --- a/drivers/iommu/exynos-iommu.c
> +++ b/drivers/iommu/exynos-iommu.c
> @@ -735,6 +735,8 @@ static int exynos_sysmmu_probe(struct platform_device *pdev)
>   	if (!data)
>   		return -ENOMEM;
>   
> +	spin_lock_init(&data->lock);
> +
>   	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
>   	data->sfrbase = devm_ioremap_resource(dev, res);
>   	if (IS_ERR(data->sfrbase))
> @@ -773,7 +775,6 @@ static int exynos_sysmmu_probe(struct platform_device *pdev)
>   		return PTR_ERR(data->clk_master);
>   
>   	data->sysmmu = dev;
> -	spin_lock_init(&data->lock);
>   
>   	__sysmmu_get_version(data);
>   




More information about the linux-arm-kernel mailing list