# Re: \[PATCH\] phy: phy\_ethtool\_ksettings\_set: Don't discard phy\_start\_aneg's return

- From: Andrew Lunn \<andrew@lunn.ch\>
- Date: 2021-11-05 18:33:01 
- List: netdev
- Page: https://ratatoskr.run/netdev/2021/11/11215673
- Thread: https://ratatoskr.run/netdev/2021/11/11215670/t.md

```text
On Fri, Nov 05, 2021 at 04:36:48PM +0100, bage@linutronix.de wrote:
> From: Bastian Germann <redacted>
> 
> 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
```
