* [PATCH] iio: adc: ade9000: move mutex init before IRQ registration
@ 2026-02-27 13:33 Antoniu Miclaus
2026-02-28 11:05 ` Andy Shevchenko
0 siblings, 1 reply; 3+ messages in thread
From: Antoniu Miclaus @ 2026-02-27 13:33 UTC (permalink / raw)
To: Lars-Peter Clausen, Michael Hennerich, Antoniu Miclaus,
Jonathan Cameron, David Lechner, Nuno Sá, Andy Shevchenko,
linux-iio, linux-kernel
Move devm_mutex_init() before ade9000_request_irq() calls so that
st->lock is initialized before any handler that depends on it can run.
Signed-off-by: Antoniu Miclaus <antoniu.miclaus@analog.com>
---
drivers/iio/adc/ade9000.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/drivers/iio/adc/ade9000.c b/drivers/iio/adc/ade9000.c
index db085dc5e526..c62c6480dd0a 100644
--- a/drivers/iio/adc/ade9000.c
+++ b/drivers/iio/adc/ade9000.c
@@ -1706,19 +1706,19 @@ static int ade9000_probe(struct spi_device *spi)
init_completion(&st->reset_completion);
- ret = ade9000_request_irq(dev, "irq0", ade9000_irq0_thread, indio_dev);
+ ret = devm_mutex_init(dev, &st->lock);
if (ret)
return ret;
- ret = ade9000_request_irq(dev, "irq1", ade9000_irq1_thread, indio_dev);
+ ret = ade9000_request_irq(dev, "irq0", ade9000_irq0_thread, indio_dev);
if (ret)
return ret;
- ret = ade9000_request_irq(dev, "dready", ade9000_dready_thread, indio_dev);
+ ret = ade9000_request_irq(dev, "irq1", ade9000_irq1_thread, indio_dev);
if (ret)
return ret;
- ret = devm_mutex_init(dev, &st->lock);
+ ret = ade9000_request_irq(dev, "dready", ade9000_dready_thread, indio_dev);
if (ret)
return ret;
--
2.43.0
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] iio: adc: ade9000: move mutex init before IRQ registration
2026-02-27 13:33 [PATCH] iio: adc: ade9000: move mutex init before IRQ registration Antoniu Miclaus
@ 2026-02-28 11:05 ` Andy Shevchenko
2026-02-28 11:52 ` Jonathan Cameron
0 siblings, 1 reply; 3+ messages in thread
From: Andy Shevchenko @ 2026-02-28 11:05 UTC (permalink / raw)
To: Antoniu Miclaus
Cc: Lars-Peter Clausen, Michael Hennerich, Jonathan Cameron,
David Lechner, Nuno Sá, Andy Shevchenko, linux-iio,
linux-kernel
On Fri, Feb 27, 2026 at 03:33:30PM +0200, Antoniu Miclaus wrote:
> Move devm_mutex_init() before ade9000_request_irq() calls so that
> st->lock is initialized before any handler that depends on it can run.
Sounds good. The technique to reproduce this (in case you have a HWr
to make sure probe runs) the kernel configuration should have
CONFIG_DEBUG_SHIRQ=y (and in some cases a tweak in the code to flag
IRQ as shared).
Reviewed-by: Andy Shevchenko <andriy.shevchenko@intel.com>
--
With Best Regards,
Andy Shevchenko
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] iio: adc: ade9000: move mutex init before IRQ registration
2026-02-28 11:05 ` Andy Shevchenko
@ 2026-02-28 11:52 ` Jonathan Cameron
0 siblings, 0 replies; 3+ messages in thread
From: Jonathan Cameron @ 2026-02-28 11:52 UTC (permalink / raw)
To: Andy Shevchenko
Cc: Antoniu Miclaus, Lars-Peter Clausen, Michael Hennerich,
David Lechner, Nuno Sá, Andy Shevchenko, linux-iio,
linux-kernel
On Sat, 28 Feb 2026 13:05:18 +0200
Andy Shevchenko <andriy.shevchenko@intel.com> wrote:
> On Fri, Feb 27, 2026 at 03:33:30PM +0200, Antoniu Miclaus wrote:
> > Move devm_mutex_init() before ade9000_request_irq() calls so that
> > st->lock is initialized before any handler that depends on it can run.
>
> Sounds good. The technique to reproduce this (in case you have a HWr
> to make sure probe runs) the kernel configuration should have
> CONFIG_DEBUG_SHIRQ=y (and in some cases a tweak in the code to flag
> IRQ as shared).
>
> Reviewed-by: Andy Shevchenko <andriy.shevchenko@intel.com>
>
Applied as a fix, so I added a Fixes tag and +CC stable.
Whilst hard to hit it is is always good to ensure we are safe against
spurious interrupts.
thanks,
Jonathan
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2026-02-28 11:52 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-02-27 13:33 [PATCH] iio: adc: ade9000: move mutex init before IRQ registration Antoniu Miclaus
2026-02-28 11:05 ` Andy Shevchenko
2026-02-28 11:52 ` Jonathan Cameron
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox