mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: FUJITA Tomonori <tomo@flapping.org>
To: engineer.jjhama@gmail.com, andrew@lunn.ch
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, 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 v3 0/3] rust: net: phy: suspend may run without phy_device->lock
Date: Tue, 24 Nov 2026 21:57:47 +0900 (JST)	[thread overview]
Message-ID: <20261124.215747.1090155063373507910.tomo@flapping.org> (raw)
In-Reply-To: <20261117-exp-phy-rs-maybelocked-v3-0-4e183a7366a7@gmail.com>

On Tue, 17 Nov 2026 19:36:18 +0900
SeungJong Ha <engineer.jjhama@gmail.com> wrote:

> Patch 1 drops `read_mmd`, `write_mmd` and `match_phy_device`, which make
> the same claim but are called under other conditions, and have no users.
> Patch 2 makes `Device` generic over a lock context and documents when
> the `Locked` callbacks run without the lock, and patch 3 gives `suspend`
> the `MaybeLocked` one.

Can we use &Device and &mut Device instead of the new context types?

&mut Device means exclusive access to the state that phy_device->lock
protects. &Device makes no such claim. Methods that use that state
(state(), set_speed(), ...) and read_paged() take &mut self. phy_id(),
read(), write() and genphy_suspend() take &self.

Then suspend, match_phy_device, read_mmd and write_mmd get &Device, and
1/3 is not needed. I would rather not drop callbacks. I want to make it
easy to write new PHY drivers in Rust.

For phy_mii_ioctl(), I agree with Andrew. The SAFETY comment can just
say that this path is outside the guarantee.

I tried this on 7.4-rc4. It builds, and the only driver change is the
suspend signature in ax88796b_rust.

      parent reply	other threads:[~2026-11-24 12:57 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-17 10:36 SeungJong Ha
2026-11-17 10:36 ` [PATCH net-next v3 1/3] rust: net: phy: drop unused read_mmd, write_mmd and match_phy_device SeungJong Ha
2026-11-17 10:36 ` [PATCH net-next v3 2/3] rust: net: phy: make Device generic over a lock context SeungJong Ha
2026-11-20  1:37   ` netdev-bot+sashiko
2026-11-23  3:11     ` SeungJong Ha
2026-11-23  4:31       ` Andrew Lunn
2026-11-17 10:36 ` [PATCH net-next v3 3/3] rust: net: phy: pass a MaybeLocked device to suspend SeungJong Ha
2026-11-24 12:57 ` FUJITA Tomonori [this message]

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=20261124.215747.1090155063373507910.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®