From: "Russell King (Oracle)" <rmk+kernel@armlinux.org.uk>
To: Vladimir Oltean <olteanv@gmail.com>
Cc: Marek Beh__n <kabel@kernel.org>, Andrew Lunn <andrew@lunn.ch>,
Vivien Didelot <vivien.didelot@gmail.com>,
Florian Fainelli <f.fainelli@gmail.com>,
"David S. Miller" <davem@davemloft.net>,
Jakub Kicinski <kuba@kernel.org>,
netdev@vger.kernel.org
Subject: [PATCH net-next 2/6] net: dsa: sja1105: remove interface checks
Date: Fri, 25 Feb 2022 11:56:07 +0000 [thread overview]
Message-ID: <E1nNZCh-00Ab1W-Ob@rmk-PC.armlinux.org.uk> (raw)
In-Reply-To: <YhjDvsSC1gZAYF74@shell.armlinux.org.uk>
When the supported interfaces bitmap is populated, phylink will itself
check that the interface mode is present in this bitmap. Drivers no
longer need to perform this check themselves. Remove these checks.
Reviewed-by: Vladimir Oltean <olteanv@gmail.com> Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
---
drivers/net/dsa/sja1105/sja1105_main.c | 29 --------------------------
1 file changed, 29 deletions(-)
diff --git a/drivers/net/dsa/sja1105/sja1105_main.c b/drivers/net/dsa/sja1105/sja1105_main.c
index 90e73a982faf..e278bd86e3c6 100644
--- a/drivers/net/dsa/sja1105/sja1105_main.c
+++ b/drivers/net/dsa/sja1105/sja1105_main.c
@@ -1358,19 +1358,6 @@ static int sja1105_adjust_port_config(struct sja1105_private *priv, int port,
return sja1105_clocking_setup_port(priv, port);
}
-/* The SJA1105 MAC programming model is through the static config (the xMII
- * Mode table cannot be dynamically reconfigured), and we have to program
- * that early (earlier than PHYLINK calls us, anyway).
- * So just error out in case the connected PHY attempts to change the initial
- * system interface MII protocol from what is defined in the DT, at least for
- * now.
- */
-static bool sja1105_phy_mode_mismatch(struct sja1105_private *priv, int port,
- phy_interface_t interface)
-{
- return priv->phy_mode[port] != interface;
-}
-
static void sja1105_mac_config(struct dsa_switch *ds, int port,
unsigned int mode,
const struct phylink_link_state *state)
@@ -1379,12 +1366,6 @@ static void sja1105_mac_config(struct dsa_switch *ds, int port,
struct sja1105_private *priv = ds->priv;
struct dw_xpcs *xpcs;
- if (sja1105_phy_mode_mismatch(priv, port, state->interface)) {
- dev_err(ds->dev, "Changing PHY mode to %s not supported!\n",
- phy_modes(state->interface));
- return;
- }
-
xpcs = priv->xpcs[port];
if (xpcs)
@@ -1438,16 +1419,6 @@ static void sja1105_phylink_validate(struct dsa_switch *ds, int port,
mii = priv->static_config.tables[BLK_IDX_XMII_PARAMS].entries;
- /* include/linux/phylink.h says:
- * When @state->interface is %PHY_INTERFACE_MODE_NA, phylink
- * expects the MAC driver to return all supported link modes.
- */
- if (state->interface != PHY_INTERFACE_MODE_NA &&
- sja1105_phy_mode_mismatch(priv, port, state->interface)) {
- linkmode_zero(supported);
- return;
- }
-
/* The MAC does not support pause frames, and also doesn't
* support half-duplex traffic modes.
*/
--
2.30.2
next prev parent reply other threads:[~2022-02-25 11:56 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-02-25 11:55 [PATCH net-next 0/6] net: dsa: sja1105: phylink updates Russell King (Oracle)
2022-02-25 11:56 ` [PATCH net-next 1/6] net: dsa: sja1105: populate supported_interfaces Russell King (Oracle)
2022-02-25 11:56 ` Russell King (Oracle)
2022-02-25 11:58 ` Vladimir Oltean
2022-02-25 12:08 ` Russell King (Oracle)
2022-02-25 12:15 ` Vladimir Oltean
2022-02-25 12:41 ` Russell King (Oracle)
2022-02-25 11:56 ` Russell King (Oracle) [this message]
2022-02-25 11:56 ` [PATCH net-next 3/6] net: dsa: sja1105: use .mac_select_pcs() interface Russell King (Oracle)
2022-02-25 11:56 ` [PATCH net-next 4/6] net: dsa: sja1105: mark as non-legacy Russell King (Oracle)
2022-02-25 11:56 ` [PATCH net-next 5/6] net: dsa: sja1105: convert to phylink_generic_validate() Russell King (Oracle)
2022-02-25 11:56 ` [PATCH net-next 6/6] net: dsa: sja1105: support switching between SGMII and 2500BASE-X Russell King (Oracle)
-- strict thread matches above, loose matches on Subject: below --
2022-02-25 11:59 [PATCH net-next v2 0/6] net: dsa: sja1105: phylink updates Russell King (Oracle)
2022-02-25 12:00 ` [PATCH net-next 2/6] net: dsa: sja1105: remove interface checks Russell King (Oracle)
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=E1nNZCh-00Ab1W-Ob@rmk-PC.armlinux.org.uk \
--to=rmk+kernel@armlinux.org.uk \
--cc=andrew@lunn.ch \
--cc=davem@davemloft.net \
--cc=f.fainelli@gmail.com \
--cc=kabel@kernel.org \
--cc=kuba@kernel.org \
--cc=netdev@vger.kernel.org \
--cc=olteanv@gmail.com \
--cc=vivien.didelot@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).