Skip to contentSkip to conversation

phy: phy_ethtool_ksettings_set: Don't discard phy_start_aneg's return

PATCH Superseded [email protected] 6 participants 18 messages Nov 5, 2021 – Nov 10, 2021

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 phy: phy_ethtool_ksettings_set: Don't discard phy_start_aneg's return

From: Bastian Germann <[email protected]>

Take the return of phy_start_aneg into account so that ethtool will handle negotiation errors and not silently accept invalid input.

Fixes 2d55173e71b0 ("phy: add generic function to support ksetting support")
---
 drivers/net/phy/phy.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
drivers/net/phy/phy.c +4 -2
index a3bfb156c83d..f740b533abba 100644
@@ -770,6 +770,8 @@ static int phy_poll_aneg_done(struct phy_device *phydev)
 int phy_ethtool_ksettings_set(struct phy_device *phydev,
 			      const struct ethtool_link_ksettings *cmd)
 {
+	int ret = 0;
+
 	__ETHTOOL_DECLARE_LINK_MODE_MASK(advertising);
 	u8 autoneg = cmd->base.autoneg;
 	u8 duplex = cmd->base.duplex;
@@ -815,10 +817,10 @@ int phy_ethtool_ksettings_set(struct phy_device *phydev,
 	phydev->mdix_ctrl = cmd->base.eth_tp_mdix_ctrl;
 
 	/* Restart the PHY */
-	_phy_start_aneg(phydev);
+	ret = _phy_start_aneg(phydev);
 
 	mutex_unlock(&phydev->lock);
-	return 0;
+	return ret;
 }
 EXPORT_SYMBOL(phy_ethtool_ksettings_set);
 
Signature · 1 line
2.30.2
maintainer
#1 lore raw
Quoted 4 lines · On Fri, Nov 05, 2021 at 04:36:48PM +0100, [email protected] wrote:

From: Bastian Germann <[email protected]>

Take the return of phy_start_aneg into account so that ethtool will handle negotiation errors and not silently accept invalid input.

Hi Bastian

What PHY driver are you using this with? phy_start_aneg() generally does not return errors, except for -EIO/-TIMEDOUT because communication with the PHY has failed. All parameter validation should of already happened before the call to phy_start_aneg(). So i'm wondering if the PHY driver is doing something wrong.

The change itself however does seems sensible. If the PHY has disappeared, returning -EIO would be valid.

Andrew

maintainer
#3 lore raw
In reply to [email protected]
Quoted 8 lines · On 05.11.2021 16:36, [email protected] wrote:

From: Bastian Germann <[email protected]>

Take the return of phy_start_aneg into account so that ethtool will handle negotiation errors and not silently accept invalid input.

Fixes 2d55173e71b0 ("phy: add generic function to support ksetting support")

In addition to what Andrew said already:

- This patch won't apply on net due to a4db9055fdb9.
- Patch misses the "net" annotation.
- Prefix should be "net: phy:", not "phy:".

At least the formal aspects should have been covered by the internal review.

drivers/net/phy/phy.c static int phy_poll_aneg_done(struct phy_device *phydev) · line 773

Quoted 13 lines
---
 drivers/net/phy/phy.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
drivers/net/phy/phy.c +1 -0
index a3bfb156c83d..f740b533abba 100644
@@ -770,6 +770,8 @@ static int phy_poll_aneg_done(struct phy_device *phydev)
 int phy_ethtool_ksettings_set(struct phy_device *phydev,
 			      const struct ethtool_link_ksettings *cmd)
 {
+	int ret = 0;

Why initializing ret?

Quoted 18 lines
drivers/net/phy/phy.c +3 -2
+
 	__ETHTOOL_DECLARE_LINK_MODE_MASK(advertising);
 	u8 autoneg = cmd->base.autoneg;
 	u8 duplex = cmd->base.duplex;
@@ -815,10 +817,10 @@ int phy_ethtool_ksettings_set(struct phy_device *phydev,
 	phydev->mdix_ctrl = cmd->base.eth_tp_mdix_ctrl;
 
 	/* Restart the PHY */
-	_phy_start_aneg(phydev);
+	ret = _phy_start_aneg(phydev);
 
 	mutex_unlock(&phydev->lock);
-	return 0;
+	return ret;
 }
 EXPORT_SYMBOL(phy_ethtool_ksettings_set);
 
#6 lore raw

PATCH v2 1/1 net: phy: phy_ethtool_ksettings_set: Don't discard phy_start_aneg's return

In reply to [email protected]

From: Bastian Germann <[email protected]>

Take the return of phy_start_aneg into account so that ethtool will handle negotiation errors and not silently accept invalid input.

Fixes 2d55173e71b0 ("phy: add generic function to support ksetting support")
---
 drivers/net/phy/phy.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)
drivers/net/phy/phy.c +5 -2
index beb2b66da132..59e024891f50 100644
@@ -770,6 +770,8 @@ static int phy_poll_aneg_done(struct phy_device *phydev)
 int phy_ethtool_ksettings_set(struct phy_device *phydev,
 			      const struct ethtool_link_ksettings *cmd)
 {
+	int ret;
+
 	__ETHTOOL_DECLARE_LINK_MODE_MASK(advertising);
 	u8 autoneg = cmd->base.autoneg;
 	u8 duplex = cmd->base.duplex;
@@ -818,12 +820,13 @@ int phy_ethtool_ksettings_set(struct phy_device *phydev,
 	if (phy_is_started(phydev)) {
 		phydev->state = PHY_UP;
 		phy_trigger_machine(phydev);
+		ret = 0;
 	} else {
-		_phy_start_aneg(phydev);
+		ret = _phy_start_aneg(phydev);
 	}
 
 	mutex_unlock(&phydev->lock);
-	return 0;
+	return ret;
 }
 EXPORT_SYMBOL(phy_ethtool_ksettings_set);
 
Signature · 1 line
2.30.2
#2 lore raw
In reply to Andrew Lunn

Am 05.11.21 um 19:32 schrieb Andrew Lunn:

Quoted 5 lines

What PHY driver are you using this with? phy_start_aneg() generally does not return errors, except for -EIO/-TIMEDOUT because communication with the PHY has failed. All parameter validation should of already happened before the call to phy_start_aneg(). So i'm wondering if the PHY driver is doing something wrong.

I am modifying broadcom phy and will make sure that I will end up nut having error checks in the wrong place.

#4 lore raw
In reply to Heiner Kallweit

Am 06.11.21 um 22:52 schrieb Heiner Kallweit:

Quoted 6 lines · On 05.11.2021 16:36, [email protected] wrote:
Quoted 5 lines

From: Bastian Germann <[email protected]>

Take the return of phy_start_aneg into account so that ethtool will handle negotiation errors and not silently accept invalid input.

Quoted 7 lines
Quoted 3 lines
Fixes 2d55173e71b0 ("phy: add generic function to support ksetting support")

In addition to what Andrew said already:

- This patch won't apply on net due to a4db9055fdb9.

Hi Heiner,

Thanks for your remarks. I would have gotten the first one right if the netdev tree was documented in the MAINTAINERS file (T: ...) and not only in netdev-FAQ.

Maybe you want to address that.

Thanks,
Bastian

Quoted 40 lines

- Patch misses the "net" annotation.
- Prefix should be "net: phy:", not "phy:".

At least the formal aspects should have been covered by the internal review.

drivers/net/phy/phy.c static int phy_poll_aneg_done(struct phy_device *phydev) · line 773

Quoted 13 lines
---
  drivers/net/phy/phy.c | 6 ++++--
  1 file changed, 4 insertions(+), 2 deletions(-)
drivers/net/phy/phy.c +1 -0
index a3bfb156c83d..f740b533abba 100644
@@ -770,6 +770,8 @@ static int phy_poll_aneg_done(struct phy_device *phydev)
  int phy_ethtool_ksettings_set(struct phy_device *phydev,
  			      const struct ethtool_link_ksettings *cmd)
  {
+	int ret = 0;

Why initializing ret?

Quoted 18 lines
drivers/net/phy/phy.c +3 -2
+
  	__ETHTOOL_DECLARE_LINK_MODE_MASK(advertising);
  	u8 autoneg = cmd->base.autoneg;
  	u8 duplex = cmd->base.duplex;
@@ -815,10 +817,10 @@ int phy_ethtool_ksettings_set(struct phy_device *phydev,
  	phydev->mdix_ctrl = cmd->base.eth_tp_mdix_ctrl;
 
  	/* Restart the PHY */
-	_phy_start_aneg(phydev);
+	ret = _phy_start_aneg(phydev);
 
  	mutex_unlock(&phydev->lock);
-	return 0;
+	return ret;
  }
  EXPORT_SYMBOL(phy_ethtool_ksettings_set);
 
#7 lore raw

Re: [PATCH net v2] net: phy: phy_ethtool_ksettings_set: Don't discard phy_start_aneg's return

In reply to [email protected]
Quoted 4 lines · On Mon, Nov 08, 2021 at 03:18:34PM +0100, [email protected] wrote:

From: Bastian Germann <[email protected]>

Take the return of phy_start_aneg into account so that ethtool will handle negotiation errors and not silently accept invalid input.

I don't think this description is accurate. If we get to call phy_start_aneg() with invalid input, then something has already gone wrong. As Andrew has already explained, an error from this function means that something went wrong with PHY communication. All validation should have happened prior to this function being called.

Thanks.

Signature · 2 lines
RMK's Patch system: https://www.armlinux.org.uk/developer/patches/
FTTP is here! 40Mbps down 10Mbps up. Decent connectivity at last!
#8 lore raw

Re: [PATCH net v2] net: phy: phy_ethtool_ksettings_set: Don't discard phy_start_aneg's return

Quoted 9 lines · On Mon, 8 Nov 2021 14:25:48 +0000 "Russell King (Oracle)"…
Quoted 4 lines · On Mon, Nov 08, 2021 at 03:18:34PM +0100, [email protected] wrote:

From: Bastian Germann <[email protected]>

Take the return of phy_start_aneg into account so that ethtool will handle negotiation errors and not silently accept invalid input.

I don't think this description is accurate. If we get to call phy_start_aneg() with invalid input, then something has already gone wrong.

The MDI/MDIX/auto-MDIX settings are not checked before calling phy_start_aneg(). If the PHY supports forcing MDI and auto-MDIX, but not forcing MDIX _phy_start_aneg() returns a failure, which is silently ignored.

Quoted 2 lines

As Andrew has already explained, an error from this function means that something went wrong with PHY communication.

Or for MDI/MDIX setings, the PHY does not support a feature/setting.

Quoted 2 lines

All validation should have happened prior to this function being called.

OK.
Just to be clear: The PHY driver should check the settings and return an error before calling phy_ethtool_ksettings_set() ?

Thanks
Bene

#9 lore raw

Re: [PATCH net v2] net: phy: phy_ethtool_ksettings_set: Don't discard phy_start_aneg's return

Quoted 9 lines · Benedikt Spranger
Quoted 6 lines · On Mon, 8 Nov 2021 14:25:48 +0000 "Russell King (Oracle)"…
Quoted 4 lines · On Mon, Nov 08, 2021 at 03:18:34PM +0100, [email protected] wrote:

From: Bastian Germann <[email protected]>

Take the return of phy_start_aneg into account so that ethtool will handle negotiation errors and not silently accept invalid input.

Quoted 7 lines
Quoted 3 lines

I don't think this description is accurate. If we get to call phy_start_aneg() with invalid input, then something has already gone wrong.

The MDI/MDIX/auto-MDIX settings are not checked before calling phy_start_aneg(). If the PHY supports forcing MDI and auto-MDIX, but not forcing MDIX _phy_start_aneg() returns a failure, which is silently ignored.

That would be very bad if it were to happen.

ksettings_set() would be called. If phy_is_started() returns true, we trigger the state machine after forcing PHY_UP state. The state machine calls phy_start_aneg() and gets an error, calling phy_error(), and the state machine is forced into PHY_HALTED mode with a kernel warning and stack trace.

That is not nice behaviour for a user.

Quoted 2 lines

Just to be clear: The PHY driver should check the settings and return an error before calling phy_ethtool_ksettings_set() ?

The PHY driver doesn't get an opportunity to validate the settings prior to calling phy_ethtool_ksettings_set() - because the PHY driver never calls this function. The MAC driver does. However, the MAC driver doesn't know what the PHY will accept.

This clearly needs to be fixed in phylib.

As a result of your explanation, I now believe your patch to be fundamentally incorrect given the current state, and it should not be applied.

We should not accept a call to phy_ethtool_ksettings_set(), modify some state (setting phydev->advertising/autoneg/master_slave_set/mdix_ctrl/ speed/duplex) and then return an error to the user indicating that the call failed because we didn't like some parameter - e.g. the mdix_ctrl value that we've writtent o phydev->mdix_ctrl.

Userspace validation should always happen _prior_ to accepting any state from userland. If there's an issue with it, the call should fail without modifying any state.

Signature · 2 lines
RMK's Patch system: https://www.armlinux.org.uk/developer/patches/
FTTP is here! 40Mbps down 10Mbps up. Decent connectivity at last!
maintainer
#10 lore raw

Re: [PATCH net v2] net: phy: phy_ethtool_ksettings_set: Don't discard phy_start_aneg's return

In reply to Benedikt Spranger
Quoted 9 lines · Benedikt Spranger
Quoted 6 lines · On Mon, 8 Nov 2021 14:25:48 +0000 "Russell King (Oracle)"…
Quoted 4 lines · On Mon, Nov 08, 2021 at 03:18:34PM +0100, [email protected] wrote:

From: Bastian Germann <[email protected]>

Take the return of phy_start_aneg into account so that ethtool will handle negotiation errors and not silently accept invalid input.

Quoted 7 lines
Quoted 3 lines

I don't think this description is accurate. If we get to call phy_start_aneg() with invalid input, then something has already gone wrong.

The MDI/MDIX/auto-MDIX settings are not checked before calling phy_start_aneg(). If the PHY supports forcing MDI and auto-MDIX, but not forcing MDIX _phy_start_aneg() returns a failure, which is silently ignored.

Does the broadcom driver currently do this, or is this the new functionality you are adding?

It actually seems odd that auto and MDI is supported, but not MDIX? I would suggest checking with Florian about that. Which particular broadcom PHY is it?

Andrew

#11 lore raw

Re: [PATCH net v2] net: phy: phy_ethtool_ksettings_set: Don't discard phy_start_aneg's return

Am 08.11.21 um 17:09 schrieb Andrew Lunn:

Quoted 18 lines · Benedikt Spranger
Quoted 9 lines
Quoted 6 lines · On Mon, 8 Nov 2021 14:25:48 +0000 "Russell King (Oracle)"…
Quoted 4 lines · On Mon, Nov 08, 2021 at 03:18:34PM +0100, [email protected] wrote:

From: Bastian Germann <[email protected]>

Take the return of phy_start_aneg into account so that ethtool will handle negotiation errors and not silently accept invalid input.

Quoted 7 lines
Quoted 3 lines

I don't think this description is accurate. If we get to call phy_start_aneg() with invalid input, then something has already gone wrong.

The MDI/MDIX/auto-MDIX settings are not checked before calling phy_start_aneg(). If the PHY supports forcing MDI and auto-MDIX, but not forcing MDIX _phy_start_aneg() returns a failure, which is silently ignored.

Quoted 6 lines

Does the broadcom driver currently do this, or is this the new functionality you are adding?

It actually seems odd that auto and MDI is supported, but not MDIX? I would suggest checking with Florian about that. Which particular broadcom PHY is it?

It is BCM53125. Currently, you can set "mdix auto|off|on" which does not take any effect. The chip will do what is its default depending on copper autonegotiation.

I am adding support for setting "mdix auto|off". I want the thing to error on "mdix on". Where would I add that check?

maintainer
#12 lore raw

Re: [PATCH net v2] net: phy: phy_ethtool_ksettings_set: Don't discard phy_start_aneg's return

Quoted 6 lines

It is BCM53125. Currently, you can set "mdix auto|off|on" which does not take any effect. The chip will do what is its default depending on copper autonegotiation.

I am adding support for setting "mdix auto|off". I want the thing to error on "mdix on". Where would I add that check?

/* MDI or MDI-X status/control - if MDI/MDI_X/AUTO is set then
* the driver is required to renegotiate link
*/
#define ETH_TP_MDI_INVALID 0x00 /* status: unknown; control: unsupported */
#define ETH_TP_MDI 0x01 /* status: MDI; control: force MDI */
#define ETH_TP_MDI_X 0x02 /* status: MDI-X; control: force MDI-X */
#define ETH_TP_MDI_AUTO 0x03 /* control: auto-select */

So there are three valid settings. And you are saying you only want to implement two of them? If the hardware can do all three, you should implement all three.

Andrew

maintainer
#13 lore raw

Re: [PATCH net v2] net: phy: phy_ethtool_ksettings_set: Don't discard phy_start_aneg's return

Quoted 15 lines · Andrew Lunn
Quoted 6 lines

It is BCM53125. Currently, you can set "mdix auto|off|on" which does not take any effect. The chip will do what is its default depending on copper autonegotiation.

I am adding support for setting "mdix auto|off". I want the thing to error on "mdix on". Where would I add that check?

/* MDI or MDI-X status/control - if MDI/MDI_X/AUTO is set then
* the driver is required to renegotiate link
*/
#define ETH_TP_MDI_INVALID 0x00 /* status: unknown; control: unsupported */
#define ETH_TP_MDI 0x01 /* status: MDI; control: force MDI */
#define ETH_TP_MDI_X 0x02 /* status: MDI-X; control: force MDI-X */
#define ETH_TP_MDI_AUTO 0x03 /* control: auto-select */

Quoted 4 lines

So there are three valid settings. And you are saying you only want to implement two of them? If the hardware can do all three, you should implement all three.

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.

Quoted 3 lines

Andrew

#14 lore raw

Re: [PATCH net v2] net: phy: phy_ethtool_ksettings_set: Don't discard phy_start_aneg's return

Quoted 21 lines · Heiner Kallweit
Quoted 15 lines · Andrew Lunn
Quoted 6 lines

It is BCM53125. Currently, you can set "mdix auto|off|on" which does not take any effect. The chip will do what is its default depending on copper autonegotiation.

I am adding support for setting "mdix auto|off". I want the thing to error on "mdix on". Where would I add that check?

/* MDI or MDI-X status/control - if MDI/MDI_X/AUTO is set then
* the driver is required to renegotiate link
*/
#define ETH_TP_MDI_INVALID 0x00 /* status: unknown; control: unsupported */
#define ETH_TP_MDI 0x01 /* status: MDI; control: force MDI */
#define ETH_TP_MDI_X 0x02 /* status: MDI-X; control: force MDI-X */
#define ETH_TP_MDI_AUTO 0x03 /* control: auto-select */

Quoted 4 lines

So there are three valid settings. And you are saying you only want to implement two of them? If the hardware can do all three, you should implement all three.

Quoted 4 lines

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.

We'll have to add more stuff to phylink to avoid MACs masking these bits... ETHTOOL_LINK_MODE seems to be becoming a disorganised dumping ground for random stuff. :(

Also, what would these bits in the advertising bitmap mean?

Finally, how do we handle the lack of these bits for existing PHYs that already implement MDI modes?

Signature · 2 lines
RMK's Patch system: https://www.armlinux.org.uk/developer/patches/
FTTP is here! 40Mbps down 10Mbps up. Decent connectivity at last!
#15 lore raw

Re: [PATCH net v2] net: phy: phy_ethtool_ksettings_set: Don't discard phy_start_aneg's return

In reply to Heiner Kallweit
Quoted 4 lines · On Mon, 8 Nov 2021 19:01:23 +0100 Heiner Kallweit <[email protected]> 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 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

maintainer
#16 lore raw

Re: [PATCH net v2] net: phy: phy_ethtool_ksettings_set: Don't discard phy_start_aneg's return

Quoted 10 lines · Benedikt Spranger
Quoted 4 lines · On Mon, 8 Nov 2021 19:01:23 +0100 Heiner Kallweit <[email protected]> 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.

Quoted 26 lines

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

#17 lore raw

Re: [PATCH net v2] net: phy: phy_ethtool_ksettings_set: Don't discard phy_start_aneg's return

In reply to Benedikt Spranger
Quoted 11 lines · Benedikt Spranger
Quoted 4 lines · On Mon, 8 Nov 2021 19:01:23 +0100 Heiner Kallweit <[email protected]> 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 auto-MDIX in 10/100 modes. No force MDIX at all.

Yes that appears to be correct from my reading of the 53125 datasheet. Force MDI-X is optional anyway AFAICT
--
Florian

maintainer
#5 lore raw
In reply to Bastian Germann
Quoted 13 lines · Bastian Germann

Am 06.11.21 um 22:52 schrieb Heiner Kallweit:

Quoted 12 lines · On 05.11.2021 16:36, [email protected] wrote:
Quoted 8 lines

From: Bastian Germann <[email protected]>

Take the return of phy_start_aneg into account so that ethtool will handle negotiation errors and not silently accept invalid input.

Fixes 2d55173e71b0 ("phy: add generic function to support ksetting support")

In addition to what Andrew said already:

Quoted 9 lines
Quoted 1 line

- This patch won't apply on net due to a4db9055fdb9.

Hi Heiner,

Thanks for your remarks. I would have gotten the first one right if the netdev tree was documented in the MAINTAINERS file (T: ...) and not only in netdev-FAQ.

Maybe you want to address that.

I'd interpret the MAINTAINERS structure in a way that if no T: entry is given the one from the next upper directory should be used. And for drivers/net/ the T: entries are available.

It's a typical case that a subsystem has a bigger number of drivers which use the repo of the subsystem, and just few drivers have an own repo, working with pull requests.
IMO having to add the subsystem T: entries to every driver entry would be not needed overhead.

Not sure however which userspace tools use the T: entries and whether they are smart enough to consider entry hierarchies.

Quoted 40 lines

Thanks,
Bastian

Quoted 37 lines

- Patch misses the "net" annotation.
- Prefix should be "net: phy:", not "phy:".

At least the formal aspects should have been covered by the internal review.

drivers/net/phy/phy.c static int phy_poll_aneg_done(struct phy_device *phydev) · line 773

Quoted 13 lines

---
  drivers/net/phy/phy.c | 6 ++++--

  1 file changed, 4 insertions(+), 2 deletions(-)
drivers/net/phy/phy.c +1 -0
index a3bfb156c83d..f740b533abba 100644
@@ -770,6 +770,8 @@ static int phy_poll_aneg_done(struct phy_device *phydev)
   int phy_ethtool_ksettings_set(struct phy_device *phydev,
                     const struct ethtool_link_ksettings *cmd)
   {
+    int ret = 0;

Why initializing ret?

Quoted 15 lines
drivers/net/phy/phy.c +3 -2
+
       __ETHTOOL_DECLARE_LINK_MODE_MASK(advertising);
       u8 autoneg = cmd->base.autoneg;
       u8 duplex = cmd->base.duplex;
@@ -815,10 +817,10 @@ int phy_ethtool_ksettings_set(struct phy_device *phydev,
       phydev->mdix_ctrl = cmd->base.eth_tp_mdix_ctrl;
         /* Restart the PHY */
-    _phy_start_aneg(phydev);
+    ret = _phy_start_aneg(phydev);
         mutex_unlock(&phydev->lock);
-    return 0;
+    return ret;
   }
   EXPORT_SYMBOL(phy_ethtool_ksettings_set);