rust-for-linux.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 0/2] Implement Send and Sync for clk
@ 2025-10-20  9:35 Alice Ryhl
  2025-10-20  9:35 ` [PATCH v2 1/2] rust: clk: implement Send and Sync Alice Ryhl
                   ` (2 more replies)
  0 siblings, 3 replies; 19+ messages in thread
From: Alice Ryhl @ 2025-10-20  9:35 UTC (permalink / raw)
  To: Michael Turquette, Stephen Boyd
  Cc: Viresh Kumar, Miguel Ojeda, Boqun Feng, Gary Guo,
	Björn Roy Baron, Benno Lossin, Andreas Hindborg,
	Trevor Gross, Danilo Krummrich, Daniel Almeida, linux-clk,
	rust-for-linux, linux-kernel, Alice Ryhl

I added a patch to remove the Send/Sync impl for the Tyr driver as well.
I think it's fine for the Tyr patch to land through whichever tree takes
the clk patch, as there should be no non-trivial merge conflicts. Or we
can also take the clk patch through drm-rust where tyr patches normally
go if preferred by clk maintainers.

Regarding Daniel's patch [1], I suggest that Daniel sends his type-state
change rebased on top of this series (without including the patches in
this series in his).

[1]: https://lore.kernel.org/rust-for-linux/20250910-clk-type-state-v2-2-1b97c11bb631@collabora.com/

Signed-off-by: Alice Ryhl <aliceryhl@google.com>
---
Changes in v2:
- Rebase on v6.18-rc1.
- Add patch to tyr driver.
- Link to v1: https://lore.kernel.org/r/20250904-clk-send-sync-v1-1-48d023320eb8@google.com

---
Alice Ryhl (2):
      rust: clk: implement Send and Sync
      tyr: remove impl Send/Sync for TyrData

 drivers/gpu/drm/tyr/driver.rs | 12 ------------
 rust/kernel/clk.rs            |  7 +++++++
 2 files changed, 7 insertions(+), 12 deletions(-)
---
base-commit: 3a8660878839faadb4f1a6dd72c3179c1df56787
change-id: 20250904-clk-send-sync-3cfa7f4e1ce2

Best regards,
-- 
Alice Ryhl <aliceryhl@google.com>


^ permalink raw reply	[flat|nested] 19+ messages in thread
* [PATCH v2 0/2] Clk improvements for 6.18
@ 2025-09-10 17:28 Daniel Almeida
  2025-09-10 17:28 ` [PATCH v2 1/2] rust: clk: implement Send and Sync Daniel Almeida
  0 siblings, 1 reply; 19+ messages in thread
From: Daniel Almeida @ 2025-09-10 17:28 UTC (permalink / raw)
  To: Michael Turquette, Stephen Boyd, Miguel Ojeda, Alex Gaynor,
	Boqun Feng, Gary Guo, Björn Roy Baron, Benno Lossin,
	Andreas Hindborg, Alice Ryhl, Trevor Gross, Danilo Krummrich,
	Rafael J. Wysocki, Viresh Kumar
  Cc: linux-clk, rust-for-linux, linux-kernel, linux-pm, Daniel Almeida

This series contains a few improvements that will be soon needed by
drivers:

Patch 1 implements Send and Sync for Clocks, as a raw pointer precludes
the compiler from automatically implementing these traits. This will
lead to an otherwise unnecessary unsafe implementation of Send and Sync
for all drivers that use kernel::clk::Clk. It was included in this
series as it would otherwise conflict with patch 2.

Patch 2 implements the same typestate pattern that has been used
successfully for Regulators. This is needed because otherwise drivers
will be responsible for unpreparing and disabling clocks themselves and
ultimately handling the reference counts on their own. This is
undesirable. The patch automatically encodes this information using the
type system so that no misuse can occur.

---
Changes in v2:
- Added Alice's patch as patch 1, since it is a dependency.
- Added devm helpers (like we did for Regulator<T>)
- Fixed missing clk_put() call in Drop (Danilo)
- Fixed missing parenthesis and wrong docs (Viresh)
- Removed extra "dev" parameter from "shutdown" example (Danilo)
- Removed useless type annotation from example (Danilo)
- Link to v1: https://lore.kernel.org/rust-for-linux/20250729-clk-type-state-v1-1-896b53816f7b@collabora.com/#r

---
Alice Ryhl (1):
      rust: clk: implement Send and Sync

Daniel Almeida (1):
      rust: clk: use the type-state pattern

 drivers/cpufreq/rcpufreq_dt.rs |   2 +-
 rust/kernel/clk.rs             | 405 ++++++++++++++++++++++++++++-------------
 rust/kernel/cpufreq.rs         |   8 +-
 3 files changed, 283 insertions(+), 132 deletions(-)
---
base-commit: 76eeb9b8de9880ca38696b2fb56ac45ac0a25c6c
change-id: 20250909-clk-type-state-c01aa7dd551d

Best regards,
-- 
Daniel Almeida <daniel.almeida@collabora.com>


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

end of thread, other threads:[~2025-10-22 14:08 UTC | newest]

Thread overview: 19+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-10-20  9:35 [PATCH v2 0/2] Implement Send and Sync for clk Alice Ryhl
2025-10-20  9:35 ` [PATCH v2 1/2] rust: clk: implement Send and Sync Alice Ryhl
2025-10-22  3:51   ` Viresh Kumar
2025-10-22  8:19     ` Alice Ryhl
2025-10-22  9:33       ` Viresh Kumar
2025-10-22 14:08         ` Alice Ryhl
2025-10-22  9:16   ` Danilo Krummrich
2025-10-20  9:35 ` [PATCH v2 2/2] tyr: remove impl Send/Sync for TyrData Alice Ryhl
2025-10-22  9:16   ` Danilo Krummrich
2025-10-22  3:54 ` [PATCH v2 0/2] Implement Send and Sync for clk Boqun Feng
  -- strict thread matches above, loose matches on Subject: below --
2025-09-10 17:28 [PATCH v2 0/2] Clk improvements for 6.18 Daniel Almeida
2025-09-10 17:28 ` [PATCH v2 1/2] rust: clk: implement Send and Sync Daniel Almeida
2025-09-10 17:49   ` Boqun Feng
2025-09-10 18:47     ` Daniel Almeida
2025-09-10 19:17       ` Boqun Feng
2025-09-20  5:06       ` Stephen Boyd
2025-09-20 10:33         ` Daniel Almeida
2025-09-21 15:48           ` Stephen Boyd
2025-09-20 17:12         ` Alice Ryhl
2025-09-20 18:43           ` Daniel Almeida

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).