Thread (37 messages) flat view 37 messages, 7 authors, 27d ago

Re: [PATCH v3 03/14] iio: adc: adi-axi-adc: Initialize state mutex

From: Jonathan Cameron <jic23@kernel.org>
Date: 2026-08-16 18:30:00
Also in: linux-devicetree, linux-gpio, linux-iio, lkml

On Thu, 13 Aug 2026 15:56:56 +0200
Janani Sunil [off-list ref] 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@analog.com>
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
quoted hunk ↗ jump to hunk
---
 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);
  
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help