All of lore.kernel.org
 help / color / mirror / Atom feed
From: Zefir Kurtisi <zefir.kurtisi@neratec.com>
To: Timur Tabi <timur@codeaurora.org>, netdev@vger.kernel.org
Cc: andrew@lunn.ch, f.fainelli@gmail.com
Subject: Re: [PATCH 2/2] at803x: double check SGMII side autoneg
Date: Thu, 19 Jan 2017 10:43:48 +0100	[thread overview]
Message-ID: <759d6323-ffac-ebe8-b197-4e1165be5673@neratec.com> (raw)
In-Reply-To: <7d61d23d-60f5-a77e-42ad-fccf6e8d5878@codeaurora.org>

On 01/18/2017 04:02 PM, Timur Tabi wrote:
> On 01/18/2017 07:53 AM, Zefir Kurtisi wrote:
>> No, not necessarily. The SGMII link default configuration is set such that you do
>> not have to bother at all.
> 
> Does the SGMII link need to make the speed and duplex of the external link?
> 
> https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/tree/drivers/net/ethernet/qualcomm/emac/emac-sgmii.c#n50
> 
> 
> Here is where I can configure the SGMII link to match whatever phydev says the
> external link is.  This is code that was handed down to me.  I've never really
> understood what the purpose was.  Shouldn't I just be able to configure the SGMII
> link to 1Gbs full-duplex, regardless of what the external link is set to?
> 

This is because the SGMII link is a transparent interface to the upper layer with
no means to inform the other side of the link type in the lower layer.

It always operates at 675MHz, which with two lines gives 1.25Gbps, which at 10/8
coding gives exactly 1Gbps net data rate. If the at803x's copper side
autonegotiates to 1Gbps, the bits traversing over the SGMII match the copper side
1:1. In case the copper side autonegotiates to e.g. 100Mbps, each bit at the
copper side on the SGMII bus is replicated and sent 10x times - or 100x times in
case of 10Mbps. The MAC side of the ETH needs to be aware of how the SGMII data
has to be interpreted, and this is why you have to set the bits you are referring to.

>> That is, if in your case you see the warning popping up but the link always
>> regains connection, then it is an ignorable false positive.
> 
> Unfortunately, I can't really ignore it because genphy does this:
> 
> $ ifup eth1
> [ 1034.754276] qcom-emac QCOM8070:00 eth1: Link is Up - 1Gbps/Full - flow control
> rx/tx
> 
> But the at803x driver does this:
> 
> $ ifup eth1
> [ 1020.507728] 803x_aneg_done: SGMII link is not ok
> [ 1020.513517] qcom-emac QCOM8070:00 eth1: Link is Up - 1Gbps/Full - flow control
> rx/tx
> [ 1020.522839] qcom-emac QCOM8070:00 eth1: Link is Up - 1Gbps/Full - flow control
> rx/tx
> 
> Customers are going to complain.
> 
Yes, the double link-status message is annoying - I was referring to the other
message.

To track down who is causing the additional message, I would proceed with
following technique that helped me dig down a similar problem: since you control
the events in question and there is no risk of flooding the kernel log, in the top
of phy.c::phy_print_status() add a dump_stack() call. In the debug log ensure that
all of the traces end up in the same phydev->adjust_link() callback handler (in
your case emac_adjust_link()).

In the gianfar's handler there is an additional check whether the link really
changed before phy_print_status() is called, in emac_adjust_link() this happens
unconditionally - maybe that is the problem you are facing.

@Florian: is it safe to assume that when phydev->adjust_link() is called there was
in fact a link change (link, duplex, pause), or does the handler have to double
check for a change? I see some ETH drivers maintain a private old state instance
for that, while others don't.


Cheers,
Zefir

  reply	other threads:[~2017-01-19  9:54 UTC|newest]

Thread overview: 46+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-10-24 10:40 [PATCH 0/2] at803x: don't power-down SGMII link Zefir Kurtisi
2016-10-24 10:40 ` [PATCH 1/2] Revert "at803x: fix suspend/resume for SGMII link" Zefir Kurtisi
2016-10-27 20:05   ` David Miller
2016-10-24 10:40 ` [PATCH 2/2] at803x: double check SGMII side autoneg Zefir Kurtisi
2016-10-27 20:05   ` David Miller
2016-10-28 22:24   ` Timur Tabi
2016-11-01 11:13     ` Zefir Kurtisi
2017-01-17 23:32   ` Timur Tabi
2017-01-18 11:00     ` Zefir Kurtisi
2017-01-18 13:13       ` Timur Tabi
2017-01-18 13:53         ` Zefir Kurtisi
2017-01-18 15:02           ` Timur Tabi
2017-01-19  9:43             ` Zefir Kurtisi [this message]
2017-01-19 18:01               ` Florian Fainelli
2017-01-20  2:38               ` Timur Tabi
2017-01-20 15:31                 ` Zefir Kurtisi
2017-05-22 20:12   ` Timur Tabi
2017-05-22 21:02     ` Andrew Lunn
2017-05-22 21:10       ` Florian Fainelli
2017-05-22 21:19         ` Timur Tabi
2017-05-22 21:50           ` Florian Fainelli
2017-05-22 21:09     ` Andrew Lunn
2017-05-22 21:29       ` Timur Tabi
2017-05-22 21:32         ` Andrew Lunn
2017-05-23 15:54           ` Timur Tabi
2017-05-23 16:07             ` Andrew Lunn
2017-05-23 16:33               ` Timur Tabi
2017-05-24  7:18                 ` Matthias May
2017-05-24 13:29                   ` Timur Tabi
2017-05-24 13:40                     ` Andrew Lunn
2017-05-24 13:48                       ` Timur Tabi
2017-05-24 14:09                         ` Andrew Lunn
2017-05-24 18:58                           ` Timur Tabi
2017-05-24 19:34                             ` Andrew Lunn
2017-05-24 20:57                               ` Timur Tabi
2017-05-24 21:15                                 ` Andrew Lunn
2017-05-24 21:20                                   ` Timur Tabi
2017-05-24 21:28                                     ` Florian Fainelli
2017-05-24 21:32                                       ` Timur Tabi
2017-05-24 21:36                                         ` Florian Fainelli
2017-05-24 22:03                                           ` Timur Tabi
2017-05-24 21:19                                 ` Florian Fainelli
2017-06-01 11:45                     ` Zefir Kurtisi
2017-06-01 14:48                       ` Timur Tabi
2016-10-25 17:31 ` [PATCH 0/2] at803x: don't power-down SGMII link Timur Tabi
2016-10-27  8:05   ` Zefir Kurtisi

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=759d6323-ffac-ebe8-b197-4e1165be5673@neratec.com \
    --to=zefir.kurtisi@neratec.com \
    --cc=andrew@lunn.ch \
    --cc=f.fainelli@gmail.com \
    --cc=netdev@vger.kernel.org \
    --cc=timur@codeaurora.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.