* [PATCH RESEND v6 0/4] rust: serdev: Refactor
@ 2026-12-04 16:58 Markus Probst
2026-12-04 16:58 ` [PATCH RESEND v6 1/4] tty: serdev: Add mutex lock Markus Probst
` (4 more replies)
0 siblings, 5 replies; 11+ messages in thread
From: Markus Probst @ 2026-12-04 16:58 UTC (permalink / raw)
To: Ayush Singh, Johan Hovold, Alex Elder, Greg Kroah-Hartman,
Miguel Ojeda, Boqun Feng, Gary Guo, Björn Roy Baron,
Benno Lossin, Andreas Hindborg, Alice Ryhl, Trevor Gross,
Danilo Krummrich, Daniel Almeida, Tamir Duberstein,
Alexandre Courbot, Onur Özkan, Eric Biggers, Ard Biesheuvel,
Lorenzo Stoakes, Vlastimil Babka, Liam R. Howlett,
Uladzislau Rezki, Jiri Slaby, Rafael J. Wysocki
Cc: greybus-dev, linux-serial, rust-for-linux, linux-kernel,
driver-core, Markus Probst, Sashiko Bot
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
Signed-off-by: Markus Probst <markus.probst@posteo.de>
---
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/20261022-rust_serdev_probe_refactor-v5-0-a27d862a415a@posteo.de
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/20261016-rust_serdev_probe_refactor-v4-0-46832e034757@posteo.de
Changes in v4:
- fix issues reported by Sashiko:
- add receive_lock to prevent deadlocks
- Link to v3: https://patch.msgid.link/20260930-rust_serdev_probe_refactor-v3-0-d1b6e77135e0@posteo.de
Changes in v3:
- add mutex
- Link to v2: https://patch.msgid.link/20260920-rust_serdev_probe_refactor-v2-0-43b855162f5d@posteo.de
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/20260906-rust_serdev_probe_refactor-v1-0-69cdae0074ec@posteo.de
---
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
-----BEGIN PGP SIGNATURE-----
iQJPBAABCAA5FiEEgnQYxPSsWOdyMMRzNHYf+OetQ9IFAmr1964bFIAAAAAABAAO
bWFudTIsMi41KzEuMTIsMiwyAAoJEDR2H/jnrUPSTjcP/0JUJpxBfi4xWI8m2J9z
yBYBAgoD2ePHJ40IeQBlIOQhIrj7+Y86G6ex78GybRK3bobR+PGek7XlJtfbWY6t
ACkgiI7CXyB5XfEQdNFF9wXxDCPGCnBUc7UUT7LJFDCqtn4rLueMcvgOxvDnnUx0
KdiRX75Rc+BGo9+/3IqttFvzXfwCAq/B45o1jScq4owclH7lXzy7UpBhxq1tLcpv
evyGBhWzjHW5H35NnI5uqPhqMUAS0QcByYcNDJLSjDZcnMURnpGZ5K5evmJQXue9
SoIJsFhBopV+hnbqeu6dAdVrclrNTtFG71xp8sjsZrrWfUxLZ+Iv9BsliLJ8NnKr
SeYuHFZvUJv//uXmK9/x0bxEVOgeV09sWRjfTEfd7D3itjscZ1b0yKmtp+jjWyAO
/CYEq/g+6Dvy0NDYiYPxg3sbXcNFJNQNiH+SqQx7GgewQ96Uv8MfZgD3Klt/KRxu
cXL1EdM0ILrqUkiK5C3M2DLUpa+59e7QEZz1lkv50SxiYyLN12xG8d95Ax7y5NwK
IAd6o6+LvgEMmxz3euopeKeOPolNdn5+eZ+LdB+EEyhyvBBHQONgdMGVPdAnI6NK
4VsnkSgWY6gKxSsO53O/bWihMzC+kVYbBLJppC4JZwV2oqnSgJf8ufRtqIFXUioL
B8Ev8Cb3L0yZqBqfbymZ7Jrg
=SI2b
-----END PGP SIGNATURE-----
--
Markus Probst <markus.probst@posteo.de>
^ permalink raw reply [flat|nested] 11+ messages in thread
* [PATCH RESEND v6 1/4] tty: serdev: Add mutex lock
2026-12-04 16:58 [PATCH RESEND v6 0/4] rust: serdev: Refactor Markus Probst
@ 2026-12-04 16:58 ` Markus Probst
2026-12-04 17:22 ` sashiko-bot
2026-12-04 16:58 ` [PATCH RESEND v6 2/4] tty: serdev: Export functions to pause receive_buf callback calls Markus Probst
` (3 subsequent siblings)
4 siblings, 1 reply; 11+ messages in thread
From: Markus Probst @ 2026-12-04 16:58 UTC (permalink / raw)
To: Ayush Singh, Johan Hovold, Alex Elder, Greg Kroah-Hartman,
Miguel Ojeda, Boqun Feng, Gary Guo, Björn Roy Baron,
Benno Lossin, Andreas Hindborg, Alice Ryhl, Trevor Gross,
Danilo Krummrich, Daniel Almeida, Tamir Duberstein,
Alexandre Courbot, Onur Özkan, Eric Biggers, Ard Biesheuvel,
Lorenzo Stoakes, Vlastimil Babka, Liam R. Howlett,
Uladzislau Rezki, Jiri Slaby, Rafael J. Wysocki
Cc: greybus-dev, linux-serial, rust-for-linux, linux-kernel,
driver-core, Markus Probst
Besides more predictable behaviour, this allows for several hardened
behaviour changes:
Return -EALREADY in `serdev_device_open` if the device is already open
instead of causing undefined behaviour.
Allow calling `serdev_device_close`, even if the device is already
closed instead of causing a null pointer dereference.
If the device is left open by the driver after remove, close it and warn
instead of leaving it in a invalid state.
Signed-off-by: Markus Probst <markus.probst@posteo.de>
---
drivers/tty/serdev/core.c | 12 +++++++---
drivers/tty/serdev/serdev-ttyport.c | 44 +++++++++++++++++++++++++++++++------
include/linux/serdev.h | 2 +-
3 files changed, 47 insertions(+), 11 deletions(-)
diff --git a/drivers/tty/serdev/core.c b/drivers/tty/serdev/core.c
index 7500efcdfc21..86d9cf8215ed 100644
--- a/drivers/tty/serdev/core.c
+++ b/drivers/tty/serdev/core.c
@@ -142,6 +142,13 @@ void serdev_device_remove(struct serdev_device *serdev)
struct serdev_controller *ctrl = serdev->ctrl;
device_unregister(&serdev->dev);
+
+ /* Warn if driver did not close the serial device. */
+ if (ctrl->ops->close && ctrl->ops->close(ctrl)) {
+ dev_WARN(&ctrl->dev, "Child driver did not close the serial device");
+ pm_runtime_put(&ctrl->dev);
+ }
+
ctrl->serdev = NULL;
}
EXPORT_SYMBOL_GPL(serdev_device_remove);
@@ -181,9 +188,8 @@ void serdev_device_close(struct serdev_device *serdev)
if (!ctrl || !ctrl->ops->close)
return;
- pm_runtime_put(&ctrl->dev);
-
- ctrl->ops->close(ctrl);
+ if (ctrl->ops->close(ctrl))
+ pm_runtime_put(&ctrl->dev);
}
EXPORT_SYMBOL_GPL(serdev_device_close);
diff --git a/drivers/tty/serdev/serdev-ttyport.c b/drivers/tty/serdev/serdev-ttyport.c
index b6638f9f40d2..17c18d4b0cb8 100644
--- a/drivers/tty/serdev/serdev-ttyport.c
+++ b/drivers/tty/serdev/serdev-ttyport.c
@@ -16,6 +16,8 @@ struct serport {
struct tty_driver *tty_drv;
int tty_idx;
unsigned long flags;
+ struct mutex lock; /* lock preventing modification of flags */
+ struct mutex receive_lock; /* lock preventing execution of serdev_controller_receive_buf */
};
/*
@@ -29,6 +31,8 @@ static size_t ttyport_receive_buf(struct tty_port *port, const u8 *cp,
struct serport *serport = serdev_controller_get_drvdata(ctrl);
size_t ret;
+ guard(mutex)(&serport->receive_lock);
+
if (!test_bit(SERPORT_ACTIVE, &serport->flags))
return 0;
@@ -99,14 +103,23 @@ static int ttyport_open(struct serdev_controller *ctrl)
struct ktermios ktermios;
int ret;
+ mutex_lock(&serport->lock);
+
+ if (test_bit(SERPORT_ACTIVE, &serport->flags)) {
+ ret = -EALREADY;
+ goto err_flags_unlock;
+ }
+
tty = tty_init_dev(serport->tty_drv, serport->tty_idx);
- if (IS_ERR(tty))
- return PTR_ERR(tty);
+ if (IS_ERR(tty)) {
+ ret = PTR_ERR(tty);
+ goto err_flags_unlock;
+ }
serport->tty = tty;
if (!tty->ops->open || !tty->ops->close) {
ret = -ENODEV;
- goto err_unlock;
+ goto err_tty_unlock;
}
ret = tty->ops->open(serport->tty, NULL);
@@ -128,26 +141,38 @@ static int ttyport_open(struct serdev_controller *ctrl)
ktermios.c_cflag |= CLOCAL;
tty_set_termios(tty, &ktermios);
+ mutex_lock(&serport->receive_lock);
set_bit(SERPORT_ACTIVE, &serport->flags);
+ mutex_unlock(&serport->receive_lock);
+
+ mutex_unlock(&serport->lock);
return 0;
err_close:
tty->ops->close(tty, NULL);
-err_unlock:
+err_tty_unlock:
tty_unlock(tty);
tty_release_struct(tty, serport->tty_idx);
serport->tty = NULL;
+err_flags_unlock:
+ mutex_unlock(&serport->lock);
return ret;
}
-static void ttyport_close(struct serdev_controller *ctrl)
+static bool ttyport_close(struct serdev_controller *ctrl)
{
struct serport *serport = serdev_controller_get_drvdata(ctrl);
- struct tty_struct *tty = serport->tty;
+ struct tty_struct *tty;
+
+ guard(mutex)(&serport->lock);
- clear_bit(SERPORT_ACTIVE, &serport->flags);
+ tty = serport->tty;
+
+ scoped_guard(mutex, &serport->receive_lock)
+ if (!__test_and_clear_bit(SERPORT_ACTIVE, &serport->flags))
+ return false;
tty_lock(tty);
if (tty->ops->close)
@@ -156,6 +181,8 @@ static void ttyport_close(struct serdev_controller *ctrl)
tty_release_struct(tty, serport->tty_idx);
serport->tty = NULL;
+
+ return true;
}
static unsigned int ttyport_set_baudrate(struct serdev_controller *ctrl, unsigned int speed)
@@ -290,6 +317,9 @@ struct device *serdev_tty_port_register(struct tty_port *port,
port->client_ops = &client_ops;
port->client_data = ctrl;
+ mutex_init(&serport->lock);
+ mutex_init(&serport->receive_lock);
+
ret = serdev_controller_add(ctrl);
if (ret)
goto err_reset_data;
diff --git a/include/linux/serdev.h b/include/linux/serdev.h
index b6c3d957ec15..0f4e81c0950d 100644
--- a/include/linux/serdev.h
+++ b/include/linux/serdev.h
@@ -81,7 +81,7 @@ struct serdev_controller_ops {
ssize_t (*write_buf)(struct serdev_controller *, const u8 *, size_t);
void (*write_flush)(struct serdev_controller *);
int (*open)(struct serdev_controller *);
- void (*close)(struct serdev_controller *);
+ bool (*close)(struct serdev_controller *);
void (*set_flow_control)(struct serdev_controller *, bool);
int (*set_parity)(struct serdev_controller *, enum serdev_parity);
unsigned int (*set_baudrate)(struct serdev_controller *, unsigned int);
--
2.56.1
^ permalink raw reply related [flat|nested] 11+ messages in thread
* [PATCH RESEND v6 2/4] tty: serdev: Export functions to pause receive_buf callback calls
2026-12-04 16:58 [PATCH RESEND v6 0/4] rust: serdev: Refactor Markus Probst
2026-12-04 16:58 ` [PATCH RESEND v6 1/4] tty: serdev: Add mutex lock Markus Probst
@ 2026-12-04 16:58 ` Markus Probst
2026-12-04 17:23 ` sashiko-bot
2026-12-04 16:58 ` [PATCH RESEND v6 3/4] rust: serdev: Replace `active` mutex with receive pause Markus Probst
` (2 subsequent siblings)
4 siblings, 1 reply; 11+ messages in thread
From: Markus Probst @ 2026-12-04 16:58 UTC (permalink / raw)
To: Ayush Singh, Johan Hovold, Alex Elder, Greg Kroah-Hartman,
Miguel Ojeda, Boqun Feng, Gary Guo, Björn Roy Baron,
Benno Lossin, Andreas Hindborg, Alice Ryhl, Trevor Gross,
Danilo Krummrich, Daniel Almeida, Tamir Duberstein,
Alexandre Courbot, Onur Özkan, Eric Biggers, Ard Biesheuvel,
Lorenzo Stoakes, Vlastimil Babka, Liam R. Howlett,
Uladzislau Rezki, Jiri Slaby, Rafael J. Wysocki
Cc: greybus-dev, linux-serial, rust-for-linux, linux-kernel,
driver-core, Markus Probst
These functions will be used to simply the serdev rust abstraction. It
also contributes to the fixing of 2 race conditions in the serdev rust
abstraction.
Signed-off-by: Markus Probst <markus.probst@posteo.de>
---
drivers/tty/serdev/core.c | 44 ++++++++++++++++++++++++++++++++++++-
drivers/tty/serdev/serdev-ttyport.c | 36 ++++++++++++++++++++++++++++++
include/linux/serdev.h | 6 +++++
3 files changed, 85 insertions(+), 1 deletion(-)
diff --git a/drivers/tty/serdev/core.c b/drivers/tty/serdev/core.c
index 86d9cf8215ed..ca20304c7b20 100644
--- a/drivers/tty/serdev/core.c
+++ b/drivers/tty/serdev/core.c
@@ -193,6 +193,45 @@ void serdev_device_close(struct serdev_device *serdev)
}
EXPORT_SYMBOL_GPL(serdev_device_close);
+/**
+ * serdev_device_pause_rx() - pause data receive
+ * @serdev: serdev device
+ *
+ * Pause calls to receive_buf.
+ *
+ * Note that if a call to receive_buf is currently executed, the function will
+ * sleep until it has finished.
+ */
+void serdev_device_pause_rx(struct serdev_device *serdev)
+{
+ struct serdev_controller *ctrl = serdev->ctrl;
+
+ if (!ctrl || !ctrl->ops->pause_rx)
+ return;
+
+ ctrl->ops->pause_rx(ctrl);
+}
+EXPORT_SYMBOL_GPL(serdev_device_pause_rx);
+
+/**
+ * serdev_device_resume_rx() - resume data receive
+ * @serdev: serdev device
+ *
+ * Resume calls to receive_buf.
+ *
+ * This can be called even if not paused to ensure data receive is active.
+ */
+void serdev_device_resume_rx(struct serdev_device *serdev)
+{
+ struct serdev_controller *ctrl = serdev->ctrl;
+
+ if (!ctrl || !ctrl->ops->resume_rx)
+ return;
+
+ ctrl->ops->resume_rx(ctrl);
+}
+EXPORT_SYMBOL_GPL(serdev_device_resume_rx);
+
static void devm_serdev_device_close(void *serdev)
{
serdev_device_close(serdev);
@@ -404,6 +443,7 @@ EXPORT_SYMBOL_GPL(serdev_device_break_ctl);
static int serdev_drv_probe(struct device *dev)
{
const struct serdev_device_driver *sdrv = to_serdev_device_driver(dev->driver);
+ struct serdev_device *sdev = to_serdev_device(dev);
int ret;
ret = dev_pm_domain_attach(dev, PD_FLAG_ATTACH_POWER_ON |
@@ -411,7 +451,9 @@ static int serdev_drv_probe(struct device *dev)
if (ret)
return ret;
- return sdrv->probe(to_serdev_device(dev));
+ serdev_device_resume_rx(sdev);
+
+ return sdrv->probe(sdev);
}
static void serdev_drv_remove(struct device *dev)
diff --git a/drivers/tty/serdev/serdev-ttyport.c b/drivers/tty/serdev/serdev-ttyport.c
index 17c18d4b0cb8..6e1134976996 100644
--- a/drivers/tty/serdev/serdev-ttyport.c
+++ b/drivers/tty/serdev/serdev-ttyport.c
@@ -7,8 +7,10 @@
#include <linux/tty.h>
#include <linux/tty_driver.h>
#include <linux/poll.h>
+#include "../tty.h"
#define SERPORT_ACTIVE 1
+#define SERPORT_PAUSE_RX 2
struct serport {
struct tty_port *port;
@@ -36,6 +38,9 @@ static size_t ttyport_receive_buf(struct tty_port *port, const u8 *cp,
if (!test_bit(SERPORT_ACTIVE, &serport->flags))
return 0;
+ if (test_bit(SERPORT_PAUSE_RX, &serport->flags))
+ return 0;
+
ret = serdev_controller_receive_buf(ctrl, cp, count);
dev_WARN_ONCE(&ctrl->dev, ret > count,
@@ -185,6 +190,35 @@ static bool ttyport_close(struct serdev_controller *ctrl)
return true;
}
+static void ttyport_pause_rx(struct serdev_controller *ctrl)
+{
+ struct serport *serport = serdev_controller_get_drvdata(ctrl);
+
+ guard(mutex)(&serport->lock);
+
+ scoped_guard(mutex, &serport->receive_lock)
+ set_bit(SERPORT_PAUSE_RX, &serport->flags);
+
+ if (test_bit(SERPORT_ACTIVE, &serport->flags))
+ tty_buffer_cancel_work(serport->tty->port);
+}
+
+static void ttyport_resume_rx(struct serdev_controller *ctrl)
+{
+ struct serport *serport = serdev_controller_get_drvdata(ctrl);
+
+ guard(mutex)(&serport->lock);
+
+ if (!test_bit(SERPORT_PAUSE_RX, &serport->flags))
+ return;
+
+ scoped_guard(mutex, &serport->receive_lock)
+ clear_bit(SERPORT_PAUSE_RX, &serport->flags);
+
+ if (test_bit(SERPORT_ACTIVE, &serport->flags))
+ tty_buffer_restart_work(serport->tty->port);
+}
+
static unsigned int ttyport_set_baudrate(struct serdev_controller *ctrl, unsigned int speed)
{
struct serport *serport = serdev_controller_get_drvdata(ctrl);
@@ -289,6 +323,8 @@ static const struct serdev_controller_ops ctrl_ops = {
.get_tiocm = ttyport_get_tiocm,
.set_tiocm = ttyport_set_tiocm,
.break_ctl = ttyport_break_ctl,
+ .pause_rx = ttyport_pause_rx,
+ .resume_rx = ttyport_resume_rx,
};
struct device *serdev_tty_port_register(struct tty_port *port,
diff --git a/include/linux/serdev.h b/include/linux/serdev.h
index 0f4e81c0950d..02773554e759 100644
--- a/include/linux/serdev.h
+++ b/include/linux/serdev.h
@@ -89,6 +89,8 @@ struct serdev_controller_ops {
int (*get_tiocm)(struct serdev_controller *);
int (*set_tiocm)(struct serdev_controller *, unsigned int, unsigned int);
int (*break_ctl)(struct serdev_controller *ctrl, unsigned int break_state);
+ void (*pause_rx)(struct serdev_controller *ctrl);
+ void (*resume_rx)(struct serdev_controller *ctrl);
};
/**
@@ -194,6 +196,8 @@ static inline size_t serdev_controller_receive_buf(struct serdev_controller *ctr
int serdev_device_open(struct serdev_device *);
void serdev_device_close(struct serdev_device *);
int devm_serdev_device_open(struct device *, struct serdev_device *);
+void serdev_device_pause_rx(struct serdev_device *serdev);
+void serdev_device_resume_rx(struct serdev_device *serdev);
unsigned int serdev_device_set_baudrate(struct serdev_device *, unsigned int);
void serdev_device_set_flow_control(struct serdev_device *, bool);
int serdev_device_write_buf(struct serdev_device *, const u8 *, size_t);
@@ -233,6 +237,8 @@ static inline int serdev_device_open(struct serdev_device *sdev)
return -ENODEV;
}
static inline void serdev_device_close(struct serdev_device *sdev) {}
+static inline void serdev_device_pause_rx(struct serdev_device *serdev) {}
+static inline void serdev_device_resume_rx(struct serdev_device *serdev) {}
static inline unsigned int serdev_device_set_baudrate(struct serdev_device *sdev, unsigned int baudrate)
{
return 0;
--
2.56.1
^ permalink raw reply related [flat|nested] 11+ messages in thread
* [PATCH RESEND v6 3/4] rust: serdev: Replace `active` mutex with receive pause
2026-12-04 16:58 [PATCH RESEND v6 0/4] rust: serdev: Refactor Markus Probst
2026-12-04 16:58 ` [PATCH RESEND v6 1/4] tty: serdev: Add mutex lock Markus Probst
2026-12-04 16:58 ` [PATCH RESEND v6 2/4] tty: serdev: Export functions to pause receive_buf callback calls Markus Probst
@ 2026-12-04 16:58 ` Markus Probst
2026-12-04 16:58 ` [PATCH RESEND v6 4/4] rust: serdev: Simplify callbacks Markus Probst
2026-12-04 17:23 ` [PATCH RESEND v6 0/4] rust: serdev: Refactor sashiko-bot
4 siblings, 0 replies; 11+ messages in thread
From: Markus Probst @ 2026-12-04 16:58 UTC (permalink / raw)
To: Ayush Singh, Johan Hovold, Alex Elder, Greg Kroah-Hartman,
Miguel Ojeda, Boqun Feng, Gary Guo, Björn Roy Baron,
Benno Lossin, Andreas Hindborg, Alice Ryhl, Trevor Gross,
Danilo Krummrich, Daniel Almeida, Tamir Duberstein,
Alexandre Courbot, Onur Özkan, Eric Biggers, Ard Biesheuvel,
Lorenzo Stoakes, Vlastimil Babka, Liam R. Howlett,
Uladzislau Rezki, Jiri Slaby, Rafael J. Wysocki
Cc: greybus-dev, linux-serial, rust-for-linux, linux-kernel,
driver-core, Markus Probst, Sashiko Bot
There are currently 2 race conditions:
- in probe if `Driver::probe` returns Err
- in unbind
. In those cases the driver data will be set to NULL before the serdev
device was closed. If data is received while the driver data is dropped,
the `receive_buf_callback` might try to access the `active` mutex on a
null pointer.
Removing the need for `receive_buf_callback` to lock the `active` mutex
fixes these.
Fixes: 99f59aa82341 ("rust: add basic serial device bus abstractions")
Reported-by: Sashiko Bot <sashiko-bot@kernel.org>
Closes: https://lore.kernel.org/linux-serial/20260905000836.C8FC91F00A3D@smtp.kernel.org/
Closes: https://lore.kernel.org/linux-serial/20260903222159.70A911F000E9@smtp.kernel.org/
Signed-off-by: Markus Probst <markus.probst@posteo.de>
---
rust/kernel/serdev.rs | 63 ++++++++++++++-------------------------------------
1 file changed, 17 insertions(+), 46 deletions(-)
diff --git a/rust/kernel/serdev.rs b/rust/kernel/serdev.rs
index 17ca504b7f8d..559d142ce557 100644
--- a/rust/kernel/serdev.rs
+++ b/rust/kernel/serdev.rs
@@ -13,13 +13,9 @@
to_result,
VTABLE_DEFAULT_ERROR, //
},
- new_mutex,
of,
prelude::*,
- sync::{
- aref::AlwaysRefCounted,
- Mutex, //
- },
+ sync::aref::AlwaysRefCounted,
time::Jiffies,
types::{
Opaque,
@@ -103,40 +99,11 @@ pub struct PrivateData<'bound, T: Driver> {
#[pin]
driver: UnsafeCell<MaybeUninit<T::Data<'bound>>>,
open: UnsafeCell<bool>,
- /// Whether `receive_buf_callback` is allowed to call `Driver::receive`.
- ///
- /// If locked, the receive_buf_callback will be blocked on data reception.
- /// This is the case while the driver is being probed or while [`PrivateData`] is being dropped.
- /// This is necessary, because we need to open the serdev device before the driver has been
- /// probed in order to allow it to be configured, which allows `receive_buf_callback` to be
- /// called. Thus we need to block data until probe completes and the driver data becomes
- /// initialized.
- ///
- /// If unlocked and true, the receive_buf_callback will forward the data to
- /// `Driver::receive`. This is the normal state of operation.
- ///
- /// If unlocked and false, the receive_buf_callback will throw away the data.
- /// This is only the case, if the serdev device is open and
- /// - the driver returned an error in probe
- /// or
- /// - the driver data already has been dropped, because it was unbound.
- #[pin]
- active: Mutex<bool>,
}
#[pinned_drop]
impl<T: Driver> PinnedDrop for PrivateData<'_, T> {
fn drop(self: Pin<&mut Self>) {
- let mut active = self.active.lock();
- if *active {
- // SAFETY:
- // - We have exclusive access to `self.driver`.
- // - `self.driver` is guaranteed to be initialized.
- unsafe { (*self.driver.get()).assume_init_drop() };
- *active = false;
- }
- drop(active);
-
// SAFETY: We have exclusive access to `self.open`.
if unsafe { *self.open.get() } {
// SAFETY: `self.sdev.as_raw()` is guaranteed to be a pointer to a valid
@@ -170,7 +137,6 @@ extern "C" fn probe_callback(sdev: *mut bindings::serdev_device) -> kernel::ffi:
sdev: &**sdev,
driver: MaybeUninit::<T::Data<'_>>::zeroed().into(),
open: false.into(),
- active <- new_mutex!(false),
}))?;
// SAFETY: We just set drvdata to `PrivateData<'_, T>`.
let private_data = unsafe { sdev.as_ref().drvdata_borrow::<PrivateData<'_, T>>() };
@@ -178,11 +144,12 @@ extern "C" fn probe_callback(sdev: *mut bindings::serdev_device) -> kernel::ffi:
// SAFETY: We just set drvdata to `PrivateData<'_, T>`.
drop(unsafe { sdev.as_ref().drvdata_obtain::<PrivateData<'_, T>>() });
});
- let mut active = private_data.active.lock();
-
// SAFETY: `sdev.as_raw()` is guaranteed to be a valid pointer to `serdev_device`.
unsafe { bindings::serdev_device_set_client_ops(sdev.as_raw(), Self::OPS) };
+ // SAFETY: `sdev.as_raw()` is guaranteed to be a valid pointer to `serdev_device`.
+ unsafe { bindings::serdev_device_pause_rx(sdev.as_raw()) };
+
// SAFETY: The serial device bus only ever calls the probe callback with a valid pointer
// to a `serdev_device`.
to_result(unsafe { bindings::serdev_device_open(sdev.as_raw()) })?;
@@ -199,12 +166,12 @@ extern "C" fn probe_callback(sdev: *mut bindings::serdev_device) -> kernel::ffi:
// - `private_data.driver` is pinned.
let result = unsafe { pin_init::raw_try_init(driver.as_mut_ptr(), data) };
- *active = result.is_ok();
-
- drop(active);
-
result.map(|()| {
private_data.dismiss();
+
+ // SAFETY: `sdev.as_raw()` is guaranteed to be a valid pointer to `serdev_device`.
+ unsafe { bindings::serdev_device_resume_rx(sdev.as_raw()) };
+
0
})
})
@@ -231,6 +198,15 @@ extern "C" fn remove_callback(sdev: *mut bindings::serdev_device) {
let data_pinned = unsafe { Pin::new_unchecked(data.assume_init_ref()) };
T::unbind(sdev, data_pinned);
+
+ // SAFETY: `sdev.as_raw()` is guaranteed to be a valid pointer to `serdev_device`.
+ unsafe { bindings::serdev_device_pause_rx(sdev.as_raw()) };
+
+ // SAFETY: We have exclusive access to `private_data.driver`.
+ let data = unsafe { &mut *private_data.driver.get() };
+
+ // SAFETY: We already established that `data` is guaranteed to be initialized.
+ unsafe { data.assume_init_drop() };
}
extern "C" fn receive_buf_callback(
@@ -248,11 +224,6 @@ extern "C" fn receive_buf_callback(
// `probe_callback`, hence it's guaranteed that `Device::set_drvdata()` has been called
// and stored a `Pin<KBox<PrivateData<'_, T>>>`.
let private_data = unsafe { sdev.as_ref().drvdata_borrow::<PrivateData<'_, T>>() };
- let active = private_data.active.lock();
-
- if !*active {
- return length;
- }
// SAFETY: No one has exclusive access to `private_data.driver`.
let data = unsafe { &*private_data.driver.get() };
--
2.56.1
^ permalink raw reply related [flat|nested] 11+ messages in thread
* [PATCH RESEND v6 4/4] rust: serdev: Simplify callbacks
2026-12-04 16:58 [PATCH RESEND v6 0/4] rust: serdev: Refactor Markus Probst
` (2 preceding siblings ...)
2026-12-04 16:58 ` [PATCH RESEND v6 3/4] rust: serdev: Replace `active` mutex with receive pause Markus Probst
@ 2026-12-04 16:58 ` Markus Probst
2026-12-04 17:13 ` sashiko-bot
2026-12-04 17:23 ` [PATCH RESEND v6 0/4] rust: serdev: Refactor sashiko-bot
4 siblings, 1 reply; 11+ messages in thread
From: Markus Probst @ 2026-12-04 16:58 UTC (permalink / raw)
To: Ayush Singh, Johan Hovold, Alex Elder, Greg Kroah-Hartman,
Miguel Ojeda, Boqun Feng, Gary Guo, Björn Roy Baron,
Benno Lossin, Andreas Hindborg, Alice Ryhl, Trevor Gross,
Danilo Krummrich, Daniel Almeida, Tamir Duberstein,
Alexandre Courbot, Onur Özkan, Eric Biggers, Ard Biesheuvel,
Lorenzo Stoakes, Vlastimil Babka, Liam R. Howlett,
Uladzislau Rezki, Jiri Slaby, Rafael J. Wysocki
Cc: greybus-dev, linux-serial, rust-for-linux, linux-kernel,
driver-core, Markus Probst
Initialize the driver's private data directly on `PrivateData`.
Introduce `OpenGuard` for resource cleanup.
Signed-off-by: Markus Probst <markus.probst@posteo.de>
---
rust/kernel/serdev.rs | 134 ++++++++++++++++++++------------------------------
1 file changed, 52 insertions(+), 82 deletions(-)
diff --git a/rust/kernel/serdev.rs b/rust/kernel/serdev.rs
index 559d142ce557..3f9165e16776 100644
--- a/rust/kernel/serdev.rs
+++ b/rust/kernel/serdev.rs
@@ -17,16 +17,12 @@
prelude::*,
sync::aref::AlwaysRefCounted,
time::Jiffies,
- types::{
- Opaque,
- ScopeGuard, //
- }, //
+ types::Opaque, //
};
use core::{
- cell::UnsafeCell,
marker::PhantomData,
- mem::{offset_of, MaybeUninit},
+ mem::offset_of,
ptr::NonNull, //
};
@@ -92,24 +88,36 @@ unsafe fn unregister(sdrv: &Opaque<Self::DriverType>) {
}
}
+struct OpenGuard<'bound> {
+ sdev: &'bound Device<device::Bound>,
+}
+
+impl Drop for OpenGuard<'_> {
+ fn drop(&mut self) {
+ // SAFETY:
+ // - `self.sdev.as_raw()` is guaranteed to be a pointer to a valid
+ // `struct serdev_device`.
+ // - The existence of self proves that the device is open.
+ unsafe { bindings::serdev_device_close(self.sdev.as_raw()) };
+ }
+}
+
#[doc(hidden)]
-#[pin_data(PinnedDrop)]
+#[pin_data]
pub struct PrivateData<'bound, T: Driver> {
- sdev: &'bound Device<device::Bound>,
#[pin]
- driver: UnsafeCell<MaybeUninit<T::Data<'bound>>>,
- open: UnsafeCell<bool>,
+ driver: T::Data<'bound>,
+ open: OpenGuard<'bound>,
}
-#[pinned_drop]
-impl<T: Driver> PinnedDrop for PrivateData<'_, T> {
- fn drop(self: Pin<&mut Self>) {
- // SAFETY: We have exclusive access to `self.open`.
- if unsafe { *self.open.get() } {
- // SAFETY: `self.sdev.as_raw()` is guaranteed to be a pointer to a valid
- // `struct serdev_device`.
- unsafe { bindings::serdev_device_close(self.sdev.as_raw()) };
- }
+impl<'bound, T: Driver> PrivateData<'bound, T> {
+ #[inline]
+ fn driver_data(self: Pin<&Self>) -> Pin<&T::Data<'bound>> {
+ // SAFETY: We treat the result as pinned.
+ let inner = unsafe { Pin::into_inner_unchecked(self) };
+
+ // SAFETY: `self.driver` is pinned.
+ unsafe { Pin::new_unchecked(&inner.driver) }
}
}
@@ -134,46 +142,30 @@ extern "C" fn probe_callback(sdev: *mut bindings::serdev_device) -> kernel::ffi:
from_result(|| {
sdev.as_ref().set_drvdata(try_pin_init!(PrivateData::<T> {
- sdev: &**sdev,
- driver: MaybeUninit::<T::Data<'_>>::zeroed().into(),
- open: false.into(),
+ open: {
+ // SAFETY:
+ // - `sdev.as_raw()` is guaranteed to be a valid pointer to
+ // `serdev_device`.
+ // - It is safe to call before open.
+ unsafe { bindings::serdev_device_set_client_ops(sdev.as_raw(), Self::OPS) };
+
+ // SAFETY: `sdev.as_raw()` is guaranteed to be a valid pointer to
+ // `serdev_device`.
+ unsafe { bindings::serdev_device_pause_rx(sdev.as_raw()) };
+
+ // SAFETY: `sdev.as_raw()` is guaranteed to be a valid pointer to
+ // `serdev_device`.
+ to_result(unsafe { bindings::serdev_device_open(sdev.as_raw()) })?;
+
+ OpenGuard { sdev }
+ },
+ driver <- T::probe(sdev, info),
}))?;
- // SAFETY: We just set drvdata to `PrivateData<'_, T>`.
- let private_data = unsafe { sdev.as_ref().drvdata_borrow::<PrivateData<'_, T>>() };
- let private_data = ScopeGuard::new_with_data(private_data, |_| {
- // SAFETY: We just set drvdata to `PrivateData<'_, T>`.
- drop(unsafe { sdev.as_ref().drvdata_obtain::<PrivateData<'_, T>>() });
- });
- // SAFETY: `sdev.as_raw()` is guaranteed to be a valid pointer to `serdev_device`.
- unsafe { bindings::serdev_device_set_client_ops(sdev.as_raw(), Self::OPS) };
// SAFETY: `sdev.as_raw()` is guaranteed to be a valid pointer to `serdev_device`.
- unsafe { bindings::serdev_device_pause_rx(sdev.as_raw()) };
-
- // SAFETY: The serial device bus only ever calls the probe callback with a valid pointer
- // to a `serdev_device`.
- to_result(unsafe { bindings::serdev_device_open(sdev.as_raw()) })?;
-
- // SAFETY: We have exclusive access to `private_data.open`.
- unsafe { *private_data.open.get() = true };
-
- let data = T::probe(sdev, info);
+ unsafe { bindings::serdev_device_resume_rx(sdev.as_raw()) };
- // SAFETY: We have exclusive access to `private_data.driver`.
- let driver = unsafe { &mut *private_data.driver.get() };
- // SAFETY:
- // - `driver.as_mut_ptr()` is a valid pointer to uninitialized data.
- // - `private_data.driver` is pinned.
- let result = unsafe { pin_init::raw_try_init(driver.as_mut_ptr(), data) };
-
- result.map(|()| {
- private_data.dismiss();
-
- // SAFETY: `sdev.as_raw()` is guaranteed to be a valid pointer to `serdev_device`.
- unsafe { bindings::serdev_device_resume_rx(sdev.as_raw()) };
-
- 0
- })
+ Ok(0)
})
}
@@ -189,24 +181,10 @@ extern "C" fn remove_callback(sdev: *mut bindings::serdev_device) {
// and stored a `Pin<KBox<PrivateData<'_, T>>>`.
let private_data = unsafe { sdev.as_ref().drvdata_borrow::<PrivateData<'_, T>>() };
- // SAFETY: No one has exclusive access to `private_data.driver`.
- let data = unsafe { &*private_data.driver.get() };
- // SAFETY:
- // - `private_data.driver` is pinned.
- // - `remove_callback` is only ever called after a successful call to `probe_callback`,
- // hence it's guaranteed that `private_data.driver` was initialized.
- let data_pinned = unsafe { Pin::new_unchecked(data.assume_init_ref()) };
-
- T::unbind(sdev, data_pinned);
+ T::unbind(sdev, private_data.driver_data());
// SAFETY: `sdev.as_raw()` is guaranteed to be a valid pointer to `serdev_device`.
unsafe { bindings::serdev_device_pause_rx(sdev.as_raw()) };
-
- // SAFETY: We have exclusive access to `private_data.driver`.
- let data = unsafe { &mut *private_data.driver.get() };
-
- // SAFETY: We already established that `data` is guaranteed to be initialized.
- unsafe { data.assume_init_drop() };
}
extern "C" fn receive_buf_callback(
@@ -214,6 +192,9 @@ extern "C" fn receive_buf_callback(
buf: *const u8,
length: usize,
) -> usize {
+ // SAFETY: `buf` is guaranteed to be non-null and has the size of `length`.
+ let buf = unsafe { core::slice::from_raw_parts(buf, length) };
+
// SAFETY: The serial device bus only ever calls the receive buf callback with a valid
// pointer to a `struct serdev_device`.
//
@@ -225,18 +206,7 @@ extern "C" fn receive_buf_callback(
// and stored a `Pin<KBox<PrivateData<'_, T>>>`.
let private_data = unsafe { sdev.as_ref().drvdata_borrow::<PrivateData<'_, T>>() };
- // SAFETY: No one has exclusive access to `private_data.driver`.
- let data = unsafe { &*private_data.driver.get() };
- // SAFETY:
- // - `private_data.driver` is pinned.
- // - `receive_buf_callback` is only ever called after a successful call to `probe_callback`,
- // hence it's guaranteed that `private_data.driver` was initialized.
- let data_pinned = unsafe { Pin::new_unchecked(data.assume_init_ref()) };
-
- // SAFETY: `buf` is guaranteed to be non-null and has the size of `length`.
- let buf = unsafe { core::slice::from_raw_parts(buf, length) };
-
- T::receive(sdev, data_pinned, buf)
+ T::receive(sdev, private_data.driver_data(), buf)
}
}
--
2.56.1
^ permalink raw reply related [flat|nested] 11+ messages in thread
* Re: [PATCH RESEND v6 4/4] rust: serdev: Simplify callbacks
2026-12-04 16:58 ` [PATCH RESEND v6 4/4] rust: serdev: Simplify callbacks Markus Probst
@ 2026-12-04 17:13 ` sashiko-bot
2026-12-04 17:37 ` Markus Probst
0 siblings, 1 reply; 11+ messages in thread
From: sashiko-bot @ 2026-12-04 17:13 UTC (permalink / raw)
To: Markus Probst; +Cc: linux-serial, ojeda, gary
Thank you for your contribution! Sashiko AI review found 2 potential
issues to consider:
- [Low] rust: serdev: missing safety comments on PrivateData drop order
and OpenGuard
- [Low] rust: serdev: unnecessary unsafe blocks in
PrivateData::driver_data()
--
commit 291367d86a907a67ebd9525dcf9dbb55c3c6c67c
Author: Markus Probst <markus.probst@posteo.de>
rust: serdev: Simplify callbacks
This commit initializes the driver's private data directly on PrivateData
via pin-init and introduces OpenGuard to close the serdev device on drop.
> diff --git a/rust/kernel/serdev.rs b/rust/kernel/serdev.rs
> index 559d142ce5573..3f9165e167764 100644
> --- a/rust/kernel/serdev.rs
> +++ b/rust/kernel/serdev.rs
[ ... ]
> @@ -92,24 +88,36 @@ unsafe fn unregister(sdrv: &Opaque<Self::DriverType>) {
> }
> }
>
> +struct OpenGuard<'bound> {
> + sdev: &'bound Device<device::Bound>,
> +}
> +
> +impl Drop for OpenGuard<'_> {
> + fn drop(&mut self) {
> + // SAFETY:
> + // - `self.sdev.as_raw()` is guaranteed to be a pointer to a valid
> + // `struct serdev_device`.
> + // - The existence of self proves that the device is open.
> + unsafe { bindings::serdev_device_close(self.sdev.as_raw()) };
> + }
> +}
> +
> #[doc(hidden)]
> -#[pin_data(PinnedDrop)]
> +#[pin_data]
> pub struct PrivateData<'bound, T: Driver> {
> - sdev: &'bound Device<device::Bound>,
> #[pin]
> - driver: UnsafeCell<MaybeUninit<T::Data<'bound>>>,
> - open: UnsafeCell<bool>,
> + driver: T::Data<'bound>,
> + open: OpenGuard<'bound>,
> }
[Severity: Low]
Should PrivateData document that driver must be declared before open for
drop-order safety?
Adapter::probe_callback() initializes open before driver in try_pin_init!(),
the reverse of PrivateData's field order. Reordering the fields to match
would close the device before T::Data drops, causing a NULL pointer
dereference of serport->tty if T::Data's Drop calls Device<Bound> methods.
Also, OpenGuard::drop() relies on the device being open whenever an OpenGuard
exists, so OpenGuard could use an # Invariants doc section and a matching
INVARIANT comment where it is constructed in probe_callback().
>
> -#[pinned_drop]
> -impl<T: Driver> PinnedDrop for PrivateData<'_, T> {
> - fn drop(self: Pin<&mut Self>) {
> - // SAFETY: We have exclusive access to `self.open`.
> - if unsafe { *self.open.get() } {
> - // SAFETY: `self.sdev.as_raw()` is guaranteed to be a pointer to a valid
> - // `struct serdev_device`.
> - unsafe { bindings::serdev_device_close(self.sdev.as_raw()) };
> - }
> +impl<'bound, T: Driver> PrivateData<'bound, T> {
> + #[inline]
> + fn driver_data(self: Pin<&Self>) -> Pin<&T::Data<'bound>> {
> + // SAFETY: We treat the result as pinned.
> + let inner = unsafe { Pin::into_inner_unchecked(self) };
> +
> + // SAFETY: `self.driver` is pinned.
> + unsafe { Pin::new_unchecked(&inner.driver) }
> }
> }
[Severity: Low]
Can driver_data() avoid both unsafe blocks by using pin-init's generated
with_project_ref() projection?
Because PrivateData is #[pin_data] with #[pin] on driver,
self.with_project_ref(|this| this.driver) projects Pin<&Self> to
Pin<&T::Data<'bound>> safely without Pin::into_inner_unchecked() or
Pin::new_unchecked().
--
Sashiko AI review · https://sashiko.dev/#/patchset/20261204-rust_serdev_probe_refactor-v6-0-0e12b6e6853b@posteo.de?part=4
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH RESEND v6 1/4] tty: serdev: Add mutex lock
2026-12-04 16:58 ` [PATCH RESEND v6 1/4] tty: serdev: Add mutex lock Markus Probst
@ 2026-12-04 17:22 ` sashiko-bot
2026-12-04 17:45 ` Markus Probst
0 siblings, 1 reply; 11+ messages in thread
From: sashiko-bot @ 2026-12-04 17:22 UTC (permalink / raw)
To: Markus Probst; +Cc: linux-serial, ojeda, gary
Thank you for your contribution! Sashiko AI review found 5 potential
issues to consider:
- [High] tty: serdev: returning -EALREADY in ttyport_open() breaks
hci_mrvl probe
- [Medium] tty: serdev: fallback close runs after serdev free and misses
driver unbind
- [Medium] tty: serdev: serdev_tty_port_register() calls mutex_init()
after client_ops
- [Low] tty: serdev: data race from __test_and_clear_bit() in
ttyport_close()
- [Low] tty: serdev: dev_WARN() used instead of dev_warn() in
serdev_device_remove()
--
commit 7655d9d3e9b00ecf625ad8092540311e1db4b89e
Author: Markus Probst <markus.probst@posteo.de>
tty: serdev: Add mutex lock
This commit adds mutexes to serdev-ttyport to serialize open, close, and
receive paths, returns -EALREADY on duplicate open, makes close
idempotent, and closes leaked devices in serdev_device_remove().
> diff --git a/drivers/tty/serdev/core.c b/drivers/tty/serdev/core.c
> index 7500efcdfc218..86d9cf8215edc 100644
> --- a/drivers/tty/serdev/core.c
> +++ b/drivers/tty/serdev/core.c
> @@ -142,6 +142,13 @@ void serdev_device_remove(struct serdev_device *serdev)
> struct serdev_controller *ctrl = serdev->ctrl;
>
> device_unregister(&serdev->dev);
> +
> + /* Warn if driver did not close the serial device. */
> + if (ctrl->ops->close && ctrl->ops->close(ctrl)) {
> + dev_WARN(&ctrl->dev, "Child driver did not close the serial device");
[Severity: Low]
As reported by Greg Kroah-Hartman on v4 [1], should this use dev_warn()
instead of dev_WARN()? dev_WARN() expands to WARN(1, ...), which prints a
backtrace and triggers panic_on_warn; dev_warn() (with a trailing newline)
logs a normal warning.
> + pm_runtime_put(&ctrl->dev);
> + }
> +
> ctrl->serdev = NULL;
> }
[Severity: Medium]
Can this trigger a use-after-free on serdev when a child driver leaves the
port open?
For direct callers of serdev_device_remove() such as dell-uart-backlight,
device_unregister(&serdev->dev) drops the last reference and frees serdev
via serdev_device_release() before ctrl->ops->close(ctrl) clears
SERPORT_ACTIVE and before ctrl->serdev is set to NULL:
CPU0 CPU1
serdev_device_remove()
device_unregister(&serdev->dev)
device_del(&serdev->dev)
put_device(&serdev->dev)
kfree(serdev)
ttyport_receive_buf()
serdev_controller_receive_buf()
serdev->ops->receive_buf(...)
<-- use-after-free
ctrl->ops->close(ctrl)
ctrl->serdev = NULL
Splitting device_unregister() into device_del(), the fallback close and
ctrl->serdev = NULL, and finally put_device() keeps serdev alive until
callbacks stop.
Separately, driver unbind (such as sysfs unbind or rmmod) runs
serdev_drv_remove() and device_unbind_cleanup() without calling
serdev_device_remove(), so an unclosed port stays active and subsequent
re-probes fail permanently with -EALREADY. Handling the fallback on
BUS_NOTIFY_UNBOUND_DRIVER would run after devres_release_all() on unbind
as well.
[ ... ]
> diff --git a/drivers/tty/serdev/serdev-ttyport.c b/drivers/tty/serdev/serdev-ttyport.c
> index b6638f9f40d2d..17c18d4b0cb8f 100644
> --- a/drivers/tty/serdev/serdev-ttyport.c
> +++ b/drivers/tty/serdev/serdev-ttyport.c
[ ... ]
> @@ -99,14 +103,23 @@ static int ttyport_open(struct serdev_controller *ctrl)
> struct ktermios ktermios;
> int ret;
>
> + mutex_lock(&serport->lock);
> +
> + if (test_bit(SERPORT_ACTIVE, &serport->flags)) {
> + ret = -EALREADY;
> + goto err_flags_unlock;
> + }
[Severity: High]
Does returning -EALREADY here break probing of Marvell serdev Bluetooth
devices in drivers/bluetooth/hci_mrvl.c?
During mrvl_serdev_probe(), hci_uart_register_device_priv() calls
serdev_device_open(hu->serdev) and then invokes mrvl_open(), which calls
serdev_device_open(hu->serdev) a second time and fails probe on any error.
hci_mrvl.c (including its duplicate close in mrvl_close()) would need to
be updated before rejecting duplicate opens with -EALREADY.
[ ... ]
> -static void ttyport_close(struct serdev_controller *ctrl)
> +static bool ttyport_close(struct serdev_controller *ctrl)
> {
> struct serport *serport = serdev_controller_get_drvdata(ctrl);
> - struct tty_struct *tty = serport->tty;
> + struct tty_struct *tty;
> +
> + guard(mutex)(&serport->lock);
>
> - clear_bit(SERPORT_ACTIVE, &serport->flags);
> + tty = serport->tty;
> +
> + scoped_guard(mutex, &serport->receive_lock)
> + if (!__test_and_clear_bit(SERPORT_ACTIVE, &serport->flags))
> + return false;
[Severity: Low]
Does switching to non-atomic __test_and_clear_bit() introduce a data race
on serport->flags?
ttyport_close() clears SERPORT_ACTIVE before tty->ops->close() stops TX
interrupts, while ttyport_write_wakeup() and ttyport_write_buf() read
serport->flags with test_bit() without holding serport->lock or
serport->receive_lock. This triggers KCSAN data-race reports under
CONFIG_KCSAN_STRICT=y and performs a plain non-atomic write on
architectures using generic non-atomic bitops. Using test_and_clear_bit()
avoids the race and matches set_bit() in ttyport_open().
[ ... ]
> @@ -290,6 +317,9 @@ struct device *serdev_tty_port_register(struct tty_port *port,
> port->client_ops = &client_ops;
> port->client_data = ctrl;
>
> + mutex_init(&serport->lock);
> + mutex_init(&serport->receive_lock);
[Severity: Medium]
Can ttyport_receive_buf() lock serport->receive_lock before mutex_init()
runs?
UART drivers such as ip22zilog_probe() register their RX IRQ before
uart_add_one_port(), and uart_configure_port() enables RX interrupts
before serdev_tty_port_register() runs. Incoming RX bytes schedule
flush_to_ldisc(), which only holds buf->lock (not port->mutex) and enters
ttyport_receive_buf() before SERPORT_ACTIVE is checked:
CPU0 CPU1
serdev_tty_port_register()
port->client_ops = &client_ops
port->client_data = ctrl
flush_to_ldisc()
ttyport_receive_buf()
mutex_lock(&serport->receive_lock)
<-- uninitialized mutex
mutex_init(&serport->lock)
mutex_init(&serport->receive_lock)
Locking an uninitialized mutex or racing with mutex_init() triggers
lockdep/debug-mutex warnings and can corrupt mutex state. Initializing
both mutexes (and setting port->client_data) before assigning
port->client_ops avoids the race.
[1] https://lore.kernel.org/r/2026101758-confidant-comprised-e1c0@gregkh
--
Sashiko AI review · https://sashiko.dev/#/patchset/20261204-rust_serdev_probe_refactor-v6-0-0e12b6e6853b@posteo.de?part=1
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH RESEND v6 2/4] tty: serdev: Export functions to pause receive_buf callback calls
2026-12-04 16:58 ` [PATCH RESEND v6 2/4] tty: serdev: Export functions to pause receive_buf callback calls Markus Probst
@ 2026-12-04 17:23 ` sashiko-bot
0 siblings, 0 replies; 11+ messages in thread
From: sashiko-bot @ 2026-12-04 17:23 UTC (permalink / raw)
To: Markus Probst; +Cc: linux-serial, ojeda, gary
Thank you for your contribution! Sashiko AI review found 3 potential
issues to consider:
- [Medium] tty: serdev: ttyport_pause_rx() leaves flip-buffer work
enabled while paused
- [Low] tty: serdev: incomplete locking and lifecycle docs for
pause/resume RX APIs
- [Low] tty: serdev: commit message omits API rationale and
serdev_drv_probe() change
--
commit a73a9e651b0f3d8206df97abbd109f24d3e9d1c8
Author: Markus Probst <markus.probst@posteo.de>
> tty: serdev: Export functions to pause receive_buf callback calls
>
> These functions will be used to simply the serdev rust abstraction. It
> also contributes to the fixing of 2 race conditions in the serdev rust
> abstraction.
>
> Signed-off-by: Markus Probst <markus.probst@posteo.de>
[Severity: Low]
Could the commit message explain the new API and the serdev_drv_probe()
change in more detail?
It does not name serdev_device_pause_rx() and serdev_device_resume_rx(),
describe the two race conditions in the Rust abstraction and why RX pausing
is needed in C, or mention that serdev_drv_probe() now calls
serdev_device_resume_rx(). There is also a typo ("simply" -> "simplify").
> diff --git a/drivers/tty/serdev/core.c b/drivers/tty/serdev/core.c
> index 86d9cf8215edc..ca20304c7b20d 100644
> --- a/drivers/tty/serdev/core.c
> +++ b/drivers/tty/serdev/core.c
> @@ -193,6 +193,45 @@ void serdev_device_close(struct serdev_device *serdev)
> }
> EXPORT_SYMBOL_GPL(serdev_device_close);
>
> +/**
> + * serdev_device_pause_rx() - pause data receive
> + * @serdev: serdev device
> + *
> + * Pause calls to receive_buf.
> + *
> + * Note that if a call to receive_buf is currently executed, the function will
> + * sleep until it has finished.
> + */
> +void serdev_device_pause_rx(struct serdev_device *serdev)
> +{
> + struct serdev_controller *ctrl = serdev->ctrl;
> +
> + if (!ctrl || !ctrl->ops->pause_rx)
> + return;
> +
> + ctrl->ops->pause_rx(ctrl);
> +}
> +EXPORT_SYMBOL_GPL(serdev_device_pause_rx);
> +
> +/**
> + * serdev_device_resume_rx() - resume data receive
> + * @serdev: serdev device
> + *
> + * Resume calls to receive_buf.
> + *
> + * This can be called even if not paused to ensure data receive is active.
> + */
> +void serdev_device_resume_rx(struct serdev_device *serdev)
> +{
> + struct serdev_controller *ctrl = serdev->ctrl;
> +
> + if (!ctrl || !ctrl->ops->resume_rx)
> + return;
> +
> + ctrl->ops->resume_rx(ctrl);
> +}
> +EXPORT_SYMBOL_GPL(serdev_device_resume_rx);
[Severity: Low]
Should the kernel-doc for serdev_device_pause_rx() and
serdev_device_resume_rx() document their locking and lifecycle contracts?
The comment on serdev_device_pause_rx() implies it only sleeps when
receive_buf is currently running, and serdev_device_resume_rx() omits
sleeping constraints altogether. In serdev-ttyport.c, both callbacks
unconditionally acquire serport->lock (and serport->receive_lock).
Because of that, neither function can be called from atomic context (such
as write_wakeup) or from inside receive_buf(), where serport->receive_lock
is already held and calling either function deadlocks.
It would also help to note that data arriving while paused stays queued in
the tty flip buffer up to mem_limit without asserting hardware flow control,
and that the paused state persists across serdev_device_close() and reopen
until resumed or re-probed.
[ ... ]
> diff --git a/drivers/tty/serdev/serdev-ttyport.c b/drivers/tty/serdev/serdev-ttyport.c
> index 17c18d4b0cb8f..6e11349769964 100644
> --- a/drivers/tty/serdev/serdev-ttyport.c
> +++ b/drivers/tty/serdev/serdev-ttyport.c
[ ... ]
> @@ -185,6 +190,35 @@ static bool ttyport_close(struct serdev_controller *ctrl)
> return true;
> }
>
> +static void ttyport_pause_rx(struct serdev_controller *ctrl)
> +{
> + struct serport *serport = serdev_controller_get_drvdata(ctrl);
> +
> + guard(mutex)(&serport->lock);
> +
> + scoped_guard(mutex, &serport->receive_lock)
> + set_bit(SERPORT_PAUSE_RX, &serport->flags);
> +
> + if (test_bit(SERPORT_ACTIVE, &serport->flags))
> + tty_buffer_cancel_work(serport->tty->port);
> +}
[Severity: Medium]
Does tty_buffer_cancel_work() actually prevent flush_to_ldisc() from
running while RX is paused?
tty_buffer_cancel_work() calls cancel_work_sync(&port->buf.work), which
re-enables the work item before returning, and setting SERPORT_PAUSE_RX
under serport->receive_lock already synchronizes with any in-flight
ttyport_receive_buf().
When an active UART keeps receiving data while paused, every
tty_flip_buffer_push() still schedules flush_to_ldisc(). Because
ttyport_receive_buf() returns 0, flush_to_ldisc() calls lookahead_bufs()
from the pinned buf->head before breaking.
As incoming data chains up to 2,560 tty_buffer nodes, each RX push wakes
the kworker, cycles buf->lock and serport->receive_lock, and rescans the
entire list (O(N^2)) even though serdev-ttyport has no lookahead_buf
callback.
Disabling port->buf.work while paused (for example with disable_work_sync()
and enable_work() coordinated with open and close) would avoid both the
kworker wakeups and the rescans.
--
Sashiko AI review · https://sashiko.dev/#/patchset/20261204-rust_serdev_probe_refactor-v6-0-0e12b6e6853b@posteo.de?part=2
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH RESEND v6 0/4] rust: serdev: Refactor
2026-12-04 16:58 [PATCH RESEND v6 0/4] rust: serdev: Refactor Markus Probst
` (3 preceding siblings ...)
2026-12-04 16:58 ` [PATCH RESEND v6 4/4] rust: serdev: Simplify callbacks Markus Probst
@ 2026-12-04 17:23 ` sashiko-bot
4 siblings, 0 replies; 11+ messages in thread
From: sashiko-bot @ 2026-12-04 17:23 UTC (permalink / raw)
To: Markus Probst; +Cc: linux-serial
Sashiko has finished reviewing this 4-patch series:
- Patch 3: no issues found.
- Patch 1 ("tty: serdev: Add mutex lock"): 5 potential issues (1 High, 2
Medium, 2 Low)
- Patch 2 ("tty: serdev: Export functions to pause receive_buf c..."): 3
potential issues (1 Medium, 2 Low)
- Patch 4 ("rust: serdev: Simplify callbacks"): 2 potential issues (2
Low)
Detailed reviews have been sent as separate replies to patches 1, 2, and
4.
--
Sashiko AI review · https://sashiko.dev/#/patchset/20261204-rust_serdev_probe_refactor-v6-0-0e12b6e6853b@posteo.de
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH RESEND v6 4/4] rust: serdev: Simplify callbacks
2026-12-04 17:13 ` sashiko-bot
@ 2026-12-04 17:37 ` Markus Probst
0 siblings, 0 replies; 11+ messages in thread
From: Markus Probst @ 2026-12-04 17:37 UTC (permalink / raw)
To: sashiko-reviews; +Cc: linux-serial, ojeda, gary
[-- Attachment #1: Type: text/plain, Size: 3742 bytes --]
On Fri, 2026-12-04 at 17:13 +0000, sashiko-bot@kernel.org wrote:
> Thank you for your contribution! Sashiko AI review found 2 potential
> issues to consider:
> - [Low] rust: serdev: missing safety comments on PrivateData drop order
> and OpenGuard
> - [Low] rust: serdev: unnecessary unsafe blocks in
> PrivateData::driver_data()
> --
>
> commit 291367d86a907a67ebd9525dcf9dbb55c3c6c67c
> Author: Markus Probst <markus.probst@posteo.de>
>
> rust: serdev: Simplify callbacks
>
> This commit initializes the driver's private data directly on PrivateData
> via pin-init and introduces OpenGuard to close the serdev device on drop.
>
> > diff --git a/rust/kernel/serdev.rs b/rust/kernel/serdev.rs
> > index 559d142ce5573..3f9165e167764 100644
> > --- a/rust/kernel/serdev.rs
> > +++ b/rust/kernel/serdev.rs
>
> [ ... ]
>
> > @@ -92,24 +88,36 @@ unsafe fn unregister(sdrv: &Opaque<Self::DriverType>) {
> > }
> > }
> >
> > +struct OpenGuard<'bound> {
> > + sdev: &'bound Device<device::Bound>,
> > +}
> > +
> > +impl Drop for OpenGuard<'_> {
> > + fn drop(&mut self) {
> > + // SAFETY:
> > + // - `self.sdev.as_raw()` is guaranteed to be a pointer to a valid
> > + // `struct serdev_device`.
> > + // - The existence of self proves that the device is open.
> > + unsafe { bindings::serdev_device_close(self.sdev.as_raw()) };
> > + }
> > +}
> > +
> > #[doc(hidden)]
> > -#[pin_data(PinnedDrop)]
> > +#[pin_data]
> > pub struct PrivateData<'bound, T: Driver> {
> > - sdev: &'bound Device<device::Bound>,
> > #[pin]
> > - driver: UnsafeCell<MaybeUninit<T::Data<'bound>>>,
> > - open: UnsafeCell<bool>,
> > + driver: T::Data<'bound>,
> > + open: OpenGuard<'bound>,
> > }
>
> [Severity: Low]
> Should PrivateData document that driver must be declared before open for
> drop-order safety?
>
> Adapter::probe_callback() initializes open before driver in try_pin_init!(),
> the reverse of PrivateData's field order. Reordering the fields to match
> would close the device before T::Data drops, causing a NULL pointer
> dereference of serport->tty if T::Data's Drop calls Device<Bound> methods.
>
> Also, OpenGuard::drop() relies on the device being open whenever an OpenGuard
> exists, so OpenGuard could use an # Invariants doc section and a matching
> INVARIANT comment where it is constructed in probe_callback().
>
> >
> > -#[pinned_drop]
> > -impl<T: Driver> PinnedDrop for PrivateData<'_, T> {
> > - fn drop(self: Pin<&mut Self>) {
> > - // SAFETY: We have exclusive access to `self.open`.
> > - if unsafe { *self.open.get() } {
> > - // SAFETY: `self.sdev.as_raw()` is guaranteed to be a pointer to a valid
> > - // `struct serdev_device`.
> > - unsafe { bindings::serdev_device_close(self.sdev.as_raw()) };
> > - }
> > +impl<'bound, T: Driver> PrivateData<'bound, T> {
> > + #[inline]
> > + fn driver_data(self: Pin<&Self>) -> Pin<&T::Data<'bound>> {
> > + // SAFETY: We treat the result as pinned.
> > + let inner = unsafe { Pin::into_inner_unchecked(self) };
> > +
> > + // SAFETY: `self.driver` is pinned.
> > + unsafe { Pin::new_unchecked(&inner.driver) }
> > }
> > }
True positive.
>
> [Severity: Low]
> Can driver_data() avoid both unsafe blocks by using pin-init's generated
> with_project_ref() projection?
>
> Because PrivateData is #[pin_data] with #[pin] on driver,
> self.with_project_ref(|this| this.driver) projects Pin<&Self> to
> Pin<&T::Data<'bound>> safely without Pin::into_inner_unchecked() or
> Pin::new_unchecked().
True positive.
[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 870 bytes --]
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH RESEND v6 1/4] tty: serdev: Add mutex lock
2026-12-04 17:22 ` sashiko-bot
@ 2026-12-04 17:45 ` Markus Probst
0 siblings, 0 replies; 11+ messages in thread
From: Markus Probst @ 2026-12-04 17:45 UTC (permalink / raw)
To: sashiko-reviews; +Cc: linux-serial, ojeda, gary
[-- Attachment #1: Type: text/plain, Size: 7574 bytes --]
On Fri, 2026-12-04 at 17:22 +0000, sashiko-bot@kernel.org wrote:
> Thank you for your contribution! Sashiko AI review found 5 potential
> issues to consider:
> - [High] tty: serdev: returning -EALREADY in ttyport_open() breaks
> hci_mrvl probe
> - [Medium] tty: serdev: fallback close runs after serdev free and misses
> driver unbind
> - [Medium] tty: serdev: serdev_tty_port_register() calls mutex_init()
> after client_ops
> - [Low] tty: serdev: data race from __test_and_clear_bit() in
> ttyport_close()
> - [Low] tty: serdev: dev_WARN() used instead of dev_warn() in
> serdev_device_remove()
> --
>
> commit 7655d9d3e9b00ecf625ad8092540311e1db4b89e
> Author: Markus Probst <markus.probst@posteo.de>
>
> tty: serdev: Add mutex lock
>
> This commit adds mutexes to serdev-ttyport to serialize open, close, and
> receive paths, returns -EALREADY on duplicate open, makes close
> idempotent, and closes leaked devices in serdev_device_remove().
>
> > diff --git a/drivers/tty/serdev/core.c b/drivers/tty/serdev/core.c
> > index 7500efcdfc218..86d9cf8215edc 100644
> > --- a/drivers/tty/serdev/core.c
> > +++ b/drivers/tty/serdev/core.c
> > @@ -142,6 +142,13 @@ void serdev_device_remove(struct serdev_device *serdev)
> > struct serdev_controller *ctrl = serdev->ctrl;
> >
> > device_unregister(&serdev->dev);
> > +
> > + /* Warn if driver did not close the serial device. */
> > + if (ctrl->ops->close && ctrl->ops->close(ctrl)) {
> > + dev_WARN(&ctrl->dev, "Child driver did not close the serial device");
>
> [Severity: Low]
> As reported by Greg Kroah-Hartman on v4 [1], should this use dev_warn()
> instead of dev_WARN()? dev_WARN() expands to WARN(1, ...), which prints a
> backtrace and triggers panic_on_warn; dev_warn() (with a trailing newline)
> logs a normal warning.
>
> > + pm_runtime_put(&ctrl->dev);
> > + }
> > +
> > ctrl->serdev = NULL;
> > }
A full recovery is not possible. Undefined behaviour likely has already
occured. `panic_on_warn` is a choice made by the user. A backtrace is
welcome to solve the bug if any.
>
> [Severity: Medium]
> Can this trigger a use-after-free on serdev when a child driver leaves the
> port open?
Yes, absolutely. Thats why dev_WARN is used.
>
> For direct callers of serdev_device_remove() such as dell-uart-backlight,
> device_unregister(&serdev->dev) drops the last reference and frees serdev
> via serdev_device_release() before ctrl->ops->close(ctrl) clears
> SERPORT_ACTIVE and before ctrl->serdev is set to NULL:
>
> CPU0 CPU1
> serdev_device_remove()
> device_unregister(&serdev->dev)
> device_del(&serdev->dev)
> put_device(&serdev->dev)
> kfree(serdev)
> ttyport_receive_buf()
> serdev_controller_receive_buf()
> serdev->ops->receive_buf(...)
> <-- use-after-free
> ctrl->ops->close(ctrl)
> ctrl->serdev = NULL
>
> Splitting device_unregister() into device_del(), the fallback close and
> ctrl->serdev = NULL, and finally put_device() keeps serdev alive until
> callbacks stop.
>
> Separately, driver unbind (such as sysfs unbind or rmmod) runs
> serdev_drv_remove() and device_unbind_cleanup() without calling
> serdev_device_remove(), so an unclosed port stays active and subsequent
> re-probes fail permanently with -EALREADY. Handling the fallback on
> BUS_NOTIFY_UNBOUND_DRIVER would run after devres_release_all() on unbind
> as well.
>
> [ ... ]
>
> > diff --git a/drivers/tty/serdev/serdev-ttyport.c b/drivers/tty/serdev/serdev-ttyport.c
> > index b6638f9f40d2d..17c18d4b0cb8f 100644
> > --- a/drivers/tty/serdev/serdev-ttyport.c
> > +++ b/drivers/tty/serdev/serdev-ttyport.c
>
> [ ... ]
>
> > @@ -99,14 +103,23 @@ static int ttyport_open(struct serdev_controller *ctrl)
> > struct ktermios ktermios;
> > int ret;
> >
> > + mutex_lock(&serport->lock);
> > +
> > + if (test_bit(SERPORT_ACTIVE, &serport->flags)) {
> > + ret = -EALREADY;
> > + goto err_flags_unlock;
> > + }
>
> [Severity: High]
> Does returning -EALREADY here break probing of Marvell serdev Bluetooth
> devices in drivers/bluetooth/hci_mrvl.c?
>
> During mrvl_serdev_probe(), hci_uart_register_device_priv() calls
> serdev_device_open(hu->serdev) and then invokes mrvl_open(), which calls
> serdev_device_open(hu->serdev) a second time and fails probe on any error.
> hci_mrvl.c (including its duplicate close in mrvl_close()) would need to
> be updated before rejecting duplicate opens with -EALREADY.
>
> [ ... ]
Thats an issue with the marvell driver, not with this.
>
> > -static void ttyport_close(struct serdev_controller *ctrl)
> > +static bool ttyport_close(struct serdev_controller *ctrl)
> > {
> > struct serport *serport = serdev_controller_get_drvdata(ctrl);
> > - struct tty_struct *tty = serport->tty;
> > + struct tty_struct *tty;
> > +
> > + guard(mutex)(&serport->lock);
> >
> > - clear_bit(SERPORT_ACTIVE, &serport->flags);
> > + tty = serport->tty;
> > +
> > + scoped_guard(mutex, &serport->receive_lock)
> > + if (!__test_and_clear_bit(SERPORT_ACTIVE, &serport->flags))
> > + return false;
>
> [Severity: Low]
> Does switching to non-atomic __test_and_clear_bit() introduce a data race
> on serport->flags?
>
> ttyport_close() clears SERPORT_ACTIVE before tty->ops->close() stops TX
> interrupts, while ttyport_write_wakeup() and ttyport_write_buf() read
> serport->flags with test_bit() without holding serport->lock or
> serport->receive_lock. This triggers KCSAN data-race reports under
> CONFIG_KCSAN_STRICT=y and performs a plain non-atomic write on
> architectures using generic non-atomic bitops. Using test_and_clear_bit()
> avoids the race and matches set_bit() in ttyport_open().
True positive.
>
> [ ... ]
>
> > @@ -290,6 +317,9 @@ struct device *serdev_tty_port_register(struct tty_port *port,
> > port->client_ops = &client_ops;
> > port->client_data = ctrl;
> >
> > + mutex_init(&serport->lock);
> > + mutex_init(&serport->receive_lock);
>
> [Severity: Medium]
> Can ttyport_receive_buf() lock serport->receive_lock before mutex_init()
> runs?
>
> UART drivers such as ip22zilog_probe() register their RX IRQ before
> uart_add_one_port(), and uart_configure_port() enables RX interrupts
> before serdev_tty_port_register() runs. Incoming RX bytes schedule
> flush_to_ldisc(), which only holds buf->lock (not port->mutex) and enters
> ttyport_receive_buf() before SERPORT_ACTIVE is checked:
I expect no calls while the tty is not open. I will move it anyway.
>
> CPU0 CPU1
> serdev_tty_port_register()
> port->client_ops = &client_ops
> port->client_data = ctrl
> flush_to_ldisc()
> ttyport_receive_buf()
> mutex_lock(&serport->receive_lock)
> <-- uninitialized mutex
> mutex_init(&serport->lock)
> mutex_init(&serport->receive_lock)
>
> Locking an uninitialized mutex or racing with mutex_init() triggers
> lockdep/debug-mutex warnings and can corrupt mutex state. Initializing
> both mutexes (and setting port->client_data) before assigning
> port->client_ops avoids the race.
>
> [1] https://lore.kernel.org/r/2026101758-confidant-comprised-e1c0@gregkh
[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 870 bytes --]
^ permalink raw reply [flat|nested] 11+ messages in thread
end of thread, other threads:[~2026-12-04 17:45 UTC | newest]
Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-12-04 16:58 [PATCH RESEND v6 0/4] rust: serdev: Refactor Markus Probst
2026-12-04 16:58 ` [PATCH RESEND v6 1/4] tty: serdev: Add mutex lock Markus Probst
2026-12-04 17:22 ` sashiko-bot
2026-12-04 17:45 ` Markus Probst
2026-12-04 16:58 ` [PATCH RESEND v6 2/4] tty: serdev: Export functions to pause receive_buf callback calls Markus Probst
2026-12-04 17:23 ` sashiko-bot
2026-12-04 16:58 ` [PATCH RESEND v6 3/4] rust: serdev: Replace `active` mutex with receive pause Markus Probst
2026-12-04 16:58 ` [PATCH RESEND v6 4/4] rust: serdev: Simplify callbacks Markus Probst
2026-12-04 17:13 ` sashiko-bot
2026-12-04 17:37 ` Markus Probst
2026-12-04 17:23 ` [PATCH RESEND v6 0/4] rust: serdev: Refactor sashiko-bot
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox