Repository navigation
Conversation
1863c97 to
2ba8190
Compare
openwrt-ai
left a comment
There was a problem hiding this comment.
Commit checks
- 2ba8190 "generic: rtl8365mb: add support for RTL8367S-VB" — the 8/8 paragraph states
sds_lockserializes "the shared SDS_INDACS window and SDS_MISC register", but SDS_MISC is still accessed without it, inrtl8365mb_pcs_config()(the sharedregmap_update_bits(), before the work is cancelled) and inrtl8365mb_phylink_mac_link_up(). Either lock those two sites or narrow the claim to SDS_INDACS plus the park/restore sequence.
Generated by Claude Code
2ba8190 to
9013312
Compare
5f36b7d to
2985f8f
Compare
2985f8f to
47f9486
Compare
47f9486 to
8b96280
Compare
8b96280 to
fc0dbe4
Compare
The TP-Link Archer AX55 v1 carries an RTL8367S-VB, a family D chip the upstream rtl8365mb driver does not know: it detects the chip, sets speed and RGMII mode, reads and writes the VLAN 4K table and the PVID the family D way, and brings up the SDS13 SerDes as a PCS with the re-latch the chip needs. 930-01..08 are Mieczyslaw Nalewaj's series from openwrt/openwrt PR openwrt#25101. 930-09 repeats the switch-side SerDes bring-up once the conduit link is up: the switch end of the 2.5G trunk is configured about two seconds before the IPQ5018 UNIPHY resets and recalibrates its own end, and the trunk intermittently came up broken (bad FCS on every frame at the CPU port, or no octets counted). Sent as openwrt/openwrt PR openwrt#25153; 17 boots without a broken trunk on an AX55. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
fc0dbe4 to
8240e4d
Compare
The TP-Link Archer AX55 v1 carries an RTL8367S-VB, a family D chip the upstream rtl8365mb driver does not know: it detects the chip, sets speed and RGMII mode, reads and writes the VLAN 4K table and the PVID the family D way, and brings up the SDS13 SerDes as a PCS with the re-latch the chip needs. 930-01..08 are Mieczyslaw Nalewaj's series from openwrt/openwrt PR openwrt#25101. 930-09 repeats the switch-side SerDes bring-up once the conduit link is up: the switch end of the 2.5G trunk is configured about two seconds before the IPQ5018 UNIPHY resets and recalibrates its own end, and the trunk intermittently came up broken (bad FCS on every frame at the CPU port, or no octets counted). Sent as openwrt/openwrt PR openwrt#25153; 17 boots without a broken trunk on an AX55. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
|
@namiltd a review from the family D board this was measured on, a TP-Link 930-05: the family D VLAN4k entry is two words, not three. On the RTL8367D the CVLAN table entry is two words. In the EX511's stock
There are no extension words because the die has eight ports. 930-05 keeps the three-word pack and adjusts FID and the IVL bit inside it, so I would give family D its own pack and unpack, two words with the fields I have not raised the |
|
@gusfm I wrote these patches blindly, basing them on the rtl8367b driver with the help of other users and Claude AI, without even owning a router with that chip. I’d be happy to hand over my "work" to a more experienced user who can finish it and submit the results to the Linux upstream. Are you able to verify and make the necessary corrections to this code? |
|
@namiltd I'm in the same boat. My EX511 support was also mostly done with Claude. I rather not accept your offer because I am not a kernel developer. What I can do is test the code of the D family driver in my EX511 that uses it. |
8240e4d to
681b796
Compare
930-01..09 were a copy of namiltd's RTL8367S-VB series from 2026-09-16 plus our openwrt#25153. Both moved on since. Take the current series under its own numbers, so the next sync is a copy: - 777-01..08 from openwrt#19644 (= openwrt#25101, f12e62e): the family D CVLAN entry is two words, not three (the old 930-05 read and wrote a third word that family D does not have); the SerDes re-latch keeps checking the link every 10 s after its 15 fast attempts instead of giving up; family D has 8 ports; sds_lock also covers the SDS_MISC access in pcs_get_state() and the link force on family C; the PVID rollback restores the frame filter too. - 778 is openwrt#25153 as it is now, with family D kept out of the deferred bring-up, as agreed with namiltd. Only the dsa_switch_ops hunk is rebased onto our 762, which adds .port_enable next to it. Tested on a TP-Link Archer AX55 v1 (RTL8367S, family C): 5 of 5 cold boots, up to 10 minutes without power, each with the SerDes brought up after eth0 came up, no FCS errors on the CPU port and traffic through the trunk; 3 network restarts with the firmware nodes back each time; routed Wi-Fi to the WAN at the usual rates, offloaded. Family D is not tested here. Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
@namiltd I included this PR in my build for TP-Link MX515v (IPQ5018, Realtek RTL8367S-VB switch, 2LAN, 1WAN) and it works perfectly. CPU to switch link is 1Gb. Some logs: All ports are working, nice job making this work. |
|
@LS3434 I am currently in the process of submitting this patch to the Linux upstream (https://lore.kernel.org/netdev/?q=rtl8365mb). The patch is currently at version 5: https://lore.kernel.org/netdev/[email protected]/ It would be great if you could use that version, test it, and report the test results. |
|
@LS3434 Would you also be able to test v6 of the fixes?: pending-6.18.zip |
|
@namiltd I will test them next week, i'm preparing a build for TP-Link NX510v, same specs as a MX515v, only modem is 5G instead of 4G. |
|
@namiltd a note on v6 from the family C side (Archer AX55 v1, RTL8367S on a 2500base-x trunk to an IPQ5018 GMAC). v6 8/9 now adds Here is 797 rebased onto v6 (below, pending-6.18). It keeps the v6 code for family D as is and adds to it:
On top of our tree (6.18.55, with the 802.1Q tagger patch in the ops table) v6 1-9 apply cleanly except the ops hunk of 8/9, the rebased 797 applies after them, and the driver builds without new warnings. On the AX55 with v6 and the rebased 797: 5 boots, 4 of them cold (30 s, 30 s, 5 min and 10 min without power) and two Testing goes on here - more cold starts on the AX55 - and I will report if anything shows up. 797-net-dsa-realtek-rtl8365mb-bring-the-SerDes-up-once-the-conduit-is-up.patch (on v6)From 9988ea19e4c5f1540596045fd8e326f003c4ba69 Mon Sep 17 00:00:00 2001
From: Stanislaw Pal <[email protected]>
Date: Sun, 20 Sep 2026 12:00:00 +0200
Subject: [PATCH] net: dsa: realtek: rtl8365mb: bring the SerDes up once the
conduit is up
On the TP-Link Archer AX55 v1 (IPQ5018 + RTL8367S, CPU port on a
2500base-x fixed link) the trunk sometimes comes up broken after a cold
start: every frame the CPU sends reaches the switch CPU port with a bad
FCS, or the port counts no octets while the conduit keeps transmitting.
A reboot may or may not clear it: two soft reboots in a row have left it
dead here, with a power cycle needed to recover, while on another
occasion the second soft reboot was enough.
The same failure reproduces on the Mercusys MR80X v2 (same SoC and
switch): 2 of 12 boots at 2500base-x came up with the CPU port counting
nothing while eth0 transmitted.
The two ends of the trunk are configured in the wrong order: phylink
configures the switch end when the switch is set up, seconds before the
conduit MAC configures its own end, and on the IPQ5018 that step resets
and recalibrates the UNIPHY PLL. The vendor bootloader brings the SoC
end up first and the switch end afterwards.
Do the same: when the conduit behind the SerDes CPU port is not up at
pcs_config() time, hold the bring-up back and run it from
conduit_state_change() once DSA reports the conduit operational, which
is after its MAC and PCS are configured. Nothing needs the trunk before
then. The SerDes mux is parked at DISABLE before the mode is written, so
a bring-up on a mux that already holds the mode still produces the edge
the receiver latches on.
This is done only when the conduit is an IPQ5018 GMAC, the only SoC this
was seen on; other boards keep the current order.
The bring-up is held back once per boot. The UNIPHY resets and
recalibrates its PLL only when its interface mode changes, which on a
fixed link happens once, so a later conduit down/up does not repeat it.
Tested on TP-Link Archer AX55 v1: 5 boots without a single broken
trunk, three of them cold starts, the last two after ten hours and
overnight without power; an earlier version of the same logic ran 17
boots, 8 of them cold, with none broken, against 2 of 9 broken without
the change. On the Mercusys MR80X v2 (Johan Alvarado) this version gave
16 of 16 clean boots, against 2 of 12 broken without it; two earlier
revisions, one stacked on another pending rtl8365mb series and one on
its own, gave 16 of 16 and 17 of 17.
Tested-by: Johan Alvarado <[email protected]>
Signed-off-by: Stanislaw Pal <[email protected]>
[namiltd: rebase onto the family D series; family D keeps its own
bring-up order and does not defer]
Signed-off-by: Mieczyslaw Nalewaj <[email protected]>
---
drivers/net/dsa/realtek/rtl8365mb_main.c | 227 +++++++++++++++++++++--
1 file changed, 213 insertions(+), 14 deletions(-)
--- a/drivers/net/dsa/realtek/rtl8365mb_main.c
+++ b/drivers/net/dsa/realtek/rtl8365mb_main.c
@@ -989,6 +989,14 @@ struct rtl8365mb_port {
* @sds_misc_target_val: SDS_MISC_CFG_MASK fields the re-latch work restores
* @sds_relatch_armed: pcs_config() set up 2500base-x; the re-latch work may run
* @sds_conduit_up: the CPU port conduit is admin and oper up
+ * @sds_defer_needed: the SerDes bring-up is held back until the conduit behind
+ * the SerDes CPU port is up, see
+ * rtl8365mb_sds_defer_needed() (family C)
+ * @sds_deferred: a bring-up requested by pcs_config() is pending
+ * @sds_link_deferred: pcs_link_up() was called while the bring-up was pending
+ * @sds_interface: interface mode of the pending pcs_config() request
+ * @sds_speed: speed of the pending pcs_link_up()
+ * @sds_duplex: duplex of the pending pcs_link_up()
*
* Private data for this driver.
*/
@@ -1017,6 +1025,12 @@ struct rtl8365mb {
u32 sds_misc_target_val;
bool sds_relatch_armed;
bool sds_conduit_up;
+ bool sds_defer_needed;
+ bool sds_deferred;
+ bool sds_link_deferred;
+ phy_interface_t sds_interface;
+ int sds_speed;
+ int sds_duplex;
};
#define pcs_to_rtl8365mb(_pcs) container_of((_pcs), struct rtl8365mb, pcs)
@@ -1558,28 +1572,30 @@ static int rtl8365mb_sds_relatch_restore(struct rtl8365mb *mb)
return ret;
}
-static int rtl8365mb_pcs_config(struct phylink_pcs *pcs, unsigned int neg_mode,
- phy_interface_t interface,
- const unsigned long *advertising,
- bool permit_pause_to_mac)
+/* The hardware half of pcs_config(): tune and mux the SerDes for the
+ * interface mode, take it out of reset and clear the data path. It runs from
+ * rtl8365mb_pcs_config(), or from rtl8365mb_conduit_state_change() when the
+ * bring-up was held back, in both cases with sds_cfg_lock held.
+ */
+static int rtl8365mb_sds_config(struct rtl8365mb *mb, phy_interface_t interface)
{
const struct rtl8365mb_jam_tbl_entry *sds_jam;
const int id = RTL8365MB_SDS_EXT_INTERFACE_ID;
- struct rtl8365mb *mb = pcs_to_rtl8365mb(pcs);
struct realtek_priv *priv = mb->priv;
size_t sds_jam_size;
u32 misc_mask;
u32 misc_val;
u32 sds_mode;
u8 sds_index;
+ bool parked;
bool is_d;
u16 val;
int ret;
int i;
- is_d = rtl8365mb_get_family(priv) == RTL8365MB_FAMILY_D;
+ lockdep_assert_held(&mb->sds_cfg_lock);
- guard(mutex)(&mb->sds_cfg_lock);
+ is_d = rtl8365mb_get_family(priv) == RTL8365MB_FAMILY_D;
/* Cancel any in-flight re-latch edge before touching SDS_MISC: the
* work parks SDS_MISC and restores the target value after a sleep, so
@@ -1672,6 +1688,24 @@ static int rtl8365mb_pcs_config(struct phylink_pcs *pcs, unsigned int neg_mode,
misc_val = (sds_mode == RTL8365MB_EXT_PORT_MODE_SGMII) ?
RTL8365MB_SDS_MISC_MAC8_SEL_SGMII_MASK :
RTL8365MB_SDS_MISC_MAC8_SEL_HSGMII_MASK;
+
+ /* Where the bring-up is held back, park the mux first: the
+ * receiver latches on the DISABLE -> mode edge, so a bring-up
+ * run on a mux that already holds the mode - the deferred one
+ * after a first pcs_config() - would otherwise be a write that
+ * update_bits skips, and produce no edge at all. Other boards
+ * keep the plain update below.
+ */
+ if (mb->sds_defer_needed) {
+ ret = regmap_update_bits_check(priv->map,
+ RTL8365MB_SDS_MISC_REG,
+ misc_mask, 0, &parked);
+ if (ret)
+ return ret;
+
+ if (parked)
+ usleep_range(20000, 21000);
+ }
}
ret = regmap_update_bits(priv->map, RTL8365MB_SDS_MISC_REG,
@@ -1751,6 +1785,134 @@ static int rtl8365mb_pcs_config(struct phylink_pcs *pcs, unsigned int neg_mode,
return 0;
}
+/* The CPU port behind the SerDes external interface, or NULL when the SerDes
+ * is not a CPU port on this board - nothing to wait for then.
+ */
+static struct dsa_port *rtl8365mb_sds_cpu_port(struct rtl8365mb *mb)
+{
+ struct dsa_switch *ds = &mb->priv->ds;
+ int i;
+
+ for (i = 0; i < RTL8365MB_MAX_NUM_EXTINTS; i++) {
+ const struct rtl8365mb_extint *extint =
+ &mb->chip_info->extints[i];
+
+ /* Match the SerDes interface by what it can carry rather than
+ * by its id: the id indexes the chip's digital interface, and
+ * nothing ties the SerDes to a particular one.
+ */
+ if (!(extint->supported_interfaces &
+ (RTL8365MB_PHY_INTERFACE_MODE_SGMII |
+ RTL8365MB_PHY_INTERFACE_MODE_HSGMII)))
+ continue;
+
+ if (!dsa_is_cpu_port(ds, extint->port))
+ return NULL;
+
+ return dsa_to_port(ds, extint->port);
+ }
+
+ return NULL;
+}
+
+/* Bring the family C SerDes up only once the conduit is up.
+ *
+ * phylink configures the switch end of a SerDes CPU port as soon as the
+ * switch is set up, seconds before the conduit MAC configures its own end.
+ * On an IPQ5018 conduit that later step resets the UNIPHY analog PLL and
+ * recalibrates it, and a switch receiver that latched on a far end which was
+ * not there yet sometimes comes out of it counting nothing or FCS errors
+ * only (TP-Link Archer AX55 v1 and Mercusys MR80X v2, both RTL8367S on a
+ * 2500base-x trunk). The vendor bootloader avoids this by bringing the SoC
+ * end up first and the switch end afterwards; this does the same. When the
+ * conduit is not up at pcs_config() time the bring-up is recorded and run
+ * from rtl8365mb_conduit_state_change() once DSA reports the conduit
+ * operational, which is after its MAC and PCS are configured. Nothing needs
+ * the trunk before then.
+ *
+ * This has only been seen with an IPQ5018 GMAC as the conduit, so the
+ * bring-up is held back only there; other boards keep the current order.
+ * Family D has its own answer to the far end coming up late, the re-latch
+ * work, which also starts from conduit_state_change().
+ */
+static bool rtl8365mb_sds_defer_needed(struct rtl8365mb *mb)
+{
+ struct dsa_port *dp;
+ struct net_device *conduit;
+
+ if (rtl8365mb_get_family(mb->priv) == RTL8365MB_FAMILY_D)
+ return false;
+
+ dp = rtl8365mb_sds_cpu_port(mb);
+ conduit = dp ? dp->conduit : NULL;
+
+ return conduit && conduit->dev.parent &&
+ of_device_is_compatible(conduit->dev.parent->of_node,
+ "qcom,ipq5018-gmac");
+}
+
+static int rtl8365mb_pcs_config(struct phylink_pcs *pcs, unsigned int neg_mode,
+ phy_interface_t interface,
+ const unsigned long *advertising,
+ bool permit_pause_to_mac)
+{
+ struct rtl8365mb *mb = pcs_to_rtl8365mb(pcs);
+ struct dsa_port *dp;
+
+ guard(mutex)(&mb->sds_cfg_lock);
+
+ mb->sds_link_deferred = false;
+ dp = mb->sds_defer_needed ? rtl8365mb_sds_cpu_port(mb) : NULL;
+ /* Same predicate DSA uses for the operational flag that drives
+ * conduit_state_change(), so the two can never disagree.
+ */
+ if (dp && !dsa_port_conduit_is_operational(dp)) {
+ mb->sds_interface = interface;
+ mb->sds_deferred = true;
+ dev_dbg(mb->priv->dev, "SerDes bring-up held until %s is up\n",
+ dp->conduit->name);
+ return 0;
+ }
+
+ mb->sds_deferred = false;
+ return rtl8365mb_sds_config(mb, interface);
+}
+
+static void rtl8365mb_sds_link_up(struct rtl8365mb *mb, int speed, int duplex);
+
+/* The held back family C bring-up, run once the conduit is up. Called with
+ * sds_cfg_lock held.
+ */
+static void rtl8365mb_sds_deferred_bringup(struct rtl8365mb *mb,
+ const struct net_device *conduit)
+{
+ struct realtek_priv *priv = mb->priv;
+ struct dsa_port *dp;
+ int ret;
+
+ dp = rtl8365mb_sds_cpu_port(mb);
+ if (!mb->sds_deferred || !dp || dp->conduit != conduit)
+ return;
+
+ /* On failure the bring-up stays pending, so it is tried again the
+ * next time the conduit comes up.
+ */
+ ret = rtl8365mb_sds_config(mb, mb->sds_interface);
+ if (ret) {
+ dev_err(priv->dev, "SerDes bring-up after %s link up failed: %pe\n",
+ conduit->name, ERR_PTR(ret));
+ return;
+ }
+
+ if (mb->sds_link_deferred)
+ rtl8365mb_sds_link_up(mb, mb->sds_speed, mb->sds_duplex);
+ mb->sds_deferred = false;
+ mb->sds_link_deferred = false;
+
+ dev_info(priv->dev, "SerDes brought up after %s link up\n",
+ conduit->name);
+}
+
static void rtl8365mb_conduit_state_change(struct dsa_switch *ds,
const struct net_device *conduit,
bool operational)
@@ -1758,8 +1920,14 @@ static void rtl8365mb_conduit_state_change(struct dsa_switch *ds,
struct realtek_priv *priv = ds->priv;
struct rtl8365mb *mb = priv->chip_data;
- if (rtl8365mb_get_family(priv) != RTL8365MB_FAMILY_D)
+ if (rtl8365mb_get_family(priv) != RTL8365MB_FAMILY_D) {
+ if (!operational || !mb->sds_defer_needed)
+ return;
+
+ guard(mutex)(&mb->sds_cfg_lock);
+ rtl8365mb_sds_deferred_bringup(mb, conduit);
return;
+ }
guard(mutex)(&mb->sds_cfg_lock);
@@ -2006,12 +2174,11 @@ static void rtl8365mb_pcs_get_state(struct phylink_pcs *pcs,
}
}
-static void rtl8365mb_pcs_link_up(struct phylink_pcs *pcs,
- unsigned int neg_mode,
- phy_interface_t interface, int speed,
- int duplex)
+/* The hardware half of pcs_link_up(): force the SerDes link parameters.
+ * Held back together with rtl8365mb_sds_config() while the conduit is not up.
+ */
+static void rtl8365mb_sds_link_up(struct rtl8365mb *mb, int speed, int duplex)
{
- struct rtl8365mb *mb = pcs_to_rtl8365mb(pcs);
struct realtek_priv *priv = mb->priv;
u32 mask = RTL8365MB_SDS_MISC_SGMII_FDUP_MASK |
RTL8365MB_SDS_MISC_SGMII_LINK_MASK |
@@ -2060,12 +2227,38 @@ static void rtl8365mb_pcs_link_up(struct phylink_pcs *pcs,
}
}
+static void rtl8365mb_pcs_link_up(struct phylink_pcs *pcs,
+ unsigned int neg_mode,
+ phy_interface_t interface, int speed,
+ int duplex)
+{
+ struct rtl8365mb *mb = pcs_to_rtl8365mb(pcs);
+
+ if (mb->sds_defer_needed) {
+ guard(mutex)(&mb->sds_cfg_lock);
+
+ if (mb->sds_deferred) {
+ mb->sds_speed = speed;
+ mb->sds_duplex = duplex;
+ mb->sds_link_deferred = true;
+ return;
+ }
+ }
+
+ rtl8365mb_sds_link_up(mb, speed, duplex);
+}
+
static void rtl8365mb_pcs_disable(struct phylink_pcs *pcs)
{
struct rtl8365mb *mb = pcs_to_rtl8365mb(pcs);
- if (rtl8365mb_get_family(mb->priv) != RTL8365MB_FAMILY_D)
+ if (rtl8365mb_get_family(mb->priv) != RTL8365MB_FAMILY_D) {
+ guard(mutex)(&mb->sds_cfg_lock);
+
+ mb->sds_deferred = false;
+ mb->sds_link_deferred = false;
return;
+ }
guard(mutex)(&mb->sds_cfg_lock);
@@ -4138,6 +4331,7 @@ static int rtl8365mb_setup(struct dsa_switch *ds)
* (in-band mode with autonegotiation disabled).
*/
mb->pcs.poll = true;
+ mb->sds_defer_needed = rtl8365mb_sds_defer_needed(mb);
ret = rtl8365mb_reset_chip(priv);
if (ret) {
@@ -4336,6 +4530,11 @@ static void rtl8365mb_teardown(struct dsa_switch *ds)
WRITE_ONCE(mb->sds_relatch_armed, false);
cancel_delayed_work_sync(&mb->sds_relatch);
+ } else {
+ guard(mutex)(&mb->sds_cfg_lock);
+
+ mb->sds_deferred = false;
+ mb->sds_link_deferred = false;
}
rtl8365mb_stats_teardown(priv); |
|
PR #19644 updated to v6. |
|
The patches are currently on the upstream Linux mailing list here: https://lore.kernel.org/netdev/[email protected]/ |
|
Since I do not own a router equipped with this integrated circuit, I am unable to perform testing of the software submitted to the Linux kernel’s main code tree (the |
|
@namiltd the follow-up I promised on the AX55: with v6 and 797 rebased onto it, 6/6 boots (5 of them cold, the last after a night without power) and 2/2 |
|
I would like to ask everyone who is able to test the v9 patch from #19644 to provide feedback, including a "Tested-by: full name " line, so that I can forward this information to the upstream Linux net-next tree. |
5693c4e to
49e08d8
Compare
49e08d8 to
e9e196e
Compare
64c3676 to
b6ee28b
Compare
| /* Every channel of the instance calls this with its own phylink state | ||
| * mutex, so nothing else keeps two of them out of the sequence below. |
There was a problem hiding this comment.
nit: this no longer holds now that qca_uniphy_pcs_preconfig() calls the function from gmac probe, where no phylink state mutex is held. Name the probe-time caller, so it is clear that uniphy->lock is the only serialization.
| /* Every channel of the instance calls this with its own phylink state | |
| * mutex, so nothing else keeps two of them out of the sequence below. | |
| /* Channels call this under their own phylink state mutex, or from | |
| * probe with none, so only this lock keeps them out of the sequence. |
Generated by Claude Code
| From e3f21ffe950d0c604fff32b31bae6d07c98e0fc7 Mon Sep 17 00:00:00 2001 | ||
| From: Mieczyslaw Nalewaj <[email protected]> | ||
| Date: Sat, 21 Nov 2026 19:10:09 +0100 | ||
| Subject: [PATCH net-next v14 13/15] net: dsa: realtek: rtl8365mb: refactor QoS priority handling |
There was a problem hiding this comment.
nit: the PR body says "This series (14 patches)" and its list leaves out this patch, but commit a71d3c8 says 15 patches and lists it. Update the PR body to match the commit.
Generated by Claude Code
Add ingress QoS offload for the RTL8365MB switch through the dcbnl app interface: a per-port default priority, PCP trust and DSCP trust. The mapping helpers go to net/core/ieee8021q_helpers.c so other drivers can share them. Two changes are visible to users. The driver now rejects a devicetree port that the chip does not have. With a default priority set, an untagged frame that leaves a VLAN-tagged port carries that priority as its PCP. Tested on an RTL8365MB-VC with eight queues. ETS scheduling and CPU-tag pre-classification will follow in separate series. Signed-off-by: Oleksij Rempel <[email protected]> Signed-off-by: Mieczyslaw Nalewaj <[email protected]>
This series (15 patches) extends the existing family C (RTL8365MB/RTL8367S/RTL8367SB/RTL8367RB-VB) driver with a new family D branch. Family C's functional behaviour is unchanged. Patches: - dt-bindings: net: dsa: realtek: add RTL8367S-VB - net: dsa: realtek: rtl8365mb: add chip family infrastructure - net: dsa: realtek: rtl8365mb: refactor forcemode handling - net: dsa: realtek: rtl8365mb: set speed for family D - net: dsa: realtek: rtl8365mb: set RGMII mode for family D - net: dsa: realtek: rtl8365mb: refactor VLAN 4k handling - net: dsa: realtek: rtl8365mb: set and get VLAN 4k for family D - net: dsa: realtek: rtl8365mb: refactor PVID handling - net: dsa: realtek: rtl8365mb: use raw VID for PVID on family D - net: dsa: realtek: rtl8365mb: add family D SDS13 PCS support - net: dsa: realtek: rtl8365mb: refactor L2 MAC handling - net: dsa: realtek: rtl8365mb: make L2/LUT access work on family D - net: dsa: realtek: rtl8365mb: refactor QoS priority handling - net: dsa: realtek: rtl8365mb: use PCP numbering on family D - net: dsa: realtek: rtl8365mb: add support for RTL8367S-VB Signed-off-by: Mieczyslaw Nalewaj <[email protected]>
Refresh the rtl8365mb hunk to match the current 6.18 tree. No functional change. Signed-off-by: Mieczyslaw Nalewaj <[email protected]>
- phylink configures the PCS only at ndo_open, until then the UNIPHY keeps the bootloader mode - MR80X v2 u-boot hands over in SGMII (MODE_CTRL 0x421, MISC2 0x70) while the board runs the trunk at 2500base-x - the RTL8367S CPU port brings its SerDes up at DSA setup, 2 s before the first open, and trains its receiver against the wrong line rate - CPU port dead or FCS errors on 18 of 51 boots, 0 of 32 with the mode sequence run from pcs_init - add qca_uniphy_pcs_preconfig() and call it from dwmac-ipq5018 with the DT phy-mode; pcs_config at open then hits the mode cache Signed-off-by: Johan Alvarado <[email protected]>
b6ee28b to
29bd28f
Compare
This series (14 patches) extends the existing family C (RTL8365MB/RTL8367S/RTL8367SB/RTL8367RB-VB) driver with a new
family D branch. Family C's functional behaviour is unchanged.
Patches: