kernel: Import latest kkit-linux-6.5.y

- Fixes the locking warnings when configuring LEDs on 6393X
- Correctly power up 3310X PHYs strapped to start powered down
- Fix kernel oops when reading from blank NVMEM configured with an
  ONIE layout
This commit is contained in:
Tobias Waldekranz
2023-11-25 20:37:15 +01:00
committed by Joachim Wiberg
parent 6c6ae844f3
commit cb0f8739ad
17 changed files with 132 additions and 22 deletions
@@ -1,7 +1,7 @@
From e1011848d2c9476e20e6a4053b8ab46ce2a1506f Mon Sep 17 00:00:00 2001
From: Tobias Waldekranz <tobias@waldekranz.com>
Date: Thu, 5 Oct 2023 16:09:25 +0200
Subject: [PATCH 01/15] eth: fwnode: Fall back to NVMEM provided MAC address
Subject: [PATCH 01/17] eth: fwnode: Fall back to NVMEM provided MAC address
from OF
In the cases where the fwnode is an OF node, make use of any NVMEM
@@ -1,7 +1,7 @@
From 1d6f30fce9f4516730439f72ee2134301d37654d Mon Sep 17 00:00:00 2001
From: Tobias Waldekranz <tobias@waldekranz.com>
Date: Tue, 5 Sep 2023 13:08:29 +0200
Subject: [PATCH 02/15] net: dsa: mv88e6xxx: Create API to read a single stat
Subject: [PATCH 02/17] net: dsa: mv88e6xxx: Create API to read a single stat
counter
This change contains no functional change. We simply push the hardware
@@ -1,7 +1,7 @@
From f960475a96d2852d06ee062c970e35074f87659c Mon Sep 17 00:00:00 2001
From: Tobias Waldekranz <tobias@waldekranz.com>
Date: Tue, 5 Sep 2023 21:10:15 +0200
Subject: [PATCH 03/15] net: dsa: mv88e6xxx: Give each hw stat an ID
Subject: [PATCH 03/17] net: dsa: mv88e6xxx: Give each hw stat an ID
With the upcoming standard counter group support, we are no longer
reading out the whole set of counters, but rather mapping a subset to
@@ -1,7 +1,7 @@
From 6a612f46152d8567a16b7b15fdcc3081cbdbb3fb Mon Sep 17 00:00:00 2001
From: Tobias Waldekranz <tobias@waldekranz.com>
Date: Tue, 5 Sep 2023 21:15:52 +0200
Subject: [PATCH 04/15] net: dsa: mv88e6xxx: Add "eth-mac" counter group
Subject: [PATCH 04/17] net: dsa: mv88e6xxx: Add "eth-mac" counter group
support
After this change, mv88e6xxx ports can report the applicable subset of
@@ -1,7 +1,7 @@
From a85c55f3232d402780a22d42859bdc81150469b4 Mon Sep 17 00:00:00 2001
From: Tobias Waldekranz <tobias@waldekranz.com>
Date: Wed, 6 Sep 2023 10:55:53 +0200
Subject: [PATCH 05/15] net: dsa: mv88e6xxx: Add "rmon" counter group support
Subject: [PATCH 05/17] net: dsa: mv88e6xxx: Add "rmon" counter group support
After this change, mv88e6xxx ports can report the applicable subset of
their counters using ethtool's standardized "rmon" counter group.
@@ -1,7 +1,7 @@
From 6f684b1b9eb8a307b77aa4baa8531e2c423112af Mon Sep 17 00:00:00 2001
From: Tobias Waldekranz <tobias@waldekranz.com>
Date: Thu, 21 Sep 2023 11:10:26 +0200
Subject: [PATCH 06/15] arm64: dts: marvell: cp11x: Provide clock names for
Subject: [PATCH 06/17] arm64: dts: marvell: cp11x: Provide clock names for
MDIO controllers
This will let the driver figure out the rate of the core clk, such
@@ -1,7 +1,7 @@
From d5e03e7b44c8ac414927751097d8d65caffc33b4 Mon Sep 17 00:00:00 2001
From: Tobias Waldekranz <tobias@waldekranz.com>
Date: Tue, 19 Sep 2023 18:19:40 +0200
Subject: [PATCH 07/15] net: mvmdio: Avoid excessive sleeps in polled mode
Subject: [PATCH 07/17] net: mvmdio: Avoid excessive sleeps in polled mode
Before this change, when operating in polled mode, i.e. no IRQ is
available, every individual C45 access would be hit with a 150us sleep
@@ -1,7 +1,7 @@
From d389cc01295ebd7be228c8240f0061134b27f215 Mon Sep 17 00:00:00 2001
From: Tobias Waldekranz <tobias@waldekranz.com>
Date: Thu, 21 Sep 2023 11:12:55 +0200
Subject: [PATCH 08/15] net: mvmdio: Support setting the MDC frequency on XSMI
Subject: [PATCH 08/17] net: mvmdio: Support setting the MDC frequency on XSMI
controllers
Support the standard "clock-frequency" attribute to set the generated
@@ -1,7 +1,7 @@
From 46bbea6b9d692ac7460e4e278cedee9f88b6da0b Mon Sep 17 00:00:00 2001
From: Tobias Waldekranz <tobias@waldekranz.com>
Date: Tue, 19 Sep 2023 18:38:10 +0200
Subject: [PATCH 09/15] net: phy: marvell10g: Support firmware loading on
Subject: [PATCH 09/17] net: phy: marvell10g: Support firmware loading on
88X3310
If a device is found waiting for firmware to be loaded into its RAM,
@@ -1,7 +1,7 @@
From 312d3efde0fbe7cec3bf7ba1908c213c9cf69337 Mon Sep 17 00:00:00 2001
From: Andrew Lunn <andrew@lunn.ch>
Date: Tue, 8 Aug 2023 23:04:33 +0200
Subject: [PATCH 10/15] led: trig: netdev: Fix requesting offload device
Subject: [PATCH 10/17] led: trig: netdev: Fix requesting offload device
When the netdev trigger is activates, it tries to determine what
device the LED blinks for, and what the current blink mode is.
@@ -1,7 +1,7 @@
From 83322015e7960ba0f1f3698e36333cfb6aecb931 Mon Sep 17 00:00:00 2001
From: Andrew Lunn <andrew@lunn.ch>
Date: Tue, 8 Aug 2023 23:04:36 +0200
Subject: [PATCH 11/15] leds: trig-netdev: Disable offload on deactivation of
Subject: [PATCH 11/17] leds: trig-netdev: Disable offload on deactivation of
trigger
Ensure that the offloading of blinking is stopped when the trigger is
@@ -1,7 +1,7 @@
From a4f09c743da21f09b0fcc6e5842d665490f9f70e Mon Sep 17 00:00:00 2001
From: Andrew Lunn <andrew@lunn.ch>
Date: Tue, 8 Aug 2023 23:04:34 +0200
Subject: [PATCH 12/15] net: phy: phy_device: Call into the PHY driver to set
Subject: [PATCH 12/17] net: phy: phy_device: Call into the PHY driver to set
LED offload
Linux LEDs can be requested to perform hardware accelerated blinking
@@ -1,7 +1,7 @@
From 5adf394404d4c8ac25fb1e36d7d3f23b699b3104 Mon Sep 17 00:00:00 2001
From: Tobias Waldekranz <tobias@waldekranz.com>
Date: Wed, 15 Nov 2023 20:58:42 +0100
Subject: [PATCH 13/15] net: phy: marvell10g: Add LED support for 88X3310
Subject: [PATCH 13/17] net: phy: marvell10g: Add LED support for 88X3310
Pickup the LEDs from the state in which the hardware reset or
bootloader left them, but also support further configuration via
@@ -1,7 +1,7 @@
From 913a57a304e8024f4cea872fa904cee867c469a2 Mon Sep 17 00:00:00 2001
From: Tobias Waldekranz <tobias@waldekranz.com>
Date: Thu, 16 Nov 2023 19:44:32 +0100
Subject: [PATCH 14/15] net: dsa: mv88e6xxx: Add LED infrastructure
Subject: [PATCH 14/17] net: dsa: mv88e6xxx: Add LED infrastructure
Parse DT for LEDs and register them for devices that support it,
though no actual implementations exist yet.
@@ -1,7 +1,7 @@
From 09fca5d7f66b1bdc6a5f72eb3d36bfd8c88bebcc Mon Sep 17 00:00:00 2001
From 8510028fa738493a46b235057ed166f9bbbf0ed4 Mon Sep 17 00:00:00 2001
From: Tobias Waldekranz <tobias@waldekranz.com>
Date: Thu, 16 Nov 2023 21:59:35 +0100
Subject: [PATCH 15/15] net: dsa: mv88e6xxx: Add LED support for 6393X
Subject: [PATCH 15/17] net: dsa: mv88e6xxx: Add LED support for 6393X
Trigger support:
- "none"
@@ -11,11 +11,11 @@ Trigger support:
Signed-off-by: Tobias Waldekranz <tobias@waldekranz.com>
---
drivers/net/dsa/mv88e6xxx/chip.c | 1 +
drivers/net/dsa/mv88e6xxx/leds.c | 219 +++++++++++++++++++++++++++++++
drivers/net/dsa/mv88e6xxx/leds.c | 226 +++++++++++++++++++++++++++++++
drivers/net/dsa/mv88e6xxx/leds.h | 2 +
drivers/net/dsa/mv88e6xxx/port.c | 33 +++++
drivers/net/dsa/mv88e6xxx/port.h | 7 +
5 files changed, 262 insertions(+)
5 files changed, 269 insertions(+)
diff --git a/drivers/net/dsa/mv88e6xxx/chip.c b/drivers/net/dsa/mv88e6xxx/chip.c
index d343ea5cc4a1..7d6b2b85fc31 100644
@@ -30,7 +30,7 @@ index d343ea5cc4a1..7d6b2b85fc31 100644
};
diff --git a/drivers/net/dsa/mv88e6xxx/leds.c b/drivers/net/dsa/mv88e6xxx/leds.c
index 42e1661e1f47..02daf976100d 100644
index 42e1661e1f47..b2a55d96b506 100644
--- a/drivers/net/dsa/mv88e6xxx/leds.c
+++ b/drivers/net/dsa/mv88e6xxx/leds.c
@@ -4,6 +4,13 @@
@@ -47,7 +47,7 @@ index 42e1661e1f47..02daf976100d 100644
struct mv88e6xxx_led {
struct mv88e6xxx_chip *chip;
int port;
@@ -12,6 +19,218 @@ struct mv88e6xxx_led {
@@ -12,6 +19,225 @@ struct mv88e6xxx_led {
struct led_classdev ldev;
};
@@ -163,9 +163,11 @@ index 42e1661e1f47..02daf976100d 100644
+ if (mode < 0)
+ return mode;
+
+ mv88e6xxx_reg_lock(led->chip);
+
+ err = mv88e6393x_port_led_read(led->chip, led->port, 0, &ctrl);
+ if (err)
+ return err;
+ goto out;
+
+ switch (led->index) {
+ case 0:
@@ -177,7 +179,10 @@ index 42e1661e1f47..02daf976100d 100644
+ ctrl |= mode << 4;
+ }
+
+ return mv88e6393x_port_led_write(led->chip, led->port, 0, ctrl);
+ err = mv88e6393x_port_led_write(led->chip, led->port, 0, ctrl);
+out:
+ mv88e6xxx_reg_unlock(led->chip);
+ return err;
+}
+
+static int mv88e6393x_led_get(struct mv88e6xxx_led *led)
@@ -185,7 +190,9 @@ index 42e1661e1f47..02daf976100d 100644
+ u16 ctrl;
+ int err;
+
+ mv88e6xxx_reg_lock(led->chip);
+ err = mv88e6393x_port_led_read(led->chip, led->port, 0, &ctrl);
+ mv88e6xxx_reg_unlock(led->chip);
+ if (err)
+ return err;
+
@@ -0,0 +1,49 @@
From b70f0aa3eb77567a057c2f42f5012a3e009a95c8 Mon Sep 17 00:00:00 2001
From: Tobias Waldekranz <tobias@waldekranz.com>
Date: Tue, 21 Nov 2023 20:15:24 +0100
Subject: [PATCH 16/17] net: phy: marvell10g: Fix power-up when strapped to
start powered down
On devices which are hardware strapped to start powered down (PDSTATE
== 1), make sure that we clear the power-down bit on all units
affected by this setting.
Signed-off-by: Tobias Waldekranz <tobias@waldekranz.com>
---
drivers/net/phy/marvell10g.c | 18 +++++++++++++++---
1 file changed, 15 insertions(+), 3 deletions(-)
diff --git a/drivers/net/phy/marvell10g.c b/drivers/net/phy/marvell10g.c
index 05ad7c769e24..1d86ee10650e 100644
--- a/drivers/net/phy/marvell10g.c
+++ b/drivers/net/phy/marvell10g.c
@@ -782,11 +782,23 @@ static int mv3310_power_down(struct phy_device *phydev)
static int mv3310_power_up(struct phy_device *phydev)
{
+ static const u16 resets[][2] = {
+ { MDIO_MMD_PCS, MV_PCS_BASE_R + MDIO_CTRL1 },
+ { MDIO_MMD_PCS, MV_PCS_1000BASEX + MDIO_CTRL1 },
+ { MDIO_MMD_PCS, MV_PCS_BASE_T + MDIO_CTRL1 },
+ { MDIO_MMD_PMAPMD, MDIO_CTRL1 },
+ { MDIO_MMD_VEND2, MV_V2_PORT_CTRL },
+ };
struct mv3310_priv *priv = dev_get_drvdata(&phydev->mdio.dev);
- int ret;
+ int i, ret;
- ret = phy_clear_bits_mmd(phydev, MDIO_MMD_VEND2, MV_V2_PORT_CTRL,
- MV_V2_PORT_CTRL_PWRDOWN);
+ for (i = 0; i < ARRAY_SIZE(resets); i++) {
+ ret = phy_clear_bits_mmd(phydev, resets[i][0], resets[i][1],
+ MV_V2_PORT_CTRL_PWRDOWN);
+ if (ret)
+ break;
+
+ }
/* Sometimes, the power down bit doesn't clear immediately, and
* a read of this register causes the bit not to clear. Delay
--
2.34.1
@@ -0,0 +1,54 @@
From dd693e037f0dd799e77af397b4d23190b66e9cf1 Mon Sep 17 00:00:00 2001
From: Tobias Waldekranz <tobias@waldekranz.com>
Date: Fri, 24 Nov 2023 23:29:55 +0100
Subject: [PATCH 17/17] nvmem: layouts: onie-tlv: Let device probe even when
TLV is invalid
Before this change, probing an NVMEM device, expected to contain a
valid TLV, would fail if it had not been provisioned yet. But an
obvious way of provisioning is to write the TLV to the nvmem
attribute, which would not be possible because the device would not
be successfully probed.
Therefore, settle for reporting data corruption issues in the log, and
simply refrain from registering any cells in those cases.
Signed-off-by: Tobias Waldekranz <tobias@waldekranz.com>
---
drivers/nvmem/layouts/onie-tlv.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/nvmem/layouts/onie-tlv.c b/drivers/nvmem/layouts/onie-tlv.c
index 59fc87ccfcff..834c46e46d0a 100644
--- a/drivers/nvmem/layouts/onie-tlv.c
+++ b/drivers/nvmem/layouts/onie-tlv.c
@@ -196,7 +196,7 @@ static int onie_tlv_parse_table(struct device *dev, struct nvmem_device *nvmem,
if (!onie_tlv_hdr_is_valid(dev, &hdr)) {
dev_err(dev, "Invalid ONIE TLV header\n");
- return -EINVAL;
+ return 0;
}
hdr_len = sizeof(hdr.id) + sizeof(hdr.version) + sizeof(hdr.data_len);
@@ -204,7 +204,7 @@ static int onie_tlv_parse_table(struct device *dev, struct nvmem_device *nvmem,
table_len = hdr_len + data_len;
if (table_len > ONIE_TLV_MAX_LEN) {
dev_err(dev, "Invalid ONIE TLV data length\n");
- return -EINVAL;
+ return 0;
}
table = devm_kmalloc(dev, table_len, GFP_KERNEL);
@@ -216,7 +216,7 @@ static int onie_tlv_parse_table(struct device *dev, struct nvmem_device *nvmem,
return ret;
if (!onie_tlv_crc_is_valid(dev, table_len, table))
- return -EINVAL;
+ return 0;
data = table + hdr_len;
ret = onie_tlv_add_cells(dev, nvmem, data_len, data);
--
2.34.1