linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Ioana Ciornei <ioana.ciornei@nxp.com>
To: Vladimir Oltean <olteanv@gmail.com>,
	Florian Fainelli <f.fainelli@gmail.com>
Cc: netdev <netdev@vger.kernel.org>,
	Russell King <rmk+kernel@armlinux.org.uk>,
	Andrew Lunn <andrew@lunn.ch>,
	Vivien Didelot <vivien.didelot@gmail.com>,
	"David S. Miller" <davem@davemloft.net>,
	open list <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH net-next] net: dsa: Deal with non-existing PHY/fixed-link
Date: Mon, 10 Jun 2019 20:49:59 +0000	[thread overview]
Message-ID: <VI1PR0402MB2800ED1A422B900F63561F9CE0130@VI1PR0402MB2800.eurprd04.prod.outlook.com> (raw)
In-Reply-To: CA+h21hrcymxF7zk4yHFGhjxbLERTCU6WkfzLGQVoZ5Yxoo4xxw@mail.gmail.com

On 6/10/19 10:53 PM, Vladimir Oltean wrote:
> On Mon, 10 Jun 2019 at 22:31, Florian Fainelli <f.fainelli@gmail.com> wrote:
>>
>> We need to specifically deal with phylink_of_phy_connect() returning
>> -ENODEV, because this can happen when a CPU/DSA port does connect
>> neither to a PHY, nor has a fixed-link property. This is a valid use
>> case that is permitted by the binding and indicates to the switch:
>> auto-configure port with maximum capabilities.
>>
>> Fixes: 0e27921816ad ("net: dsa: Use PHYLINK for the CPU/DSA ports")
>> Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
>> ---
>>   net/dsa/port.c | 2 +-
>>   1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/net/dsa/port.c b/net/dsa/port.c
>> index d74bc9df1359..dde3085ff065 100644
>> --- a/net/dsa/port.c
>> +++ b/net/dsa/port.c
>> @@ -622,7 +622,7 @@ static int dsa_port_phylink_register(struct dsa_port *dp)
>>          }
>>
>>          err = phylink_of_phy_connect(dp->pl, port_dn, 0);
>> -       if (err) {
>> +       if (err && err != -ENODEV) {
>>                  pr_err("could not attach to PHY: %d\n", err);
>>                  goto err_phy_connect;
>>          }
>> --
>> 2.17.1
>>
> 
> Hi Florian,
> 
> Can you give an example of when this is a valid use case, and why
> fixed-link is not appropriate?
> 
> Regards,
> -Vladimir
> 

Hi,

This reminds me of a previous discussion on what to do when the DSA CPU 
port does not have a device_tree node at all: 
https://www.spinics.net/lists/netdev/msg573554.html.

This was the case of the dsa-loop driver that probes as a platform 
device. I'm still not clear how the PHYLINK callbacks are supposed to 
work in that case though.

--
Ioana



  reply	other threads:[~2019-06-10 20:50 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-06-10 19:31 [PATCH net-next] net: dsa: Deal with non-existing PHY/fixed-link Florian Fainelli
2019-06-10 19:53 ` Vladimir Oltean
2019-06-10 20:49   ` Ioana Ciornei [this message]
2019-06-10 21:11   ` Andrew Lunn
2019-06-10 21:15 ` Andrew Lunn
2019-06-12 18:01 ` David Miller

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=VI1PR0402MB2800ED1A422B900F63561F9CE0130@VI1PR0402MB2800.eurprd04.prod.outlook.com \
    --to=ioana.ciornei@nxp.com \
    --cc=andrew@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=f.fainelli@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=olteanv@gmail.com \
    --cc=rmk+kernel@armlinux.org.uk \
    --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).