From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.6 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id F1C81C4321A for ; Mon, 10 Jun 2019 19:53:45 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id C9671206E0 for ; Mon, 10 Jun 2019 19:53:45 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="hVy55VCq" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2389433AbfFJTxo (ORCPT ); Mon, 10 Jun 2019 15:53:44 -0400 Received: from mail-ed1-f67.google.com ([209.85.208.67]:44579 "EHLO mail-ed1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2389173AbfFJTxo (ORCPT ); Mon, 10 Jun 2019 15:53:44 -0400 Received: by mail-ed1-f67.google.com with SMTP id k8so16150314edr.11; Mon, 10 Jun 2019 12:53:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=i55Z4U6HHP04ncRU8z8qEOuvsQo8+MFGoJtJQ1qxggI=; b=hVy55VCqLf8hQzfitNmW4sqc3n5sW4eQScHIYu60TCju2x+O2oNK8h740boBaRxLWm gnCttUCWtoVUFutQf/PUtHzMbzkbgxYQVPlA9vRjnw4FusDHizTXKG+7tIp+fUPfUmUm 0K9+JKjrHQggSA54ho9tAN/jk5C8+u7EW7SnRSiCKddeHNWCVb7mQGstmYhTWBVjGkQC HienM+LFdHUv3ijj+NlHTD5Ypjim5jmoKVSNWWZVAvY7J1vnQ2oqE4nkz+C1IEZD+jNX BUqkBdqC3/XSulFv9i6vROS019+Ja1p+T3Su/+K4tiy3ILj2aBRD6xXn176xKw0x1awf qsWQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=i55Z4U6HHP04ncRU8z8qEOuvsQo8+MFGoJtJQ1qxggI=; b=cReyGS/rpPfNsDlVpLOxtnWTaDM82QpQSYJrOMJJXgZ8I/OdPscOnYCpR0KnBPi9F8 oxtO68b2EY3li1zJxYSjCT5sxouCs58gU0A8W9TTsBk1DeucpoT2tMY4eTTJZA72ALH3 D7xuxXRrdb5R4zhq80p2qWWmHt7dpRxRTGfIYJJoV7MIbuvCj1ga4qjpZRs7slNuSSYn GgtIT45KeAGshYl/i1ItjEWrjm4CfKg8NPrASoVtdvd71lC8iRndXCeRSF+K1//awN5k ZEvA+iI4qRxrJWk40eNjD58f1MBCOKil2QzkOwivSJfBsEGEuuCQJz0BRnhok1osjoOd izQQ== X-Gm-Message-State: APjAAAUE3C4nSOjOfwLQ00gS73xWG6hq4HY0WHhVYv2YoCJh80QaSawe hMe9AzLG6oobRZKYofwxRAPImZhJLtS3W/mIzGibLA== X-Google-Smtp-Source: APXvYqy8JYIQjk6hk815Z5Gf1qnVb/uo/VadlhNJffuQid562XATsQWu4IkyXqHtJK/3Pxz5cCu5cV44oVnOE4AyicM= X-Received: by 2002:a17:906:19d3:: with SMTP id h19mr10748698ejd.300.1560196422555; Mon, 10 Jun 2019 12:53:42 -0700 (PDT) MIME-Version: 1.0 References: <20190610193150.22231-1-f.fainelli@gmail.com> In-Reply-To: <20190610193150.22231-1-f.fainelli@gmail.com> From: Vladimir Oltean Date: Mon, 10 Jun 2019 22:53:31 +0300 Message-ID: Subject: Re: [PATCH net-next] net: dsa: Deal with non-existing PHY/fixed-link To: Florian Fainelli Cc: netdev , Ioana Ciornei , Russell King , Andrew Lunn , Vivien Didelot , "David S. Miller" , open list Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, 10 Jun 2019 at 22:31, Florian Fainelli 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 > --- > 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