From mboxrd@z Thu Jan 1 00:00:00 1970 From: John Rama Subject: Re: DSA: external phy address and port number of switch conflicts Date: Tue, 18 Dec 2018 13:55:50 -0500 Message-ID: <5C1942B6.8090506@gmail.com> References: <5C12F555.2070305@gmail.com> <5C18294E.1050105@gmail.com> <631866cf-f419-68ac-3519-d090f0096ca0@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit To: Florian Fainelli , netdev@vger.kernel.org, Andrew Lunn , Vivien Didelot Return-path: Received: from mail-it1-f194.google.com ([209.85.166.194]:39395 "EHLO mail-it1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726536AbeLRSzw (ORCPT ); Tue, 18 Dec 2018 13:55:52 -0500 Received: by mail-it1-f194.google.com with SMTP id a6so5709644itl.4 for ; Tue, 18 Dec 2018 10:55:51 -0800 (PST) In-Reply-To: <631866cf-f419-68ac-3519-d090f0096ca0@gmail.com> Sender: netdev-owner@vger.kernel.org List-ID: Hi Florian, On 2018/12/17 18:03, Florian Fainelli wrote: > On 12/17/18 2:55 PM, John Rama wrote: >> Hi, Andrew, Florian and Viven >> >> thank you your feedback !! >> >>>> I would recommend checking a newer kernel anyway which would have >>>> support for the mv88e6xxx internal MDIO bus as it might allow you to >>>> solve that specific problem. A kernel that contains >>>> a3c53be55c955b7150cda17874c3fcb4eeb97a89 ("net: dsa: mv88e6xxx: Support >>>> multiple MDIO busses") might work better and actually help here, though >>>> I don't know enough about that specific switch model, Andrew or Vivien >>>> would. >>>> >>>>> >> >> I tried with kernel 4.9.0, and confirmed that same problem happens. >> (I wanted to try more latest one, but newer version is using phylink, >> which I need couple of time to understand how it works) >> I think this is not the driver side issue, maybe dsa side (but not sure for newer kernel) >> or I misunderstanding some concept. >> >>> Since you have the switch in single address mode, i don't see why this >>> should not work. >> >> Why conflicts happens is because of the code at slave.c (@kernel 4.9.0) >> >> /* pseudo code */ >> dsa_slave_phy_setup() { >> phy_dn = of_parse_phandle(port_dn, "phy-handle", 0); >> if (phy_dn) { >> phy_id = of_mdio_parse_addr(&slave_dev->dev, phy_dn); >> dsa_slave_phy_connect(p, slave_dev, phy_id); <= register with phy_id >> } >> if (!p->phy) { >> dsa_slave_phy_connect(p, slave_dev, p->port); <= register with port number >> } >> } > > That was later fixed with this commit: > > https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=399ba77a94e1ee01f747b168c429a121164ac962 > > can you try to backport that change and see if that helps? > Yes, that's the one !! I confirmed that the problem is solved by backporting this patch to both kernel 4.9.0 and 4.1.15. Thanks a lot. John