Netdev List
 help / color / mirror / Atom feed
From: Andrew Lunn <andrew@lunn.ch>
To: Kyle Switch <kyle.switch@motor-comm.com>
Cc: Frank.Sae@motor-comm.com, hkallweit1@gmail.com,
	linux@armlinux.org.uk, davem@davemloft.net, edumazet@google.com,
	kuba@kernel.org, pabeni@redhat.com, netdev@vger.kernel.org,
	linux-kernel@vger.kernel.org, jianmin.wang@motor-comm.com,
	xiaolin.xu@motor-comm.com, ming.xu@motor-comm.com,
	jie.han@motor-comm.com
Subject: Re: [Patch net-next v2 2/2] net: phy: Add driver for Motorcomm Quad 2.5GbE phy
Date: Thu, 16 Jul 2026 18:48:14 +0200	[thread overview]
Message-ID: <cc9e3f9d-a3e3-4099-83a9-7204dbc4854b@lunn.ch> (raw)
In-Reply-To: <20260715121012.1113552-1-kyle.switch@motor-comm.com>

> +static inline int ytphy_top_write(struct phy_device *phydev, u32 regnum,
> +				  u16 val)


No inline functions in .C files. And this is a PHY driver, it is a
long way from the hot path, optimisations are not needed.

As i said elsewhere, please look at phy_package.c. It might result in
better code, and a more obvious locking model.

> +/**
> + * ytphy_read_top_ext() - read a PHY's top extended register for YT8824
> + * @phydev: a pointer to a &struct phy_device
> + * @regnum: register number to read
> + *
> + * NOTE:The caller must have taken the MDIO bus lock.

Rather that have this comment, use lockdep_assert_held() to prove it
has been taken.

Maybe add a phy_assert_lock_mdio_bus(struct phy_device *phydev) next
to phy_lock_mdio_bus() and phy_unlock_mdio_bus(), to hide away all the
pointer following.


    Andrew

---
pw-bot: cr

  reply	other threads:[~2026-07-16 16:48 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-15 12:10 [Patch net-next v2 2/2] net: phy: Add driver for Motorcomm Quad 2.5GbE phy Kyle Switch
2026-07-16 16:48 ` Andrew Lunn [this message]
2026-07-16 17:16 ` Andrew Lunn
2026-07-17  5:31   ` Kyle Switch

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=cc9e3f9d-a3e3-4099-83a9-7204dbc4854b@lunn.ch \
    --to=andrew@lunn.ch \
    --cc=Frank.Sae@motor-comm.com \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=hkallweit1@gmail.com \
    --cc=jianmin.wang@motor-comm.com \
    --cc=jie.han@motor-comm.com \
    --cc=kuba@kernel.org \
    --cc=kyle.switch@motor-comm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@armlinux.org.uk \
    --cc=ming.xu@motor-comm.com \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=xiaolin.xu@motor-comm.com \
    /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