diff mbox series

[net-next,v12,08/15] net: stmmac: dwmac-loongson: Add phy mask for Loongson GMAC

Message ID d0607989f5bf64c4251259af72d8816469e8865f.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 success Errors and warnings before: 926 this patch: 926
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 success Errors and warnings before: 937 this patch: 937
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 success Errors and warnings before: 937 this patch: 937
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

Yanteng Si April 25, 2024, 1:06 p.m. UTC
The phy mask of gmac(and gnet) is 0.

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

Comments

Serge Semin May 3, 2024, 6:28 p.m. UTC | #1
On Thu, Apr 25, 2024 at 09:06:11PM +0800, Yanteng Si wrote:
> The phy mask of gmac(and gnet) is 0.

First of all the GNET PHY mask won't be zero as you setting it up to
~BIT(2) in the patch 13 yourself. Secondly the stmmac_mdio_bus_data
structure instance is Z-malloced, thus it will be zeroed anyway. So
the only reason why the explicit stmmac_mdio_bus_data::phy_mask
zeroing would be useful is to signify the difference between the GMAC
and GNET devices. But that difference could be relatively easy
inferred from the code. So to speak IMO the patch has a little value.
I would drop it.

-Serge(y)

> 
> Signed-off-by: Feiyang Chen <chenfeiyang@loongson.cn>
> Signed-off-by: Yinggang Gu <guyinggang@loongson.cn>
> Signed-off-by: Yanteng Si <siyanteng@loongson.cn>
> ---
>  drivers/net/ethernet/stmicro/stmmac/dwmac-loongson.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-loongson.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-loongson.c
> index 9f208f84c1e7..f7618edf4a3a 100644
> --- a/drivers/net/ethernet/stmicro/stmmac/dwmac-loongson.c
> +++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-loongson.c
> @@ -48,6 +48,8 @@ static int loongson_gmac_data(struct plat_stmmacenet_data *plat)
>  {
>  	loongson_default_data(plat);
>  
> +	plat->mdio_bus_data->phy_mask = 0;
> +
>  	return 0;
>  }
>  
> -- 
> 2.31.4
>
Yanteng Si May 13, 2024, 10:23 a.m. UTC | #2
在 2024/5/4 02:28, Serge Semin 写道:
> On Thu, Apr 25, 2024 at 09:06:11PM +0800, Yanteng Si wrote:
>> The phy mask of gmac(and gnet) is 0.
> First of all the GNET PHY mask won't be zero as you setting it up to
> ~BIT(2) in the patch 13 yourself. Secondly the stmmac_mdio_bus_data
> structure instance is Z-malloced, thus it will be zeroed anyway. So
> the only reason why the explicit stmmac_mdio_bus_data::phy_mask
> zeroing would be useful is to signify the difference between the GMAC
> and GNET devices. But that difference could be relatively easy
> inferred from the code. So to speak IMO the patch has a little value.
> I would drop it.

OK, drop it.


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 9f208f84c1e7..f7618edf4a3a 100644
--- a/drivers/net/ethernet/stmicro/stmmac/dwmac-loongson.c
+++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-loongson.c
@@ -48,6 +48,8 @@  static int loongson_gmac_data(struct plat_stmmacenet_data *plat)
 {
 	loongson_default_data(plat);
 
+	plat->mdio_bus_data->phy_mask = 0;
+
 	return 0;
 }