diff mbox series

[net] net: ngbe: Fix phy mode set to external phy

Message ID E9C427FDDCF0CBC3+20240812103025.42417-1-mengyuanlou@net-swift.com (mailing list archive)
State Superseded
Delegated to: Netdev Maintainers
Headers show
Series [net] net: ngbe: Fix phy mode set to external phy | expand

Checks

Context Check Description
netdev/tree_selection success Clearly marked for net
netdev/apply fail Patch does not apply to net-0

Commit Message

Mengyuan Lou Aug. 12, 2024, 10:30 a.m. UTC
The MAC only has add the TX delay and it can not be modified.
MAC and PHY are both set the TX delay cause transmission problems.
So just disable TX delay in PHY, when use rgmii to attach to
external phy, set PHY_INTERFACE_MODE_RGMII_RXID to phy drivers.
And it is does not matter to internal phy.

Fixes: a1cf597b99a7 ("net: ngbe: Add ngbe mdio bus driver.")
Signed-off-by: Mengyuan Lou <mengyuanlou@net-swift.com>
---
v2:
-Add a comment for the code modification.
-Add the problem in commit messages.
v1:
https://lore.kernel.org/netdev/C1587837D62D1BC0+20240806082520.29193-1-mengyuanlou@net-swift.com/

 drivers/net/ethernet/wangxun/ngbe/ngbe_mdio.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

Comments

