diff mbox series

[net-next,v12,14/15] net: stmmac: dwmac-loongson: Move disable_force flag to _gnet_date

Message ID 7235e4af89c169e79f0404a3dc953f1756bab196.1714046812.git.siyanteng@loongson.cn (mailing list archive)
State Changes Requested
Delegated to: Netdev Maintainers
Headers show
Series stmmac: Add Loongson platform support | expand

Checks

Context Check Description
netdev/series_format success Posting correctly formatted
netdev/tree_selection success Clearly marked for net-next
netdev/ynl success Generated files up to date; no warnings/errors; no diff in generated;
netdev/fixes_present success Fixes tag not required for -next series
netdev/header_inline success No static functions without inline keyword in header files
netdev/build_32bit fail Errors and warnings before: 931 this patch: 931
netdev/build_tools success No tools touched, skip
netdev/cc_maintainers warning 6 maintainers not CCed: pabeni@redhat.com edumazet@google.com linux-stm32@st-md-mailman.stormreply.com linux-arm-kernel@lists.infradead.org kuba@kernel.org mcoquelin.stm32@gmail.com
netdev/build_clang fail Errors and warnings before: 942 this patch: 942
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 No Fixes tag
netdev/build_allmodconfig_warn fail Errors and warnings before: 942 this patch: 942
netdev/checkpatch success total: 0 errors, 0 warnings, 0 checks, 25 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

Yanteng Si April 25, 2024, 1:11 p.m. UTC
We've already introduced loongson_gnet_data(), so the
STMMAC_FLAG_DISABLE_FORCE_1000 should be take away from
loongson_dwmac_probe().

Signed-off-by: Feiyang Chen <chenfeiyang@loongson.cn>
Signed-off-by: Yinggang Gu <guyinggang@loongson.cn>
Signed-off-by: Yanteng Si <siyanteng@loongson.cn>
---
 .../net/ethernet/stmicro/stmmac/dwmac-loongson.c    | 13 ++++++-------
 1 file changed, 6 insertions(+), 7 deletions(-)

Comments

Serge Semin May 5, 2024, 9:53 p.m. UTC | #1
On Thu, Apr 25, 2024 at 09:11:37PM +0800, Yanteng Si wrote:
> We've already introduced loongson_gnet_data(), so the
> STMMAC_FLAG_DISABLE_FORCE_1000 should be take away from
> loongson_dwmac_probe().
> 
> Signed-off-by: Feiyang Chen <chenfeiyang@loongson.cn>
> Signed-off-by: Yinggang Gu <guyinggang@loongson.cn>
> Signed-off-by: Yanteng Si <siyanteng@loongson.cn>
> ---
>  .../net/ethernet/stmicro/stmmac/dwmac-loongson.c    | 13 ++++++-------
>  1 file changed, 6 insertions(+), 7 deletions(-)
> 
> diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-loongson.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-loongson.c
> index 68de90c44feb..dea02de030e6 100644
> --- a/drivers/net/ethernet/stmicro/stmmac/dwmac-loongson.c
> +++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-loongson.c
> @@ -286,6 +286,12 @@ static int loongson_gnet_data(struct pci_dev *pdev,
>  	plat->mdio_bus_data->phy_mask = ~(u32)BIT(2);
>  	plat->fix_mac_speed = loongson_gnet_fix_speed;
>  

> +	/* GNET devices with dev revision 0x00 do not support manually
> +	 * setting the speed to 1000.
> +	 */
> +	if (pdev->revision == 0x00)
> +		plat->flags |= STMMAC_FLAG_DISABLE_FORCE_1000;
> +

Just introduce the change above in the framework of the patch 
[PATCH net-next v12 13/15] net: stmmac: dwmac-loongson: Add Loongson GNET support
and ...

>  	return 0;
>  }
>  
> @@ -540,13 +546,6 @@ static int loongson_dwmac_probe(struct pci_dev *pdev, const struct pci_device_id
>  		break;
>  	}
>  

> -	/* GNET devices with dev revision 0x00 do not support manually
> -	 * setting the speed to 1000.
> -	 */
> -	if (pdev->device == PCI_DEVICE_ID_LOONGSON_GNET &&
> -	    pdev->revision == 0x00)
> -		plat->flags |= STMMAC_FLAG_DISABLE_FORCE_1000;
> -

... you won't to have this being undone. So this patch won't be even
needed to be introduced.

