Linux-Next discussions
 help / color / mirror / Atom feed
* [PATCH -next] rust: fwctl: replace `__pinned_init` with `raw_try_init`
@ 2026-08-18 10:53 Miguel Ojeda
  2026-08-18 12:55 ` Jason Gunthorpe
  0 siblings, 1 reply; 9+ messages in thread
From: Miguel Ojeda @ 2026-08-18 10:53 UTC (permalink / raw)
  To: Mark Brown, Dave Jiang, Jason Gunthorpe, Saeed Mahameed, Zhi Wang,
	Benno Lossin, Gary Guo, Miguel Ojeda
  Cc: linux-next, Jonathan Cameron, rust-for-linux, Boqun Feng,
	Björn Roy Baron, Andreas Hindborg, Alice Ryhl, Trevor Gross,
	Danilo Krummrich, Daniel Almeida, Tamir Duberstein,
	Alexandre Courbot, Onur Özkan

Commit

  ea7da3116015 ("rust: treewide: replace `__pinned_init` with `raw_[try_]init`")

from the pin-init tree replaced the method before removing it, but commit

  e052daab94ee ("rust: introduce abstractions for fwctl")

from the fwctl tree added a new use.

Thus replace that one as well to fix this error in next-20260817:

    error[E0599]: no method named `__pinned_init` found for associated type `impl pin_init::PinInit<T, error::Error>` in the current scope
       --> rust/kernel/fwctl.rs:465:49
        |
    465 |                 match T::open(device, reg_data).__pinned_init(uctx_ptr) {
        |                                                 ^^^^^^^^^^^^^ method not found in `impl pin_init::PinInit<T, error::Error>`

Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
---
 rust/kernel/fwctl.rs | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/rust/kernel/fwctl.rs b/rust/kernel/fwctl.rs
index e6a8513a47d0..f29244fb0d1d 100644
--- a/rust/kernel/fwctl.rs
+++ b/rust/kernel/fwctl.rs
@@ -462,7 +462,7 @@ impl<T: Operations> VTable<T> {
         // `uctx_size`.
         unsafe {
             device.with_registration_data(|device, reg_data| {
-                match T::open(device, reg_data).__pinned_init(uctx_ptr) {
+                match pin_init::raw_try_init(uctx_ptr, T::open(device, reg_data)) {
                     Ok(()) => 0,
                     Err(e) => e.to_errno(),
                 }

base-commit: e6664f2b33db9b6811eb4cec109f06cb2b4f458d
--
2.55.0

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

* Re: [PATCH -next] rust: fwctl: replace `__pinned_init` with `raw_try_init`
  2026-08-18 10:53 [PATCH -next] rust: fwctl: replace `__pinned_init` with `raw_try_init` Miguel Ojeda
@ 2026-08-18 12:55 ` Jason Gunthorpe
  2026-08-18 13:11   ` Gary Guo
  0 siblings, 1 reply; 9+ messages in thread
From: Jason Gunthorpe @ 2026-08-18 12:55 UTC (permalink / raw)
  To: Miguel Ojeda
  Cc: Mark Brown, Dave Jiang, Saeed Mahameed, Zhi Wang, Benno Lossin,
	Gary Guo, linux-next, Jonathan Cameron, rust-for-linux,
	Boqun Feng, Björn Roy Baron, Andreas Hindborg, Alice Ryhl,
	Trevor Gross, Danilo Krummrich, Daniel Almeida, Tamir Duberstein,
	Alexandre Courbot, Onur Özkan

On Tue, Aug 18, 2026 at 12:53:50PM +0200, Miguel Ojeda wrote:
> Commit
> 
>   ea7da3116015 ("rust: treewide: replace `__pinned_init` with `raw_[try_]init`")
> 
> from the pin-init tree replaced the method before removing it, but commit
> 
>   e052daab94ee ("rust: introduce abstractions for fwctl")
> 
> from the fwctl tree added a new use.
> 
> Thus replace that one as well to fix this error in next-20260817:
> 
>     error[E0599]: no method named `__pinned_init` found for associated type `impl pin_init::PinInit<T, error::Error>` in the current scope
>        --> rust/kernel/fwctl.rs:465:49
>         |
>     465 |                 match T::open(device, reg_data).__pinned_init(uctx_ptr) {
>         |                                                 ^^^^^^^^^^^^^ method not found in `impl pin_init::PinInit<T, error::Error>`

If you delete functions like this then you break everyone elses branches :|

I can't use this patch:

465 |              match pin_init::raw_try_init(uctx_ptr, T::open(device, reg_data)) {
    |                              ^^^^^^^^^^^^ not found in `pin_init`


Linus will have to fix this as a merge conflict.

Jason

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

* Re: [PATCH -next] rust: fwctl: replace `__pinned_init` with `raw_try_init`
  2026-08-18 12:55 ` Jason Gunthorpe