Paolo Abeni Aug. 15, 2024, 10:15 a.m. UTC | #1
On 8/12/24 12:30, Mengyuan Lou wrote:
> The MAC only has add the TX delay and it can not be modified.
> MAC and PHY are both set the TX delay cause transmission problems.
> So just disable TX delay in PHY, when use rgmii to attach to
> external phy, set PHY_INTERFACE_MODE_RGMII_RXID to phy drivers.
> And it is does not matter to internal phy.
> 
> Fixes: a1cf597b99a7 ("net: ngbe: Add ngbe mdio bus driver.")
> Signed-off-by: Mengyuan Lou <mengyuanlou@net-swift.com>
> ---
> v2:
> -Add a comment for the code modification.
> -Add the problem in commit messages.
> v1:
> https://lore.kernel.org/netdev/C1587837D62D1BC0+20240806082520.29193-1-mengyuanlou@net-swift.com/
> 
>   drivers/net/ethernet/wangxun/ngbe/ngbe_mdio.c | 6 +++++-
>   1 file changed, 5 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/net/ethernet/wangxun/ngbe/ngbe_mdio.c b/drivers/net/ethernet/wangxun/ngbe/ngbe_mdio.c
> index ba33a57b42c2..0876b2e810c0 100644
> --- a/drivers/net/ethernet/wangxun/ngbe/ngbe_mdio.c
> +++ b/drivers/net/ethernet/wangxun/ngbe/ngbe_mdio.c
> @@ -215,10 +215,14 @@ int ngbe_phy_connect(struct wx *wx)
>   {
>   	int ret;
>   
> +	/* The MAC only has add the Tx delay and it can not be modified.
> +	 * So just disable TX delay in PHY, and it is does not matter to
> +	 * internal phy.
> +	 */
>   	ret = phy_connect_direct(wx->netdev,
>   				 wx->phydev,
>   				 ngbe_handle_link_change,
> -				 PHY_INTERFACE_MODE_RGMII_ID);
> +				 PHY_INTERFACE_MODE_RGMII_RXID);
>   	if (ret) {
>   		wx_err(wx, "PHY connect failed.\n");
>   		return ret;

Does not apply cleanly to net since:

commit bc2426d74aa35cd8ec9c97a253ef57c2c5cd730c
Author: Jiawen Wu <jiawenwu@trustnetic.com>
Date:   Wed Jan 3 10:08:49 2024 +0800

     net: ngbe: convert phylib to phylink

Please rebase

Thanks,

Paolo
Mengyuan Lou Aug. 16, 2024, 6:11 a.m. UTC | #2
> 2024年8月15日 18:15,Paolo Abeni <pabeni@redhat.com> 写道:
> 
> On 8/12/24 12:30, Mengyuan Lou wrote:
>> The MAC only has add the TX delay and it can not be modified.
>> MAC and PHY are both set the TX delay cause transmission problems.
>> So just disable TX delay in PHY, when use rgmii to attach to
>> external phy, set PHY_INTERFACE_MODE_RGMII_RXID to phy drivers.
>> And it is does not matter to internal phy.
>> Fixes: a1cf597b99a7 ("net: ngbe: Add ngbe mdio bus driver.")
>> Signed-off-by: Mengyuan Lou <mengyuanlou@net-swift.com>
>> ---
>> v2:
>> -Add a comment for the code modification.
>> -Add the problem in commit messages.
>> v1:
>> https://lore.kernel.org/netdev/C1587837D62D1BC0+20240806082520.29193-1-mengyuanlou@net-swift.com/
>>  drivers/net/ethernet/wangxun/ngbe/ngbe_mdio.c | 6 +++++-
>>  1 file changed, 5 insertions(+), 1 deletion(-)
>> diff --git a/drivers/net/ethernet/wangxun/ngbe/ngbe_mdio.c b/drivers/net/ethernet/wangxun/ngbe/ngbe_mdio.c
>> index ba33a57b42c2..0876b2e810c0 100644
>> --- a/drivers/net/ethernet/wangxun/ngbe/ngbe_mdio.c
>> +++ b/drivers/net/ethernet/wangxun/ngbe/ngbe_mdio.c
>> @@ -215,10 +215,14 @@ int ngbe_phy_connect(struct wx *wx)
>>  {
>>   int ret;
>>  + /* The MAC only has add the Tx delay and it can not be modified.
>> +  * So just disable TX delay in PHY, and it is does not matter to
>> +  * internal phy.
>> +  */
>>   ret = phy_connect_direct(wx->netdev,
>>    wx->phydev,
>>    ngbe_handle_link_change,
>> -  PHY_INTERFACE_MODE_RGMII_ID);
>> +  PHY_INTERFACE_MODE_RGMII_RXID);
>>   if (ret) {
>>   wx_err(wx, "PHY connect failed.\n");
>>   return ret;
> 
> Does not apply cleanly to net since:
> 
> commit bc2426d74aa35cd8ec9c97a253ef57c2c5cd730c
> Author: Jiawen Wu <jiawenwu@trustnetic.com>
> Date:   Wed Jan 3 10:08:49 2024 +0800
> 
>    net: ngbe: convert phylib to phylink
> 
> Please rebase

I Know there has something changed in this commit.

If I want to send this patch to fix the code between this two commits.
> commit: a1cf597b99a7 ("net: ngbe: Add ngbe mdio bus driver.")

> commit: bc2426d74aa3 (“net: ngbe: convert phylib to phylink")

Should I add the stable tag flag like 6.6 or do something else.

Thanks,
Mengyuan Lou.
Jakub Kicinski Aug. 16, 2024, 3:19 p.m. UTC | #3
On Fri, 16 Aug 2024 14:11:27 +0800 mengyuanlou@net-swift.com wrote:
> > Does not apply cleanly to net since:
> > 
> > commit bc2426d74aa35cd8ec9c97a253ef57c2c5cd730c
> > Author: Jiawen Wu <jiawenwu@trustnetic.com>
> > Date:   Wed Jan 3 10:08:49 2024 +0800
> > 
> >    net: ngbe: convert phylib to phylink
> > 
> > Please rebase  
> 
> I Know there has something changed in this commit.
> 
> If I want to send this patch to fix the code between this two commits.
> > commit: a1cf597b99a7 ("net: ngbe: Add ngbe mdio bus driver.")  
> 
> > commit: bc2426d74aa3 (“net: ngbe: convert phylib to phylink")  
> 
> Should I add the stable tag flag like 6.6 or do something else.

If I understand the question correctly the answer is: don't worry about
stable right now.

Add the CC: stable@.. tag, and fix the code as it is in net/main.
Once the commit reaches Linus you will get a notification from 
the stable team that the patch has reached them and either does 
or does not apply. At which point you can provide them with a patch
adjusted to what's needed in LTS kernels.
diff mbox series

Patch

diff --git a/drivers/net/ethernet/wangxun/ngbe/ngbe_mdio.c b/drivers/net/ethernet/wangxun/ngbe/ngbe_mdio.c
index ba33a57b42c2..0876b2e810c0 100644
--- a/drivers/net/ethernet/wangxun/ngbe/ngbe_mdio.c
+++ b/drivers/net/ethernet/wangxun/ngbe/ngbe_mdio.c
@@ -215,10 +215,14 @@  int ngbe_phy_connect(struct wx *wx)
 {
 	int ret;
 
+	/* The MAC only has add the Tx delay and it can not be modified.
+	 * So just disable TX delay in PHY, and it is does not matter to
+	 * internal phy.
+	 */
 	ret = phy_connect_direct(wx->netdev,
 				 wx->phydev,
 				 ngbe_handle_link_change,
-				 PHY_INTERFACE_MODE_RGMII_ID);
+				 PHY_INTERFACE_MODE_RGMII_RXID);
 	if (ret) {
 		wx_err(wx, "PHY connect failed.\n");
 		return ret;