diff mbox series

[net] net: ftgmac100: corrcet the phy interface of NC-SI mode

Message ID 20241011082827.2205979-1-jacky_chou@aspeedtech.com (mailing list archive)
State Changes Requested
Delegated to: Netdev Maintainers
Headers show
Series [net] net: ftgmac100: corrcet the phy interface of NC-SI mode | 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: 5 this patch: 5
netdev/build_tools success No tools touched, skip
netdev/cc_maintainers success CCed 6 of 6 maintainers
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: 3 this patch: 3
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
netdev/contest success net-next-2024-10-12--12-00 (tests: 777)

Commit Message

Jacky Chou Oct. 11, 2024, 8:28 a.m. UTC
In NC-SI specification, NC-SI is using RMII, not MII.

Fixes: e24a6c874601 ("net: ftgmac100: Get link speed and duplex for NC-SI")
Signed-off-by: Jacky Chou <jacky_chou@aspeedtech.com>
---
 drivers/net/ethernet/faraday/ftgmac100.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Andrew Lunn Oct. 12, 2024, 6:29 p.m. UTC | #1
On Fri, Oct 11, 2024 at 04:28:27PM +0800, Jacky Chou wrote:
> In NC-SI specification, NC-SI is using RMII, not MII.
> 
> Fixes: e24a6c874601 ("net: ftgmac100: Get link speed and duplex for NC-SI")
> Signed-off-by: Jacky Chou <jacky_chou@aspeedtech.com>
> ---
>  drivers/net/ethernet/faraday/ftgmac100.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/net/ethernet/faraday/ftgmac100.c b/drivers/net/ethernet/faraday/ftgmac100.c
> index ae0235a7a74e..85fea13b2879 100644
> --- a/drivers/net/ethernet/faraday/ftgmac100.c
> +++ b/drivers/net/ethernet/faraday/ftgmac100.c
> @@ -1913,7 +1913,7 @@ static int ftgmac100_probe(struct platform_device *pdev)
>  			goto err_phy_connect;
>  		}
>  		err = phy_connect_direct(netdev, phydev, ftgmac100_adjust_link,
> -					 PHY_INTERFACE_MODE_MII);
> +					 PHY_INTERFACE_MODE_RMII);
>  		if (err) {
>  			dev_err(&pdev->dev, "Connecting PHY failed\n");
>  			goto err_phy_connect;

I'm a but confused here. Please could you expand the commit
message. When i look at the code:

		phydev = fixed_phy_register(PHY_POLL, &ncsi_phy_status, NULL);
		err = phy_connect_direct(netdev, phydev, ftgmac100_adjust_link,
					 PHY_INTERFACE_MODE_MII);
		if (err) {
			dev_err(&pdev->dev, "Connecting PHY failed\n");
			goto err_phy_connect;
		}

The phy being connected to is a fixed PHY. So the interface mode
should not matter, at least to the PHY, since there is no physical
PHY. Does the MAC driver get this value returned to it, e.g. as part
of ftgmac100_adjust_link, and the MAC then configures itself into the
wrong interface mode?

For a patch with a Fixes: it is good to describe the problem the user
sees.

	Andrew
Jacky Chou Oct. 14, 2024, 2:23 a.m. UTC | #2
Hi Andrew,

Thanks for the review.

> > In NC-SI specification, NC-SI is using RMII, not MII.
> >
> > Fixes: e24a6c874601 ("net: ftgmac100: Get link speed and duplex for
> > NC-SI")
> > Signed-off-by: Jacky Chou <jacky_chou@aspeedtech.com>
> > ---
> >  drivers/net/ethernet/faraday/ftgmac100.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/drivers/net/ethernet/faraday/ftgmac100.c
> > b/drivers/net/ethernet/faraday/ftgmac100.c
> > index ae0235a7a74e..85fea13b2879 100644
> > --- a/drivers/net/ethernet/faraday/ftgmac100.c
> > +++ b/drivers/net/ethernet/faraday/ftgmac100.c
> > @@ -1913,7 +1913,7 @@ static int ftgmac100_probe(struct platform_device
> *pdev)
> >  			goto err_phy_connect;
> >  		}
> >  		err = phy_connect_direct(netdev, phydev, ftgmac100_adjust_link,
> > -					 PHY_INTERFACE_MODE_MII);
> > +					 PHY_INTERFACE_MODE_RMII);
> >  		if (err) {
> >  			dev_err(&pdev->dev, "Connecting PHY failed\n");
> >  			goto err_phy_connect;
> 
> I'm a but confused here. Please could you expand the commit message. When i
> look at the code:
> 
> 		phydev = fixed_phy_register(PHY_POLL, &ncsi_phy_status, NULL);
> 		err = phy_connect_direct(netdev, phydev, ftgmac100_adjust_link,
> 					 PHY_INTERFACE_MODE_MII);
> 		if (err) {
> 			dev_err(&pdev->dev, "Connecting PHY failed\n");
> 			goto err_phy_connect;
> 		}
> 
> The phy being connected to is a fixed PHY. So the interface mode should not
> matter, at least to the PHY, since there is no physical PHY. Does the MAC driver
> get this value returned to it, e.g. as part of ftgmac100_adjust_link, and the
> MAC then configures itself into the wrong interface mode?
> 
> For a patch with a Fixes: it is good to describe the problem the user sees.

Although it is connected to a fixed PHY and do not care what interface mode is, 
the driver still configures the correct interface.

In the ftgmac100 driver, the MAC driver does not actually need to know the interface mode 
connecting the MAC and PHY.
The driver just needs to get some information from the PHY, like speed, duplex and so on, to 
configure the MAC.

Perhaps it is not matter on PHY interface to MAC, it should correct to the correct interface mode 
for code.

Jacky
Andrew Lunn Oct. 14, 2024, 1:22 p.m. UTC | #3
On Mon, Oct 14, 2024 at 02:23:40AM +0000, Jacky Chou wrote:
> Hi Andrew,
> 
> Thanks for the review.
> 
> > > In NC-SI specification, NC-SI is using RMII, not MII.
> > >
> > > Fixes: e24a6c874601 ("net: ftgmac100: Get link speed and duplex for
> > > NC-SI")
> > > Signed-off-by: Jacky Chou <jacky_chou@aspeedtech.com>
> > > ---
> > >  drivers/net/ethernet/faraday/ftgmac100.c | 2 +-
> > >  1 file changed, 1 insertion(+), 1 deletion(-)
> > >
> > > diff --git a/drivers/net/ethernet/faraday/ftgmac100.c
> > > b/drivers/net/ethernet/faraday/ftgmac100.c
> > > index ae0235a7a74e..85fea13b2879 100644
> > > --- a/drivers/net/ethernet/faraday/ftgmac100.c
> > > +++ b/drivers/net/ethernet/faraday/ftgmac100.c
> > > @@ -1913,7 +1913,7 @@ static int ftgmac100_probe(struct platform_device
> > *pdev)
> > >  			goto err_phy_connect;
> > >  		}
> > >  		err = phy_connect_direct(netdev, phydev, ftgmac100_adjust_link,
> > > -					 PHY_INTERFACE_MODE_MII);
> > > +					 PHY_INTERFACE_MODE_RMII);
> > >  		if (err) {
> > >  			dev_err(&pdev->dev, "Connecting PHY failed\n");
> > >  			goto err_phy_connect;
> > 
> > I'm a but confused here. Please could you expand the commit message. When i
> > look at the code:
> > 
> > 		phydev = fixed_phy_register(PHY_POLL, &ncsi_phy_status, NULL);
> > 		err = phy_connect_direct(netdev, phydev, ftgmac100_adjust_link,
> > 					 PHY_INTERFACE_MODE_MII);
> > 		if (err) {
> > 			dev_err(&pdev->dev, "Connecting PHY failed\n");
> > 			goto err_phy_connect;
> > 		}
> > 
> > The phy being connected to is a fixed PHY. So the interface mode should not
> > matter, at least to the PHY, since there is no physical PHY. Does the MAC driver
> > get this value returned to it, e.g. as part of ftgmac100_adjust_link, and the
> > MAC then configures itself into the wrong interface mode?
> > 
> > For a patch with a Fixes: it is good to describe the problem the user sees.
> 
> Although it is connected to a fixed PHY and do not care what interface mode is, 
> the driver still configures the correct interface.
> 
> In the ftgmac100 driver, the MAC driver does not actually need to know the interface mode 
> connecting the MAC and PHY.
> The driver just needs to get some information from the PHY, like speed, duplex and so on, to 
> configure the MAC.
> 
> Perhaps it is not matter on PHY interface to MAC, it should correct to the correct interface mode 
> for code.

So nothing is actually broken which a user would notice. So please
drop the Fixes: tag, and submit this for net-next.

     Andrew
diff mbox series

Patch

diff --git a/drivers/net/ethernet/faraday/ftgmac100.c b/drivers/net/ethernet/faraday/ftgmac100.c
index ae0235a7a74e..85fea13b2879 100644
--- a/drivers/net/ethernet/faraday/ftgmac100.c
+++ b/drivers/net/ethernet/faraday/ftgmac100.c
@@ -1913,7 +1913,7 @@  static int ftgmac100_probe(struct platform_device *pdev)
 			goto err_phy_connect;
 		}
 		err = phy_connect_direct(netdev, phydev, ftgmac100_adjust_link,
-					 PHY_INTERFACE_MODE_MII);
+					 PHY_INTERFACE_MODE_RMII);
 		if (err) {
 			dev_err(&pdev->dev, "Connecting PHY failed\n");
 			goto err_phy_connect;