Re: [PATCH] Input: zinitix: iterate contact slots by finger count

From: Linus Walleij

Date: Tue Jun 30 2026 - 05:21:24 EST


Hi Thanh,

sorry for slow reply!

On Wed, Apr 8, 2026 at 6:19 AM Thanh Nguyen <thanhnguyxn07@xxxxxxxxx> wrote:
>
> On affected devices (for example Samsung A3 2015), the value in
> touch_event.finger_mask appears to behave as a count of reported slots
> rather than a bitmask. Using for_each_set_bit() can then skip valid
> contacts and break multitouch gestures.
>
> Keep filtering by SUB_BIT_EXIST to avoid reporting shadow contacts, but
> iterate from slot 0 up to min(finger_mask, MAX_SUPPORTED_FINGER_NUM).
> This follows the maintainer feedback to treat the field as a possible
> count while preserving the anti-shadow check.
>
> Fixes: e941dc13fd37 ("Input: zinitix - do not report shadow fingers")
> Link: https://bugzilla.kernel.org/show_bug.cgi?id=221278
> Signed-off-by: Thanh Nguyen <thanhnguyxn07@xxxxxxxxx>
> ---
> v2:
> - Address maintainer feedback: do not revert e941dc13fd37.
> - Keep SUB_BIT_EXIST filtering to avoid shadow contacts.
> - Treat finger_mask as a slot-count bound and iterate 0..min(mask, max).

I can test this if need be, but maybe Nikita want to check it
first?

Yours,
Linus Walleij