lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <2024081809-scoff-uncross-5061@gregkh>
Date: Sun, 18 Aug 2024 17:45:51 +0200
From: Greg KH <gregkh@...uxfoundation.org>
To: Andrew Lunn <andrew@...n.ch>
Cc: Benno Lossin <benno.lossin@...ton.me>,
	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

On Sun, Aug 18, 2024 at 05:38:01PM +0200, Andrew Lunn wrote:
> > Just to be sure: the `phydev.mdio.dev` struct is refcounted and
> > incrementing the refcount is fine, right?
> 
> There is nothing special here. PHY devices are just normal Linux
> devices. The device core is responsible for calling .probe() and
> .remove() on a device, and these should be the first and last
> operation on a device. The device core provides refcounting of the
> struct device, so it should always be valid.
> 
> 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...

thanks,

greg k-h

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