[PATCH v6 0/2] HID: intel-thc-hid: PRD tables under a drain

From: Emfox Zhou

Date: Tue Nov 17 2026 - 05:27:45 EST


The PRD tables lose capacity when a frame is left unread, and a drain can
reach a ring that a reset already rewound. Rebuild the tables before the
engine that reads them starts, hold every path that stops an engine or
moves its pointers under the lock the drain takes, and stop the drain from
treating an empty read as a frame.

Patch 1 does the ring side in the core. Patch 2 fixes the two callers that
go by the buffer instead of the length they were given.

Changes in v6:

- The stop, the rewind and the release hold the lock as well: a drain
that had already passed the flag could still read an entry of a ring
whose pointer had moved, and the teardown could free the tables under
it.

- quickspi and quicki2c no longer process a read that returned nothing.

Link to v5: https://lore.kernel.org/r/20261117093212.4122283-1-emfox@xxxxxxxxxx

Emfox Zhou (2):
HID: intel-thc-hid: intel-thc: restore PRD table capacity
HID: intel-thc-hid: quickspi, quicki2c: skip an empty read

.../intel-quicki2c/pci-quicki2c.c | 3 +
.../intel-quickspi/pci-quickspi.c | 3 +
.../intel-thc-hid/intel-thc/intel-thc-dma.c | 89 ++++++++++++++++++-
.../intel-thc-hid/intel-thc/intel-thc-dma.h | 8 ++
4 files changed, 99 insertions(+), 4 deletions(-)


base-commit: aebb7274476403040d582c61478df8f4a7bf9cd3