Re: [PATCH net-next v2 3/3] net: dp83869: Add speed optimization feature
From: Jakub Kicinski
Date: Wed Sep 02 2020 - 22:06:54 EST
On Wed, 2 Sep 2020 15:34:44 -0500 Dan Murphy wrote:
> Set the speed optimization bit on the DP83869 PHY.
>
> Speed optimization, also known as link downshift, enables fallback to 100M
> operation after multiple consecutive failed attempts at Gigabit link
> establishment. Such a case could occur if cabling with only four wires
> (two twisted pairs) were connected instead of the standard cabling with
> eight wires (four twisted pairs).
>
> The number of failed link attempts before falling back to 100M operation is
> configurable. By default, four failed link attempts are required before
> falling back to 100M.
>
> Signed-off-by: Dan Murphy <dmurphy@xxxxxx>
there seems to be lots of checkpatch warnings here:
ERROR: switch and case should be at the same indent
#111: FILE: drivers/net/phy/dp83869.c:342:
+ switch (cnt) {
+ case DP83869_DOWNSHIFT_1_COUNT:
[...]
+ case DP83869_DOWNSHIFT_2_COUNT:
[...]
+ case DP83869_DOWNSHIFT_4_COUNT:
[...]
+ case DP83869_DOWNSHIFT_8_COUNT:
[...]
+ default:
CHECK: Alignment should match open parenthesis
#139: FILE: drivers/net/phy/dp83869.c:370:
+static int dp83869_get_tunable(struct phy_device *phydev,
+ struct ethtool_tunable *tuna, void *data)
CHECK: Alignment should match open parenthesis
#150: FILE: drivers/net/phy/dp83869.c:381:
+static int dp83869_set_tunable(struct phy_device *phydev,
+ struct ethtool_tunable *tuna, const void *data)
WARNING: please, no spaces at the start of a line
#168: FILE: drivers/net/phy/dp83869.c:669:
+ ret = phy_modify(phydev, DP83869_CFG2, DP83869_DOWNSHIFT_EN,$
ERROR: code indent should use tabs where possible
#169: FILE: drivers/net/phy/dp83869.c:670:
+ DP83869_DOWNSHIFT_EN);$
WARNING: please, no spaces at the start of a line
#169: FILE: drivers/net/phy/dp83869.c:670:
+ DP83869_DOWNSHIFT_EN);$
WARNING: please, no spaces at the start of a line
#170: FILE: drivers/net/phy/dp83869.c:671:
+ if (ret)$
WARNING: suspect code indent for conditional statements (7, 15)
#170: FILE: drivers/net/phy/dp83869.c:671:
+ if (ret)
+ return ret;
ERROR: code indent should use tabs where possible
#171: FILE: drivers/net/phy/dp83869.c:672:
+ return ret;$
WARNING: please, no spaces at the start of a line
#171: FILE: drivers/net/phy/dp83869.c:672:
+ return ret;$
total: 3 errors, 5 warnings, 2 checks, 152 lines checked