[PATCH v4 7/9] iio: light: opt3001: mark the interrupt handler __context_unsafe

From: Rupesh Majhi

Date: Tue Oct 27 2026 - 08:57:36 EST


opt3001_irq() takes opt->lock only when ok_to_ignore_lock is false, and
releases it under the same test. Context analysis does not follow a
lock taken and released on a condition, so mark the handler
__context_unsafe().

Signed-off-by: Rupesh Majhi <zoone.rupert@xxxxxxxxx>
---
Cc: Marco Elver <elver@xxxxxxxxxx>
Cc: Bart Van Assche <bvanassche@xxxxxxx>

drivers/iio/light/opt3001.c | 1 +
1 file changed, 1 insertion(+)

diff --git a/drivers/iio/light/opt3001.c b/drivers/iio/light/opt3001.c
index a948353014ac..cfd4a0ba9bd7 100644
--- a/drivers/iio/light/opt3001.c
+++ b/drivers/iio/light/opt3001.c
@@ -817,6 +817,7 @@ static int opt3001_configure(struct opt3001 *opt)
}

static irqreturn_t opt3001_irq(int irq, void *_iio)
+ __context_unsafe(/* lock only taken when !ok_to_ignore_lock */)
{
struct iio_dev *iio = _iio;
struct opt3001 *opt = iio_priv(iio);
--
2.43.0