Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp4036446ybl; Mon, 3 Feb 2020 11:16:57 -0800 (PST) X-Google-Smtp-Source: APXvYqyzwtFJJs7CMrOvqs4fOab/DmJD7s4AjCO07VWV/+AqnTTVx5dmiio2zdHGl6rrDpC68FcZ X-Received: by 2002:a9d:6398:: with SMTP id w24mr18342988otk.15.1580757417173; Mon, 03 Feb 2020 11:16:57 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1580757417; cv=none; d=google.com; s=arc-20160816; b=ihrs0XEP4ftkIFDmDL9KH8NiT/TcKfidc4IxMGibf4s/Bp5d1ET7OfaPmu5M2lFMqp L2F+W0lzME3eWDduMJmCAI045yCjYm0WLbfBVX8P3dYN6iBZry7UUht9w0+3AshVKOQu /hTGcBNDKdfRIrSCp8VSC6EUBOwhqOExT6QqXFICYzIJbJWu4tKN1h+n36m8N+0s3Oep 40nUp93ZLjOjVqi9pzUug82HVIxUlOIVgICK/r8Ng02eM4HyWE1VW0ZrrIC2589odARu /my0UjgXx1d2FWVr2C8yuAyMD8gGEGD5ld0YH8rtSVjuc5UpqTuh8qw0Jm+jT68Bdiwa 2Uew== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=qvDOaWUiHvwEs516vyd8sNz5hwIl/fKnRnf/xSvQNXw=; b=mhGwcubosf73JB+gKF6FTqibYzGVyHF9NstEKCDSoftWufhCi3pDrmGgtYNkdiVJKI N450+fSWdjGA8OV2vWFkZQqSBWvPtJZPxocnnPz3A9POMsn0ZEJQNz2okuP2pbo0YcZ6 O6TD1ieFPCKXHNWicbd8uC27/Ept+hn1hZoCsqZZyzBaSq/baP0tKRGby6d3FhZt+wSP cjIN9Q5v9x94C7Re6hLfa+ZgUZzJIHno8fLMZFEUE3Aj76NhOchrHtpaSCxcQv016hM5 7tqGtXj+N8SZ4J2pr6Lx7rZGeSxFW+Pv/GNERDDbBkQFVHF/LQ5CeWWZa04mLK9YshYA smjw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail (test mode) header.i=@armlinux.org.uk header.s=pandora-2019 header.b=vNytEFPA; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=armlinux.org.uk Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id o8si9436445oti.47.2020.02.03.11.16.44; Mon, 03 Feb 2020 11:16:57 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=fail (test mode) header.i=@armlinux.org.uk header.s=pandora-2019 header.b=vNytEFPA; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=armlinux.org.uk Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729739AbgBCSns (ORCPT + 99 others); Mon, 3 Feb 2020 13:43:48 -0500 Received: from pandora.armlinux.org.uk ([78.32.30.218]:38080 "EHLO pandora.armlinux.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728901AbgBCSnr (ORCPT ); Mon, 3 Feb 2020 13:43:47 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=armlinux.org.uk; s=pandora-2019; h=Sender:In-Reply-To:Content-Type: MIME-Version:References:Message-ID:Subject:Cc:To:From:Date:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=qvDOaWUiHvwEs516vyd8sNz5hwIl/fKnRnf/xSvQNXw=; b=vNytEFPAc0JcaO3v6lOGWH4IT hAGORSJAZ0N3rLsGuzorgd9Vu07isRjWebVZrsZCGi3Yo3TPLyA9pRYMGpJkDpyxoiFuzrM5k6KPX GQrsW5gkzqTdQOjENDR2AxjdF1j4AvXYBWqRprzuOQhc3s05Q3dq7pC+zwn5dS0GJcwK5/vvz104c fSjVqbgi9ZUfTzfB9VLJGrctaMNR+hvHC6UFapoBKwuZCWO90DWyH35mWhxJlDbJ85kq7OwSXtD0p dRy/QgMWEdSi2MGUJpazxfSD9fnILYolBTKyZ7YkGqCvysDOq4HI8CE3pkvMWYIIV1eRxfCsIlCfd k8J+pHmoQ==; Received: from shell.armlinux.org.uk ([2001:4d48:ad52:3201:5054:ff:fe00:4ec]:35510) by pandora.armlinux.org.uk with esmtpsa (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.90_1) (envelope-from ) id 1iygh2-0005Fj-My; Mon, 03 Feb 2020 18:43:32 +0000 Received: from linux by shell.armlinux.org.uk with local (Exim 4.92) (envelope-from ) id 1iygh0-000083-Gi; Mon, 03 Feb 2020 18:43:30 +0000 Date: Mon, 3 Feb 2020 18:43:30 +0000 From: Russell King - ARM Linux admin To: Calvin Johnson Cc: linux.cj@gmail.com, Jon Nettleton , Makarand Pawagi , cristian.sovaiala@nxp.com, laurentiu.tudor@nxp.com, ioana.ciornei@nxp.com, V.Sethi@nxp.com, pankaj.bansal@nxp.com, "Rajesh V . Bikkina" , Calvin Johnson , Andrew Lunn , "David S. Miller" , Florian Fainelli , Heiner Kallweit , linux-kernel@vger.kernel.org, netdev@vger.kernel.org Subject: Re: [PATCH v1 6/7] net: phylink: Introduce phylink_fwnode_phy_connect() Message-ID: <20200203184330.GF18808@shell.armlinux.org.uk> References: <20200131153440.20870-1-calvin.johnson@nxp.com> <20200131153440.20870-7-calvin.johnson@nxp.com> <20200203184121.GR25745@shell.armlinux.org.uk> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200203184121.GR25745@shell.armlinux.org.uk> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Feb 03, 2020 at 06:41:21PM +0000, Russell King - ARM Linux admin wrote: > On Fri, Jan 31, 2020 at 09:04:39PM +0530, Calvin Johnson wrote: > > From: Calvin Johnson > > > > Introduce phylink_fwnode_phy_connect API to connect the PHY using > > fwnode. > > > > Signed-off-by: Calvin Johnson > > --- > > > > drivers/net/phy/phylink.c | 64 +++++++++++++++++++++++++++++++++++++++ > > include/linux/phylink.h | 2 ++ > > 2 files changed, 66 insertions(+) > > > > diff --git a/drivers/net/phy/phylink.c b/drivers/net/phy/phylink.c > > index ee7a718662c6..f211f62283b5 100644 > > --- a/drivers/net/phy/phylink.c > > +++ b/drivers/net/phy/phylink.c > > @@ -18,6 +18,7 @@ > > #include > > #include > > #include > > +#include > > > > #include "sfp.h" > > #include "swphy.h" > > @@ -817,6 +818,69 @@ int phylink_connect_phy(struct phylink *pl, struct phy_device *phy) > > } > > EXPORT_SYMBOL_GPL(phylink_connect_phy); > > > > +/** > > + * phylink_fwnode_phy_connect() - connect the PHY specified in the fwnode. > > + * @pl: a pointer to a &struct phylink returned from phylink_create() > > + * @dn: a pointer to a &struct device_node. > > + * @flags: PHY-specific flags to communicate to the PHY device driver > > + * > > + * Connect the phy specified in the device node @dn to the phylink instance > > + * specified by @pl. Actions specified in phylink_connect_phy() will be > > + * performed. > > + * > > + * Returns 0 on success or a negative errno. > > + */ > > +int phylink_fwnode_phy_connect(struct phylink *pl, > > + struct fwnode_handle *fwnode, > > + u32 flags) > > +{ > > + struct fwnode_handle *phy_node; > > + struct phy_device *phy_dev; > > + int ret; > > + int status; > > + struct fwnode_reference_args args; > > + > > + /* Fixed links and 802.3z are handled without needing a PHY */ > > + if (pl->link_an_mode == MLO_AN_FIXED || > > + (pl->link_an_mode == MLO_AN_INBAND && > > + phy_interface_mode_is_8023z(pl->link_interface))) > > + return 0; > > + > > + status = acpi_node_get_property_reference(fwnode, "phy-handle", 0, > > + &args); > > + if (ACPI_FAILURE(status) || !is_acpi_device_node(args.fwnode)) > > + status = acpi_node_get_property_reference(fwnode, "phy", 0, > > + &args); > > + if (ACPI_FAILURE(status) || !is_acpi_device_node(args.fwnode)) > > + status = acpi_node_get_property_reference(fwnode, > > + "phy-device", 0, > > + &args); > > This is a copy-and-paste of phylink_of_phy_connect() without much > thought. > > There is no need to duplicate the legacy DT functionality of > phy/phy-device/phy-handle in ACPI - there is no legacy to support, > so it's pointless trying to find one of three properties here. > > I'd prefer both the DT and ACPI variants to be more integrated, so > we don't have two almost identical functions except for the firmware > specific detail. Also, I don't see any ACPI folk in the list of recipients to your series. -- RMK's Patch system: https://www.armlinux.org.uk/developer/patches/ FTTC broadband for 0.8mile line in suburbia: sync at 12.1Mbps down 622kbps up According to speedtest.net: 11.9Mbps down 500kbps up