net: dsa: fix oops while probing Marvell DSA switches
Subsystems (3)
PATCH 1/1 net: dsa: fix oops while probing Marvell DSA switches
Fix an oops in dsa_port_phylink_mac_change() caused by a combination of a20f997010c4 ("net: dsa: Don't instantiate phylink for CPU/DSA ports unless needed") and the net-dsa-improve-serdes-integration series of patches 65b7a2c8e369 ("Merge branch 'net-dsa-improve-serdes-integration'").
Unable to handle kernel NULL pointer dereference at virtual address 00000124 pgd = c0004000 [00000124] *pgd=00000000 Internal error: Oops: 805 [#1] SMP ARM Modules linked in: tag_edsa spi_nor mtd xhci_plat_hcd mv88e6xxx(+) xhci_hcd armada_thermal marvell_cesa dsa_core ehci_orion libdes phy_armada38x_comphy at24 mcp3021 sfp evbug spi_orion sff mdio_i2c CPU: 1 PID: 214 Comm: irq/55-mv88e6xx Not tainted 5.6.0+ #470 Hardware name: Marvell Armada 380/385 (Device Tree) PC is at phylink_mac_change+0x10/0x88 LR is at mv88e6352_serdes_irq_status+0x74/0x94 [mv88e6xxx]
---
This problem only exists when the above patch and series are merged together.
net/dsa/slave.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
net/dsa/slave.c +2 -1
@@ -1245,7 +1245,8 @@ void dsa_port_phylink_mac_change(struct dsa_switch *ds, int port, bool up) {const struct dsa_port *dp =dsa_to_port (ds, port); -phylink_mac_change (dp->pl, up); +if (dp->pl) +phylink_mac_change (dp->pl, up); }EXPORT_SYMBOL_GPL (dsa_port_phylink_mac_change);
Signature · 1 line
2.20.1
Quoted 16 lines · Russell King
Fix an oops in
dsa_port_phylink_mac_change()caused by a combination ofa20f997010c4("net: dsa: Don't instantiate phylink for CPU/DSA ports unless needed") and the net-dsa-improve-serdes-integration series of patches65b7a2c8e369("Merge branch 'net-dsa-improve-serdes-integration'").Unable to handle kernel NULL pointer dereference at virtual address 00000124 pgd = c0004000 [00000124] *pgd=00000000 Internal error: Oops: 805 [#1] SMP ARM Modules linked in: tag_edsa spi_nor mtd xhci_plat_hcd mv88e6xxx(+) xhci_hcd armada_thermal marvell_cesa dsa_core ehci_orion libdes phy_armada38x_comphy at24 mcp3021 sfp evbug spi_orion sff mdio_i2c CPU: 1 PID: 214 Comm: irq/55-mv88e6xx Not tainted 5.6.0+ #470 Hardware name: Marvell Armada 380/385 (Device Tree) PC is at phylink_mac_change+0x10/0x88 LR is at mv88e6352_serdes_irq_status+0x74/0x94 [mv88e6xxx]
Quoted 1 line
Signed-off-by Russell King <[email protected]>
From: Russell King <[email protected]>
Date: Tue, 31 Mar 2020 15:17:36 +0100
Quoted 16 lines
Fix an oops in
dsa_port_phylink_mac_change()caused by a combination ofa20f997010c4("net: dsa: Don't instantiate phylink for CPU/DSA ports unless needed") and the net-dsa-improve-serdes-integration series of patches65b7a2c8e369("Merge branch 'net-dsa-improve-serdes-integration'").Unable to handle kernel NULL pointer dereference at virtual address 00000124 pgd = c0004000 [00000124] *pgd=00000000 Internal error: Oops: 805 [#1] SMP ARM Modules linked in: tag_edsa spi_nor mtd xhci_plat_hcd mv88e6xxx(+) xhci_hcd armada_thermal marvell_cesa dsa_core ehci_orion libdes phy_armada38x_comphy at24 mcp3021 sfp evbug spi_orion sff mdio_i2c CPU: 1 PID: 214 Comm: irq/55-mv88e6xx Not tainted 5.6.0+ #470 Hardware name: Marvell Armada 380/385 (Device Tree) PC is at phylink_mac_change+0x10/0x88 LR is at mv88e6352_serdes_irq_status+0x74/0x94 [mv88e6xxx]
Quoted 1 line
Signed-off-by Russell King <[email protected]>
Applied, thanks.