Linux Input/HID development
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Luca Weiss" <luca.weiss@fairphone.com>
Cc: robh@kernel.org, conor+dt@kernel.org, dmitry.torokhov@gmail.com,
	linux-input@vger.kernel.org, devicetree@vger.kernel.org
Subject: Re: [PATCH v2 2/3] Input: Add driver for ESWIN EPH8621 touchscreen IC
Date: Thu, 17 Sep 2026 08:35:09 +0000	[thread overview]
Message-ID: <20260917083510.092F21F000FF@smtp.kernel.org> (raw)
In-Reply-To: <20260917-eswin-eph8621-v2-2-f534080a6338@fairphone.com>

Thank you for your contribution! Sashiko AI review found 2 potential issue(s) to consider:
- [High] input: unhandled SPI errors in IRQ handler cause IRQ storm
- [Low] input: implicit return of input_register_device() in probe
--

commit 72cf856c7b1ca07b03f9ce8e0bf75be42e60151c
Author: Luca Weiss <luca.weiss@fairphone.com>

Input: Add driver for ESWIN EPH8621 touchscreen IC

This commit adds a new SPI driver for the ESWIN EPH8621 series touchscreen
controllers.

> diff --git a/drivers/input/touchscreen/eswin_eph8621.c b/drivers/input/touchscreen/eswin_eph8621.c
> index 0000000000000..866cdc7e9334d
> --- /dev/null
> +++ b/drivers/input/touchscreen/eswin_eph8621.c
[ ... ]
> +static irqreturn_t eswin_interrupt(int irq, void *dev_id)
> +{
> +	struct eswin_touch *ts = dev_id;
> +	int payload_len;
> +
> +	payload_len = eswin_comms_two_stage_read(ts, ts->rx_buf);
> +	if (payload_len > 0)
> +		eswin_process_report(ts, ts->rx_buf, payload_len);
> +
> +	return IRQ_HANDLED;
> +}

[Severity: High]
Will this cause an interrupt storm if a communication error occurs?

If eswin_comms_two_stage_read() fails and returns a negative error code
(like -EINVAL), the device's interrupt condition isn't cleared. By
unconditionally returning IRQ_HANDLED, the kernel's spurious IRQ detector
is bypassed. Because the physical interrupt line is still asserted, won't
the interrupt immediately fire again and lead to an infinite CPU loop?

[ ... ]
> +static int eswin_probe(struct spi_device *spi)
> +{
[ ... ]
> +	error = devm_request_threaded_irq(dev, spi->irq, NULL, eswin_interrupt,
> +					  IRQF_ONESHOT, dev_name(dev), ts);
> +	if (error)
> +		return dev_err_probe(dev, error, "Failed to request IRQ\n");
> +
> +	return input_register_device(ts->input);
> +}

[Severity: Low]
This isn't a bug, but does this violate the input subsystem's style
preferences for explicit failure paths?

The subsystem guidelines recommend against using `return action(...);` where
the action returns an error code in functions with multiple failure points.
Should this be expanded to capture the return value of 
input_register_device(), check it, and explicitly return 0 on success?

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20260917-eswin-eph8621-v2-0-f534080a6338@fairphone.com?part=2

  reply	other threads:[~2026-09-17  8:35 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-17  8:25 [PATCH v2 0/3] ESWIN EPH8621 touchscreen support for Fairphone (Gen. 6) Luca Weiss
2026-09-17  8:25 ` [PATCH v2 1/3] dt-bindings: input: touchscreen: document ESWIN EPH8621 Luca Weiss
2026-09-17  8:25 ` [PATCH v2 2/3] Input: Add driver for ESWIN EPH8621 touchscreen IC Luca Weiss
2026-09-17  8:35   ` sashiko-bot [this message]
2026-09-17  8:25 ` [PATCH v2 3/3] arm64: dts: qcom: milos-fairphone-fp6: Add touchscreen Luca Weiss

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=20260917083510.092F21F000FF@smtp.kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=dmitry.torokhov@gmail.com \
    --cc=linux-input@vger.kernel.org \
    --cc=luca.weiss@fairphone.com \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox