Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Input: apple_z2 - fix reading incorrect reports after exiting sleep

Under certain conditions (more prevalent after a suspend/resume cycle),
the touchscreen controller can send the "boot complete" interrupt before
it actually finished booting. In those cases, attempting to read touch
data resuls in a stream of "not ready" messages being read and
interpreted as a touch report. Check that the response is in fact a
touch report and discard it otherwise.

Reported-by: pitust <piotr@stelmaszek.com>
Closes: https://oftc.catirclogs.org/asahi/2025-12-17#34878715;
Fixes: 471a92f8a21a ("Input: apple_z2 - add a driver for Apple Z2 touchscreens")
Signed-off-by: Sasha Finkelstein <fnkl.kernel@gmail.com>
Link: https://patch.msgid.link/20251218-z2-init-fix-v1-1-48e3aa239caf@gmail.com
Cc: stable@vger.kernel.org
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>

authored by

Sasha Finkelstein and committed by
Dmitry Torokhov
d579478c bf40644e

+4
+4
drivers/input/touchscreen/apple_z2.c
··· 21 21 #define APPLE_Z2_TOUCH_STARTED 3 22 22 #define APPLE_Z2_TOUCH_MOVED 4 23 23 #define APPLE_Z2_CMD_READ_INTERRUPT_DATA 0xEB 24 + #define APPLE_Z2_REPLY_INTERRUPT_DATA 0xE1 24 25 #define APPLE_Z2_HBPP_CMD_BLOB 0x3001 25 26 #define APPLE_Z2_FW_MAGIC 0x5746325A 26 27 #define LOAD_COMMAND_INIT_PAYLOAD 0 ··· 142 141 error = spi_sync_transfer(z2->spidev, &xfer, 1); 143 142 if (error) 144 143 return error; 144 + 145 + if (z2->rx_buf[0] != APPLE_Z2_REPLY_INTERRUPT_DATA) 146 + return 0; 145 147 146 148 pkt_len = (get_unaligned_le16(z2->rx_buf + 1) + 8) & 0xfffffffc; 147 149