From: Alexandre Hamamdjian via B4 Relay <devnull+azkali.limited.gmail.com@kernel.org>
To: Dmitry Torokhov <dmitry.torokhov@gmail.com>,
Henrik Rydberg <rydberg@bitmath.org>,
Rob Herring <robh@kernel.org>,
Krzysztof Kozlowski <krzk+dt@kernel.org>,
Conor Dooley <conor+dt@kernel.org>
Cc: linux-input@vger.kernel.org, linux-kernel@vger.kernel.org,
devicetree@vger.kernel.org,
Alexandre Hamamdjian <azkali.limited@gmail.com>
Subject: [PATCH v2] Input: edt-ft5x06 - ignore contacts with an out-of-range slot id
Date: Thu, 23 Jul 2026 20:24:09 +0700 [thread overview]
Message-ID: <20260723-b4-ft5426-v2-1-cd2bed168051@gmail.com> (raw)
From: Alexandre Hamamdjian <azkali.limited@gmail.com>
The per-contact slot id is taken from the top nibble of the third
report byte, so it can be any value from 0 to 15. The driver only
allocates max_support_points MT slots (2 to 10 depending on the
variant), so a report that carries an id at or above that count - be it
a genuinely higher-numbered contact or a corrupted byte - is outside the
range the input core was told about.
input_mt_slot() silently ignores an ABS_MT_SLOT beyond num_slots and
leaves the current slot unchanged, so the following
input_mt_report_slot_state()/touchscreen_report_pos() pair is applied to
whichever slot happened to be selected last, reporting the contact at the
wrong position. Skip such entries instead.
Signed-off-by: Alexandre Hamamdjian <azkali.limited@gmail.com>
---
A single generic correctness fix: a report whose contact id is at or
above max_support_points selects an MT slot the input core was never
told about, so input_mt_slot() ignores it and the contact is reported
against the previously-selected slot.
The marginal-i2c-bus mitigations that accompanied this in v1 (the
no-regmap-bulk-read property + driver fallback, and the poll-while-down
recovery) are dropped: reviewers correctly noted the bulk-read quirk is
a property of the i2c controller rather than the touch controller and
does not belong in the touch node's binding, so that work is better
placed in the i2c controller (or kept out of tree) and is not part of
this series.
---
drivers/input/touchscreen/edt-ft5x06.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/input/touchscreen/edt-ft5x06.c b/drivers/input/touchscreen/edt-ft5x06.c
index d3b1177185a3..d6c3d033b83d 100644
--- a/drivers/input/touchscreen/edt-ft5x06.c
+++ b/drivers/input/touchscreen/edt-ft5x06.c
@@ -331,6 +331,8 @@ static irqreturn_t edt_ft5x06_ts_isr(int irq, void *dev_id)
swap(x, y);
id = (buf[2] >> 4) & 0x0f;
+ if (id >= tsdata->max_support_points)
+ continue;
input_mt_slot(tsdata->input, id);
if (input_mt_report_slot_state(tsdata->input, MT_TOOL_FINGER,
---
base-commit: e98d21c170b01ddef366f023bbfcf6b31509fa83
change-id: 20260723-b4-ft5426-393d8514e4bf
Best regards,
--
Alexandre Hamamdjian <azkali.limited@gmail.com>
next reply other threads:[~2026-07-23 13:24 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-23 13:24 Alexandre Hamamdjian via B4 Relay [this message]
2026-07-23 17:43 ` [PATCH v2] Input: edt-ft5x06 - ignore contacts with an out-of-range slot id Dmitry Torokhov
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=20260723-b4-ft5426-v2-1-cd2bed168051@gmail.com \
--to=devnull+azkali.limited.gmail.com@kernel.org \
--cc=azkali.limited@gmail.com \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=dmitry.torokhov@gmail.com \
--cc=krzk+dt@kernel.org \
--cc=linux-input@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=robh@kernel.org \
--cc=rydberg@bitmath.org \
/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