* [PATCH v4 0/3] Implement Send and Sync for clk
@ 2026-01-13 15:12 Alice Ryhl
2026-01-13 15:12 ` [PATCH v4 3/3] pwm: th1520: remove impl Send/Sync for Th1520PwmDriverData Alice Ryhl
0 siblings, 1 reply; 6+ messages in thread
From: Alice Ryhl @ 2026-01-13 15:12 UTC (permalink / raw)
To: Stephen Boyd
Cc: Michael Turquette, Maarten Lankhorst, Maxime Ripard, Drew Fustini,
Guo Ren, Fu Wei, Uwe Kleine-König, Michal Wilczynski,
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, dri-devel, linux-pwm, Alice Ryhl,
linux-riscv
The Clk type is thread-safe, so let's mark it as thread-safe in the type
system. This lets us get rid of hacks in drivers.
For Stephen's clk tree.
Signed-off-by: Alice Ryhl <aliceryhl@google.com>
---
Changes in v4:
- Pick up Reviewed-by tags.
- Link to v3: https://lore.kernel.org/r/20251218-clk-send-sync-v3-0-e48b2e2f1eac@google.com
Changes in v3:
- Rebase on v6.19-rc1.
- Pick up tags.
- Add fix for pwm driver as well.
- Link to v2: https://lore.kernel.org/r/20251020-clk-send-sync-v2-0-44ab533ae084@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 (3):
rust: clk: implement Send and Sync
tyr: remove impl Send/Sync for TyrData
pwm: th1520: remove impl Send/Sync for Th1520PwmDriverData
drivers/gpu/drm/tyr/driver.rs | 12 ------------
drivers/pwm/pwm_th1520.rs | 15 ---------------
rust/kernel/clk.rs | 7 +++++++
3 files changed, 7 insertions(+), 27 deletions(-)
---
base-commit: 8f0b4cce4481fb22653697cced8d0d04027cb1e8
change-id: 20250904-clk-send-sync-3cfa7f4e1ce2
Best regards,
--
Alice Ryhl <aliceryhl@google.com>
_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv
^ permalink raw reply [flat|nested] 6+ messages in thread* [PATCH v4 3/3] pwm: th1520: remove impl Send/Sync for Th1520PwmDriverData 2026-01-13 15:12 [PATCH v4 0/3] Implement Send and Sync for clk Alice Ryhl @ 2026-01-13 15:12 ` Alice Ryhl 2026-01-19 21:45 ` Michal Wilczynski 0 siblings, 1 reply; 6+ messages in thread From: Alice Ryhl @ 2026-01-13 15:12 UTC (permalink / raw) To: Stephen Boyd Cc: Michael Turquette, Maarten Lankhorst, Maxime Ripard, Drew Fustini, Guo Ren, Fu Wei, Uwe Kleine-König, Michal Wilczynski, 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, dri-devel, linux-pwm, Alice Ryhl, linux-riscv Now that clk implements Send and Sync, we no longer need to manually implement these traits for Th1520PwmDriverData. Thus remove the implementations. Reviewed-by: Gary Guo <gary@garyguo.net> Reviewed-by: Daniel Almeida <daniel.almeida@collabora.com> Signed-off-by: Alice Ryhl <aliceryhl@google.com> --- Cc: linux-riscv@lists.infradead.org --- drivers/pwm/pwm_th1520.rs | 15 --------------- 1 file changed, 15 deletions(-) diff --git a/drivers/pwm/pwm_th1520.rs b/drivers/pwm/pwm_th1520.rs index e3b7e77356fc2492077c519073e861beb3e44df9..043dc4dbc6232020195c7b73fad302bbb69652df 100644 --- a/drivers/pwm/pwm_th1520.rs +++ b/drivers/pwm/pwm_th1520.rs @@ -97,21 +97,6 @@ struct Th1520PwmDriverData { clk: Clk, } -// This `unsafe` implementation is a temporary necessity because the underlying `kernel::clk::Clk` -// type does not yet expose `Send` and `Sync` implementations. This block should be removed -// as soon as the clock abstraction provides these guarantees directly. -// TODO: Remove those unsafe impl's when Clk will support them itself. - -// SAFETY: The `devres` framework requires the driver's private data to be `Send` and `Sync`. -// We can guarantee this because the PWM core synchronizes all callbacks, preventing concurrent -// access to the contained `iomem` and `clk` resources. -unsafe impl Send for Th1520PwmDriverData {} - -// SAFETY: The same reasoning applies as for `Send`. The PWM core's synchronization -// guarantees that it is safe for multiple threads to have shared access (`&self`) -// to the driver data during callbacks. -unsafe impl Sync for Th1520PwmDriverData {} - impl pwm::PwmOps for Th1520PwmDriverData { type WfHw = Th1520WfHw; -- 2.52.0.457.g6b5491de43-goog _______________________________________________ linux-riscv mailing list linux-riscv@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-riscv ^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH v4 3/3] pwm: th1520: remove impl Send/Sync for Th1520PwmDriverData 2026-01-13 15:12 ` [PATCH v4 3/3] pwm: th1520: remove impl Send/Sync for Th1520PwmDriverData Alice Ryhl @ 2026-01-19 21:45 ` Michal Wilczynski 2026-01-20 8:48 ` Uwe Kleine-König 0 siblings, 1 reply; 6+ messages in thread From: Michal Wilczynski @ 2026-01-19 21:45 UTC (permalink / raw) To: Alice Ryhl, Stephen Boyd Cc: Michael Turquette, Maarten Lankhorst, Maxime Ripard, Drew Fustini, Guo Ren, Fu Wei, Uwe Kleine-König, 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, dri-devel, linux-pwm, linux-riscv On 1/13/26 16:12, Alice Ryhl wrote: > Now that clk implements Send and Sync, we no longer need to manually > implement these traits for Th1520PwmDriverData. Thus remove the > implementations. > > Reviewed-by: Gary Guo <gary@garyguo.net> > Reviewed-by: Daniel Almeida <daniel.almeida@collabora.com> > Signed-off-by: Alice Ryhl <aliceryhl@google.com> > --- > Cc: linux-riscv@lists.infradead.org > --- > drivers/pwm/pwm_th1520.rs | 15 --------------- > 1 file changed, 15 deletions(-) > > diff --git a/drivers/pwm/pwm_th1520.rs b/drivers/pwm/pwm_th1520.rs > index e3b7e77356fc2492077c519073e861beb3e44df9..043dc4dbc6232020195c7b73fad302bbb69652df 100644 > --- a/drivers/pwm/pwm_th1520.rs > +++ b/drivers/pwm/pwm_th1520.rs > @@ -97,21 +97,6 @@ struct Th1520PwmDriverData { > clk: Clk, > } > > -// This `unsafe` implementation is a temporary necessity because the underlying `kernel::clk::Clk` > -// type does not yet expose `Send` and `Sync` implementations. This block should be removed > -// as soon as the clock abstraction provides these guarantees directly. > -// TODO: Remove those unsafe impl's when Clk will support them itself. > - > -// SAFETY: The `devres` framework requires the driver's private data to be `Send` and `Sync`. > -// We can guarantee this because the PWM core synchronizes all callbacks, preventing concurrent > -// access to the contained `iomem` and `clk` resources. > -unsafe impl Send for Th1520PwmDriverData {} > - > -// SAFETY: The same reasoning applies as for `Send`. The PWM core's synchronization > -// guarantees that it is safe for multiple threads to have shared access (`&self`) > -// to the driver data during callbacks. > -unsafe impl Sync for Th1520PwmDriverData {} > - > impl pwm::PwmOps for Th1520PwmDriverData { > type WfHw = Th1520WfHw; > > I thought this was already merged :-). Reviewed-by: Michal Wilczynski <m.wilczynski@samsung.com> _______________________________________________ linux-riscv mailing list linux-riscv@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-riscv ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH v4 3/3] pwm: th1520: remove impl Send/Sync for Th1520PwmDriverData 2026-01-19 21:45 ` Michal Wilczynski @ 2026-01-20 8:48 ` Uwe Kleine-König 2026-03-05 8:24 ` Uwe Kleine-König 0 siblings, 1 reply; 6+ messages in thread From: Uwe Kleine-König @ 2026-01-20 8:48 UTC (permalink / raw) To: Stephen Boyd, Michal Wilczynski Cc: Alice Ryhl, Michael Turquette, Maarten Lankhorst, Maxime Ripard, Drew Fustini, Guo Ren, Fu Wei, 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, dri-devel, linux-pwm, linux-riscv [-- Attachment #1.1: Type: text/plain, Size: 952 bytes --] Hello, On Mon, Jan 19, 2026 at 10:45:56PM +0100, Michal Wilczynski wrote: > On 1/13/26 16:12, Alice Ryhl wrote: > > Now that clk implements Send and Sync, we no longer need to manually > > implement these traits for Th1520PwmDriverData. Thus remove the > > implementations. > > I thought this was already merged :-). > > Reviewed-by: Michal Wilczynski <m.wilczynski@samsung.com> If I understand correctly this patch 3 depends on the first patch of this series so I cannot pick it up via the pwm tree *now*. There is another patch pending for the th1520 PWM driver, but as of now git seems to cope well when merging the pwm's tree for-next with this patch. So it's fine for me if the series is picked up for 6.20-rc1 via the clock tree. Acked-by: Uwe Kleine-König <ukleinek@kernel.org> (Nitpick: If it was me who picked up patch 3 I would have capitalized the "remove" in the Subject for consistency.) Best regards Uwe [-- Attachment #1.2: signature.asc --] [-- Type: application/pgp-signature, Size: 488 bytes --] [-- Attachment #2: Type: text/plain, Size: 161 bytes --] _______________________________________________ linux-riscv mailing list linux-riscv@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-riscv ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH v4 3/3] pwm: th1520: remove impl Send/Sync for Th1520PwmDriverData 2026-01-20 8:48 ` Uwe Kleine-König @ 2026-03-05 8:24 ` Uwe Kleine-König 2026-03-05 8:43 ` Alice Ryhl 0 siblings, 1 reply; 6+ messages in thread From: Uwe Kleine-König @ 2026-03-05 8:24 UTC (permalink / raw) To: Stephen Boyd, Michal Wilczynski Cc: Alice Ryhl, Michael Turquette, Maarten Lankhorst, Maxime Ripard, Drew Fustini, Guo Ren, Fu Wei, 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, dri-devel, linux-pwm, linux-riscv [-- Attachment #1.1: Type: text/plain, Size: 1063 bytes --] Hello, On Tue, Jan 20, 2026 at 09:48:48AM +0100, Uwe Kleine-König wrote: > On Mon, Jan 19, 2026 at 10:45:56PM +0100, Michal Wilczynski wrote: > > On 1/13/26 16:12, Alice Ryhl wrote: > > > Now that clk implements Send and Sync, we no longer need to manually > > > implement these traits for Th1520PwmDriverData. Thus remove the > > > implementations. > > > > I thought this was already merged :-). > > > > Reviewed-by: Michal Wilczynski <m.wilczynski@samsung.com> > > If I understand correctly this patch 3 depends on the first patch of > this series so I cannot pick it up via the pwm tree *now*. There is > another patch pending for the th1520 PWM driver, but as of now git seems > to cope well when merging the pwm's tree for-next with this patch. So > it's fine for me if the series is picked up for 6.20-rc1 via the clock > tree. That didn't happen (with s/6.20/7.0/), so this patch is still open in my todo list. Is the first patch still considered for the clk subsystem? What is the plan for the pwm patch? Best regards Uwe [-- Attachment #1.2: signature.asc --] [-- Type: application/pgp-signature, Size: 488 bytes --] [-- Attachment #2: Type: text/plain, Size: 161 bytes --] _______________________________________________ linux-riscv mailing list linux-riscv@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-riscv ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH v4 3/3] pwm: th1520: remove impl Send/Sync for Th1520PwmDriverData 2026-03-05 8:24 ` Uwe Kleine-König @ 2026-03-05 8:43 ` Alice Ryhl 0 siblings, 0 replies; 6+ messages in thread From: Alice Ryhl @ 2026-03-05 8:43 UTC (permalink / raw) To: Uwe Kleine-König Cc: Stephen Boyd, Michal Wilczynski, Michael Turquette, Maarten Lankhorst, Maxime Ripard, Drew Fustini, Guo Ren, Fu Wei, 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, dri-devel, linux-pwm, linux-riscv On Thu, Mar 05, 2026 at 09:24:33AM +0100, Uwe Kleine-König wrote: > Hello, > > On Tue, Jan 20, 2026 at 09:48:48AM +0100, Uwe Kleine-König wrote: > > On Mon, Jan 19, 2026 at 10:45:56PM +0100, Michal Wilczynski wrote: > > > On 1/13/26 16:12, Alice Ryhl wrote: > > > > Now that clk implements Send and Sync, we no longer need to manually > > > > implement these traits for Th1520PwmDriverData. Thus remove the > > > > implementations. > > > > > > I thought this was already merged :-). > > > > > > Reviewed-by: Michal Wilczynski <m.wilczynski@samsung.com> > > > > If I understand correctly this patch 3 depends on the first patch of > > this series so I cannot pick it up via the pwm tree *now*. There is > > another patch pending for the th1520 PWM driver, but as of now git seems > > to cope well when merging the pwm's tree for-next with this patch. So > > it's fine for me if the series is picked up for 6.20-rc1 via the clock > > tree. > > That didn't happen (with s/6.20/7.0/), so this patch is still open in my > todo list. Is the first patch still considered for the clk subsystem? > What is the plan for the pwm patch? It's been on my todo list to try and contact Stephen to see if he can take these patches, or if he is okay with them going through another tree, but I have not gotten around to it. He has not replied on the list to any version of this series. Alice _______________________________________________ linux-riscv mailing list linux-riscv@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-riscv ^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2026-03-05 8:43 UTC | newest] Thread overview: 6+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2026-01-13 15:12 [PATCH v4 0/3] Implement Send and Sync for clk Alice Ryhl 2026-01-13 15:12 ` [PATCH v4 3/3] pwm: th1520: remove impl Send/Sync for Th1520PwmDriverData Alice Ryhl 2026-01-19 21:45 ` Michal Wilczynski 2026-01-20 8:48 ` Uwe Kleine-König 2026-03-05 8:24 ` Uwe Kleine-König 2026-03-05 8:43 ` Alice Ryhl
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox