diff mbox series

[net-next,v7,9/9] net: stmmac: Disable coe for some Loongson GNET

Message ID 479a6614d1fc4285c02953bf1ca181fa56942fb6.1702990507.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: 20 this patch: 20
netdev/cc_maintainers warning 6 maintainers not CCed: edumazet@google.com pabeni@redhat.com kuba@kernel.org mcoquelin.stm32@gmail.com linux-stm32@st-md-mailman.stormreply.com linux-arm-kernel@lists.infradead.org
netdev/build_clang fail Errors and warnings before: 21 this patch: 21
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: 20 this patch: 20
netdev/checkpatch success total: 0 errors, 0 warnings, 0 checks, 11 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 Dec. 19, 2023, 2:28 p.m. UTC
Some chips of Loongson GNET does not support coe, so disable them.

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

Comments

Serge Semin Dec. 21, 2023, 2:36 a.m. UTC | #1
On Tue, Dec 19, 2023 at 10:28:19PM +0800, Yanteng Si wrote:
> Some chips of Loongson GNET does not support coe, so disable them.
> 
> Signed-off-by: Yanteng Si <siyanteng@loongson.cn>
> Signed-off-by: Feiyang Chen <chenfeiyang@loongson.cn>
> Signed-off-by: Yinggang Gu <guyinggang@loongson.cn>
> ---
>  drivers/net/ethernet/stmicro/stmmac/hwif.c | 5 +++++
>  1 file changed, 5 insertions(+)
> 
> diff --git a/drivers/net/ethernet/stmicro/stmmac/hwif.c b/drivers/net/ethernet/stmicro/stmmac/hwif.c
> index 3724cf698de6..f211880925aa 100644
> --- a/drivers/net/ethernet/stmicro/stmmac/hwif.c
> +++ b/drivers/net/ethernet/stmicro/stmmac/hwif.c
> @@ -73,6 +73,11 @@ static int stmmac_dwmac1_quirks(struct stmmac_priv *priv)
>  		mac->desc = &ndesc_ops;
>  	}
>  
> +	if (priv->synopsys_id == DWLGMAC_CORE_1_00) {
> +		priv->plat->tx_coe = 0;
> +		priv->plat->rx_coe = STMMAC_RX_COE_NONE;
> +	}

Couldn't this be done in dwmac-loongson.c?

-Serge(y)

> +
>  	stmmac_dwmac_mode_quirk(priv);
>  	return 0;
>  }
> -- 
> 2.31.4
>
Yanteng Si Jan. 23, 2024, 12:47 p.m. UTC | #2
在 2023/12/21 10:36, Serge Semin 写道:
> On Tue, Dec 19, 2023 at 10:28:19PM +0800, Yanteng Si wrote:
>> Some chips of Loongson GNET does not support coe, so disable them.
>>
>> Signed-off-by: Yanteng Si <siyanteng@loongson.cn>
>> Signed-off-by: Feiyang Chen <chenfeiyang@loongson.cn>
>> Signed-off-by: Yinggang Gu <guyinggang@loongson.cn>
>> ---
>>   drivers/net/ethernet/stmicro/stmmac/hwif.c | 5 +++++
>>   1 file changed, 5 insertions(+)
>>
>> diff --git a/drivers/net/ethernet/stmicro/stmmac/hwif.c b/drivers/net/ethernet/stmicro/stmmac/hwif.c
>> index 3724cf698de6..f211880925aa 100644
>> --- a/drivers/net/ethernet/stmicro/stmmac/hwif.c
>> +++ b/drivers/net/ethernet/stmicro/stmmac/hwif.c
>> @@ -73,6 +73,11 @@ static int stmmac_dwmac1_quirks(struct stmmac_priv *priv)
>>   		mac->desc = &ndesc_ops;
>>   	}
>>   
>> +	if (priv->synopsys_id == DWLGMAC_CORE_1_00) {
>> +		priv->plat->tx_coe = 0;
>> +		priv->plat->rx_coe = STMMAC_RX_COE_NONE;
>> +	}
> Couldn't this be done in dwmac-loongson.c?

Sorry for the late reply, I have been busy with patches 4 and 5.

I think I can give you a definite answer: This is possible, just like

the method you mentioned in patch 5, I only need to

overwrite ld->dwlgmac_dma_ops.get_hw_feature.


Thanks,

Yanteng

>
> -Serge(y)
>
>> +
>>   	stmmac_dwmac_mode_quirk(priv);
>>   	return 0;
>>   }
>> -- 
>> 2.31.4
>>
diff mbox series

Patch

diff --git a/drivers/net/ethernet/stmicro/stmmac/hwif.c b/drivers/net/ethernet/stmicro/stmmac/hwif.c
index 3724cf698de6..f211880925aa 100644
--- a/drivers/net/ethernet/stmicro/stmmac/hwif.c
+++ b/drivers/net/ethernet/stmicro/stmmac/hwif.c
@@ -73,6 +73,11 @@  static int stmmac_dwmac1_quirks(struct stmmac_priv *priv)
 		mac->desc = &ndesc_ops;
 	}
 
+	if (priv->synopsys_id == DWLGMAC_CORE_1_00) {
+		priv->plat->tx_coe = 0;
+		priv->plat->rx_coe = STMMAC_RX_COE_NONE;
+	}
+
 	stmmac_dwmac_mode_quirk(priv);
 	return 0;
 }