Re: [TECH TOPIC] Rust for Linux

Andrew Lunn
2021-07-20T13:21:47Z

On Tue, Jul 20, 2021 at 02:20:34AM +0100, Wedson Almeida Filho wrote:
> On Tue, Jul 20, 2021 at 12:16:32AM +0200, Linus Walleij wrote:
> > On Mon, Jul 19, 2021 at 4:42 PM Wedson Almeida Filho
> > <wedsonaf@google.com> wrote:
> >
> > > > I think people want to see the code inside these classes as well,
> > > > can we browse it?
> > >
> > > The whole tree is available here: https://github.com/wedsonaf/linux/tree/pl061
> > > -- I should caution you that the two most recent commits are not merged into the
> > > rust tree yet because they're WIP. (I'll clean them up and eventually merge
> > > after the feedback from you all.)
> >
> > I found that the gpio_chip C wrappers lives here:
> > https://github.com/wedsonaf/linux/blob/pl061/rust/kernel/gpio.rs
> >
> > This file is very interesting!
> >
> > I think it's not a good idea to keep these wrappers in their own
> > rust directory, they need to be distributed out into the kernel
> > everywhere they are used. We have made this mistake before
> > with OF (device tree) that started exactly like this in
> > drivers/of/*, and now I have part of the OF GPIO handling
> > and tests inside files in that directory as a consequence.
>
> That's great feedback. Our plan was to have the core parts in `rust/kernel`, but
> once maintainers got involved, we would place things where it made more sense.
> Since we have no maintainers involved in development yet, everything is in rust/
> for now.

Part of the issue here is -stable and back porting fixes. If files
move around within the tree, it makes this back porting harder. git
cherry-pick is a lot less likely to work, it needs more manual
intervention. I expect it will make the stable teams job much easier
if these files are in the right place from day 1 and never move.

Andrew