Linux Input/HID development
 help / color / mirror / Atom feed
* [PATCH v2 0/2] HID: intel-ish-hid: Size the buffers for a later, larger response
@ 2026-11-25  9:06 Maoyi Xie
  2026-11-25  9:06 ` [PATCH v2 1/2] HID: intel-ish-hid: Reallocate the descriptor buffers for a longer response Maoyi Xie
  2026-11-25  9:06 ` [PATCH v2 2/2] HID: intel-ish-hid: Allocate hid_devices for the largest device count Maoyi Xie
  0 siblings, 2 replies; 3+ messages in thread
From: Maoyi Xie @ 2026-11-25  9:06 UTC (permalink / raw)
  To: Srinivas Pandruvada, Jiri Kosina; +Cc: Benjamin Tissoires, linux-input, stable

Both patches fix buffers in process_recv() that are allocated for the
first firmware response and then reused for later, larger ones.

A pending patch [1] limits hid_dev_count to MAX_HID_DEVICES, and it is
still needed with this series. Patch 2 does not depend on [1], so it
allocates U8_MAX entries (2295 bytes). With [1] applied first,
MAX_HID_DEVICES entries would be enough.

The series is based on hid.git for-7.4/upstream-fixes. In mainline,
patch 2 conflicts with the treewide devm_kmalloc_obj() conversion
(4dd10fbbeb9c). I can send a version for mainline if you prefer.

I used an LLM to help write the harness and these patches.

Changes in v2:
- Patch 1 ignores a response whose done flag is already set.
- Patch 2 allocates hid_devices once for the largest count and does
  not reallocate it. The subject of patch 2 and of this letter changed
  with that.
- Both changes follow the Sashiko review of v1.
- v1: https://lore.kernel.org/linux-input/20261123092816.2200718-1-maoyixie.tju@gmail.com/

[1] https://lore.kernel.org/all/tencent_130404E5ABECE66E8D0E70D8E6892C751C0A@qq.com/

Maoyi Xie (2):
  HID: intel-ish-hid: Reallocate the descriptor buffers for a longer
    response
  HID: intel-ish-hid: Allocate hid_devices for the largest device count

 drivers/hid/intel-ish-hid/ishtp-hid-client.c | 27 ++++++++++++--------
 1 file changed, 16 insertions(+), 11 deletions(-)


base-commit: 10bc1d627c297097cfdc099377f8a13efdfffd86
-- 
2.34.1


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

end of thread, other threads:[~2026-11-25  9:06 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-25  9:06 [PATCH v2 0/2] HID: intel-ish-hid: Size the buffers for a later, larger response Maoyi Xie
2026-11-25  9:06 ` [PATCH v2 1/2] HID: intel-ish-hid: Reallocate the descriptor buffers for a longer response Maoyi Xie
2026-11-25  9:06 ` [PATCH v2 2/2] HID: intel-ish-hid: Allocate hid_devices for the largest device count Maoyi Xie

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