netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Marvell Phy (1510) issue since v4.7 kernel
@ 2017-01-09 22:38 Murali Karicheri
  2017-01-09 22:56 ` Andrew Lunn
  0 siblings, 1 reply; 21+ messages in thread
From: Murali Karicheri @ 2017-01-09 22:38 UTC (permalink / raw)
  To: Andrew Lunn, netdev; +Cc: Kwok, WingMan

Hello Charles-Antoine, Andrew,

We have recently upgraded our kernel to v4.9 and started seeing an issue
on our Keystone EVMs (K2E/L) that uses Marvel Phy 1510. The issue is that
when we do a reboot command from the Linux console or do a SoC reset,
the DHCP times out at U-Boot due to Phy auto negotiation failure. This works
fine when the board is power cycled.

This is traced back to v4.7 where following commits were introduced:-

3758be3dc162b56ea Marvell phy: add functions to suspend and resume both interfaces: fiber and copper links.
78301ebe9b5a2645d Marvell phy: add configuration of autonegociation for fiber link.
2170fef78a400ca3c Marvell phy: add field to get errors from fiber link.
6cfb3bcc064110995 Marvell phy: check link status in case of fiber link 

Specifically the commit 6cfb3bcc0641109951a124019cd2e0623107d18d which changed
the marvell_read_status() behavior

Once we add the below HACK, this works fine.

commit e5bd8bfe7f544df03772c094331bb27e1a5a5600
Author: Murali Karicheri <m-karicheri2@ti.com>
Date:   Fri Jan 6 12:22:13 2017 -0500

    TEMP: work around in marvel Phy driver for u-boot dhcp timeout
    
    Signed-off-by: Murali Karicheri <m-karicheri2@ti.com>

diff --git a/drivers/net/phy/marvell.c b/drivers/net/phy/marvell.c
index c2dcf02..e91bdd3 100644
--- a/drivers/net/phy/marvell.c
+++ b/drivers/net/phy/marvell.c
@@ -1194,7 +1194,7 @@ static int marvell_read_status(struct phy_device *phydev)
        int err;
 
        /* Check the fiber mode first */
-       if (phydev->supported & SUPPORTED_FIBRE) {
+       if (!(phydev->supported & SUPPORTED_FIBRE)) {
                err = phy_write(phydev, MII_MARVELL_PHY_PAGE, MII_M1111_FIBER);
                if (err < 0)
                        goto error;


Also we see comments/logic in the code that contradicts with each other

For example in marvell_read_status(), it says "Check the fiber mode first and
uses the logic 
     if (phydev->supported & SUPPORTED_FIBRE)

Where as in  marvell_resume() comment says 'Resume the fiber mode first' and
uses the logic 

     if (!(phydev->supported & SUPPORTED_FIBRE))

Both are not symmetrical. Could you please explain?

-- 
Murali Karicheri
Linux Kernel, Keystone

^ permalink raw reply related	[flat|nested] 21+ messages in thread

end of thread, other threads:[~2017-01-12 22:50 UTC | newest]

Thread overview: 21+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-01-09 22:38 Marvell Phy (1510) issue since v4.7 kernel Murali Karicheri
2017-01-09 22:56 ` Andrew Lunn
2017-01-09 23:48   ` Kwok, WingMan
2017-01-09 23:55     ` Andrew Lunn
2017-01-10  1:37       ` Kwok, WingMan
2017-01-10  1:53         ` Andrew Lunn
2017-01-11 22:18           ` Kwok, WingMan
2017-01-11 22:27             ` Andrew Lunn
2017-01-11 22:32               ` Kwok, WingMan
2017-01-11 22:41               ` Kwok, WingMan
2017-01-11 22:59                 ` Andrew Lunn
2017-01-11 23:09                   ` Kwok, WingMan
2017-01-11 23:22                     ` Andrew Lunn
2017-01-12  0:31                       ` Kwok, WingMan
2017-01-12  1:06                         ` Andrew Lunn
2017-01-12 21:31                           ` Kwok, WingMan
2017-01-12 21:41                             ` Russell King - ARM Linux
2017-01-12 22:40                               ` Kwok, WingMan
2017-01-12 21:49                             ` Andrew Lunn
2017-01-12 22:31                               ` Russell King - ARM Linux
2017-01-12 22:49                               ` Kwok, WingMan

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).