diff mbox series

[net-next] net: phylink: handle NA interface mode in phylink_fwnode_phy_connect()

Message ID E1mo6kA-008ZGa-Ut@rmk-PC.armlinux.org.uk (mailing list archive)
State Accepted
Commit a18e6521a7d95dae8c65b5b0ef6bbe624fbe808c
Delegated to: Netdev Maintainers
Headers show
Series [net-next] net: phylink: handle NA interface mode in phylink_fwnode_phy_connect() | expand

Checks

Context Check Description
netdev/tree_selection success Clearly marked for net-next
netdev/fixes_present success Fixes tag not required for -next series
netdev/subject_prefix success Link
netdev/cover_letter success Single patches do not need cover letters
netdev/patch_count success Link
netdev/header_inline success No static functions without inline keyword in header files
netdev/build_32bit success Errors and warnings before: 0 this patch: 0
netdev/cc_maintainers warning 1 maintainers not CCed: linux@armlinux.org.uk
netdev/build_clang success Errors and warnings before: 0 this patch: 0
netdev/module_param success Was 0 now: 0
netdev/verify_signedoff success Signed-off-by tag matches author and committer
netdev/verify_fixes success No Fixes tag
netdev/build_allmodconfig_warn success Errors and warnings before: 0 this patch: 0
netdev/checkpatch success total: 0 errors, 0 warnings, 0 checks, 21 lines checked
netdev/kdoc success Errors and warnings before: 0 this patch: 0
netdev/source_inline success Was 0 now: 0

Commit Message

Russell King (Oracle) Nov. 19, 2021, 4:28 p.m. UTC
Commit 4904b6ea1f9db ("net: phy: phylink: Use PHY device interface if
N/A") introduced handling for the phy interface mode where this is not
known at phylink creation time. This was never added to the OF/fwnode
paths, but is necessary when the phy is present in DT, but the phy-mode
is not specified.

Add this handling.

Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
---
Hi Florian,

It owuld be useful to have your ACK for this since you were the original
author for the above referenced commit. Thanks!

 drivers/net/phy/phylink.c | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

Comments

Florian Fainelli Nov. 19, 2021, 9:46 p.m. UTC | #1
On 11/19/21 8:28 AM, Russell King (Oracle) wrote:
> Commit 4904b6ea1f9db ("net: phy: phylink: Use PHY device interface if
> N/A") introduced handling for the phy interface mode where this is not
> known at phylink creation time. This was never added to the OF/fwnode
> paths, but is necessary when the phy is present in DT, but the phy-mode
> is not specified.
> 
> Add this handling.
> 
> Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>

Acked-by: Florian Fainelli <f.fainelli@gmail.com>
patchwork-bot+netdevbpf@kernel.org Nov. 22, 2021, 1:20 p.m. UTC | #2
Hello:

This patch was applied to netdev/net-next.git (master)
by David S. Miller <davem@davemloft.net>:

On Fri, 19 Nov 2021 16:28:06 +0000 you wrote:
> Commit 4904b6ea1f9db ("net: phy: phylink: Use PHY device interface if
> N/A") introduced handling for the phy interface mode where this is not
> known at phylink creation time. This was never added to the OF/fwnode
> paths, but is necessary when the phy is present in DT, but the phy-mode
> is not specified.
> 
> Add this handling.
> 
> [...]

Here is the summary with links:
  - [net-next] net: phylink: handle NA interface mode in phylink_fwnode_phy_connect()
    https://git.kernel.org/netdev/net-next/c/a18e6521a7d9

You are awesome, thank you!
diff mbox series

Patch

diff --git a/drivers/net/phy/phylink.c b/drivers/net/phy/phylink.c
index da17b874a5e7..f34550c8e90d 100644
--- a/drivers/net/phy/phylink.c
+++ b/drivers/net/phy/phylink.c
@@ -1325,7 +1325,8 @@  static int phylink_bringup_phy(struct phylink *pl, struct phy_device *phy,
 	mutex_unlock(&phy->lock);
 
 	phylink_dbg(pl,
-		    "phy: setting supported %*pb advertising %*pb\n",
+		    "phy: %s setting supported %*pb advertising %*pb\n",
+		    phy_modes(interface),
 		    __ETHTOOL_LINK_MODE_MASK_NBITS, pl->supported,
 		    __ETHTOOL_LINK_MODE_MASK_NBITS, phy->advertising);
 
@@ -1443,6 +1444,12 @@  int phylink_fwnode_phy_connect(struct phylink *pl,
 	if (!phy_dev)
 		return -ENODEV;
 
+	/* Use PHY device/driver interface */
+	if (pl->link_interface == PHY_INTERFACE_MODE_NA) {
+		pl->link_interface = phy_dev->interface;
+		pl->link_config.interface = pl->link_interface;
+	}
+
 	ret = phy_attach_direct(pl->netdev, phy_dev, flags,
 				pl->link_interface);
 	if (ret) {