diff mbox series

[net-next,11/15] net: qca8k: update PCS driver to use neg_mode

Message ID E1qA8EU-00EaG9-1l@rmk-PC.armlinux.org.uk (mailing list archive)
State Accepted
Commit bfa0a3ac05b69842aaee7c60a8ceffd734f2e2b9
Delegated to: Netdev Maintainers
Headers show
Series Add and use helper for PCS negotiation modes | expand

Checks

Context Check Description
netdev/series_format success Posting correctly formatted
netdev/tree_selection success Clearly marked for net-next
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: 8 this patch: 8
netdev/cc_maintainers warning 1 maintainers not CCed: ansuelsmth@gmail.com
netdev/build_clang success Errors and warnings before: 8 this patch: 8
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: 8 this patch: 8
netdev/checkpatch success total: 0 errors, 0 warnings, 0 checks, 33 lines checked
netdev/kdoc success Errors and warnings before: 0 this patch: 0
netdev/source_inline success Was 0 now: 0

Commit Message

Russell King (Oracle) June 16, 2023, 12:07 p.m. UTC
Update qca8k's embedded PCS driver to use neg_mode rather than the
mode argument. As there is no pcs_link_up() method, this only affects
the pcs_config() method.

Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
---
 drivers/net/dsa/qca/qca8k-8xxx.c | 13 ++++++-------
 1 file changed, 6 insertions(+), 7 deletions(-)

Comments

Russell King (Oracle) June 20, 2023, 9:18 a.m. UTC | #1
On Fri, Jun 16, 2023 at 01:07:14PM +0100, Russell King (Oracle) wrote:
> Update qca8k's embedded PCS driver to use neg_mode rather than the
> mode argument. As there is no pcs_link_up() method, this only affects
> the pcs_config() method.
> 
> Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>

I see netdevbpf patchwork is complaining that I didn't Cc a maintainer
for this patch (ansuelsmth@gmail.com). Why is it complaining? This
address is *not* in the MAINTAINERS file in the net-next tree neither
for the version I generated the patch against (tip on submission date),
today's tip, nor the net tree.

Is patchwork using an outdated MAINTAINERS file?
Vladimir Oltean June 20, 2023, 11:28 a.m. UTC | #2
On Tue, Jun 20, 2023 at 10:18:13AM +0100, Russell King (Oracle) wrote:
> On Fri, Jun 16, 2023 at 01:07:14PM +0100, Russell King (Oracle) wrote:
> > Update qca8k's embedded PCS driver to use neg_mode rather than the
> > mode argument. As there is no pcs_link_up() method, this only affects
> > the pcs_config() method.
> > 
> > Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
> 
> I see netdevbpf patchwork is complaining that I didn't Cc a maintainer
> for this patch (ansuelsmth@gmail.com). Why is it complaining? This
> address is *not* in the MAINTAINERS file in the net-next tree neither
> for the version I generated the patch against (tip on submission date),
> today's tip, nor the net tree.
> 
> Is patchwork using an outdated MAINTAINERS file?
> 
> -- 
> RMK's Patch system: https://www.armlinux.org.uk/developer/patches/
> FTTP is here! 80Mbps down 10Mbps up. Decent connectivity at last!

I can presume that patchwork runs scripts/get_maintainer.pl, which looks
not only at the MAINTAINERS file, but also at the recent authors and
sign offs from git for a certain file path.
Jakub Kicinski June 20, 2023, 4:22 p.m. UTC | #3
On Tue, 20 Jun 2023 14:28:58 +0300 Vladimir Oltean wrote:
> On Tue, Jun 20, 2023 at 10:18:13AM +0100, Russell King (Oracle) wrote:
> > I see netdevbpf patchwork is complaining that I didn't Cc a maintainer
> > for this patch (ansuelsmth@gmail.com). Why is it complaining? This
> > address is *not* in the MAINTAINERS file in the net-next tree neither
> > for the version I generated the patch against (tip on submission date),
> > today's tip, nor the net tree.
> > 
> > Is patchwork using an outdated MAINTAINERS file?
> > 
> > -- 
> > RMK's Patch system: https://www.armlinux.org.uk/developer/patches/
> > FTTP is here! 80Mbps down 10Mbps up. Decent connectivity at last!  
> 
> I can presume that patchwork runs scripts/get_maintainer.pl, which looks
> not only at the MAINTAINERS file, but also at the recent authors and
> sign offs from git for a certain file path.

The exact incantation it uses is:

./scripts/get_maintainer.pl --git-min-percent 25

But it's just a warning because get_maintainer sometimes reports 
stupid stuff.
diff mbox series

Patch

diff --git a/drivers/net/dsa/qca/qca8k-8xxx.c b/drivers/net/dsa/qca/qca8k-8xxx.c
index dee7b6579916..f7d7cfb2fd86 100644
--- a/drivers/net/dsa/qca/qca8k-8xxx.c
+++ b/drivers/net/dsa/qca/qca8k-8xxx.c
@@ -1493,7 +1493,7 @@  static void qca8k_pcs_get_state(struct phylink_pcs *pcs,
 		state->pause |= MLO_PAUSE_TX;
 }
 
-static int qca8k_pcs_config(struct phylink_pcs *pcs, unsigned int mode,
+static int qca8k_pcs_config(struct phylink_pcs *pcs, unsigned int neg_mode,
 			    phy_interface_t interface,
 			    const unsigned long *advertising,
 			    bool permit_pause_to_mac)
@@ -1520,14 +1520,12 @@  static int qca8k_pcs_config(struct phylink_pcs *pcs, unsigned int mode,
 	}
 
 	/* Enable/disable SerDes auto-negotiation as necessary */
-	ret = qca8k_read(priv, QCA8K_REG_PWS, &val);
+	val = neg_mode == PHYLINK_PCS_NEG_INBAND_ENABLED ?
+		0 : QCA8K_PWS_SERDES_AEN_DIS;
+
+	ret = qca8k_rmw(priv, QCA8K_REG_PWS, QCA8K_PWS_SERDES_AEN_DIS, val);
 	if (ret)
 		return ret;
-	if (phylink_autoneg_inband(mode))
-		val &= ~QCA8K_PWS_SERDES_AEN_DIS;
-	else
-		val |= QCA8K_PWS_SERDES_AEN_DIS;
-	qca8k_write(priv, QCA8K_REG_PWS, val);
 
 	/* Configure the SGMII parameters */
 	ret = qca8k_read(priv, QCA8K_REG_SGMII_CTRL, &val);
@@ -1598,6 +1596,7 @@  static void qca8k_setup_pcs(struct qca8k_priv *priv, struct qca8k_pcs *qpcs,
 			    int port)
 {
 	qpcs->pcs.ops = &qca8k_pcs_ops;
+	qpcs->pcs.neg_mode = true;
 
 	/* We don't have interrupts for link changes, so we need to poll */
 	qpcs->pcs.poll = true;