Devicetree
 help / color / mirror / Atom feed
* [PATCH v2] Input: edt-ft5x06 - ignore contacts with an out-of-range slot id
@ 2026-07-23 13:24 Alexandre Hamamdjian via B4 Relay
  2026-07-23 17:43 ` Dmitry Torokhov
  0 siblings, 1 reply; 2+ messages in thread
From: Alexandre Hamamdjian via B4 Relay @ 2026-07-23 13:24 UTC (permalink / raw)
  To: Dmitry Torokhov, Henrik Rydberg, Rob Herring, Krzysztof Kozlowski,
	Conor Dooley
  Cc: linux-input, linux-kernel, devicetree, Alexandre Hamamdjian

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>



^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH v2] Input: edt-ft5x06 - ignore contacts with an out-of-range slot id
  2026-07-23 13:24 [PATCH v2] Input: edt-ft5x06 - ignore contacts with an out-of-range slot id Alexandre Hamamdjian via B4 Relay
@ 2026-07-23 17:43 ` Dmitry Torokhov
  0 siblings, 0 replies; 2+ messages in thread
From: Dmitry Torokhov @ 2026-07-23 17:43 UTC (permalink / raw)
  To: azkali.limited
  Cc: Henrik Rydberg, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
	linux-input, linux-kernel, devicetree

On Thu, Jul 23, 2026 at 08:24:09PM +0700, Alexandre Hamamdjian via B4 Relay wrote:
> 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>

Applied, thank you.

-- 
Dmitry

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2026-07-23 17:43 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-07-23 13:24 [PATCH v2] Input: edt-ft5x06 - ignore contacts with an out-of-range slot id Alexandre Hamamdjian via B4 Relay
2026-07-23 17:43 ` Dmitry Torokhov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox