mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Jonathan Cameron <jic23@kernel.org>
To: Salah Triki <salah.triki@gmail.com>
Cc: "David Lechner" <dlechner@baylibre.com>,
	"Nuno Sá" <nuno.sa@analog.com>,
	"Andy Shevchenko" <andy@kernel.org>,
	"Wang Shuaijie" <wangshuaijie@awinic.com>,
	linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2] iio: proximity: aw96103: Fix early return in IRQ handler loop
Date: Sun, 23 Aug 2026 19:18:48 +0100	[thread overview]
Message-ID: <20260823191848.272c910f@jic23-huawei> (raw)
In-Reply-To: <20260823040926.23860-1-salah.triki@gmail.com>

On Sun, 23 Aug 2026 05:09:25 +0100
Salah Triki <salah.triki@gmail.com> wrote:

> When an unrecognized proximity status is encountered in aw96103_irq(),
> the default case executes a return IRQ_HANDLED. Because this happens
> inside the loop over the device's channels, any remaining channels are
> left unhandled, causing missed events and stale IRQ status.
> 
> Replace the return IRQ_HANDLED statement in the default case with
> continue to ensure all channels are processed even if one has an
> unexpected status value.
> 
> This issue was found via code inspection.
> 
> Signed-off-by: Salah Triki <salah.triki@gmail.com>
Applied to the testing branch of iio.git.

Another one I forgot for reasons I apply quicker than average (see
reply the tmp117)

- Low risk changes - either because of code (true here) or because of timing
  the tree is getting rebased anyway (also true)

Jonathan

> ---
> Changes since v1:
> -Remove Fixes tag as this is hardening rather than a fix for a real-world bug.
> -Mention in commit message that the issue was identified through code reading.
> 
>  drivers/iio/proximity/aw96103.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/iio/proximity/aw96103.c b/drivers/iio/proximity/aw96103.c
> index 8fbb755dcae0..b1f36a51d56f 100644
> --- a/drivers/iio/proximity/aw96103.c
> +++ b/drivers/iio/proximity/aw96103.c
> @@ -669,7 +669,7 @@ static irqreturn_t aw96103_irq(int irq, void *data)
>  				       iio_get_time_ns(indio_dev));
>  			break;
>  		default:
> -			return IRQ_HANDLED;
> +			continue;
>  		}
>  		aw96103->channels_arr[i].old_irq_status = curr_status;
>  	}


      reply	other threads:[~2026-08-23 18:18 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-23  4:09 Salah Triki
2026-08-23 18:18 ` Jonathan Cameron [this message]

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=20260823191848.272c910f@jic23-huawei \
    --to=jic23@kernel.org \
    --cc=andy@kernel.org \
    --cc=dlechner@baylibre.com \
    --cc=linux-iio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=nuno.sa@analog.com \
    --cc=salah.triki@gmail.com \
    --cc=wangshuaijie@awinic.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®