Skip to content

rust: serdev: Refactor

Markus Probst driver-core linux-serial lkml rust-for-linux sashiko-reviews 6 versions – In review

Get series with b4
b4 am [email protected] change-id 20260905-rust_serdev_probe_refactor-0e2b044354a7

Versions newest first

  1. v6 Latest4 patches 1 replyIn review
  2. v54 patches 1 replySuperseded
  3. v44 patches 4 repliesSuperseded
Earlier versions · 3
VersionPostedPatchesRepliesStatus
v34 patches2 repliesSuperseded
v23 patches7 repliesSuperseded
v15 patches4 repliesSuperseded

Changes in v6 from the cover letter

- fix issues reported by Sashiko:
- fix compile error on 3. patch
- rebase onto v7.4-rc2
- use dev_WARN instead of WARN_ON (WARN intentionally kept)
- Link to v5: https://patch.msgid.link/[email protected]

Patches in v6 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/4tty: serdev: Add mutex lockdrivers/tty/serdev/core.c drivers/tty/serdev/serdev-ttyport.c include/linux/serdev.h+47 -111 reply
2/4tty: serdev: Export functions to pause receive_buf callback callsdrivers/tty/serdev/core.c drivers/tty/serdev/serdev-ttyport.c include/linux/serdev.h+85 -10 replies
3/4rust: serdev: Replace `active` mutex with receive pauserust/kernel/serdev.rs+17 -460 replies
4/4rust: serdev: Simplify callbacksrust/kernel/serdev.rs+52 -820 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v6 yet.

Read the v6 thread

Cover letter [PATCH v6 0/4] rust: serdev: Refactor

The following has been changed:
- introduce mutex to C serdev tty port controller
- introduce a new C serdev API to fix race conditions and simplify rust code. Should also be useful on the C side.
- fix race conditions
- simplify rust code

---
Changes in v6:
- fix issues reported by Sashiko:
- fix compile error on 3. patch
- rebase onto v7.4-rc2
- use dev_WARN instead of WARN_ON (WARN intentionally kept)
- Link to v5: https://patch.msgid.link/[email protected]

Changes in v5:
- fix issues reported by Sashiko:
- fix access to serport->tty outside of locked mutex
- only lock receive_lock in ttyport_open for set_bit
- Link to v4: https://patch.msgid.link/[email protected]

Changes in v4:
- fix issues reported by Sashiko:
- add receive_lock to prevent deadlocks
- Link to v3: https://patch.msgid.link/[email protected]

Changes in v3:
- add mutex
- Link to v2: https://patch.msgid.link/[email protected]

Changes in v2:
- fix missing memory barriers in serdev apis
- use tty_buffer_restart_work instead of tty_flip_buffer_push
- use tty_buffer_flush_work instead of exclusively locking the mutex
- add #[inline] to PrivateData::driver_data
- remove patches for mutable references
- Link to v1: https://patch.msgid.link/[email protected]

---
Markus Probst (4):
tty: serdev: Add mutex lock
tty: serdev: Export functions to pause receive_buf callback calls
rust: serdev: Replace active mutex with receive pause
rust: serdev: Simplify callbacks

 drivers/tty/serdev/core.c           |  56 +++++++++++-
 drivers/tty/serdev/serdev-ttyport.c |  80 +++++++++++++++--
 include/linux/serdev.h              |   8 +-
 rust/kernel/serdev.rs               | 167 ++++++++++++------------------------
 4 files changed, 186 insertions(+), 125 deletions(-)

---
base-commit: fd9230005e85472b81c1c7c16afe93dd878996b1
change-id: 20260905-rust_serdev_probe_refactor-0e2b044354a7