From: FUJITA Tomonori <tomo@flapping.org>
To: engineer.jjhama@gmail.com
Cc: fujita.tomonori@gmail.com, tmgross@umich.edu,
davem@davemloft.net, edumazet@kernel.org, kuba@kernel.org,
pabeni@redhat.com, horms@kernel.org, ojeda@kernel.org,
boqun@kernel.org, gary@garyguo.net, bjorn3_gh@protonmail.com,
lossin@kernel.org, a.hindborg@kernel.org, aliceryhl@google.com,
dakr@kernel.org, daniel.almeida@collabora.com, tamird@kernel.org,
acourbot@nvidia.com, work@onurozkan.dev, andrew@lunn.ch,
hkallweit1@gmail.com, linux@armlinux.org.uk,
netdev@vger.kernel.org, rust-for-linux@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH net-next v4 1/2] rust: net: phy: take &self in methods that do not need phy_device->lock
Date: Mon, 30 Nov 2026 18:46:33 +0900 (JST) [thread overview]
Message-ID: <20261130.184633.1152374256389299845.tomo@flapping.org> (raw)
In-Reply-To: <20261126-exp-phy-rs-maybelocked-v4-1-16f9a10bb579@gmail.com>
On Thu, 26 Nov 2026 23:08:32 +0900
SeungJong Ha <engineer.jjhama@gmail.com> wrote:
> -/// - Referencing a `phy_device` using this struct asserts that you are in
> -/// a context where all methods defined on this struct are safe to call.
> -/// - This struct always has a valid `self.0.mdio.dev`.
> +/// - `self.0` is a valid `phy_device`, and `self.0.mdio.dev` is a valid `struct device`.
> +/// - For the lifetime of a `&mut Device`, no other thread accesses the state of the `phy_device`
> +/// that `phy_device->lock` protects.
read_paged() relies on phydev->drv being set, but this is not in the
invariant. Can you add "self.0.drv points to a valid phy_driver" here
for &mut Device, and the same to the safety requirements of
from_raw_mut()? The callers can say that PHYLIB calls them through
phydev->drv, and the SAFETY comment in read_paged() can refer to the
invariant.
next prev parent reply other threads:[~2026-11-30 9:46 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-26 14:08 [PATCH net-next v4 0/2] rust: net: phy: pass &Device to callbacks without exclusive access SeungJong Ha
2026-11-26 14:08 ` [PATCH net-next v4 1/2] rust: net: phy: take &self in methods that do not need phy_device->lock SeungJong Ha
2026-11-27 15:01 ` netdev-bot+sashiko
2026-11-28 4:34 ` SeungJong Ha
2026-11-30 9:46 ` FUJITA Tomonori [this message]
2026-11-26 14:08 ` [PATCH net-next v4 2/2] rust: net: phy: pass &Device to suspend, read_mmd and write_mmd SeungJong Ha
2026-11-27 15:01 ` netdev-bot+sashiko
2026-11-30 9:54 ` FUJITA Tomonori
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20261130.184633.1152374256389299845.tomo@flapping.org \
--to=tomo@flapping.org \
--cc=a.hindborg@kernel.org \
--cc=acourbot@nvidia.com \
--cc=aliceryhl@google.com \
--cc=andrew@lunn.ch \
--cc=bjorn3_gh@protonmail.com \
--cc=boqun@kernel.org \
--cc=dakr@kernel.org \
--cc=daniel.almeida@collabora.com \
--cc=davem@davemloft.net \
--cc=edumazet@kernel.org \
--cc=engineer.jjhama@gmail.com \
--cc=fujita.tomonori@gmail.com \
--cc=gary@garyguo.net \
--cc=hkallweit1@gmail.com \
--cc=horms@kernel.org \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@armlinux.org.uk \
--cc=lossin@kernel.org \
--cc=netdev@vger.kernel.org \
--cc=ojeda@kernel.org \
--cc=pabeni@redhat.com \
--cc=rust-for-linux@vger.kernel.org \
--cc=tamird@kernel.org \
--cc=tmgross@umich.edu \
--cc=work@onurozkan.dev \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®