Re: [PATCH v3 03/14] iio: adc: adi-axi-adc: Initialize state mutex
From: Jonathan Cameron
Date: Sun Aug 16 2026 - 14:30:19 EST
On Thu, 13 Aug 2026 15:56:56 +0200
Janani Sunil <janani.sunil@xxxxxxxxxx> wrote:
> The AXI ADC register access paths serialize transactions with st->lock,
> but probe does not initialize it. Initialize the mutex before registering
> the backend.
>
> Fixes: 7ecb8ee5c93b ("iio: adc: adi-axi-adc: support digital interface calibration")
> Signed-off-by: Janani Sunil <janani.sunil@xxxxxxxxxx>
Fixes come first. In future move this up to start of series so it is
really obvious.
Given it's kind of critical, I'll apply it to the fixes-togreg branch now.
Note that branch won't go upstream until after rc1, but I think it won't
be too disruptive to have this series go through the slow togreg tree
in parallel with that.
Thanks,
Jonathan
> ---
> drivers/iio/adc/adi-axi-adc.c | 4 ++++
> 1 file changed, 4 insertions(+)
>
> diff --git a/drivers/iio/adc/adi-axi-adc.c b/drivers/iio/adc/adi-axi-adc.c
> index 26b9c75bd4d8..b5e59b1871b6 100644
> --- a/drivers/iio/adc/adi-axi-adc.c
> +++ b/drivers/iio/adc/adi-axi-adc.c
> @@ -684,6 +684,10 @@ static int adi_axi_adc_probe(struct platform_device *pdev)
> if (!st)
> return -ENOMEM;
>
> + ret = devm_mutex_init(dev, &st->lock);
> + if (ret)
> + return ret;
> +
> base = devm_platform_ioremap_resource(pdev, 0);
> if (IS_ERR(base))
> return PTR_ERR(base);
>