All of lore.kernel.org
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Javier Carrasco" <javier.carrasco.cruz@gmail.com>
Cc: krzk+dt@kernel.org, conor+dt@kernel.org,
	devicetree@vger.kernel.org, robh@kernel.org
Subject: Re: [PATCH v2 2/4] iio: light: veml6030: fix channel type when pushing events
Date: Thu, 14 May 2026 08:08:46 +0000	[thread overview]
Message-ID: <20260514080847.4194DC2BCB7@smtp.kernel.org> (raw)
In-Reply-To: <20260513-veml6031x00-v2-2-4703ca661a1d@gmail.com>

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [High] Returning IRQ_HANDLED on I2C read failure in the interrupt handler causes an interrupt storm.
--

commit 198c71e09b48e4ebbfc54cfa1edf78cced994d05
Author: Javier Carrasco <javier.carrasco.cruz@gmail.com>

iio: light: veml6030: fix channel type when pushing events

The events are registered for IIO_LIGHT and not for IIO_INTENSITY.
Use the correct channel type.

> diff --git a/drivers/iio/light/veml6030.c b/drivers/iio/light/veml6030.c
> index 745cf3ad7092e..855f052b60c2c 100644
> --- a/drivers/iio/light/veml6030.c
> +++ b/drivers/iio/light/veml6030.c
> @@ -871,9 +871,11 @@ static irqreturn_t veml6030_event_handler(int irq, void *private)

This isn't a bug introduced by this commit, but looking at the beginning of
veml6030_event_handler():

	ret = regmap_read(data->regmap, VEML6030_REG_ALS_INT, &reg);
	if (ret) {
		dev_err(&data->client->dev,
				"can't read als interrupt register %d\n", ret);
		return IRQ_HANDLED;
	}

Could returning IRQ_HANDLED on I2C read failure cause an interrupt storm?

The VEML6030 device uses a level-triggered interrupt which is cleared by the
hardware only when the VEML6030_REG_ALS_INT register is successfully read.
If regmap_read() fails, the device continues to assert the interrupt line.

Because the line is still asserted and IRQ_HANDLED signals the interrupt was
serviced, the core IRQ subsystem unmasks the line, which fires immediately and
wakes the threaded handler again.

Would it be better to return IRQ_NONE instead, so the IRQ core's spurious
interrupt detector can track the unhandled threaded interrupt and eventually
disable the misbehaving line?

>  	else
>  		evtdir = IIO_EV_DIR_FALLING;
>  
> -	iio_push_event(indio_dev, IIO_UNMOD_EVENT_CODE(IIO_INTENSITY,
> -					0, IIO_EV_TYPE_THRESH, evtdir),
> -					iio_get_time_ns(indio_dev));
> +	iio_push_event(indio_dev, IIO_UNMOD_EVENT_CODE(IIO_LIGHT,
> +						       0,
> +						       IIO_EV_TYPE_THRESH,
> +						       evtdir),
> +			iio_get_time_ns(indio_dev));
>  
>  	return IRQ_HANDLED;
>  }

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20260513-veml6031x00-v2-0-4703ca661a1d@gmail.com?part=2

  parent reply	other threads:[~2026-05-14  8:08 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-05-13  4:49 [PATCH v2 0/4] iio: light: add support for veml6031x00 ALS series Javier Carrasco
2026-05-13  4:49 ` [PATCH v2 1/4] iio: light: veml6030: remove unnecessary read of IT index Javier Carrasco
2026-05-13 16:59   ` Andy Shevchenko
2026-05-13 18:17     ` Javier Carrasco
2026-05-13 19:58       ` Andy Shevchenko
2026-05-14  7:54   ` sashiko-bot
2026-05-13  4:49 ` [PATCH v2 2/4] iio: light: veml6030: fix channel type when pushing events Javier Carrasco
2026-05-13 17:48   ` Andy Shevchenko
2026-05-13 18:13     ` Javier Carrasco
2026-05-13 20:02       ` Andy Shevchenko
2026-05-13 20:44         ` Javier Carrasco
2026-05-13 20:56           ` Andy Shevchenko
2026-05-14  8:08   ` sashiko-bot [this message]
2026-05-13  4:49 ` [PATCH v2 3/4] dt-bindings: iio: light: veml6030: add veml6031x00 ALS series Javier Carrasco
2026-05-13  4:49 ` [PATCH v2 4/4] iio: light: add support for " Javier Carrasco
     [not found]   ` <690B63AD-4429-4045-B413-29911ED7DA3D@gmail.com>
2026-05-13 16:36     ` Andy Shevchenko
2026-05-13 16:37       ` Andy Shevchenko
2026-05-13 16:56   ` Andy Shevchenko
2026-05-13 18:23     ` Javier Carrasco
2026-05-13 20:08       ` Andy Shevchenko
2026-05-14  9:29   ` sashiko-bot

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260514080847.4194DC2BCB7@smtp.kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=javier.carrasco.cruz@gmail.com \
    --cc=krzk+dt@kernel.org \
    --cc=robh@kernel.org \
    --cc=sashiko-reviews@lists.linux.dev \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.