Commit 2842a48d authored by mara's avatar mara

[ 46.782700] rk_gmac-dwmac fe300000.ethernet: IRQ eth_wake_irq not found

[   46.783587] rk_gmac-dwmac fe300000.ethernet: IRQ eth_lpi not found
[   46.786303] rk_gmac-dwmac fe300000.ethernet: cannot get clock clk_mac_speed
[   46.857181] brcmfmac: brcmf_fw_alloc_request: using brcm/brcmfmac43456-sdio for chip BCM4345/9
[   46.967716] brcmfmac: brcmf_fw_alloc_request: using brcm/brcmfmac43456-sdio for chip BCM4345/9
[   46.979062] brcmfmac: brcmf_c_preinit_dcmds: Firmware: BCM4345/9 wl0: Jun 16 2017 12:38:26 version 7.45.96.2 (66c4e21@sh-git) (r) FWID 01-1813af84
[   52.161439] Unable to handle kernel NULL pointer dereference at virtual address 0000000000000378
[   52.162330] Mem abort info:
[   52.162602]   ESR = 0x96000006
[   52.162889]   EC = 0x25: DABT (current EL), IL = 32 bits
[   52.163379]   SET = 0, FnV = 0
[   52.163662]   EA = 0, S1PTW = 0
[   52.163953] Data abort info:
[   52.166148]   ISV = 0, ISS = 0x00000006
[   52.168087]   CM = 0, WnR = 0
[   52.170166] user pgtable: 4k pages, 48-bit VAs, pgdp=00000000e65c2000
[   52.172390] [0000000000000378] pgd=00000000f0c65003, pud=00000000ec8dd003, pmd=0000000000000000
[   52.174924] Internal error: Oops: 96000006 [#1] PREEMPT SMP
[   52.176973] Modules linked in: r8188eu(C) lib80211 brcmfmac rockchip_rga brcmutil v4l2_mem2mem panfrost videobuf2_dma_sg gpu_sched videobuf2_memops videobuf2_vk
[   52.182227] CPU: 4 PID: 689 Comm: ip Tainted: G         C        5.4.7+ #1
[   52.184516] Hardware name: Radxa ROCK Pi 4 (DT)
[   52.186581] pstate: 00000005 (nzcv daif -PAN -UAO)
[   52.188657] pc : mdiobus_get_phy+0x4/0x20
[   52.190669] lr : stmmac_open+0x7a0/0xa60 [stmmac]
[   52.192729] sp : ffff8000133032f0
[   52.194693] x29: ffff8000133032f0 x28: ffff0000ed1ec8c0
[   52.196815] x27: ffff0000ed1ec000 x26: ffff800008e020a0
[   52.198927] x25: 0000000000000001 x24: 0000000000000000
[   52.201064] x23: 0000000000001002 x22: ffff800008e020a0
[   52.203191] x21: ffff800013303ac0 x20: ffff0000ed1ec000
[   52.205325] x19: 00000000ffffffff x18: 0000000000000000
[   52.207447] x17: 0000000000000000 x16: 0000000000000000
[   52.209550] x15: 0000000000000000 x14: 0000000000000000
[   52.211659] x13: 0000000000000000 x12: 0000000000000000
[   52.213745] x11: 0000000000000003 x10: 0101010101010101
[   52.215820] x9 : fffffffffffffff9 x8 : 7f7f7f7f7f7f7f7f
[   52.217889] x7 : fefefeff646c606d x6 : 1e091448e4e5f6e9
[   52.219935] x5 : 697665644814091e x4 : 8080808000000000
[   52.221940] x3 : 8343c96b232bb348 x2 : ffff0000f02f9480
[   52.223927] x1 : fffffffffffffff8 x0 : 0000000000000000
[   52.225888] Call trace:
[   52.227622]  mdiobus_get_phy+0x4/0x20
[   52.229466]  __dev_open+0xe4/0x160
[   52.231257]  __dev_change_flags+0x160/0x1b8
[   52.233109]  dev_change_flags+0x20/0x60
[   52.234928]  do_setlink+0x5b0/0xbd0
[   52.236713]  __rtnl_newlink+0x3e0/0x6e0
[   52.238521]  rtnl_newlink+0x48/0x70
[   52.240271]  rtnetlink_rcv_msg+0x11c/0x368
[   52.242080]  netlink_rcv_skb+0x54/0x110
[   52.243900]  rtnetlink_rcv+0x14/0x20
[   52.245680]  netlink_unicast+0x174/0x200
[   52.247484]  netlink_sendmsg+0x178/0x318
[   52.249285]  ____sys_sendmsg+0x240/0x280
[   52.251083]  ___sys_sendmsg+0x80/0xd8
[   52.252847]  __sys_sendmsg+0x64/0xb8
[   52.254579]  __arm64_sys_sendmsg+0x20/0x28
[   52.256363]  el0_svc_common.constprop.0+0x6c/0x178
[   52.258203]  el0_svc_handler+0x20/0x80
[   52.259949]  el0_svc+0x8/0xc
[   52.261623] Code: 97ffffb0 a8c17bfd d65f03c0 8b21cc01 (f941c020)
[   52.263554] ---[ end trace 6288edcca8512e8e ]---

fix mdiobus_get_phy
parent 5a7d77c0
......@@ -7,7 +7,7 @@ SERIAL_CONSOLE=ttyS1
DDR=rk3399_ddr_800MHz_v1.24.bin
MINI_LOADER=rk3399_miniloader_v1.22.bin
BLOB_LOADER=rk3399_loader_v1.24.122.bin
BL31=rk3399_bl31_v1.31.elf
BL31=rk3399_bl31_v1.32.elf
BL32=rk3399_bl32_v1.21.bin
......
> Date: Thu, 19 Dec 2019 15:47:01 +0530
>
> > The current implementation of "stmmac_dt_phy" function initializes
> > the MDIO platform bus data, even in the absence of PHY. This fix
> > will skip MDIO initialization if there is no PHY present.
> >
> > Fixes: 7437127 ("net: stmmac: Convert to phylink and remove phylib logic")
> > Acked-by: Jayati Sahu <jayati.sahu@samsung.com>
> > Signed-off-by: Sriram Dash <sriram.dash@samsung.com>
> > Signed-off-by: Padmanabhan Rajanbabu <p.rajanbabu@samsung.com>
>
> Applied and queued up for -stable, thanks.
with this patch applied I now run into issues on multiple rockchip
platforms using a gmac interface.
When probing the driver and trying to establish a connection for a nfsroot
it always runs into a null pointer in mdiobus_get_phy():
[ 26.878839] rk_gmac-dwmac ff360000.ethernet: IRQ eth_wake_irq not found
[ 26.886322] rk_gmac-dwmac ff360000.ethernet: IRQ eth_lpi not found
[ 26.894505] rk_gmac-dwmac ff360000.ethernet: PTP uses main clock
[ 26.908209] rk_gmac-dwmac ff360000.ethernet: clock input or output? (output).
[ 26.916269] rk_gmac-dwmac ff360000.ethernet: Can not read property: tx_delay.
[ 26.924297] rk_gmac-dwmac ff360000.ethernet: set tx_delay to 0x30
[ 26.931150] rk_gmac-dwmac ff360000.ethernet: Can not read property: rx_delay.
[ 26.939166] rk_gmac-dwmac ff360000.ethernet: set rx_delay to 0x10
[ 26.946021] rk_gmac-dwmac ff360000.ethernet: integrated PHY? (no).
[ 26.953032] rk_gmac-dwmac ff360000.ethernet: cannot get clock clk_mac_refout
[ 26.966161] rk_gmac-dwmac ff360000.ethernet: init for RMII
[ 26.972633] rk_gmac-dwmac ff360000.ethernet: User ID: 0x10, Synopsys ID: 0x35
[ 26.980830] rk_gmac-dwmac ff360000.ethernet: DWMAC1000
[ 26.986735] rk_gmac-dwmac ff360000.ethernet: DMA HW capability register supported
[ 26.995145] rk_gmac-dwmac ff360000.ethernet: RX Checksum Offload Engine supported
[ 27.003540] rk_gmac-dwmac ff360000.ethernet: COE Type 2
[ 27.009408] rk_gmac-dwmac ff360000.ethernet: TX Checksum insertion supported
[ 27.017320] rk_gmac-dwmac ff360000.ethernet: Wake-Up On Lan supported
[ 27.024577] rk_gmac-dwmac ff360000.ethernet: Normal descriptors
[ 27.031211] rk_gmac-dwmac ff360000.ethernet: Ring mode enabled
[ 27.037743] rk_gmac-dwmac ff360000.ethernet: Enable RX Mitigation via HW Watchdog Timer
[ 27.209823] Unable to handle kernel NULL pointer dereference at virtual address 0000000000000398
2IP-Config: eth0 hardware address 66:e4:9b:b1:30:c3 mtu 1500 DHCP
7.219681] Mem abort info:
[ 27.229322] ESR = 0x96000006
[ 27.229328] EC = 0x25: DABT (current EL), IL = 32 bits
[ 27.229330] SET = 0, FnV = 0
[ 27.229332] EA = 0, S1PTW = 0
[ 27.229334] Data abort info:
[ 27.229336] ISV = 0, ISS = 0x00000006
[ 27.229338] CM = 0, WnR = 0
[ 27.229342] user pgtable: 4k pages, 48-bit VAs, pgdp=000000003e7d4000
[ 27.229345] [0000000000000398] pgd=0000000036739003, pud=0000000035894003, pmd=0000000000000000
[ 27.273398] Internal error: Oops: 96000006 [#1] SMP
[ 27.273403] Modules linked in: smsc95xx smsc75xx ax88179_178a asix usbnet panel_leadtek_ltk500hd1829 dwmac_rk stmmac_platform stmmac rockchipdrm phy_rockchip_inno_dsidphy analogix_dp dw_hdmi cec r
c_core dw_mipi_dsi drm_kms_helper rtc_rk808 drm drm_panel_orientation_quirks
[ 27.305785] CPU: 3 PID: 1388 Comm: ipconfig Not tainted 5.5.0-rc4-00934-gd57e566e6874 #1463
[ 27.305790] Hardware name: Theobroma Systems Cobra with Leadtek Display (DT)
[ 27.323006] pstate: 40000005 (nZcv daif -PAN -UAO)
[ 27.323020] pc : mdiobus_get_phy+0x4/0x20
[ 27.332867] lr : stmmac_open+0x780/0xa78 [stmmac]
[ 27.332872] sp : ffff80001113b9a0
[ 27.341823] x29: ffff80001113b9a0 x28: 0000000000401003
[ 27.347761] x27: ffff00003d5cf200 x26: 0000000000000000
[ 27.353699] x25: 0000000000000001 x24: 0000000000000000
[ 27.359636] x23: 0000000000001002 x22: ffff800008b790a0
[ 27.365575] x21: ffff000035f84000 x20: 00000000ffffffff
[ 27.371513] x19: ffff000035f84800 x18: 0000000000000000
[ 27.377451] x17: 0000000000000000 x16: 0000000000000000
[ 27.383389] x15: 0000000000000000 x14: ffffffffffffffff
[ 27.389328] x13: 0000000000000020 x12: 0101010101010101
[ 27.395266] x11: 0000000000000003 x10: 0101010101010101
[ 27.401203] x9 : fffffffffffffffd x8 : 7f7f7f7f7f7f7f7f
[ 27.407143] x7 : fefefeff646c606d x6 : 1e091448e4e5f6e9
[ 27.413074] x5 : 697665644814091e x4 : 8080808000000000
[ 27.419013] x3 : 8343c96b232bb348 x2 : ffff00003d63f880
[ 27.424953] x1 : fffffffffffffff8 x0 : 0000000000000000
[ 27.430882] Call trace:
[ 27.433620] mdiobus_get_phy+0x4/0x20
[ 27.437715] __dev_open+0xe4/0x160
[ 27.441515] __dev_change_flags+0x160/0x1b8
[ 27.446191] dev_change_flags+0x20/0x60
[ 27.450478] devinet_ioctl+0x66c/0x738
[ 27.454666] inet_ioctl+0x2f4/0x360
[ 27.458565] sock_do_ioctl+0x44/0x2b0
[ 27.462657] sock_ioctl+0x1c8/0x508
[ 27.466556] do_vfs_ioctl+0x604/0xbd0
[ 27.470646] ksys_ioctl+0x78/0xa8
[ 27.474351] __arm64_sys_ioctl+0x1c/0x28
[ 27.478737] el0_svc_common.constprop.0+0x68/0x160
[ 27.484083] el0_svc_handler+0x20/0x80
[ 27.488273] el0_sync_handler+0x10c/0x180
[ 27.492753] el0_sync+0x140/0x180
[ 27.496462] Code: 97ffffb0 a8c17bfd d65f03c0 8b21cc01 (f941d020)
[ 27.503275] ---[ end trace 6f6ca54e66af6d48 ]---
With the expected output being normally at this point:
[ 18.575321] rk_gmac-dwmac ff360000.ethernet eth0: PHY [stmmac-0:00] driver [RTL8201F Fast Ethernet]
[ 18.602975] rk_gmac-dwmac ff360000.ethernet eth0: No Safety Features support found
[ 18.611505] rk_gmac-dwmac ff360000.ethernet eth0: PTP not supported by HW
[ 18.619117] rk_gmac-dwmac ff360000.ethernet eth0: configuring for phy/rmii link mode
[ 22.719478] rk_gmac-dwmac ff360000.ethernet eth0: Link is Up - 100Mbps/Full - flow control rx/tx
or
[ 27.326984] rk_gmac-dwmac ff360000.ethernet eth0: PHY [stmmac-0:00] driver [Generic PHY]
[ 27.353543] rk_gmac-dwmac ff360000.ethernet eth0: No Safety Features support found
[ 27.362055] rk_gmac-dwmac ff360000.ethernet eth0: PTP not supported by HW
[ 27.369663] rk_gmac-dwmac ff360000.ethernet eth0: configuring for phy/rmii link mode
[ 29.406784] rk_gmac-dwmac ff360000.ethernet eth0: Link is Up - 100Mbps/Full - flow control rx/tx
Do you mind trying this patch and letting me know if it works for you.
Sriram, please also try it on your platforms and let me know if solves
the problem you were after. Thanks
diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c
b/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c
index cc8d7e7bf9ac..e192b8e0809e 100644
--- a/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c
+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c
@@ -320,7 +320,7 @@
static int stmmac_dt_phy(struct plat_stmmacenet_data *plat,
struct device_node *np, struct device *dev)
{
- bool mdio = false;
+ bool mdio = true;
static const struct of_device_id need_mdio_ids[] = {
{ .compatible = "snps,dwc-qos-ethernet-4.10" },
{},
@@ -341,8 +341,9 @@
}
if (plat->mdio_node) {
- dev_dbg(dev, "Found MDIO subnode\n");
- mdio = true;
+ mdio = of_device_is_available(plat->mdio_node);
+ dev_dbg(dev, "Found MDIO subnode, status: %sabled\n",
+ mdio ? "en" : "dis");
}
if (mdio) {
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment