openwrt/package/kernel
Christian Marangi 8cce00bc9d
qca-ssdk: fix unsupported scenario with PORT1 not declared in switch bmp
Commit 947b44d9ae ("ipq807x: fix wrong define for LAN and WAN ess mask")
started fixing wrong switch_lan_bmp that defined lan there weren't
actually present. This displayed a fragility in the malibu phy init code
in qca-ssdk.

Add patch to fix this.

Quoting the patch detailed description:

I'm very confused by this and to me it's not clear the real usage of
this logic.

From what I can see the usage of this is EXTREMELY FRAGILE and results
in dangerous results if the OEM (or anyone that by chance try to
implement things in a logical manner) deviates from the default values
from the "magical template".

To be in more details. With QSDK 12.4, some tweaks were done to improve
autoneg and now on every call of port status, the phydev is tried to
add. This resulted in the call and log spam of an error with ports that
are actually not present on the system with qsdk reporting phydev is
NULL. This itself is not an error and printing the error is correct.

What is actually an error from ages is setting generic bitmap reporting
presence of port that are actually not present. This is very common on
OEM where the switch_lan_bmp is always a variant of 0x1e (that on bitmap
results in PORT1 PORT2 PORT3 PORT4 present) or 0x3e (PORT1 PORT2 PORT3
PORT4 PORT5). Reality is that many device are used as AP with one LAN
port or one WAN port. (or even exotic configuration with PORT1 not
present and PORT2 PORT3 PORT4 present (Xiaomi 3600)

With this finding one can say... ok nice, then lets update the DT and
set the correct bitmap...

Again world is a bad place and reality is that this cause wonderful
regression in some case of by extreme luck the first ever connected
port working and the rest of the switch dead.

The problem has been bisected to all the device that doesn't have the
PORT1 declared in any of the bitmap.

With this perfection in mind, on to the REAL problem.

malibu_phy_hw_init FOR SOME REASON, set a global variable first_phy_addr
to the first detected PHY addr that coincidentally is always PORT1.
PORT1 addr is 0x0. The entire code in malibu_phy use this variable to
derive the phy addrs in some function.

Declaring a bitmap where the PORT1 is missing (or worse PORT4 the only
one connected) result in first_phy_addr set to 1 or whatever phy addr is
detected first setting wrong value all over the init stage.

To fix this, just drop this variable and hardcode everything to assume
the first phy adrr is ALWAYS 0 and remove calculation and use define for
special case.

With the following change normal switch traffic is restored and ports
function is recovered.

Fixes: #13945
Fixes: 947b44d9ae ("ipq807x: fix wrong define for LAN and WAN ess mask")
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
2023-11-11 23:39:32 +01:00
..
ath10k-ct ath10k-ct: add patch fixing compilation error in debug 2023-11-03 04:10:03 +01:00
bcm27xx-gpu-fw
bcm63xx-cfe
bpf-headers bpf-headers: Fix download URL with kernel 6.1 2023-11-06 23:20:14 +01:00
broadcom-wl
button-hotplug
cryptodev-linux
dtc/patches
gpio-button-hotplug
gpio-nct5104d
lantiq ltq-vdsl-vr11-mei: fix compilation error with kernel 6.1 2023-08-27 19:26:53 +02:00
leds-ws2812b kernel: leds-ws2812b: fix build with Linux >= 5.18 2023-07-08 15:10:12 +01:00
linux packages: add needed packages for Mellanox Spectrum Switches 2023-10-31 21:12:15 +01:00
mac80211 mac80211: fix not set noscan option for wpa_supplicant 2023-11-09 15:58:34 +01:00
mt76 mt76: Add firmware package for MT7922 2023-10-29 22:39:16 +01:00
mt7621-qtn-rgmii
mwlwifi mwlwifi: fix 6.1 Kernel support 2023-08-10 16:34:07 +02:00
nat46
qca-nss-dp kernel: qca-nss-dp: port FDB roaming fix 2023-07-01 14:22:37 +02:00
qca-ssdk qca-ssdk: fix unsupported scenario with PORT1 not declared in switch bmp 2023-11-11 23:39:32 +01:00
rtc-rv5c386a
rtl8812au-ct rtl8812au-ct: Fix PKG_MIRROR_HASH 2023-10-02 13:01:35 +02:00
trelay
ubnt-ledbar ubnt-ledbar: depend on mediatek and ramips subtargets 2023-05-24 00:56:54 +02:00
ubootenv-nvram kernel: ubootenv-nvram: driver for RAM backed environments 2023-08-20 01:14:06 +02:00