Patch "rust: phy: implement `Send` for `Registration`" has been added to the 6.8-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    rust: phy: implement `Send` for `Registration`

to the 6.8-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     rust-phy-implement-send-for-registration.patch
and it can be found in the queue-6.8 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.


>From df70d04d56975f527b9c965322cf56e245909071 Mon Sep 17 00:00:00 2001
From: Wedson Almeida Filho <walmeida@xxxxxxxxxxxxx>
Date: Thu, 28 Mar 2024 16:54:53 -0300
Subject: rust: phy: implement `Send` for `Registration`

From: Wedson Almeida Filho <walmeida@xxxxxxxxxxxxx>

commit df70d04d56975f527b9c965322cf56e245909071 upstream.

In preparation for requiring `Send` for `Module` implementations in the
next patch.

Cc: FUJITA Tomonori <fujita.tomonori@xxxxxxxxx>
Cc: Trevor Gross <tmgross@xxxxxxxxx>
Cc: netdev@xxxxxxxxxxxxxxx
Signed-off-by: Wedson Almeida Filho <walmeida@xxxxxxxxxxxxx>
Reviewed-by: Alice Ryhl <aliceryhl@xxxxxxxxxx>
Link: https://lore.kernel.org/r/20240328195457.225001-2-wedsonaf@xxxxxxxxx
Signed-off-by: Miguel Ojeda <ojeda@xxxxxxxxxx>
Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx>
---
 rust/kernel/net/phy.rs |    4 ++++
 1 file changed, 4 insertions(+)

--- a/rust/kernel/net/phy.rs
+++ b/rust/kernel/net/phy.rs
@@ -640,6 +640,10 @@ pub struct Registration {
     drivers: Pin<&'static mut [DriverVTable]>,
 }
 
+// SAFETY: The only action allowed in a `Registration` instance is dropping it, which is safe to do
+// from any thread because `phy_drivers_unregister` can be called from any thread context.
+unsafe impl Send for Registration {}
+
 impl Registration {
     /// Registers a PHY driver.
     pub fn register(


Patches currently in stable-queue which might be from walmeida@xxxxxxxxxxxxx are

queue-6.8/rust-kernel-require-send-for-module-implementations.patch
queue-6.8/rust-phy-implement-send-for-registration.patch




[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux