[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <cbb9e253-499d-4b11-93ae-63ea7cb9cfa3@lunn.ch>
Date: Sun, 18 Aug 2024 18:16:32 +0200
From: Andrew Lunn <andrew@...n.ch>
To: Benno Lossin <benno.lossin@...ton.me>
Cc: Greg KH <gregkh@...uxfoundation.org>,
FUJITA Tomonori <fujita.tomonori@...il.com>, netdev@...r.kernel.org,
rust-for-linux@...r.kernel.org, tmgross@...ch.edu,
miguel.ojeda.sandonis@...il.com, aliceryhl@...gle.com
Subject: Re: [PATCH net-next v4 3/6] rust: net::phy implement
AsRef<kernel::device::Device> trait
> Thanks that's good to know.
>
> >> So i have to wounder if you are solving this at the correct
> >> level. This should be generic to any device, so the Rust concept of a
> >> device should be stating these guarantees, not each specific type of
> >> device.
> >
> > It should, why isn't it using the rust binding to Device that we already
> > have:
> > https://rust.docs.kernel.org/kernel/device/struct.Device.html
> > or is it? I'm confused now...
>
> It is using that one.
> I wanted to verify that we can use that one, since using this
> implementation users can freely increment the refcount of the device
> (without decrementing it before control is given back to PHYLIB). Since
> that seems to be the case, all is fine.
Any driver which is not using the device core is broken, and no amount
of SAFETY is going to fix it.
Andrew
Powered by blists - more mailing lists