[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <d80ebfbb-5fb5-4dde-a79b-adb22231a63e@oss.qualcomm.com>
Date: Wed, 23 Jul 2025 13:32:19 +0200
From: Konrad Dybcio <konrad.dybcio@....qualcomm.com>
To: Miguel Ojeda <miguel.ojeda.sandonis@...il.com>,
Konrad Dybcio <konradybcio@...nel.org>
Cc: Miguel Ojeda <ojeda@...nel.org>, Alex Gaynor <alex.gaynor@...il.com>,
Boqun Feng <boqun.feng@...il.com>, Gary Guo <gary@...yguo.net>,
Björn Roy Baron <bjorn3_gh@...tonmail.com>,
Benno Lossin <lossin@...nel.org>,
Andreas Hindborg <a.hindborg@...nel.org>,
Alice Ryhl <aliceryhl@...gle.com>, Trevor Gross <tmgross@...ch.edu>,
Danilo Krummrich <dakr@...nel.org>, Georgi Djakov <djakov@...nel.org>,
Dmitry Baryshkov <dmitry.baryshkov@....qualcomm.com>,
Bjorn Andersson <bjorn.andersson@....qualcomm.com>,
Marijn Suijten <marijn.suijten@...ainline.org>,
linux-kernel@...r.kernel.org, rust-for-linux@...r.kernel.org,
linux-pm@...r.kernel.org
Subject: Re: [PATCH 1/2] rust: Add initial interconnect framework abstractions
On 7/23/25 12:42 PM, Miguel Ojeda wrote:
> Hi Konrad,
>
> Some quick mostly doc-related comments...
[...]
>> + /// Create a new instance from gigabytes (GB) per second
>> + pub const fn from_gigabytes_per_sec(gbps: u32) -> Self {
>> + Self(gbps * 1000 * 1000)
>> + }
>
> I guess this means callers must call this with reasonable numbers and
> otherwise it is considered a bug, right? i.e. this could overflow, and
> thus panic under `CONFIG_RUST_OVERFLOW_CHECKS=y`.
The C framework makes no effort to check for that, so panicking is at
least something.. That said, what would you suggest to do here?
[...]
>> +#[cfg(CONFIG_INTERCONNECT)]
>> +mod icc_path {
>
> Maybe a different file?
I was debating that. icc_path represents the interconnect consumer part
(i.e. used in device drivers that just need to toggle a bus endpoint),
whereas the corresponding provider part (which manages said bus) is not
yet abstracted.
It would make logical sense to split these two.. with the latter going
to icc_provider.rs, perhaps?
[...]
>> +// SAFETY: An `IccPath` is always reference-counted and can be released from any thread.
>> +unsafe impl Send for IccPath {}
>
> This gives an error, right? Was it meant to be inside the other Rust module?
No, it compiles fine here.. Strangely, I didn't get any warnings or
errors with this patch. Maybe because the struct is pub and within the
same file?
Should I move it into the module scope for sanity?
>
> Also, please also run `make .... rustfmt`.
>
> Finally, the examples in the docs are converted automatically into
> KUnit tests (under `CONFIG_RUST_KERNEL_DOCTESTS=y`) -- the examples
> currently have build errors.
I was missing this config, yeah..
>
> We have some extra notes at:
>
> https://rust-for-linux.com/contributing#submit-checklist-addendum
>
> on things that are useful to test/check.
I almost wanna say `make rustfmt` produced slightly different results
(one or two lines of difference) than make rust-analyzer + vscode
extension.. hmm.. Perhaps PEBKAC..
Konrad
Powered by blists - more mailing lists