netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Murali Karicheri <m-karicheri2@ti.com>
To: Andrew Lunn <andrew@lunn.ch>, <netdev@vger.kernel.org>
Cc: "Kwok, WingMan" <w-kwok2@ti.com>
Subject: Marvell Phy (1510) issue since v4.7 kernel
Date: Mon, 9 Jan 2017 17:38:39 -0500	[thread overview]
Message-ID: <587410EF.5090607@ti.com> (raw)

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

             reply	other threads:[~2017-01-09 22:39 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-01-09 22:38 Murali Karicheri [this message]
2017-01-09 22:56 ` Marvell Phy (1510) issue since v4.7 kernel 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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=587410EF.5090607@ti.com \
    --to=m-karicheri2@ti.com \
    --cc=andrew@lunn.ch \
    --cc=netdev@vger.kernel.org \
    --cc=w-kwok2@ti.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).