Thread (11 messages) flat view 11 messages, 8 authors, 2020-01-13

Re: [Linux-stm32] [PATCH] net: stmmac: platform: Fix MDIO init for platforms without PHY

From: Patrice CHOTARD <hidden>
Date: 2020-01-07 13:15:38
Also in: lkml, netdev, stable

Hi All

On 1/7/20 6:34 AM, Sriram Dash wrote:
quoted
From: Heiko Stübner <heiko@sntech.de>
Subject: Re: [PATCH] net: stmmac: platform: Fix MDIO init for platforms
without
quoted
PHY

Hi Florian,

Am Sonntag, 5. Januar 2020, 23:22:00 CET schrieb Florian Fainelli:
quoted
On 1/5/2020 12:43 PM, Heiko Stübner wrote:
quoted
Am Samstag, 21. Dezember 2019, 06:29:18 CET schrieb David Miller:
quoted
From: Padmanabhan Rajanbabu <redacted>
Date: Thu, 19 Dec 2019 15:47:01 +0530
quoted
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 <redacted>
Signed-off-by: Sriram Dash <redacted>
Signed-off-by: Padmanabhan Rajanbabu <redacted>
Applied and queued up for -stable, thanks.
with this patch applied I now run into issues on multiple rockchip
platforms using a gmac interface.
Do you have a list of DTS files that are affected by any chance? For
the 32-bit platforms that I looked it, it seems like:
Hi Florian, 
We have listed down the platforms which will break for as they don't have
the mdio / snps,dwmac-mdio node.
Arm32 spear* , Arm32 ox820*, arm32 rv1108, arc abilis* , arc axs10x*, arc
vdk_axs10x*, mips pistachio, arm64 rockchip/px30* There might be more
platforms.
STiH410-B2260 is affected by this patch, i proposed a fix for this board :

https://patchwork.kernel.org/project/linux-arm-kernel/list/?series=224639

David, will you applied this DT series in your tree ?

Thanks

Patrice

quoted
quoted
arch/arm/boot/dts/rk3228-evb.dts is OK because it has a MDIO bus node
arch/arm/boot/dts/rk3229-xms6.dts is also OK

arch/arm/boot/dts/rk3229-evb.dts is probably broken, there is no
phy-handle property or MDIO bus node, so it must be relying on
auto-scanning of the bus somehow that this patch broke.

And likewise for most 64-bit platforms except a1 and nanopi4.
I primarily noticed that on the px30-evb.dts and the internal board I'm
working
quoted
on right now. Both don't have that mdio bus node right now.

quoted
quoted
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
quoted
quoted
[   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).
... snip ...
quoted
quoted
quoted
This is torvalds git head and it was still working at -rc1 and all
kernels before that. When I just revert this commit, things also
start working again, so I guess something must be wrong here?
Yes, this was also identified to be problematic by the kernelci boot
farms on another platform, see [1].

[1]:
https://lore.kernel.org/linux-arm-kernel/5e0314da.1c69fb81.a7d63.29c1@
mx.google.com/

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
Works on both boards I had that were affected, so
Tested-by: Heiko Stuebner <heiko@sntech.de>
Nacked-by : Sriram Dash [off-list ref]
quoted
Thanks
Heiko
quoted
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_mtl_setup(struct platform_device
*pdev,  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 @@ static int stmmac_dt_phy(struct
plat_stmmacenet_data *plat,
        }

        if (plat->mdio_node) {
For the platforms which neither have mdio nor snps,dwmac-mdio property in
dt, they will not enter the block.
plat->mdio_node will always be false for them. Which, essentially, preserves
the mdio variable Boolean value defined at the start of the function.
quoted
quoted
-               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) {
There is a proposal for this problem solution. You can refer it at :
https://lkml.org/lkml/2020/1/7/14



_______________________________________________
Linux-stm32 mailing list
Linux-stm32@st-md-mailman.stormreply.com
https://st-md-mailman.stormreply.com/mailman/listinfo/linux-stm32
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help