netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Chris Packham <Chris.Packham@alliedtelesis.co.nz>
To: Russell King - ARM Linux admin <linux@armlinux.org.uk>
Cc: Marek Behun <marek.behun@nic.cz>, Andrew Lunn <andrew@lunn.ch>,
	"vivien.didelot@gmail.com" <vivien.didelot@gmail.com>,
	"f.fainelli@gmail.com" <f.fainelli@gmail.com>,
	"olteanv@gmail.com" <olteanv@gmail.com>,
	"davem@davemloft.net" <davem@davemloft.net>,
	"kuba@kernel.org" <kuba@kernel.org>,
	"netdev@vger.kernel.org" <netdev@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH v3 1/3] net: dsa: mv88e6xxx: Don't force link when using in-band-status
Date: Wed, 21 Oct 2020 02:20:19 +0000	[thread overview]
Message-ID: <93761179-236f-c923-4b1f-1f85e531f98f@alliedtelesis.co.nz> (raw)
In-Reply-To: <20201020211814.GG1551@shell.armlinux.org.uk>


On 21/10/20 10:18 am, Russell King - ARM Linux admin wrote:
> On Tue, Oct 20, 2020 at 09:06:32PM +0000, Chris Packham wrote:
>> On 21/10/20 3:51 am, Marek Behun wrote:
>>> On Tue, 20 Oct 2020 15:15:25 +0100
>>> Russell King - ARM Linux admin <linux@armlinux.org.uk> wrote:
>>>
>>>> On Tue, Oct 20, 2020 at 04:05:35PM +0200, Andrew Lunn wrote:
>>>>> On Tue, Oct 20, 2020 at 03:49:40PM +0200, Marek Behun wrote:
>>>>>> On Tue, 20 Oct 2020 11:15:52 +0100
>>>>>> Russell King - ARM Linux admin <linux@armlinux.org.uk> wrote:
>>>>>>     
>>>>>>> On Tue, Oct 20, 2020 at 04:45:56PM +1300, Chris Packham wrote:
>>>>>>>> When a port is configured with 'managed = "in-band-status"' don't force
>>>>>>>> the link up, the switch MAC will detect the link status correctly.
>>>>>>>>
>>>>>>>> Signed-off-by: Chris Packham <chris.packham@alliedtelesis.co.nz>
>>>>>>>> Reviewed-by: Andrew Lunn <andrew@lunn.ch>
>>>>>>> I thought we had issues with the 88E6390 where the PCS does not
>>>>>>> update the MAC with its results. Isn't this going to break the
>>>>>>> 6390? Andrew?
>>>>>>>     
>>>>>> Russell, I tested this patch on Turris MOX with 6390 on port 9 (cpu
>>>>>> port) which is configured in devicetree as 2500base-x, in-band-status,
>>>>>> and it works...
>>>>>>
>>>>>> Or will this break on user ports?
>>>>> User ports is what needs testing, ideally with an SFP.
>>>>>
>>>>> There used to be explicit code which when the SERDES reported link up,
>>>>> the MAC was configured in software with the correct speed etc. With
>>>>> the move to pcs APIs, it is less obvious how this works now, does it
>>>>> still software configure the MAC, or do we have the right magic so
>>>>> that the hardware updates itself.
>>>> It's still there. The speed/duplex etc are read from the serdes PHY
>>>> via mv88e6390_serdes_pcs_get_state(). When the link comes up, we
>>>> pass the negotiated link parameters read from there to the link_up()
>>>> functions. For ports where mv88e6xxx_port_ppu_updates() returns false
>>>> (no external PHY) we update the port's speed and duplex setting and
>>>> (currently, before this patch) force the link up.
>>>>
>>>> That was the behaviour before I converted the code, the one that you
>>>> referred to. I had assumed the code was correct, and _none_ of the
>>>> speed, duplex, nor link state was propagated from the serdes PCS to
>>>> the port on the 88E6390 - hence why the code you refer to existed.
>>>>
>>> Russell, you are right.
>>> SFP on 88E6390 does not work with this patch applied.
>>> So this patch breaks 88E6390.
>> Thanks for testing. It sounds like maybe if I make
>> mv88e6xxx_port_ppu_updates() return true for the 6097 in serdes mode I
>> can avoid the forced link up without affecting the 6390.
> Another option would be to make mv88e6xxx_mac_link_up() call a
> switch specific implementation function, which is probably way
> cleaner than introducing conditionals on the switch type in
> functions, and reflects the existing code structure.

I've spent most of the day plumbing in the serdes interrupts. And while 
I have that working I think even with interrupts I still have the 
problem that on the 88E6097 and similar there is no separation of PCS 
from the MAC so I'd have to do something like this anyway.

So I'll probably look at making the body of mv88e6xxx_mac_link_up a 
switch specific function.

  reply	other threads:[~2020-10-21  2:20 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-20  3:45 [PATCH v3 0/3] net: dsa: mv88e6xxx: serdes link without phy Chris Packham
2020-10-20  3:45 ` [PATCH v3 1/3] net: dsa: mv88e6xxx: Don't force link when using in-band-status Chris Packham
2020-10-20 10:15   ` Russell King - ARM Linux admin
2020-10-20 13:49     ` Marek Behun
2020-10-20 14:05       ` Andrew Lunn
2020-10-20 14:15         ` Russell King - ARM Linux admin
2020-10-20 14:51           ` Marek Behun
2020-10-20 14:58             ` Andrew Lunn
2020-10-20 21:04               ` Chris Packham
2020-10-20 21:15                 ` Andrew Lunn
2020-10-20 21:06             ` Chris Packham
2020-10-20 21:18               ` Russell King - ARM Linux admin
2020-10-21  2:20                 ` Chris Packham [this message]
2020-10-20  3:45 ` [PATCH v3 2/3] net: dsa: mv88e6xxx: Support serdes ports on MV88E6097/6095/6185 Chris Packham
2020-10-20  3:45 ` [PATCH v3 3/3] net: dsa: mv88e6xxx: Support serdes ports on MV88E6123/6131 Chris Packham
2020-10-20 10:18   ` Russell King - ARM Linux admin
2020-10-20 21:24     ` Chris Packham
2020-10-20 21:34       ` Russell King - ARM Linux admin

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=93761179-236f-c923-4b1f-1f85e531f98f@alliedtelesis.co.nz \
    --to=chris.packham@alliedtelesis.co.nz \
    --cc=andrew@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=f.fainelli@gmail.com \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@armlinux.org.uk \
    --cc=marek.behun@nic.cz \
    --cc=netdev@vger.kernel.org \
    --cc=olteanv@gmail.com \
    --cc=vivien.didelot@gmail.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).