Re: [PATCH v3 5/5] rust: Add KUNIT tests for bitfield

2025-09-21 Thread Miguel Ojeda
On Sat, Sep 20, 2025 at 2:39 AM Joel Fernandes wrote: > > The C checks use BUILD_BUG_ON, in rust-for-linux we have build_assert but it > is fragile and depends on the value being a constant. What do you mean? `build_assert!` works essentially like `BUILD_BUG_ON`, i.e. after the optimizer, and do

Re: [PATCH v4 1/6] nova-core: bitfield: Move bitfield-specific code from register! into new macro

2025-09-21 Thread Miguel Ojeda
On Sun, Sep 21, 2025 at 11:36 AM Greg KH wrote: > > And where does this allow us to define things like BIT(2) for values? > (ok, that's kind of not the point of this patch series, but it will come > up over time...) We have the `bits` module since 6.17: https://rust.docs.kernel.org/kernel/bi

Re: [PATCH v2 4/4] rust: Move register and bitstruct macros out of Nova

2025-09-20 Thread Miguel Ojeda
On Mon, Sep 8, 2025 at 7:06 PM Joel Fernandes wrote: > > The issue I ran into is, without adding it to prelude, the users of register! > macro will have to import both bitfield! and register! macros explictly, even > though they're only using register!. I tried to make it work without adding to >

Re: [PATCH v3 00/11] rust: use `core::ffi::CStr` method names

2025-09-16 Thread Miguel Ojeda
On Wed, Aug 13, 2025 at 5:42 PM Tamir Duberstein wrote: > > This is series 2b/5 of the migration to `core::ffi::CStr`[0]. > 20250704-core-cstr-prepare-v1-0-a91524037...@gmail.com. > > This series depends on the prior series[0] and is intended to go through > the rust tree to reduce the number of r

Re: [PATCH v3 0/9] rust: use `kernel::{fmt,prelude::fmt!}`

2025-09-16 Thread Miguel Ojeda
On Wed, Aug 13, 2025 at 5:39 PM Tamir Duberstein wrote: > > This is series 2a/5 of the migration to `core::ffi::CStr`[0]. > 20250704-core-cstr-prepare-v1-0-a91524037...@gmail.com. > > This series depends on the prior series[0] and is intended to go through > the rust tree to reduce the number of r

Re: [PATCH v5 02/12] gpu: nova-core: move GSP boot code to a dedicated method

2025-09-13 Thread Miguel Ojeda
On Sat, Sep 13, 2025 at 7:14 PM Joel Fernandes wrote: > > I am not alone in that opinion. Hmm... I am not sure how to read this. > This should be first-class in a (systems) language, built into > the language itself? I would suggest taking a look at our website and the links there (like issue #

Re: Implicit panics (was: [PATCH v2 2/8] gpu: nova-core: firmware: add support for common firmware header)

2025-09-10 Thread Miguel Ojeda
On Wed, Sep 10, 2025 at 7:45 AM Alexandre Courbot wrote: > > That would be nice, but also wouldn't cover all the cases where implicit > panics can happen, like out-of-bounds slice accesses - we can't have a > "report-and-continue" mode for these. In principle, it could cover OOBs (even if it is a

Re: Implicit panics (was: [PATCH v2 2/8] gpu: nova-core: firmware: add support for common firmware header)

2025-09-10 Thread Miguel Ojeda
On Wed, Sep 10, 2025 at 3:55 PM Alexandre Courbot wrote: > > The only two options are either allowing user-space to crash the kernel > through a module with a missing bound check, or letting it tamper with So we are definitely not aiming to allow that on purpose, i.e. I know you said "missing", b

Re: [PATCH v3 4/5] rust: Move register and bitfield macros out of Nova

2025-09-09 Thread Miguel Ojeda
On Tue, Sep 9, 2025 at 11:21 PM Joel Fernandes wrote: > > Out of broad need for these macros in Rust, move them out. Several folks > have shown interest (Nova, Tyr GPU drivers). Please Cc the rust-for-Linux mailing list, especially so for patches that add things to the core infrastructure. I not

Re: [PATCH 0/3] Fix broken `srctree/` links and warn about them

2025-09-07 Thread Miguel Ojeda
On Wed, Jul 30, 2025 at 3:07 PM Miguel Ojeda wrote: > > This fixes a handful of broken links and introduces a warning to > prevent them from happening in the future. Applied to `rust-next` -- thanks everyone! I added Cc: sta...@vger.kernel.org on the fixes. Andreas/Boqun: if you don&#

Re: [PATCH v2 4/4] rust: Move register and bitstruct macros out of Nova

2025-09-07 Thread Miguel Ojeda
Hi Joel, I didn't check the macros, but a couple nits I noticed in this patch in particular given it moved it to `kernel`... On Wed, Sep 3, 2025 at 11:54 PM Joel Fernandes wrote: > > +//! A library that provides support for defining bit fields in Rust What about just "Support for defining bit f

Re: [PATCH 00/10] gpu: nova-core: Boot GSP to RISC-V active

2025-08-29 Thread Miguel Ojeda
On Fri, Aug 29, 2025 at 9:40 AM Danilo Krummrich wrote: > > I'm happy about every potential additional reviewer for Nova, but I'm not sure > it scales very well for the rust-for-linux if we get more drivers. :) Yeah, it is an informal rule I/we added back then so that people interested in Rust in

Re: gpu: nova-core: arm32 build errors

2025-08-28 Thread Miguel Ojeda
On Thu, Aug 28, 2025 at 9:31 PM Miguel Ojeda wrote: > > and a `DmaAddress` > newtype, not just a typedef, could perhaps be nice anyway? The one from your linked patch is not a newtype though, so I guess there is a reason for that. Cheers, Miguel

Re: gpu: nova-core: arm32 build errors

2025-08-28 Thread Miguel Ojeda
On Thu, Aug 28, 2025 at 9:24 PM Danilo Krummrich wrote: > > Maybe I spoke too soon, it's actually pretty painful to keep 32-bit > compatibility, even though it would be nice for testing purposes. > > I'll paste the diff to fix it below, I think that makes it obvious why I say > that. > > Instead,

gpu: nova-core: arm32 build errors

2025-08-28 Thread Miguel Ojeda
Hi Danilo et al., In Linus' tree and -next, for an arm32 LLVM defconfig plus Rust build, I see: error[E0308]: mismatched types --> drivers/gpu/nova-core/fb.rs:49:59 | 49 | hal::fb_hal(chipset).write_sysmem_flush_page(bar, page.dma_handle())?; |

Re: [PATCH v2 1/8] rust: transmute: add `from_bytes_copy` method to `FromBytes` trait

2025-08-28 Thread Miguel Ojeda
On Thu, Aug 28, 2025 at 1:26 PM Alexandre Courbot wrote: > > We got 3 Reviewed-by on this patch - Miguel, are you ok if I merge it > together with Christian's `from_bytes` patch, since they are closely > related? If you are taking this series this cycle, then sure! Acked

Re: [PATCH v2 2/8] gpu: nova-core: firmware: add support for common firmware header

2025-08-28 Thread Miguel Ojeda
On Wed, Aug 27, 2025 at 10:47 AM Alexandre Courbot wrote: > > However, `fw_start + fw_size` can panic in debug configuration if it > overflows. In a release build I believe it will just happily wrap, and In the kernel, it is a panic in the default configuration, not just a debug one. We have deb

Re: [PATCH 00/10] gpu: nova-core: Boot GSP to RISC-V active

2025-08-28 Thread Miguel Ojeda
On Wed, 27 Aug 2025 18:19:57 +1000 Alistair Popple wrote: > > This series builds on top of Alex's series[1] to continue initialising the GSP > into a state where it becomes active and it starts communicating with the > host. No big deal, but in case it helps since probably it was not intentional

Re: [RFC PATCH 0/3] Initial plumbing for implementing DRM connector APIs in Rust

2025-08-18 Thread Miguel Ojeda
On Mon, Aug 18, 2025 at 7:04 AM Rahul Rameshbabu wrote: > > I did toss in two doc comment cleanup patches in the mix. If these need to > be re-sent individually or split due to the multiple Fixes: tags, do not > hesitate to let me know. Thanks! Normally, if they are independent, like in this cas

Re: [RFC PATCH 1/3] rust: drm: fix C header references in doc comments

2025-08-18 Thread Miguel Ojeda
On Mon, Aug 18, 2025 at 7:04 AM Rahul Rameshbabu wrote: > > The Rust DRM abstractions would incorrectly reference headers using the > non-existent path include/linux/drm. Correct the path to include/drm. > > Signed-off-by: Rahul Rameshbabu > Fixes: 9a69570682b1 ("rust: drm: ioctl: Add DRM ioctl a

Re: [PATCH 1/4] rust: alloc: replace aligned_size() with Kmalloc::aligned_layout()

2025-08-16 Thread Miguel Ojeda
attaching it for reference in case the now-stable feature is needed, e.g. if you want to make that `const fn` again. Cheers, Miguel From 3cf24f05614e33493ba086bab1f02f701c894807 Mon Sep 17 00:00:00 2001 From: Miguel Ojeda Date: Sat, 16 Aug 2025 22:20:29 +0200 Subject: [NOT PATCH] rust: kerne

[PATCH] rust: alloc: fix `rusttest` by providing `Cmalloc::aligned_layout` too

2025-08-16 Thread Miguel Ojeda
em `aligned_layout` not found for this struct Thus add an equivalent one for `Cmalloc`. Fixes: fde578c86281 ("rust: alloc: replace aligned_size() with Kmalloc::aligned_layout()") Signed-off-by: Miguel Ojeda --- Danilo, as usual, please feel free to rebase if that is better. Here I ju

Re: [PATCH v2 00/19] rust: replace `kernel::c_str!` with C-Strings

2025-08-14 Thread Miguel Ojeda
On Thu, Aug 14, 2025 at 10:24 AM Alice Ryhl wrote: > > Tamir mentioned to me that he ran into a daily limit on the number of > emails he could send. He is posting the updates around the migration in Zulip: https://rust-for-linux.zulipchat.com/#narrow/channel/288089-General/topic/CStr.20migr

Re: [PATCH 1/4] rust: alloc: replace aligned_size() with Kmalloc::aligned_layout()

2025-08-12 Thread Miguel Ojeda
On Tue, Aug 12, 2025 at 10:00 PM Danilo Krummrich wrote: > > I don't think so, it just lead to pad to the alignment for Vmalloc too. > > Technically, this makes no difference, since Vmalloc is always PAGE_SIZE > aligned > and the size always a multiple of PAGE_SIZE. Got it, thanks for the quick

Re: [PATCH 1/4] rust: alloc: replace aligned_size() with Kmalloc::aligned_layout()

2025-08-12 Thread Miguel Ojeda
On Thu, Jul 31, 2025 at 5:49 PM Danilo Krummrich wrote: > > aligned_size() dates back to when Rust did support kmalloc() only, but > is now used in ReallocFunc::call() and hence for all allocators. > > However, the additional padding applied by aligned_size() is only > required by the kmalloc() al

Re: [git pull] drm for 6.17-rc1

2025-07-31 Thread Miguel Ojeda
u time. Thanks! Cheers, Miguel From: Miguel Ojeda Date: Thu, 31 Jul 2025 21:41:37 +0200 Subject: [PATCH] gpu: nova-core: fix up formatting after merge In the merge 260f6f4fda93 ("Merge tag 'drm-next-2025-07-30' of https://gitlab.freedesktop.org/drm/kernel";), the formatting i

[PATCH 3/3] rust: warn if `srctree/` links do not exist

2025-07-30 Thread Miguel Ojeda
to include/linux/drm/drm_file.h does not exist warning: srctree/ link to include/linux/drm/drm_device.h does not exist Inspired-by: "Onur Özkan" Link: https://lore.kernel.org/rust-for-linux/CANiq72=xcya7z7_rxpzzkkkhjs6m7l_xealmuarvn3zacye...@mail.gmail.com/ Signed-off-by: Mi

[PATCH 2/3] rust: drm: fix `srctree/` links

2025-07-30 Thread Miguel Ojeda
ect abstraction") Fixes: 07c9016085f9 ("rust: drm: add driver abstractions") Fixes: 1e4b8896c0f3 ("rust: drm: add device abstraction") Fixes: 9a69570682b1 ("rust: drm: ioctl: Add DRM ioctl abstraction") Signed-off-by: Miguel Ojeda --- rust/kernel/drm/device.rs | 2

[PATCH 1/3] rust: block: fix `srctree/` links

2025-07-30 Thread Miguel Ojeda
This `srctree/` link pointed to a file with an underscore, but the header used a dash instead. Thus fix it. This cleans a future warning that will check our `srctree/` links. Fixes: 3253aba3408a ("rust: block: introduce `kernel::block::mq` module") Signed-off-by: Miguel Ojeda --- r

[PATCH 0/3] Fix broken `srctree/` links and warn about them

2025-07-30 Thread Miguel Ojeda
these that avoids repetition or a fancier preprocessing step. Miguel Ojeda (3): rust: block: fix `srctree/` links rust: drm: fix `srctree/` links rust: warn if `srctree/` links do not exist rust/Makefile| 6 ++ rust/kernel/block/mq/gen_disk.rs | 2 +- rust/kernel/drm

Re: [PATCH] drm: nova-drm: fix 32-bit arm build

2025-07-24 Thread Miguel Ojeda
On Thu, Jul 24, 2025 at 7:05 PM Danilo Krummrich wrote: > > Thanks -- will take it through -fixes once rc-1 is out. By the way, in that case we should probably: Cc: sta...@vger.kernel.org Cheers, Miguel

Re: [PATCH] drm: nova-drm: fix 32-bit arm build

2025-07-24 Thread Miguel Ojeda
On Thu, Jul 24, 2025 at 7:05 PM Danilo Krummrich wrote: > > I think I will follow up with a function to perform the conversion in a single > place, but I really like the idea of a special clippy annotation to tell > clippy > to not warn about unnecessary into() conversions for a specific type ali

[PATCH] drm: nova-drm: fix 32-bit arm build

2025-07-24 Thread Miguel Ojeda
)` call to support the 32-bit case, while allowing the Clippy lint that complains in the 64-bit case where the type is the same. Fixes: cdeaeb9dd762 ("drm: nova-drm: add initial driver skeleton") Signed-off-by: Miguel Ojeda --- As discussed, it may be best to have a newtype, or at least a func

Re: [PATCH v2 7/8] rust: seq_file: use `kernel::{fmt,prelude::fmt!}`

2025-07-21 Thread Miguel Ojeda
On Sun, Jul 20, 2025 at 12:42 AM Tamir Duberstein wrote: > > Reduce coupling to implementation details of the formatting machinery by > avoiding direct use for `core`'s formatting traits and macros. > > Acked-by: Greg Kroah-Hartman > Reviewed-by: Alice Ryhl > Reviewed-by: Benno Lossin > Acked-b

Re: [PATCH v2 5/8] rust: file: use `kernel::{fmt,prelude::fmt!}`

2025-07-21 Thread Miguel Ojeda
On Sun, Jul 20, 2025 at 12:42 AM Tamir Duberstein wrote: > > Reduce coupling to implementation details of the formatting machinery by > avoiding direct use for `core`'s formatting traits and macros. > > Acked-by: Greg Kroah-Hartman > Reviewed-by: Alice Ryhl > Reviewed-by: Benno Lossin > Acked-b

Re: [PATCH v2 00/10] rust: use `core::ffi::CStr` method names

2025-07-21 Thread Miguel Ojeda
On Mon, Jul 21, 2025 at 10:31 PM Tamir Duberstein wrote: > > Yes, please do. I did indeed use b4 - and Alice also let me know that > this was not correct. Sorry about that! Same is true for 2a, I'll > reply to that email as well. Sounds good, thanks for confirming! > I believe it was for everyth

Re: [PATCH v2 0/8] rust: use `kernel::{fmt,prelude::fmt!}`

2025-07-21 Thread Miguel Ojeda
On Sun, Jul 20, 2025 at 12:42 AM Tamir Duberstein wrote: > > Subsystem maintainers: I would appreciate your `Acked-by`s so that this > can be taken through Miguel's tree (where the other series must go). Same here as in step 2b/5, i.e. Danilo's Acked-by was picked up for things he didn't Acked-by

Re: [PATCH v2 00/10] rust: use `core::ffi::CStr` method names

2025-07-21 Thread Miguel Ojeda
On Sun, Jul 20, 2025 at 12:42 AM Tamir Duberstein wrote: > > Subsystem maintainers: I would appreciate your `Acked-by`s so that this > can be taken through Miguel's tree (where the other series must go). Did you apply this with `b4`? I think you picked Danilo's Acked-by, which was for a subset, f

Re: [PATCH 1/6] rust: kernel: remove `fmt!`, fix clippy::uninlined-format-args

2025-07-21 Thread Miguel Ojeda
On Mon, Jul 21, 2025 at 9:37 AM Viresh Kumar wrote: > > Acked-by: Viresh Kumar Thanks Viresh -- I will add this one if I rebase, since Stephen already solved a conflict with it (I should have pinged earlier I guess, sorry; I thought you guys didn't Ack so far since it was trivial, but thanks to

Re: [PATCH 1/6] rust: kernel: remove `fmt!`, fix clippy::uninlined-format-args

2025-07-20 Thread Miguel Ojeda
On Mon, Jul 21, 2025 at 1:04 AM Tamir Duberstein wrote: > > Just noticed a tiny typo here: it should say "can *be* taken". > > Miguel, if you can fix that on apply, please do - but if not, no worries. Done! (We could also have removed that sentence too, since it sounds a bit like something one wo

Re: [PATCH 0/6] Replace `kernel::str::CStr` with `core::ffi::CStr` (cycle 1)

2025-07-20 Thread Miguel Ojeda
On Fri, Jul 4, 2025 at 10:16 PM Tamir Duberstein wrote: > > As this is a large migration that touches many subsystems, it will take > place in several cycles, each of which may see multiple series: Let's start the long road, then... Applied to `rust-next` -- thanks everyone! [ Reworded titl

Re: [PATCH 1/6] rust: kernel: remove `fmt!`, fix clippy::uninlined-format-args

2025-07-20 Thread Miguel Ojeda
On Fri, Jul 4, 2025 at 10:16 PM Tamir Duberstein wrote: > > drivers/cpufreq/rcpufreq_dt.rs| 3 +-- > drivers/gpu/nova-core/firmware.rs | 5 +++-- > rust/kernel/opp.rs| 2 +- Danilo, Viresh: I assume you are OK with this, but let me know otherwise, thanks! Cheers, Miguel

Re: [PATCH v2 2/2] rust: types: rename Opaque::raw_get to cast_into

2025-07-17 Thread Miguel Ojeda
On Tue, Jun 24, 2025 at 5:28 PM Alice Ryhl wrote: > > -let cell_inner = ::core::cell::UnsafeCell::raw_get(self_ptr); > +let cell_inner = > ::core::cell::UnsafeCell::cast_into(self_ptr); Bah, we also missed this one -- I will rebase / send a patch. Cheers, Miguel

Re: [PATCH v2 0/2] Add Opaque::cast_from

2025-07-16 Thread Miguel Ojeda
On Tue, Jun 24, 2025 at 5:28 PM Alice Ryhl wrote: > > Since commit b20fbbc08a36 ("rust: check type of `$ptr` in > `container_of!`") we have enforced that the field pointer passed to > container_of! must match the declared field. This caused mismatches when > using a pointer to bindings::x for fiel

Re: [PATCH 01/10] gpu: nova-core: use `core::ffi::CStr` method names

2025-07-14 Thread Miguel Ojeda
On Mon, Jul 14, 2025 at 5:28 PM Tamir Duberstein wrote: > > Yep, that's what I was going to do - but do I resend the whole series, > or somehow just this patch? Whole series is simpler, I think. Cheers, Miguel

Re: [PATCH 01/10] gpu: nova-core: use `core::ffi::CStr` method names

2025-07-14 Thread Miguel Ojeda
On Mon, Jul 14, 2025 at 2:35 PM Tamir Duberstein wrote: > > How should I respin this one? the subject should be drm/panic, I think. I would mimic what the previous commits did, i.e. drm/panic indeed. (If I happen to pick it up before a resend, I could fix it on my side) Cheers, Miguel

Re: [PATCH v3 2/7] gpu: nova-core: Clarify sysmembar operations

2025-07-10 Thread Miguel Ojeda
On Sun, Jul 6, 2025 at 3:46 PM Miguel Ojeda wrote: > > Added the possibility of catching this automatically in e.g. `rustdoc` to: > > https://github.com/Rust-for-Linux/linux/issues/350 Filled: https://github.com/rust-lang/rust-clippy/issues/15245 so that they have it upstr

Re: [PATCH v3 3/7] gpu: nova-core: Clarify falcon code

2025-07-06 Thread Miguel Ojeda
On Wed, Jul 2, 2025 at 1:32 PM Alexandre Courbot wrote: > > +/// Security mode of the Falcon microprocessor. > +/// See falcon.rst for more details. Please add a newline between those -- the first paragraph is a title ("short description"). A few more instances below, too. `falcon.rst` > +/

Re: [PATCH v3 2/7] gpu: nova-core: Clarify sysmembar operations

2025-07-06 Thread Miguel Ojeda
On Wed, Jul 2, 2025 at 1:05 PM Alexandre Courbot wrote: > > +/// driver initialization, and before any falcon is reset. > +// > /// Users are responsible for manually calling [`Self::unregister`] before > dropping this object, Missing slash. Added the possibility of catching this automatically

Re: [PATCH v3 1/7] gpu: nova-core: Add code comments related to devinit

2025-07-06 Thread Miguel Ojeda
On Wed, Jul 2, 2025 at 1:04 PM Alexandre Courbot wrote: > > +// Check that FWSEC has lowered its protection level before reading > the GFW_BOOT status. `GFW_BOOT` (another one below), since it is written like that above. > -/* PGC6 */ > +/* > + * PGC6 register space. > + * > + * `GC6` i

Re: [PATCH v13 2/5] rust: support formatting of foreign types

2025-07-04 Thread Miguel Ojeda
On Fri, Jul 4, 2025 at 1:59 PM Tamir Duberstein wrote: > > That would probably work. We will probably see regressions because we > can't just replace `core::fmt` imports with `kernel::fmt`, so new code > may appear that uses the former. That is fine -- it happens all the time with this sort of ap

Re: [PATCH v13 2/5] rust: support formatting of foreign types

2025-07-04 Thread Miguel Ojeda
On Fri, Jul 4, 2025 at 12:46 AM Tamir Duberstein wrote: > > There's also a tactical question about splitting by subsystem: are > there any tools that would assist in doing this, or is it a matter of > manually consulting MAINTAINERS to figure out file groupings? As Andrew mentioned, you can use t

Re: [PATCH v13 2/5] rust: support formatting of foreign types

2025-07-03 Thread Miguel Ojeda
On Thu, Jul 3, 2025 at 11:28 PM Andrew Lunn wrote: > > A small patch tends to be more obviously correct than a big patch. The > commit message is more focused and helpful because it refers to a > small chunk of code. Because the commit message is more focused, it > can answer questions reviewers m

Re: [PATCH v13 2/5] rust: support formatting of foreign types

2025-07-03 Thread Miguel Ojeda
On Thu, Jul 3, 2025 at 3:56 PM Tamir Duberstein wrote: > > Can you help me understand why? The changes you ask to be separated > would all be in different files, so why would separate commits make it > easier to review? By the way, if we are talking about splitting, it is easier to land patches t

Re: [PATCH v13 0/5] rust: replace kernel::str::CStr w/ core::ffi::CStr

2025-07-01 Thread Miguel Ojeda
On Tue, Jul 1, 2025 at 6:49 PM Tamir Duberstein wrote: > > This picks up from Michal Rostecki's work[0]. Per Michal's guidance I > have omitted Co-authored tags, as the end result is quite different. > > Link: > https://lore.kernel.org/rust-for-linux/20240819153656.28807-2-vadorov...@protonmail.c

Re: [PATCH] Introduce Tyr

2025-06-30 Thread Miguel Ojeda
On Mon, Jun 30, 2025 at 5:23 PM Daniel Almeida wrote: > > When I said "in development"I was referring to "dead_code" specifically, as we > will invariably have some of that until the other parts of the driver land. > > Just as an example: IMHO it doesn't make much sense to only introduce the > reg

Re: [PATCH] Introduce Tyr

2025-06-30 Thread Miguel Ojeda
On Mon, Jun 30, 2025 at 3:52 PM Rob Herring wrote: > > No. Drivers rely on empty stubs for all the providers they need. It > would be pretty unmaintainable to depend on all of them. You want > enabling drivers for compile testing as easy as possible. That is fine -- I was referring to the current

Re: [PATCH] Introduce Tyr

2025-06-28 Thread Miguel Ojeda
On Sat, Jun 28, 2025 at 3:06 PM Daniel Almeida wrote: > > The branch I shared is drm-misc-next plus a few dependencies, i.e.: 10 commits > total if I counted it correctly - all of which have been sent to the list > already and most of which have seen a quite a few iterations. I should have > expli

Re: [PATCH] Introduce Tyr

2025-06-28 Thread Miguel Ojeda
Hi Daniel, Some procedural notes and general comments, and please note that some may apply several times. On Sat, Jun 28, 2025 at 12:35 AM Daniel Almeida wrote: > > Signed-off-by: Rob Herring > > Signed-off-by: Daniel Almeida No newline. > [2]: https://gitlab.freedesktop.org/panfrost/linux/-

Re: [PATCH] Introduce Tyr

2025-06-28 Thread Miguel Ojeda
On Sat, Jun 28, 2025 at 2:13 AM Daniel Almeida wrote: > > Also, for some reason the Clippy lint did not save me this time. Hmm... it should -- I tried to build it and Clippy reports it. There is also another warning too [1]. I see the compiler reporting [2] too. By the way, do you need to depen

Re: [PATCH] drm/panic: Add a u64 divide by 10 for arm32

2025-06-27 Thread Miguel Ojeda
On Fri, Jun 27, 2025 at 11:41 AM Jocelyn Falempe wrote: > > +/// On arm32 architecture, dividing an u64 by a constant will generate a call > +/// to __aeabi_uldivmod which is not present in the kernel. > +/// So use the multiply by inverse method for this architecture. This sounds more like a nor

Re: [PATCH] drm/panic: Add a u64 divide by 10 for arm32

2025-06-27 Thread Miguel Ojeda
On Fri, Jun 27, 2025 at 1:37 PM Alice Ryhl wrote: > > I would get rid of this conditional and declare another div10 function > that just does input/10 on other arches. Yeah, please keep `cfg`s as local as possible, i.e. inside the implementation of the function where possible, so that we share ev

Re: [PATCH] rust: drm: mm: Add DRM MM Range Allocator abstraction

2025-06-25 Thread Miguel Ojeda
On Tue, Jun 24, 2025 at 12:13 AM Daniel Almeida wrote: > > Signed-off-by: Asahi Lina Patches from others also need to be signed off by you as carrier. > Changes from v0: I assume you mean the RFC patch from more than 2 years ago, i.e. https://lore.kernel.org/rust-for-linux/20230307-rust-

Re: [PATCH] rust: module: remove deprecated author key

2025-06-23 Thread Miguel Ojeda
On Mon, Jun 9, 2025 at 2:22 PM Guilherme Giacomo Simoes wrote: > > Commit 38559da6afb2 ("rust: module: introduce `authors` key") introduced > a new `authors` key to support multiple module authors, while keeping > the old `author` key for backward compatibility. > > Now that all in-tree modules ha

Re: [PATCH v6 04/24] rust: make ETIMEDOUT error available

2025-06-23 Thread Miguel Ojeda
On Thu, Jun 19, 2025 at 3:24 PM Alexandre Courbot wrote: > > We will use this error in the nova-core driver. > > Reviewed-by: Benno Lossin > Signed-off-by: Alexandre Courbot Acked-by: Miguel Ojeda Cheers, Miguel

Re: [PATCH v6 05/24] rust: sizes: add constants up to SZ_2G

2025-06-23 Thread Miguel Ojeda
On Thu, Jun 19, 2025 at 3:24 PM Alexandre Courbot wrote: > > nova-core will need to use SZ_1M, so make the remaining constants > available. > > Reviewed-by: Boqun Feng > Signed-off-by: Alexandre Courbot Acked-by: Miguel Ojeda Cheers, Miguel

Re: [PATCH v12 0/6] rust: reduce `as` casts, enable related lints

2025-06-22 Thread Miguel Ojeda
On Sun, Jun 15, 2025 at 10:55 PM Tamir Duberstein wrote: > > This started with a patch that enabled `clippy::ptr_as_ptr`. Benno > Lossin suggested I also look into `clippy::ptr_cast_constness` and I > discovered `clippy::as_ptr_cast_mut`. This series now enables all 3 > lints. It also enables `cli

Re: [PATCH v12 4/6] rust: enable `clippy::as_underscore` lint

2025-06-18 Thread Miguel Ojeda
On Wed, Jun 18, 2025 at 7:56 PM Tamir Duberstein wrote: > > Miguel, would you mind taking care of this on apply? Quite a big > series to send again. Yeah, of course. Cheers, Miguel

Re: [PATCH v12 1/6] rust: enable `clippy::ptr_as_ptr` lint

2025-06-18 Thread Miguel Ojeda
On Wed, Jun 18, 2025 at 7:44 PM Danilo Krummrich wrote: > > Independent from that, won't this potentially leave us with a lot of warnings > from code that goes through other trees in the upcoming merge window? How do > we > deal with that? Yeah, good question. Since they are Clippy ones, it sho

Re: [PATCH v12 4/6] rust: enable `clippy::as_underscore` lint

2025-06-18 Thread Miguel Ojeda
On Wed, Jun 18, 2025 at 7:38 PM Danilo Krummrich wrote: > > Shouldn't this be `c_long`? Yeah, agreed, it is clearer -- I mentioned that for similar ones in a previous version. Cheers, Miguel

Re: [PATCH v12 6/6] rust: enable `clippy::ref_as_ptr` lint

2025-06-18 Thread Miguel Ojeda
On Sun, Jun 15, 2025 at 10:55 PM Tamir Duberstein wrote: > > rust/kernel/configfs.rs | 20 ++-- > rust/kernel/device_id.rs | 2 +- > rust/kernel/fs/file.rs | 2 +- Andreas, Christian, Danilo, Greg: it would be nice to get Acked-by's for your bits. (This particular one can be

Re: [PATCH v12 2/6] rust: enable `clippy::ptr_cast_constness` lint

2025-06-18 Thread Miguel Ojeda
On Sun, Jun 15, 2025 at 10:55 PM Tamir Duberstein wrote: > > rust/kernel/drm/device.rs | 4 ++-- Danilo: for completeness: if you don't want this, please shout. Thanks! Cheers, Miguel

Re: [PATCH v12 3/6] rust: enable `clippy::as_ptr_cast_mut` lint

2025-06-18 Thread Miguel Ojeda
On Sun, Jun 15, 2025 at 10:55 PM Tamir Duberstein wrote: > > rust/kernel/devres.rs | 2 +- Danilo, Greg: for completeness: if you don't want this, please shout. Thanks! Cheers, Miguel

Re: [PATCH v12 5/6] rust: enable `clippy::cast_lossless` lint

2025-06-18 Thread Miguel Ojeda
On Wed, Jun 18, 2025 at 3:52 PM Tamir Duberstein wrote: > > @Danilo Krummrich could you please have a look for drm and nova? Jocelyn, Tomo: it would also be nice to get Acked-by's for your bits. Thanks! Cheers, Miguel

Re: [PATCH v12 4/6] rust: enable `clippy::as_underscore` lint

2025-06-18 Thread Miguel Ojeda
On Wed, Jun 18, 2025 at 3:51 PM Tamir Duberstein wrote: > > @Danilo Krummrich could you please have a look for nova? Alice, Christian, Danilo, Greg, Tejun: it would also be nice to get Acked-by's for your (other) bits. Thanks! Cheers, Miguel

Re: [PATCH v12 1/6] rust: enable `clippy::ptr_as_ptr` lint

2025-06-18 Thread Miguel Ojeda
On Sun, Jun 15, 2025 at 10:55 PM Tamir Duberstein wrote: > > Apply these changes and enable the lint -- no functional change > intended. We need one more for `opp` [1] -- Viresh: I can do it on apply, unless you disagree. Cheers, Miguel [1] diff --git a/rust/kernel/opp.rs b/rust/kernel/opp.rs

Re: [PATCH v12 1/6] rust: enable `clippy::ptr_as_ptr` lint

2025-06-18 Thread Miguel Ojeda
On Wed, Jun 18, 2025 at 3:54 PM Tamir Duberstein wrote: > > @Andreas Hindborg could you please have a look for configfs? > > @Rafael J. Wysocki @Viresh Kumar could you please have a look for cpufreq? Thanks Tamir. Christian, Danilo, David, Greg, Tejun: It would also be nice to get Acked-by's for

Re: [PATCH v5 04/23] rust: add new `num` module with `PowerOfTwo` type

2025-06-15 Thread Miguel Ojeda
On Thu, Jun 12, 2025 at 4:02 PM Alexandre Courbot wrote: > > +/// > assert_eq!(PowerOfTwotry_new(16).unwrap().value(), 16); By the way, we are trying to write examples close to normal kernel code as possible, so could you please use `?` here instead of `unwrap()`? It is not

Re: [PATCH v5 05/23] rust: num: add the `fls` operation

2025-06-15 Thread Miguel Ojeda
On Sun, Jun 15, 2025 at 12:58 PM Alexandre Courbot wrote: > > Also, although this will work nicely for `impl_fls!` which is a single > function, I'm afraid this won't scale well for `power_of_two_impl!`, > which defines 6 functions per type... Any suggestions for this case? We can always generate

Re: [PATCH v5 05/23] rust: num: add the `fls` operation

2025-06-15 Thread Miguel Ojeda
On Thu, Jun 12, 2025 at 4:02 PM Alexandre Courbot wrote: > > +/// ``` > +/// use kernel::num::fls_u32; > +/// > +/// assert_eq!(fls_u32(0x0), 0); > +/// assert_eq!(fls_u32(0x1), 1); > +/// assert_eq!(fls_u32(0x10), 5); > +

Re: [PATCH v11 0/6] rust: reduce `as` casts, enable related lints

2025-06-13 Thread Miguel Ojeda
On Wed, Jun 11, 2025 at 12:23 PM Tamir Duberstein wrote: > > This series depends on "rust: retain pointer mut-ness in > `container_of!`"[1]. Not anymore! :) > Signed-off-by: Tamir Duberstein Thanks for rebasing, Tamir, I appreciate it. This has a bunch of hits in configfs, cpufreq and Nova [1

Re: [PATCH v10 4/6] rust: enable `clippy::as_underscore` lint

2025-06-10 Thread Miguel Ojeda
On Tue, Jun 10, 2025 at 4:14 PM Tamir Duberstein wrote: > > Yeah, I think these are good calls - I'll fix it in v11. When would > you like me to send it? Since -rc1 is out, please feel free to send it already if you can. It would be nice to see if we can apply it all soon in the cycle, but we wil

Re: [PATCH] rust: module: remove deprecated author key

2025-06-10 Thread Miguel Ojeda
On Tue, Jun 10, 2025 at 2:37 PM Guilherme Giacomo Simoes wrote: > > Maybe, after this patch we can make a checkpatch change for check the > `authors` > key (and MODULE_AUTHOR for C side), and throw a WARN if the author is a name > (not a url, or "rust for linux") and don't have a email address. >

Re: [PATCH] rust: module: remove deprecated author key

2025-06-10 Thread Miguel Ojeda
On Tue, Jun 10, 2025 at 12:03 PM Miguel Ojeda wrote: > > I even saw a URL... i.e. as the sole thing, not as an addition to a company name: MODULE_AUTHOR("https://www.comedi.org";); Perhaps we could have a new key or similar for companies/entities, but I am not sure if it i

Re: [PATCH] rust: module: remove deprecated author key

2025-06-10 Thread Miguel Ojeda
On Tue, Jun 10, 2025 at 12:12 PM Benno Lossin wrote: > > Hmm, I guess a checkpatch lint fits better then? Yeah, that would work. Probably for the C side too -- from a quick grep I don't see it. Cheers, Miguel

Re: [PATCH] rust: module: remove deprecated author key

2025-06-10 Thread Miguel Ojeda
On Tue, Jun 10, 2025 at 10:58 AM Benno Lossin wrote: > > Unrelated to this change, I think we should add email addresses to > people in authors. Possibly enforce it by scanning each author element > and checking if there is an email address. Sounds good to me, but I am not sure if it is possible

Re: [PATCH] rust: module: remove deprecated author key

2025-06-09 Thread Miguel Ojeda
On Mon, Jun 9, 2025 at 2:22 PM Guilherme Giacomo Simoes wrote: > > Now that all in-tree modules have migrated to `authors`, remove: Nit: I would have said "most modules", since we have new/remaining ones (no need for a new version for this). I think this patch is OK -- we could wait to do this m

Re: [PATCH v10 0/6] rust: reduce `as` casts, enable related lints

2025-06-08 Thread Miguel Ojeda
On Fri, Apr 18, 2025 at 5:37 PM Tamir Duberstein wrote: > > This started with a patch that enabled `clippy::ptr_as_ptr`. Benno > Lossin suggested I also look into `clippy::ptr_cast_constness` and I > discovered `clippy::as_ptr_cast_mut`. This series now enables all 3 > lints. It also enables `clip

Re: [PATCH v10 4/6] rust: enable `clippy::as_underscore` lint

2025-06-08 Thread Miguel Ojeda
On Fri, Apr 18, 2025 at 5:37 PM Tamir Duberstein wrote: > > -bindings::BLK_STS_OK as _ > +bindings::BLK_STS_OK as u8 > -unsafe { bindings::blk_mq_end_request(request_ptr, > bindings::BLK_STS_OK as _) }; > +unsafe { bindings::blk_mq_end_request(request_ptr,

Re: [PATCH v4 16/20] nova-core: Add support for VBIOS ucode extraction for boot

2025-06-04 Thread Miguel Ojeda
On Tue, Jun 3, 2025 at 11:05 PM Lyude Paul wrote: > > Not sure this makes sense - debug_assertions is supposed to be about > assertions, we probably shouldn't try to use it for other things (especially > since we've already got dev_dbg! here) Yeah, we added it in `pr_debug!`, but I think we shoul

Re: [PATCH v4 11/20] gpu: nova-core: wait for GFW_BOOT completion

2025-05-31 Thread Miguel Ojeda
On Sat, May 31, 2025 at 4:37 PM Danilo Krummrich wrote: > > I agreed to take this code without waiting for those abstractions, but with a > TODO to fix things up once they land. That sounds good, yeah. Cheers, Miguel

Re: [PATCH v4 11/20] gpu: nova-core: wait for GFW_BOOT completion

2025-05-31 Thread Miguel Ojeda
On Fri, May 30, 2025 at 11:51 PM Lyude Paul wrote: > > JFYI: You can actually just say Result here, since () is the default type for > the kernel's Result type +1 > TBH - we should really add some safe bindings for sleeps instead of calling > this unsafely, I'd be happy to review them if you do

Re: [PATCH v10 1/5] rust: retitle "Example" section as "Examples"

2025-05-26 Thread Miguel Ojeda
On Sat, May 24, 2025 at 10:33 PM Tamir Duberstein wrote: > > This title is consistent with all other macros' documentation, > regardless of the number of examples contained in their "Examples" > sections. > > Signed-off-by: Tamir Duberstein I was going to say that I could take this one independe

Re: linux-next: manual merge of the rust tree with the drm tree

2025-05-23 Thread Miguel Ojeda
On Fri, May 23, 2025 at 8:14 AM Stephen Rothwell wrote: > > I fixed it up (see below) and can carry the fix as necessary. 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

Re: [PATCH v4 04/20] rust: add new `num` module with useful integer operations

2025-05-22 Thread Miguel Ojeda
On Thu, May 22, 2025 at 6:01 AM Alexandre Courbot wrote: > > Either that, or we enable `#![feature(const_trait_impl)]`. I just tried > and with it we could indeed define and implement `NumExt` as const, > which looks like the cleanest way to do this to me. Hmm... I think that one is actively bein

Re: [PATCH v2 7/8] rust: drm: gem: Add GEM object abstraction

2025-05-12 Thread Miguel Ojeda
On Mon, May 12, 2025 at 2:09 PM Danilo Krummrich wrote: > > Lyude's series [1] should address this and the other one you pointed out. Great, thanks! Cheers, Miguel

Re: [PATCH v2 7/8] rust: drm: gem: Add GEM object abstraction

2025-05-12 Thread Miguel Ojeda
On Mon, May 12, 2025 at 1:41 PM Miguel Ojeda wrote: > > Doing something unrelated, I got a Clippy warning about this public By the way, this call (and another one here) to `container_of!` goes through `Opaque`, so it will not pass the future `assert_same_type` test we want to have: error

Re: [PATCH v2 7/8] rust: drm: gem: Add GEM object abstraction

2025-05-12 Thread Miguel Ojeda
On Fri, Apr 11, 2025 at 1:56 AM Danilo Krummrich wrote: > > +fn from_gem_obj(obj: *mut bindings::drm_gem_object) -> *mut Self { > +// SAFETY: All of our objects are Object. > +unsafe { crate::container_of!(obj, Object, obj).cast_mut() } > +} Doing something unrelated, I go

Re: [PATCH v9 4/6] rust: enable `clippy::as_underscore` lint

2025-04-22 Thread Miguel Ojeda
On Fri, Apr 18, 2025 at 5:09 PM Boqun Feng wrote: > > I'm leaning towards to 2 and then 3, because using `as` can sometimes > surprise you when you change the type. Thoughts? Having explicit functions sounds good to me, and would also help migrating later easily to anything else (because all case

Re: [PATCH] drm/panic: Use a decimal fifo to avoid u64 by u64 divide

2025-04-18 Thread Miguel Ojeda
On Fri, Apr 18, 2025 at 6:51 PM Jocelyn Falempe wrote: > > Link: > https://lore.kernel.org/dri-devel/caniq72ke45eowckmhwhvmwxc03dxr4rnxxkvx+hvwdblopz...@mail.gmail.com/ > [1] Thanks for fixing that -- some tags for your consideration: Reported-by: Miguel Ojeda Cl

  1   2   3   >