From: Boqun Feng <boqun.feng@gmail.com>
To: Stephen Rothwell <sfr@canb.auug.org.au>
Cc: Greg KH <greg@kroah.com>, Danilo Krummrich <dakr@kernel.org>,
"Rafael J. Wysocki" <rafael@kernel.org>,
Thomas Gleixner <tglx@linutronix.de>,
Ingo Molnar <mingo@kernel.org>, "H. Peter Anvin" <hpa@zytor.com>,
Peter Zijlstra <peterz@infradead.org>,
Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
Linux Next Mailing List <linux-next@vger.kernel.org>
Subject: Re: linux-next: manual merge of the driver-core tree with the tip tree
Date: Mon, 17 Nov 2025 13:34:44 -0800 [thread overview]
Message-ID: <aRuU9LM1TijiJRLa@tardis.local> (raw)
In-Reply-To: <20251117163033.5fe01a29@canb.auug.org.au>
On Mon, Nov 17, 2025 at 04:30:33PM +1100, Stephen Rothwell wrote:
> Hi all,
>
> Today's linux-next merge of the driver-core tree got conflicts in:
>
> samples/rust/rust_debugfs.rs
> samples/rust/rust_debugfs_scoped.rs
>
> between commit:
>
> f74cf399e02e ("rust: debugfs: Replace the usage of Rust native atomics")
>
> from the tip tree and commits:
>
> 0242623384c7 ("rust: driver: let probe() return impl PinInit<Self, Error>")
> 52af0c37964b ("samples: rust: debugfs: add example for blobs")
> f656279afde1 ("samples: rust: debugfs_scoped: add example for blobs")
>
> from the driver-core tree.
>
> I fixed it up (I think - see below) and can carry the fix as necessary.
Again, this fix looks good to me. Thanks!
Regards,
Boqun
> This is now fixed as far as linux-next is concerned, but any non trivial
> conflicts should be mentioned to your upstream maintainer when your tree
> is submitted for merging. You may also want to consider cooperating
> with the maintainer of the conflicting tree to minimise any particularly
> complex conflicts.
>
> --
> Cheers,
> Stephen Rothwell
>
> diff --cc samples/rust/rust_debugfs.rs
> index 711faa07bece,c45b568d951b..000000000000
> --- a/samples/rust/rust_debugfs.rs
> +++ b/samples/rust/rust_debugfs.rs
> @@@ -36,8 -38,9 +36,9 @@@ use kernel::c_str
> use kernel::debugfs::{Dir, File};
> use kernel::new_mutex;
> use kernel::prelude::*;
> + use kernel::sizes::*;
> +use kernel::sync::atomic::{Atomic, Relaxed};
> use kernel::sync::Mutex;
> -
> use kernel::{acpi, device::Core, of, platform, str::CString, types::ARef};
>
> kernel::module_platform_driver! {
> @@@ -57,9 -60,13 +58,13 @@@ struct RustDebugFs
> #[pin]
> _compatible: File<CString>,
> #[pin]
> - counter: File<AtomicUsize>,
> + counter: File<Atomic<usize>>,
> #[pin]
> inner: File<Mutex<Inner>>,
> + #[pin]
> + array_blob: File<Mutex<[u8; 4]>>,
> + #[pin]
> + vector_blob: File<Mutex<KVec<u8>>>,
> }
>
> #[derive(Debug)]
> @@@ -104,16 -111,17 +109,17 @@@ impl platform::Driver for RustDebugFs
> fn probe(
> pdev: &platform::Device<Core>,
> _info: Option<&Self::IdInfo>,
> - ) -> Result<Pin<KBox<Self>>> {
> - let result = KBox::try_pin_init(RustDebugFs::new(pdev), GFP_KERNEL)?;
> - // We can still mutate fields through the files which are atomic or mutexed:
> - result.counter.store(91, Relaxed);
> - {
> - let mut guard = result.inner.lock();
> - guard.x = guard.y;
> - guard.y = 42;
> - }
> - Ok(result)
> + ) -> impl PinInit<Self, Error> {
> + RustDebugFs::new(pdev).pin_chain(|this| {
> - this.counter.store(91, Ordering::Relaxed);
> ++ this.counter.store(91, Relaxed);
> + {
> + let mut guard = this.inner.lock();
> + guard.x = guard.y;
> + guard.y = 42;
> + }
> +
> + Ok(())
> + })
> }
> }
>
> diff --cc samples/rust/rust_debugfs_scoped.rs
> index 9f0ec5f24cda,c80312cf168d..000000000000
> --- a/samples/rust/rust_debugfs_scoped.rs
> +++ b/samples/rust/rust_debugfs_scoped.rs
> @@@ -6,9 -6,10 +6,10 @@@
> //! `Scope::dir` to create a variety of files without the need to separately
> //! track them all.
>
> -use core::sync::atomic::AtomicUsize;
> use kernel::debugfs::{Dir, Scope};
> use kernel::prelude::*;
> + use kernel::sizes::*;
> +use kernel::sync::atomic::Atomic;
> use kernel::sync::Mutex;
> use kernel::{c_str, new_mutex, str::CString};
>
> @@@ -109,7 -114,8 +114,8 @@@ impl ModuleData
>
> struct DeviceData {
> name: CString,
> - nums: KVec<AtomicUsize>,
> + nums: KVec<Atomic<usize>>,
> + blob: Pin<KBox<Mutex<[u8; SZ_4K]>>>,
> }
>
> fn init_control(base_dir: &Dir, dyn_dirs: Dir) -> impl PinInit<Scope<ModuleData>> + '_ {
next prev parent reply other threads:[~2025-11-17 21:34 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-11-17 5:30 linux-next: manual merge of the driver-core tree with the tip tree Stephen Rothwell
2025-11-17 21:34 ` Boqun Feng [this message]
-- strict thread matches above, loose matches on Subject: below --
2025-11-17 5:21 Stephen Rothwell
2025-11-17 21:29 ` Boqun Feng
2014-07-31 7:07 Stephen Rothwell
2014-08-01 0:20 ` Greg KH
2014-08-01 23:38 ` Kees Cook
2014-08-02 2:40 ` Greg KH
2014-08-04 18:27 ` John Stultz
2014-03-13 0:07 Mark Brown
2013-04-11 5:30 Stephen Rothwell
2013-04-11 13:26 ` Greg KH
2012-11-29 4:24 Stephen Rothwell
2012-11-29 5:19 ` Greg KH
2011-12-28 4:57 Stephen Rothwell
2012-01-04 22:52 ` Greg KH
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=aRuU9LM1TijiJRLa@tardis.local \
--to=boqun.feng@gmail.com \
--cc=dakr@kernel.org \
--cc=greg@kroah.com \
--cc=hpa@zytor.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-next@vger.kernel.org \
--cc=mingo@kernel.org \
--cc=peterz@infradead.org \
--cc=rafael@kernel.org \
--cc=sfr@canb.auug.org.au \
--cc=tglx@linutronix.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).