All of lore.kernel.org
 help / color / mirror / Atom feed
From: Heiner Kallweit <hkallweit1@gmail.com>
To: Benedikt Spranger <b.spranger@linutronix.de>
Cc: Andrew Lunn <andrew@lunn.ch>,
	Bastian Germann <bage@linutronix.de>,
	"Russell King (Oracle)" <linux@armlinux.org.uk>,
	davem@davemloft.net, netdev@vger.kernel.org,
	Florian Fainelli <f.fainelli@gmail.com>
Subject: Re: [PATCH net v2] net: phy: phy_ethtool_ksettings_set: Don't discard phy_start_aneg's return
Date: Mon, 8 Nov 2021 20:35:53 +0100	[thread overview]
Message-ID: <b1defb1e-fd87-d84b-3ea1-efaa461ccd30@gmail.com> (raw)
In-Reply-To: <20211108200257.78864d69@mitra>

On 08.11.2021 20:02, Benedikt Spranger wrote:
> On Mon, 8 Nov 2021 19:01:23 +0100
> Heiner Kallweit <hkallweit1@gmail.com> wrote:
> 
>> If we would like to support PHY's that don't support all MDI modes
>> then supposedly this would require to add ETHTOOL_LINK_MODE bits for
>> the MDI modes. Then we could use the generic mechanism to check the
>> bits in the "supported" bitmap.
> 
> The things are even worse:
> The chip supports only auto-MDIX at Gigabit and force MDI and

The Gigabit part seems to be normal. Gigabit supports neither
forced mode nor forced MDI settings.

> auto-MDIX in 10/100 modes. No force MDIX at all.
> 
> A validation callback from phy_ethtool_ksettings_set() before
> restarting the PHY seems reasonable for me. Something like:
> 
> 	/* Verify the settings we care about. */
> 	if (autoneg != AUTONEG_ENABLE && autoneg != AUTONEG_DISABLE)
> 	        return -EINVAL;
> 
>         if (autoneg == AUTONEG_ENABLE && linkmode_empty(advertising))
> 	        return -EINVAL;
> 
>         if (autoneg == AUTONEG_DISABLE &&
> 	    ((speed != SPEED_1000 &&
> 	      speed != SPEED_100 &&
>               speed != SPEED_10) ||
>              (duplex != DUPLEX_HALF &&
>               duplex != DUPLEX_FULL)))
>                 return -EINVAL;
> 
> 	if (phydev->validate_cmd && phydev->validate_cmd(cmd))
> 		return -EINVAL;
> 
> Thanks
>     Benedikt Spranger
> 


  reply	other threads:[~2021-11-08 19:36 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-11-05 15:36 [PATCH] phy: phy_ethtool_ksettings_set: Don't discard phy_start_aneg's return bage
2021-11-05 18:32 ` Andrew Lunn
2021-11-08 14:21   ` Bastian Germann
2021-11-06 21:52 ` Heiner Kallweit
2021-11-08 14:25   ` Bastian Germann
2021-11-10  8:14     ` Heiner Kallweit
2021-11-08 14:18 ` [PATCH net v2] net: " bage
2021-11-08 14:25   ` Russell King (Oracle)
2021-11-08 15:06     ` Benedikt Spranger
2021-11-08 15:40       ` Russell King (Oracle)
2021-11-08 16:09       ` Andrew Lunn
2021-11-08 16:32         ` Bastian Germann
2021-11-08 17:57           ` Andrew Lunn
2021-11-08 18:01             ` Heiner Kallweit
2021-11-08 18:06               ` Russell King (Oracle)
2021-11-08 19:02               ` Benedikt Spranger
2021-11-08 19:35                 ` Heiner Kallweit [this message]
2021-11-09 18:29                 ` Florian Fainelli

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=b1defb1e-fd87-d84b-3ea1-efaa461ccd30@gmail.com \
    --to=hkallweit1@gmail.com \
    --cc=andrew@lunn.ch \
    --cc=b.spranger@linutronix.de \
    --cc=bage@linutronix.de \
    --cc=davem@davemloft.net \
    --cc=f.fainelli@gmail.com \
    --cc=linux@armlinux.org.uk \
    --cc=netdev@vger.kernel.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.