Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp2450617pxj; Sun, 13 Jun 2021 21:35:10 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxM2kyhwZdEv2XYM056ZTdyuo6pEU9f7jXHNNBO5tsoP52sAgGAC9UGsI3nYCLxEmonL0I4 X-Received: by 2002:a05:6402:1c11:: with SMTP id ck17mr15673809edb.102.1623645310191; Sun, 13 Jun 2021 21:35:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1623645310; cv=none; d=google.com; s=arc-20160816; b=ZFbIfTQu8WiJMBAkA6bjei0bkxcBc/4WUjmpdoZ01JSdGyn9OwyEGIMW2ulCo5RM/m Y77cI/OMnro3/WSlT47CS7jzlWP/XXrENI1jmVcoZHtLAogcRmsuWtY/ErTCsAIMeLFa jXAuQecu3b1EbIqjAc28LQ3cSiI5RmjkDQY4sXNGi99p7FzePXlsh/65/rg7gzS9eU3m +i0eKTo599I3SUU8WBp3cvJ83wNQ6uG6M0toqcvTURRgrxX4WXIUp1PjxmO6RvEVW5Jw LDB5tt9Mw0psaiamgnxFFyW01mLUbTOylWgnEEIFzgZNHrAvCEJ25O1NRrLvClIm1VnF 9cPw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=tX8oy/5xFTWvC/IJdNTO9q1xDRZNHprbp1KCkbAfqS8=; b=AwifljyPYFLrHGrEzimWODc1Y5KfH7cNyP5hyshaXsiJE/uMjFThRb3fXk2Vqt1nJv 5wLeSBsJ8eMSathvoAqLoMo7sA5C0ScRyjZgvsDneEhL7RFGWHTu8c+xyVxmf2XU4YBl 33B3v2xQGt4xkHhVOjCaxmtK9KMvjU+fLQGFz3lWgc+31mhbpdpFye4s2ZQ2mVJpeffp gjIMWFlfrD/31ksj+Ift2fkeO76iVZvBn+2XNg0fmydkw7zr+jxDo6PnbylMNARfaq0I hNaY+GQ1nHu/AePW39hBWIo9bGxxqaER99dhjIlLbtNxFNGYnUJyh6a9iUCDT3bP6I6C 5rmw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id d24si6044701ejo.430.2021.06.13.21.34.47; Sun, 13 Jun 2021 21:35:10 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232425AbhFNEeF (ORCPT + 99 others); Mon, 14 Jun 2021 00:34:05 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38232 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232340AbhFNEdl (ORCPT ); Mon, 14 Jun 2021 00:33:41 -0400 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EB76FC061787 for ; Sun, 13 Jun 2021 21:31:38 -0700 (PDT) Received: from dude.hi.pengutronix.de ([2001:67c:670:100:1d::7]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lseFz-0001kV-Q5; Mon, 14 Jun 2021 06:31:27 +0200 Received: from ore by dude.hi.pengutronix.de with local (Exim 4.92) (envelope-from ) id 1lseFy-00035T-Tp; Mon, 14 Jun 2021 06:31:26 +0200 From: Oleksij Rempel To: Woojung Huh , UNGLinuxDriver@microchip.com, Andrew Lunn , Florian Fainelli , Vivien Didelot , Vladimir Oltean , "David S. Miller" , Jakub Kicinski Cc: Oleksij Rempel , kernel@pengutronix.de, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Russell King , Michael Grzeschik Subject: [PATCH net-next v5 7/8] net: dsa: dsa_slave_phy_connect(): extend phy's flags with port specific phy flags Date: Mon, 14 Jun 2021 06:31:24 +0200 Message-Id: <20210614043125.11658-8-o.rempel@pengutronix.de> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20210614043125.11658-1-o.rempel@pengutronix.de> References: <20210614043125.11658-1-o.rempel@pengutronix.de> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-SA-Exim-Connect-IP: 2001:67c:670:100:1d::7 X-SA-Exim-Mail-From: ore@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-kernel@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The current get_phy_flags() is only processed when we connect to a PHY via a designed phy-handle property via phylink_of_phy_connect(), but if we fallback on the internal MDIO bus created by a switch and take the dsa_slave_phy_connect() path then we would not be processing that flag and using it at PHY connection time. Suggested-by: Florian Fainelli Signed-off-by: Oleksij Rempel --- net/dsa/slave.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/net/dsa/slave.c b/net/dsa/slave.c index d4756b920108..915c7cab7900 100644 --- a/net/dsa/slave.c +++ b/net/dsa/slave.c @@ -1749,7 +1749,8 @@ static void dsa_slave_phylink_fixed_state(struct phylink_config *config, } /* slave device setup *******************************************************/ -static int dsa_slave_phy_connect(struct net_device *slave_dev, int addr) +static int dsa_slave_phy_connect(struct net_device *slave_dev, int addr, + u32 flags) { struct dsa_port *dp = dsa_slave_to_port(slave_dev); struct dsa_switch *ds = dp->ds; @@ -1760,6 +1761,8 @@ static int dsa_slave_phy_connect(struct net_device *slave_dev, int addr) return -ENODEV; } + slave_dev->phydev->dev_flags |= flags; + return phylink_connect_phy(dp->pl, slave_dev->phydev); } @@ -1804,7 +1807,7 @@ static int dsa_slave_phy_setup(struct net_device *slave_dev) /* We could not connect to a designated PHY or SFP, so try to * use the switch internal MDIO bus instead */ - ret = dsa_slave_phy_connect(slave_dev, dp->index); + ret = dsa_slave_phy_connect(slave_dev, dp->index, phy_flags); if (ret) { netdev_err(slave_dev, "failed to connect to port %d: %d\n", -- 2.29.2