See my comment sent to
[PATCH net-next v12 12/15] net: stmmac: dwmac-loongson: Fixed failure to set network speed to 1000.

-Serge(y)

>  	ret = stmmac_dvr_probe(&pdev->dev, plat, &res);
>  	if (ret)
>  		goto err_disable_device;
> -- 
> 2.31.4
>
Yanteng Si May 13, 2024, 10:20 a.m. UTC | #2
在 2024/5/6 05:53, Serge Semin 写道:
> On Thu, Apr 25, 2024 at 09:11:37PM +0800, Yanteng Si wrote:
>> We've already introduced loongson_gnet_data(), so the
>> STMMAC_FLAG_DISABLE_FORCE_1000 should be take away from
>> loongson_dwmac_probe().
>>
>> Signed-off-by: Feiyang Chen <chenfeiyang@loongson.cn>
>> Signed-off-by: Yinggang Gu <guyinggang@loongson.cn>
>> Signed-off-by: Yanteng Si <siyanteng@loongson.cn>
>> ---
>>   .../net/ethernet/stmicro/stmmac/dwmac-loongson.c    | 13 ++++++-------
>>   1 file changed, 6 insertions(+), 7 deletions(-)
>>
>> diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-loongson.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-loongson.c
>> index 68de90c44feb..dea02de030e6 100644
>> --- a/drivers/net/ethernet/stmicro/stmmac/dwmac-loongson.c
>> +++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-loongson.c
>> @@ -286,6 +286,12 @@ static int loongson_gnet_data(struct pci_dev *pdev,
>>   	plat->mdio_bus_data->phy_mask = ~(u32)BIT(2);
>>   	plat->fix_mac_speed = loongson_gnet_fix_speed;
>>   
>> +	/* GNET devices with dev revision 0x00 do not support manually
>> +	 * setting the speed to 1000.
>> +	 */
>> +	if (pdev->revision == 0x00)
>> +		plat->flags |= STMMAC_FLAG_DISABLE_FORCE_1000;
>> +
> Just introduce the change above in the framework of the patch
> [PATCH net-next v12 13/15] net: stmmac: dwmac-loongson: Add Loongson GNET support
> and ...
OK.
>
>>   	return 0;
>>   }
>>   
>> @@ -540,13 +546,6 @@ static int loongson_dwmac_probe(struct pci_dev *pdev, const struct pci_device_id
>>   		break;
>>   	}
>>   
>> -	/* GNET devices with dev revision 0x00 do not support manually
>> -	 * setting the speed to 1000.
>> -	 */
>> -	if (pdev->device == PCI_DEVICE_ID_LOONGSON_GNET &&
>> -	    pdev->revision == 0x00)
>> -		plat->flags |= STMMAC_FLAG_DISABLE_FORCE_1000;
>> -
> ... you won't to have this being undone. So this patch won't be even
> needed to be introduced.
>
> See my comment sent to
> [PATCH net-next v12 12/15] net: stmmac: dwmac-loongson: Fixed failure to set network speed to 1000.
>
OK.


Thanks,

Yanteng
diff mbox series

Patch

diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-loongson.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-loongson.c
index 68de90c44feb..dea02de030e6 100644
--- a/drivers/net/ethernet/stmicro/stmmac/dwmac-loongson.c
+++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-loongson.c
@@ -286,6 +286,12 @@  static int loongson_gnet_data(struct pci_dev *pdev,
 	plat->mdio_bus_data->phy_mask = ~(u32)BIT(2);
 	plat->fix_mac_speed = loongson_gnet_fix_speed;
 
+	/* GNET devices with dev revision 0x00 do not support manually
+	 * setting the speed to 1000.
+	 */
+	if (pdev->revision == 0x00)
+		plat->flags |= STMMAC_FLAG_DISABLE_FORCE_1000;
+
 	return 0;
 }
 
@@ -540,13 +546,6 @@  static int loongson_dwmac_probe(struct pci_dev *pdev, const struct pci_device_id
 		break;
 	}
 
-	/* GNET devices with dev revision 0x00 do not support manually
-	 * setting the speed to 1000.
-	 */
-	if (pdev->device == PCI_DEVICE_ID_LOONGSON_GNET &&
-	    pdev->revision == 0x00)
-		plat->flags |= STMMAC_FLAG_DISABLE_FORCE_1000;
-
 	ret = stmmac_dvr_probe(&pdev->dev, plat, &res);
 	if (ret)
 		goto err_disable_device;