Skip to content

Input: gscps2: cleanups and locking fixes

Dmitry Torokhov linux-input linux-parisc lkml 1 version In review

Get series with b4
b4 am [email protected] change-id 20260809-gscps2-affec5caa7f9

Versions newest first

  1. v1 Latest7 patches 2 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/7Input: gscps2 - clean up driver code style and structuredrivers/input/serio/gscps2.c+91 -1172 replies
2/7Input: gscps2 - use RCU for ps2port_list and manage it in open/closedrivers/input/serio/gscps2.c+16 -70 replies
3/7Input: gscps2 - protect buffer access in read and report helpersdrivers/input/serio/gscps2.c+12 -100 replies
4/7Input: gscps2 - serialize hardware and buffer access in gscps2_flush()drivers/input/serio/gscps2.c+6 -20 replies
5/7Input: gscps2 - return IRQ_NONE when interrupt is not handleddrivers/input/serio/gscps2.c+11 -40 replies
6/7Input: gscps2 - serialize concurrent interrupt handlersdrivers/input/serio/gscps2.c+22 -100 replies
7/7Input: gscps2 - drop busy-wait and manual interrupt pump on transmitdrivers/input/serio/gscps2.c+0 -70 replies

Reviews trailers per patch

1 of 7 patches has a Reviewed-by or Acked-by.

PatchHelge Deller
1/7A-b T-b
2/7
3/7
4/7
5/7
6/7
7/7

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v1 thread

Cover letter [PATCH 0/7] Input: gscps2: cleanups and locking fixes

This series cleans up the PA-RISC GSC PS/2 driver (gscps2) and addresses several concurrency, locking, and interrupt handling issues.

The series performs code style and structural cleanups, including removing forward declarations, converting printk calls to dev_* logging helpers, and simplifying enable/disable handling.

Additionally, it resolves several concurrency, locking, and interrupt handling issues:
- Protect ps2port_list traversal with RCU and manage port registration in open/close rather than probe/remove to avoid use-after-free during device unregistration.
- Protect ring buffer indices with ps2port->lock in read and report helpers while releasing the lock before calling serio_interrupt().
- Assert and enforce ps2port->lock across gscps2_flush() callers.
- Return IRQ_NONE when no data was handled on shared interrupt lines to preserve core spurious interrupt detection.
- Serialize concurrent interrupt handlers using a try-lock to guarantee in-order byte delivery.
- Drop the 6 ms busy-wait and manual interrupt pump on transmit in favor of standard asynchronous hardware interrupt delivery.

---
Dmitry Torokhov (7):
Input: gscps2 - clean up driver code style and structure
Input: gscps2 - use RCU for ps2port_list and manage it in open/close
Input: gscps2 - protect buffer access in read and report helpers
Input: gscps2 - serialize hardware and buffer access in gscps2_flush()
Input: gscps2 - return IRQ_NONE when interrupt is not handled
Input: gscps2 - serialize concurrent interrupt handlers
Input: gscps2 - drop busy-wait and manual interrupt pump on transmit

 drivers/input/serio/gscps2.c | 277 ++++++++++++++++++++++---------------------
 1 file changed, 139 insertions(+), 138 deletions(-)

---
base-commit: e30626823a406725ce29bc75cb8ec467d3e1e326
change-id: 20260809-gscps2-affec5caa7f9

Thanks.

Signature · 1 line
Dmitry