diff mbox series

[net] net: txgbe: fix null pointer to pcs

Message ID 20241115073508.1130046-1-jiawenwu@trustnetic.com (mailing list archive)
State Accepted
Commit 2160428bcb20f2f70a72ee84aba91a1264dc4ff3
Delegated to: Netdev Maintainers
Headers show
Series [net] net: txgbe: fix null pointer to pcs | expand

Checks

Context Check Description
netdev/series_format success Single patches do not need cover letters
netdev/tree_selection success Clearly marked for net
netdev/ynl success Generated files up to date; no warnings/errors; no diff in generated;
netdev/fixes_present success Fixes tag present in non-next series
netdev/header_inline success No static functions without inline keyword in header files
netdev/build_32bit success Errors and warnings before: 3 this patch: 3
netdev/build_tools success No tools touched, skip
netdev/cc_maintainers warning 1 maintainers not CCed: edumazet@google.com
netdev/build_clang success Errors and warnings before: 3 this patch: 3
netdev/verify_signedoff success Signed-off-by tag matches author and committer
netdev/deprecated_api success None detected
netdev/check_selftest success No net selftest shell script
netdev/verify_fixes success Fixes tag looks correct
netdev/build_allmodconfig_warn success Errors and warnings before: 4 this patch: 4
netdev/checkpatch success total: 0 errors, 0 warnings, 0 checks, 8 lines checked
netdev/build_clang_rust success No Rust files in patch. Skipping build
netdev/kdoc success Errors and warnings before: 0 this patch: 0
netdev/source_inline success Was 0 now: 0

Commit Message

Jiawen Wu Nov. 15, 2024, 7:35 a.m. UTC
For 1000BASE-X or SGMII interface mode, the PCS also need to be selected.
Only return null pointer when there is a copper NIC with external PHY.

Fixes: 02b2a6f91b90 ("net: txgbe: support copper NIC with external PHY")
Signed-off-by: Jiawen Wu <jiawenwu@trustnetic.com>
---
 drivers/net/ethernet/wangxun/txgbe/txgbe_phy.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

patchwork-bot+netdevbpf@kernel.org Nov. 19, 2024, 3 a.m. UTC | #1
Hello:

This patch was applied to netdev/net.git (main)
by Jakub Kicinski <kuba@kernel.org>:

On Fri, 15 Nov 2024 15:35:08 +0800 you wrote:
> For 1000BASE-X or SGMII interface mode, the PCS also need to be selected.
> Only return null pointer when there is a copper NIC with external PHY.
> 
> Fixes: 02b2a6f91b90 ("net: txgbe: support copper NIC with external PHY")
> Signed-off-by: Jiawen Wu <jiawenwu@trustnetic.com>
> ---
>  drivers/net/ethernet/wangxun/txgbe/txgbe_phy.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

Here is the summary with links:
  - [net] net: txgbe: fix null pointer to pcs
    https://git.kernel.org/netdev/net/c/2160428bcb20

You are awesome, thank you!
Matthieu Baerts (NGI0) Nov. 19, 2024, 9:14 a.m. UTC | #2
Hello,

On 15/11/2024 08:35, Jiawen Wu wrote:
> For 1000BASE-X or SGMII interface mode, the PCS also need to be selected.
> Only return null pointer when there is a copper NIC with external PHY.

FYI, we got a small conflict when merging 'net' in 'net-next' in the
MPTCP tree due to this patch applied in 'net':

  2160428bcb20 ("net: txgbe: fix null pointer to pcs")

and this one from 'net-next':

  155c499ffd1d ("net: wangxun: txgbe: use phylink_pcs internally")

----- Generic Message -----
The best is to avoid conflicts between 'net' and 'net-next' trees but if
they cannot be avoided when preparing patches, a note about how to fix
them is much appreciated.

The conflict has been resolved on our side [1] and the resolution we
suggest is attached to this email. Please report any issues linked to
this conflict resolution as it might be used by others. If you worked on
the mentioned patches, don't hesitate to ACK this conflict resolution.
---------------------------

Regarding this conflict, it was simple to resolve it because the
conflict was in the context: so the modification from both sides can be
taken: the new 'if' condition from 'net', and the new 'return' statement
from 'net-next'.

Rerere cache is available in [2].

1: https://github.com/multipath-tcp/mptcp_net-next/commit/74e6371ac34a
2: https://github.com/multipath-tcp/mptcp-upstream-rr-cache/commit/631a1

Cheers,
Matt
diff mbox series

Patch

diff --git a/drivers/net/ethernet/wangxun/txgbe/txgbe_phy.c b/drivers/net/ethernet/wangxun/txgbe/txgbe_phy.c
index 2bfe41339c1c..f26946198a2f 100644
--- a/drivers/net/ethernet/wangxun/txgbe/txgbe_phy.c
+++ b/drivers/net/ethernet/wangxun/txgbe/txgbe_phy.c
@@ -162,7 +162,7 @@  static struct phylink_pcs *txgbe_phylink_mac_select(struct phylink_config *confi
 	struct wx *wx = phylink_to_wx(config);
 	struct txgbe *txgbe = wx->priv;
 
-	if (interface == PHY_INTERFACE_MODE_10GBASER)
+	if (wx->media_type != sp_media_copper)
 		return &txgbe->xpcs->pcs;
 
 	return NULL;