netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Russell King (Oracle)" <linux@armlinux.org.uk>
To: Gerhard Engleder <gerhard@engleder-embedded.com>
Cc: andrew@lunn.ch, hkallweit1@gmail.com, davem@davemloft.net,
	edumazet@google.com, kuba@kernel.org, pabeni@redhat.com,
	netdev@vger.kernel.org
Subject: Re: [PATCH net-next v4 3/7] net: phy: micrel: Add loopback support
Date: Mon, 3 Feb 2025 19:54:17 +0000	[thread overview]
Message-ID: <Z6Ee6RDkaAeKw749@shell.armlinux.org.uk> (raw)
In-Reply-To: <20250203191057.46351-4-gerhard@engleder-embedded.com>

On Mon, Feb 03, 2025 at 08:10:53PM +0100, Gerhard Engleder wrote:
> +static int ksz9031_set_loopback(struct phy_device *phydev, bool enable,
> +				int speed)
> +{
> +	u16 ctl = BMCR_LOOPBACK;
> +	int ret, val;
> +
> +	if (!enable)
> +		return genphy_loopback(phydev, enable, 0);
> +
> +	if (speed == SPEED_10 || speed == SPEED_100 || speed == SPEED_1000)
> +		phydev->speed = speed;
> +	else if (speed)
> +		return -EINVAL;
> +	phydev->duplex = DUPLEX_FULL;
> +
> +	ctl |= mii_bmcr_encode_fixed(phydev->speed, phydev->duplex);
> +
> +	phy_modify(phydev, MII_BMCR, ~0, ctl);

Why do you use phy_modify() here rather than phy_write() which is
effectively what this is.

-- 
RMK's Patch system: https://www.armlinux.org.uk/developer/patches/
FTTP is here! 80Mbps down 10Mbps up. Decent connectivity at last!

  reply	other threads:[~2025-02-03 19:54 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-02-03 19:10 [PATCH net-next v4 0/7] Support loopback mode speed selection Gerhard Engleder
2025-02-03 19:10 ` [PATCH net-next v4 1/7] net: phy: Allow loopback speed selection for PHY drivers Gerhard Engleder
2025-02-03 19:10 ` [PATCH net-next v4 2/7] net: phy: Support speed selection for PHY loopback Gerhard Engleder
2025-02-03 19:10 ` [PATCH net-next v4 3/7] net: phy: micrel: Add loopback support Gerhard Engleder
2025-02-03 19:54   ` Russell King (Oracle) [this message]
2025-02-04 20:26     ` Gerhard Engleder
2025-02-03 19:10 ` [PATCH net-next v4 4/7] net: phy: marvell: Align set_loopback() implementation Gerhard Engleder
2025-02-03 19:10 ` [PATCH net-next v4 5/7] tsnep: Select speed for loopback Gerhard Engleder
2025-02-03 19:10 ` [PATCH net-next v4 6/7] net: selftests: Export net_test_phy_loopback_* Gerhard Engleder
2025-02-04 18:50   ` kernel test robot
2025-02-03 19:10 ` [PATCH net-next v4 7/7] tsnep: Add PHY loopback selftests Gerhard Engleder

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=Z6Ee6RDkaAeKw749@shell.armlinux.org.uk \
    --to=linux@armlinux.org.uk \
    --cc=andrew@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=gerhard@engleder-embedded.com \
    --cc=hkallweit1@gmail.com \
    --cc=kuba@kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.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;
as well as URLs for NNTP newsgroup(s).