@ 2026-08-18 13:11   ` Gary Guo
  2026-08-18 13:20     ` Jason Gunthorpe
  0 siblings, 1 reply; 9+ messages in thread
From: Gary Guo @ 2026-08-18 13:11 UTC (permalink / raw)
  To: Jason Gunthorpe, Miguel Ojeda
  Cc: Mark Brown, Dave Jiang, Saeed Mahameed, Zhi Wang, Benno Lossin,
	Gary Guo, linux-next, Jonathan Cameron, rust-for-linux,
	Boqun Feng, Björn Roy Baron, Andreas Hindborg, Alice Ryhl,
	Trevor Gross, Danilo Krummrich, Daniel Almeida, Tamir Duberstein,
	Alexandre Courbot, Onur Özkan

On Tue Aug 18, 2026 at 1:55 PM BST, Jason Gunthorpe wrote:
> On Tue, Aug 18, 2026 at 12:53:50PM +0200, Miguel Ojeda wrote:
>> Commit
>> 
>>   ea7da3116015 ("rust: treewide: replace `__pinned_init` with `raw_[try_]init`")
>> 
>> from the pin-init tree replaced the method before removing it, but commit
>> 
>>   e052daab94ee ("rust: introduce abstractions for fwctl")
>> 
>> from the fwctl tree added a new use.
>> 
>> Thus replace that one as well to fix this error in next-20260817:
>> 
>>     error[E0599]: no method named `__pinned_init` found for associated type `impl pin_init::PinInit<T, error::Error>` in the current scope
>>        --> rust/kernel/fwctl.rs:465:49
>>         |
>>     465 |                 match T::open(device, reg_data).__pinned_init(uctx_ptr) {
>>         |                                                 ^^^^^^^^^^^^^ method not found in `impl pin_init::PinInit<T, error::Error>`
>
> If you delete functions like this then you break everyone elses branches :|

I'm not sure how this break everyone elses' branches? It only breaks linux-next
but that's why it exists in the first place, to catch tree conflicts.

>
> I can't use this patch:
>
> 465 |              match pin_init::raw_try_init(uctx_ptr, T::open(device, reg_data)) {
>     |                              ^^^^^^^^^^^^ not found in `pin_init`
>
>
> Linus will have to fix this as a merge conflict.

This patch is sent as a semantic conflict resolution so yes it should be applied
by Linus.

For the removal of the function: Initially I plan to do this removal for
multiple cycles. However when I apply this near rc6 there wasn't any new users
introducing the usage of it so I proceed to remove it the same cycle.

If we want to do a cycle's grace period then reverting commit 1f7fa1374d3b
("rust: pin-init: remove `__pinned_init` method for `cfg(kernel)`") should be
sufficient. That said, I am not sure it's worth doing.

Best,
Gary

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

* Re: [PATCH -next] rust: fwctl: replace `__pinned_init` with `raw_try_init`
  2026-08-18 13:11   ` Gary Guo
@ 2026-08-18 13:20     ` Jason Gunthorpe
  2026-08-18 13:40       ` Gary Guo
  2026-08-18 14:16       ` Mark Brown
  0 siblings, 2 replies; 9+ messages in thread
From: Jason Gunthorpe @ 2026-08-18 13:20 UTC (permalink / raw)
  To: Gary Guo
  Cc: Miguel Ojeda, Mark Brown, Dave Jiang, Saeed Mahameed, Zhi Wang,
	Benno Lossin, linux-next, Jonathan Cameron, rust-for-linux,
	Boqun Feng, Björn Roy Baron, Andreas Hindborg, Alice Ryhl,
	Trevor Gross, Danilo Krummrich, Daniel Almeida, Tamir Duberstein,
	Alexandre Courbot, Onur Özkan

On Tue, Aug 18, 2026 at 02:11:57PM +0100, Gary Guo wrote:
> On Tue Aug 18, 2026 at 1:55 PM BST, Jason Gunthorpe wrote:
> > On Tue, Aug 18, 2026 at 12:53:50PM +0200, Miguel Ojeda wrote:
> >> Commit
> >> 
> >>   ea7da3116015 ("rust: treewide: replace `__pinned_init` with `raw_[try_]init`")
> >> 
> >> from the pin-init tree replaced the method before removing it, but commit
> >> 
> >>   e052daab94ee ("rust: introduce abstractions for fwctl")
> >> 
> >> from the fwctl tree added a new use.
> >> 
> >> Thus replace that one as well to fix this error in next-20260817:
[E0599]: no method named `__pinned_init` found for associated type `impl pin_init::PinInit<T, error::Error>` in the current scope
> >>        --> rust/kernel/fwctl.rs:465:49
> >>         |
> >>     465 |                 match T::open(device, reg_data).__pinned_init(uctx_ptr) {
> >>         |                                                 ^^^^^^^^^^^^^ method not found in `impl pin_init::PinInit<T, error::Error>`
> >
> > If you delete functions like this then you break everyone elses branches :|
> 
> I'm not sure how this break everyone elses' branches? It only breaks linux-next
> but that's why it exists in the first place, to catch tree
> conflicts.

linux-next is to catch missed things, you shouldn't use it to
purposefully cause conflicts during the merge window..

So for example introduce your new API and do some conversions, then
remove the old API down the road after the merge window is a more
expected work flow.

> > I can't use this patch:
> >
> > 465 |              match pin_init::raw_try_init(uctx_ptr, T::open(device, reg_data)) {
> >     |                              ^^^^^^^^^^^^ not found in `pin_init`
> >
> >
> > Linus will have to fix this as a merge conflict.
> 
> This patch is sent as a semantic conflict resolution so yes it should be applied
> by Linus.

That's not really how things work. Now Miguel and I both have to send
Linus a pointer to this hunk because we don't know what order he will
merge the branches in, and last one to get merged needs him to put
this in the merge commit.

> If we want to do a cycle's grace period then reverting commit 1f7fa1374d3b
> ("rust: pin-init: remove `__pinned_init` method for `cfg(kernel)`") should be
> sufficient. That said, I am not sure it's worth doing.

Probably not, but it doesn't hurt to understand the expected work flow
as rust grows bigger.

Jason

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

* Re: [PATCH -next] rust: fwctl: replace `__pinned_init` with `raw_try_init`
  2026-08-18 13:20     ` Jason Gunthorpe
@ 2026-08-18 13:40       ` Gary Guo
  2026-08-18 14:16       ` Mark Brown
  1 sibling, 0 replies; 9+ messages in thread
From: Gary Guo @ 2026-08-18 13:40 UTC (permalink / raw)
  To: Jason Gunthorpe, Gary Guo
  Cc: Miguel Ojeda, Mark Brown, Dave Jiang, Saeed Mahameed, Zhi Wang,
	Benno Lossin, linux-next, Jonathan Cameron, rust-for-linux,
	Boqun Feng, Björn Roy Baron, Andreas Hindborg, Alice Ryhl,
	Trevor Gross, Danilo Krummrich, Daniel Almeida, Tamir Duberstein,
	Alexandre Courbot, Onur Özkan

On Tue Aug 18, 2026 at 2:20 PM BST, Jason Gunthorpe wrote:
> On Tue, Aug 18, 2026 at 02:11:57PM +0100, Gary Guo wrote:
>> On Tue Aug 18, 2026 at 1:55 PM BST, Jason Gunthorpe wrote:
>> > On Tue, Aug 18, 2026 at 12:53:50PM +0200, Miguel Ojeda wrote:
>> >> Commit
>> >> 
>> >>   ea7da3116015 ("rust: treewide: replace `__pinned_init` with `raw_[try_]init`")
>> >> 
>> >> from the pin-init tree replaced the method before removing it, but commit
>> >> 
>> >>   e052daab94ee ("rust: introduce abstractions for fwctl")
>> >> 
>> >> from the fwctl tree added a new use.
>> >> 
>> >> Thus replace that one as well to fix this error in next-20260817:
> [E0599]: no method named `__pinned_init` found for associated type `impl pin_init::PinInit<T, error::Error>` in the current scope
>> >>        --> rust/kernel/fwctl.rs:465:49
>> >>         |
>> >>     465 |                 match T::open(device, reg_data).__pinned_init(uctx_ptr) {
>> >>         |                                                 ^^^^^^^^^^^^^ method not found in `impl pin_init::PinInit<T, error::Error>`
>> >
>> > If you delete functions like this then you break everyone elses branches :|
>> 
>> I'm not sure how this break everyone elses' branches? It only breaks linux-next
>> but that's why it exists in the first place, to catch tree
>> conflicts.
>
> linux-next is to catch missed things, you shouldn't use it to
> purposefully cause conflicts during the merge window..

That is an accusation that I find unacceptable. The API removal commit lands in
linux-next almost 10 days before you pick the Rust fwctl series. The conflict
between rust and fwctl tree doesn't exist in next-20260814, the last linux-next
tag before Miguel sent the PR to Linus. How come I am purposefully causing
conflicts?

> So for example introduce your new API and do some conversions, then
> remove the old API down the road after the merge window is a more
> expected work flow.

I'd happily keep the old API for an additional cycle before removing it, if I
knew that there'll be additional users. However I couldn't predict that new
users will be added late in the cycle after I sent my pull request.

Best,
Gary

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

* Re: [PATCH -next] rust: fwctl: replace `__pinned_init` with `raw_try_init`
  2026-08-18 13:20     ` Jason Gunthorpe
  2026-08-18 13:40       ` Gary Guo
@ 2026-08-18 14:16       ` Mark Brown
  2026-08-18 14:23         ` Jason Gunthorpe
  2026-08-18 14:30         ` Danilo Krummrich
  1 sibling, 2 replies; 9+ messages in thread
From: Mark Brown @ 2026-08-18 14:16 UTC (permalink / raw)
  To: Jason Gunthorpe
  Cc: Gary Guo, Miguel Ojeda, Dave Jiang, Saeed Mahameed, Zhi Wang,
	Benno Lossin, linux-next, Jonathan Cameron, rust-for-linux,
	Boqun Feng, Björn Roy Baron, Andreas Hindborg, Alice Ryhl,
	Trevor Gross, Danilo Krummrich, Daniel Almeida, Tamir Duberstein,
	Alexandre Courbot, Onur Özkan

[-- Attachment #1: Type: text/plain, Size: 1165 bytes --]

On Tue, Aug 18, 2026 at 10:20:22AM -0300, Jason Gunthorpe wrote:
> On Tue, Aug 18, 2026 at 02:11:57PM +0100, Gary Guo wrote:

> > I'm not sure how this break everyone elses' branches? It only breaks linux-next
> > but that's why it exists in the first place, to catch tree
> > conflicts.

> linux-next is to catch missed things, you shouldn't use it to
> purposefully cause conflicts during the merge window..

> So for example introduce your new API and do some conversions, then
> remove the old API down the road after the merge window is a more
> expected work flow.

So are these updates that are requiring frequent patching up aren't
forced as a result of some Rust language thing but rather deliberate
decisions?  In that case I tend to agree with Jason, I'd not expect to
see changes like these coming in during the merge window without a
strong reason, and with C changes like these would normally be done in a
much more coordinated fashion - for example an overlap period like Jason
suggests, possibly with shared branches.

I'd been under the impression that the reason this was happening a lot
with Rust was something to do with how the language works.

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

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

* Re: [PATCH -next] rust: fwctl: replace `__pinned_init` with `raw_try_init`
  2026-08-18 14:16       ` Mark Brown
@ 2026-08-18 14:23         ` Jason Gunthorpe
  2026-08-18 14:30         ` Danilo Krummrich
  1 sibling, 0 replies; 9+ messages in thread
From: Jason Gunthorpe @ 2026-08-18 14:23 UTC (permalink / raw)
  To: Mark Brown
  Cc: Gary Guo, Miguel Ojeda, Dave Jiang, Saeed Mahameed, Zhi Wang,
	Benno Lossin, linux-next, Jonathan Cameron, rust-for-linux,
	Boqun Feng, Björn Roy Baron, Andreas Hindborg, Alice Ryhl,
	Trevor Gross, Danilo Krummrich, Daniel Almeida, Tamir Duberstein,
	Alexandre Courbot, Onur Özkan

On Tue, Aug 18, 2026 at 03:16:21PM +0100, Mark Brown wrote:

> I'd been under the impression that the reason this was happening a lot
> with Rust was something to do with how the language works.

My impression is the rust team is still learning how best to apply
rust to linux. So things land and get changed around with a healthy
does of compile breaking changes. In a certain sense they are building
a unique kernel specific dialect of rust as they go.

It's fine, and this particular case is managable, but my main point is
as rust increases in scope a more accommodating process is needed to
maintain the general kernel work flow.

Jason

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

* Re: [PATCH -next] rust: fwctl: replace `__pinned_init` with `raw_try_init`
  2026-08-18 14:16       ` Mark Brown
  2026-08-18 14:23         ` Jason Gunthorpe
@ 2026-08-18 14:30         ` Danilo Krummrich
  2026-08-18 14:44           ` Mark Brown
  1 sibling, 1 reply; 9+ messages in thread
From: Danilo Krummrich @ 2026-08-18 14:30 UTC (permalink / raw)
  To: Mark Brown
  Cc: Jason Gunthorpe, Gary Guo, Miguel Ojeda, Dave Jiang,
	Saeed Mahameed, Zhi Wang, Benno Lossin, linux-next,
	Jonathan Cameron, rust-for-linux, Boqun Feng,
	Björn Roy Baron, Andreas Hindborg, Alice Ryhl, Trevor Gross,
	Daniel Almeida, Tamir Duberstein, Alexandre Courbot,
	Onur Özkan

On Tue Aug 18, 2026 at 4:16 PM CEST, Mark Brown wrote:
> So are these updates that are requiring frequent patching up aren't
> forced as a result of some Rust language thing but rather deliberate
> decisions?  In that case I tend to agree with Jason, I'd not expect to
> see changes like these coming in during the merge window without a
> strong reason, and with C changes like these would normally be done in a
> much more coordinated fashion - for example an overlap period like Jason
> suggests, possibly with shared branches.
>
> I'd been under the impression that the reason this was happening a lot
> with Rust was something to do with how the language works.

In general that is the case, the stronger type system makes it more difficult to
avoid conflicts by preserving compatible APIs (which is also one reason why I
work a lot with shared signed tags).

In this specific case it is indeed what Gary already explained; the API was
removed and unexpectedly gained a new user.

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

* Re: [PATCH -next] rust: fwctl: replace `__pinned_init` with `raw_try_init`
  2026-08-18 14:30         ` Danilo Krummrich
@ 2026-08-18 14:44           ` Mark Brown
  0 siblings, 0 replies; 9+ messages in thread
From: Mark Brown @ 2026-08-18 14:44 UTC (permalink / raw)
  To: Danilo Krummrich
  Cc: Jason Gunthorpe, Gary Guo, Miguel Ojeda, Dave Jiang,
	Saeed Mahameed, Zhi Wang, Benno Lossin, linux-next,
	Jonathan Cameron, rust-for-linux, Boqun Feng,
	Björn Roy Baron, Andreas Hindborg, Alice Ryhl, Trevor Gross,
	Daniel Almeida, Tamir Duberstein, Alexandre Courbot,
	Onur Özkan

[-- Attachment #1: Type: text/plain, Size: 520 bytes --]

On Tue, Aug 18, 2026 at 04:30:16PM +0200, Danilo Krummrich wrote:

> In this specific case it is indeed what Gary already explained; the API was
> removed and unexpectedly gained a new user.

Ah, OK.  That's the sort of thing that -next is intended to catch,
though it does sound like a shared branch for the removal would've been
helpful to cope with people wanting to add new users of the removed API.
It's also a bit surprising that a new user appeared during the merge
window, I guess that's a last minute addition.

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

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

end of thread, other threads:[~2026-08-18 14:44 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-08-18 10:53 [PATCH -next] rust: fwctl: replace `__pinned_init` with `raw_try_init` Miguel Ojeda
2026-08-18 12:55 ` Jason Gunthorpe
2026-08-18 13:11   ` Gary Guo
2026-08-18 13:20     ` Jason Gunthorpe
2026-08-18 13:40       ` Gary Guo
2026-08-18 14:16       ` Mark Brown
2026-08-18 14:23         ` Jason Gunthorpe
2026-08-18 14:30         ` Danilo Krummrich
2026-08-18 14:44           ` Mark Brown

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox