Re: [PATCH v4 1/2] Input: synaptics-rmi4 - fix irq[] overrun with 7 interrupt sources

From: Wei Jie LAW

Date: Sun Oct 11 2026 - 04:27:31 EST


From: Wei Jie Law <98lawweijie@xxxxxxxxx>

On Fri, Oct 09, 2026 at 08:49:45PM -0700, Dmitry Torokhov wrote:

> Per the Synaptics RMI4 specification (Section "Function Descriptor
> registers"), only values 0 through 6 directly specify an interrupt
> count, while value 7 is reserved to indicate "more than 6 interrupt
> sources" (which is why the comment above RMI_FN_MAX_IRQS states "up
> to 6 interrupt sources in the normal manner").

Thanks for the correction.

> Since the driver does not implement support for functions with more than
> 6 interrupt sources, we should keep RMI_FN_MAX_IRQS as 6 and reject
> functions reporting interrupt_source_count > RMI_FN_MAX_IRQS with
> -EINVAL during PDT scanning in rmi_scan_pdt_page() (after the
> RMI4_END_OF_PDT() check so unpopulated 0xff entries still terminate the
> scan cleanly).

Agreed, I'll be sending a v5 patch that does that. Tested on v6.12.105
with an emulated device: a function declaring 7 sources now fails the
probe with -EINVAL, and a device whose PDT ends in an all-0xff entry
still probes. With the check moved before RMI4_END_OF_PDT() that second
device is rejected, so the ordering does matter.

Thanks,
Wei Jie