* [PATCH net-next v3 0/7] net: dsa: lantiq_gswip: use regmap for register access
@ 2025-10-19 12:46 Daniel Golle
2025-10-19 12:46 ` [PATCH net-next v3 1/7] net: dsa: lantiq_gswip: clarify GSWIP 2.2 VLAN mode in comment Daniel Golle
` (6 more replies)
0 siblings, 7 replies; 15+ messages in thread
From: Daniel Golle @ 2025-10-19 12:46 UTC (permalink / raw)
To: Hauke Mehrtens, Andrew Lunn, Vladimir Oltean, David S. Miller,
Eric Dumazet, Jakub Kicinski, Paolo Abeni, Russell King, netdev,
linux-kernel
Cc: Andreas Schirm, Lukas Stockmann, Alexander Sverdlin,
Peter Christen, Avinash Jayaraman, Bing tao Xu, Liang Xu,
Juraj Povazanec, Fanni (Fang-Yi) Chan, Benny (Ying-Tsan) Weng,
Livia M. Rosu, John Crispin
This series refactors the lantiq_gswip driver to utilize the regmap API
for register access, replacing the previous approach of open-coding
register operations.
Using regmap paves the way for supporting different busses to access the
switch registers, for example it makes it easier to use an MDIO-based
method required to access the registers of the MaxLinear GSW1xx series
of dedicated switch ICs.
Apart from that, the use of regmap improves readability and
maintainability of the driver by standardizing register access.
When ever possible changes were made using Coccinelle semantic patches,
sometimes adjusting white space and adding line breaks when needed.
The remaining changes which were not done using semantic patches are
small and should be easy to review and verify.
The series was previously posted as RFC[1], changes since the RFC/v1
version are documented in each changed patch.
Apart from the now fixed subject line there have been no changes between
v2 and v3.
[1]: https://patchwork.kernel.org/project/netdevbpf/list/?series=998183&state=*
Changes since v2:
* correctly target net-next tree (fix typo in subject)
Changes since RFC:
* drop error handling, it wasn't there before and it would anyway be
removed again by a follow-up change
* optimize more of the regmap_write_bits() calls
Daniel Golle (7):
net: dsa: lantiq_gswip: clarify GSWIP 2.2 VLAN mode in comment
net: dsa: lantiq_gswip: convert accessors to use regmap
net: dsa: lantiq_gswip: convert trivial accessor uses to regmap
net: dsa: lantiq_gswip: manually convert remaining uses of read
accessors
net: dsa: lantiq_gswip: replace *_mask() functions with regmap API
net: dsa: lantiq_gswip: optimize regmap_write_bits() statements
net: dsa: lantiq_gswip: harmonize gswip_mii_mask_*() parameters
drivers/net/dsa/lantiq/Kconfig | 1 +
drivers/net/dsa/lantiq/lantiq_gswip.c | 458 +++++++++++++-------------
drivers/net/dsa/lantiq/lantiq_gswip.h | 6 +-
3 files changed, 239 insertions(+), 226 deletions(-)
--
2.51.1.dirty
^ permalink raw reply [flat|nested] 15+ messages in thread
* [PATCH net-next v3 1/7] net: dsa: lantiq_gswip: clarify GSWIP 2.2 VLAN mode in comment
2025-10-19 12:46 [PATCH net-next v3 0/7] net: dsa: lantiq_gswip: use regmap for register access Daniel Golle
@ 2025-10-19 12:46 ` Daniel Golle
2025-10-22 2:29 ` Andrew Lunn
2025-10-19 12:47 ` [PATCH net-next v3 2/7] net: dsa: lantiq_gswip: convert accessors to use regmap Daniel Golle
` (5 subsequent siblings)
6 siblings, 1 reply; 15+ messages in thread
From: Daniel Golle @ 2025-10-19 12:46 UTC (permalink / raw)
To: Hauke Mehrtens, Andrew Lunn, Vladimir Oltean, David S. Miller,
Eric Dumazet, Jakub Kicinski, Paolo Abeni, Russell King, netdev,
linux-kernel
The comment above writing the default PVID incorrectly states that
"GSWIP 2.2 (GRX300) and later program here the VID directly."
The truth is that even GSWIP 2.2 and newer maintain the behavior of
GSWIP 2.1 unless the VLANMD bit in PCE Global Control Register 1 is
set ("GSWIP2.2 VLAN Mode").
Fix the misleading comment accordingly.
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
---
drivers/net/dsa/lantiq/lantiq_gswip.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/drivers/net/dsa/lantiq/lantiq_gswip.c b/drivers/net/dsa/lantiq/lantiq_gswip.c
index 25f6b46957a0..86b410a40d32 100644
--- a/drivers/net/dsa/lantiq/lantiq_gswip.c
+++ b/drivers/net/dsa/lantiq/lantiq_gswip.c
@@ -588,7 +588,11 @@ static void gswip_port_commit_pvid(struct gswip_priv *priv, int port)
FIELD_PREP(GSWIP_PCE_VCTRL_VINR, vinr),
GSWIP_PCE_VCTRL(port));
- /* GSWIP 2.2 (GRX300) and later program here the VID directly. */
+ /* Note that in GSWIP 2.2 VLAN mode the VID needs to be programmed
+ * directly instead of referencing the index in the Active VLAN Tablet.
+ * However, without the VLANMD bit (9) in PCE_GCTRL_1 (0x457) even
+ * GSWIP 2.2 and newer hardware maintain the GSWIP 2.1 behavior.
+ */
gswip_switch_w(priv, idx, GSWIP_PCE_DEFPVID(port));
}
--
2.51.1.dirty
^ permalink raw reply related [flat|nested] 15+ messages in thread
* [PATCH net-next v3 2/7] net: dsa: lantiq_gswip: convert accessors to use regmap
2025-10-19 12:46 [PATCH net-next v3 0/7] net: dsa: lantiq_gswip: use regmap for register access Daniel Golle
2025-10-19 12:46 ` [PATCH net-next v3 1/7] net: dsa: lantiq_gswip: clarify GSWIP 2.2 VLAN mode in comment Daniel Golle
@ 2025-10-19 12:47 ` Daniel Golle
2025-10-22 2:34 ` Andrew Lunn
2025-10-19 12:48 ` [PATCH net-next v3 3/7] net: dsa: lantiq_gswip: convert trivial accessor uses to regmap Daniel Golle
` (4 subsequent siblings)
6 siblings, 1 reply; 15+ messages in thread
From: Daniel Golle @ 2025-10-19 12:47 UTC (permalink / raw)
To: Hauke Mehrtens, Andrew Lunn, Vladimir Oltean, David S. Miller,
Eric Dumazet, Jakub Kicinski, Paolo Abeni, Russell King, netdev,
linux-kernel
Cc: Andreas Schirm, Lukas Stockmann, Alexander Sverdlin,
Peter Christen, Avinash Jayaraman, Bing tao Xu, Liang Xu,
Juraj Povazanec, Fanni (Fang-Yi) Chan, Benny (Ying-Tsan) Weng,
Livia M. Rosu, John Crispin
Use regmap for register access in preparation for supporting the MaxLinear
GSW1xx family of switches connected via MDIO or SPI.
Rewrite the existing accessor read-poll-timeout functions to use calls to
the regmap API for now.
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
---
v2: drop error handling, it wasn't there before and it would anyway be
removed again by a follow-up change
drivers/net/dsa/lantiq/Kconfig | 1 +
drivers/net/dsa/lantiq/lantiq_gswip.c | 109 +++++++++++++++-----------
drivers/net/dsa/lantiq/lantiq_gswip.h | 6 +-
3 files changed, 69 insertions(+), 47 deletions(-)
diff --git a/drivers/net/dsa/lantiq/Kconfig b/drivers/net/dsa/lantiq/Kconfig
index 1cb053c823f7..3cfa16840cf5 100644
--- a/drivers/net/dsa/lantiq/Kconfig
+++ b/drivers/net/dsa/lantiq/Kconfig
@@ -2,6 +2,7 @@ config NET_DSA_LANTIQ_GSWIP
tristate "Lantiq / Intel GSWIP"
depends on HAS_IOMEM
select NET_DSA_TAG_GSWIP
+ select REGMAP
help
This enables support for the Lantiq / Intel GSWIP 2.1 found in
the xrx200 / VR9 SoC.
diff --git a/drivers/net/dsa/lantiq/lantiq_gswip.c b/drivers/net/dsa/lantiq/lantiq_gswip.c
index 86b410a40d32..7ca1767cd60e 100644
--- a/drivers/net/dsa/lantiq/lantiq_gswip.c
+++ b/drivers/net/dsa/lantiq/lantiq_gswip.c
@@ -113,22 +113,22 @@ static const struct gswip_rmon_cnt_desc gswip_rmon_cnt[] = {
static u32 gswip_switch_r(struct gswip_priv *priv, u32 offset)
{
- return __raw_readl(priv->gswip + (offset * 4));
+ u32 val;
+
+ regmap_read(priv->gswip, offset, &val);
+
+ return val;
}
static void gswip_switch_w(struct gswip_priv *priv, u32 val, u32 offset)
{
- __raw_writel(val, priv->gswip + (offset * 4));
+ regmap_write(priv->gswip, offset, val);
}
static void gswip_switch_mask(struct gswip_priv *priv, u32 clear, u32 set,
u32 offset)
{
- u32 val = gswip_switch_r(priv, offset);
-
- val &= ~(clear);
- val |= set;
- gswip_switch_w(priv, val, offset);
+ regmap_write_bits(priv->gswip, offset, clear | set, set);
}
static u32 gswip_switch_r_timeout(struct gswip_priv *priv, u32 offset,
@@ -136,48 +136,34 @@ static u32 gswip_switch_r_timeout(struct gswip_priv *priv, u32 offset,
{
u32 val;
- return readx_poll_timeout(__raw_readl, priv->gswip + (offset * 4), val,
- (val & cleared) == 0, 20, 50000);
+ return regmap_read_poll_timeout(priv->gswip, offset, val,
+ !(val & cleared), 20, 50000);
}
static u32 gswip_mdio_r(struct gswip_priv *priv, u32 offset)
{
- return __raw_readl(priv->mdio + (offset * 4));
+ u32 val;
+
+ regmap_read(priv->mdio, offset, &val);
+
+ return val;
}
static void gswip_mdio_w(struct gswip_priv *priv, u32 val, u32 offset)
{
- __raw_writel(val, priv->mdio + (offset * 4));
+ regmap_write(priv->mdio, offset, val);
}
static void gswip_mdio_mask(struct gswip_priv *priv, u32 clear, u32 set,
u32 offset)
{
- u32 val = gswip_mdio_r(priv, offset);
-
- val &= ~(clear);
- val |= set;
- gswip_mdio_w(priv, val, offset);
-}
-
-static u32 gswip_mii_r(struct gswip_priv *priv, u32 offset)
-{
- return __raw_readl(priv->mii + (offset * 4));
-}
-
-static void gswip_mii_w(struct gswip_priv *priv, u32 val, u32 offset)
-{
- __raw_writel(val, priv->mii + (offset * 4));
+ regmap_write_bits(priv->mdio, offset, clear | set, set);
}
static void gswip_mii_mask(struct gswip_priv *priv, u32 clear, u32 set,
u32 offset)
{
- u32 val = gswip_mii_r(priv, offset);
-
- val &= ~(clear);
- val |= set;
- gswip_mii_w(priv, val, offset);
+ regmap_write_bits(priv->mii, offset, clear | set, set);
}
static void gswip_mii_mask_cfg(struct gswip_priv *priv, u32 clear, u32 set,
@@ -220,17 +208,10 @@ static void gswip_mii_mask_pcdu(struct gswip_priv *priv, u32 clear, u32 set,
static int gswip_mdio_poll(struct gswip_priv *priv)
{
- int cnt = 100;
+ u32 ctrl;
- while (likely(cnt--)) {
- u32 ctrl = gswip_mdio_r(priv, GSWIP_MDIO_CTRL);
-
- if ((ctrl & GSWIP_MDIO_CTRL_BUSY) == 0)
- return 0;
- usleep_range(20, 40);
- }
-
- return -ETIMEDOUT;
+ return regmap_read_poll_timeout(priv->mdio, GSWIP_MDIO_CTRL, ctrl,
+ !(ctrl & GSWIP_MDIO_CTRL_BUSY), 40, 4000);
}
static int gswip_mdio_wr(struct mii_bus *bus, int addr, int reg, u16 val)
@@ -1893,9 +1874,37 @@ static int gswip_validate_cpu_port(struct dsa_switch *ds)
return 0;
}
+static const struct regmap_config sw_regmap_config = {
+ .name = "switch",
+ .reg_bits = 32,
+ .val_bits = 32,
+ .reg_shift = -2,
+ .val_format_endian = REGMAP_ENDIAN_NATIVE,
+ .max_register = GSWIP_SDMA_PCTRLp(6),
+};
+
+static const struct regmap_config mdio_regmap_config = {
+ .name = "mdio",
+ .reg_bits = 32,
+ .val_bits = 32,
+ .reg_shift = -2,
+ .val_format_endian = REGMAP_ENDIAN_NATIVE,
+ .max_register = GSWIP_MDIO_PHYp(0),
+};
+
+static const struct regmap_config mii_regmap_config = {
+ .name = "mii",
+ .reg_bits = 32,
+ .val_bits = 32,
+ .reg_shift = -2,
+ .val_format_endian = REGMAP_ENDIAN_NATIVE,
+ .max_register = GSWIP_MII_CFGp(6),
+};
+
static int gswip_probe(struct platform_device *pdev)
{
struct device_node *np, *gphy_fw_np;
+ __iomem void *gswip, *mdio, *mii;
struct device *dev = &pdev->dev;
struct gswip_priv *priv;
int err;
@@ -1906,15 +1915,27 @@ static int gswip_probe(struct platform_device *pdev)
if (!priv)
return -ENOMEM;
- priv->gswip = devm_platform_ioremap_resource(pdev, 0);
+ gswip = devm_platform_ioremap_resource(pdev, 0);
+ if (IS_ERR(gswip))
+ return PTR_ERR(gswip);
+
+ mdio = devm_platform_ioremap_resource(pdev, 1);
+ if (IS_ERR(mdio))
+ return PTR_ERR(mdio);
+
+ mii = devm_platform_ioremap_resource(pdev, 2);
+ if (IS_ERR(mii))
+ return PTR_ERR(mii);
+
+ priv->gswip = devm_regmap_init_mmio(dev, gswip, &sw_regmap_config);
if (IS_ERR(priv->gswip))
return PTR_ERR(priv->gswip);
- priv->mdio = devm_platform_ioremap_resource(pdev, 1);
+ priv->mdio = devm_regmap_init_mmio(dev, mdio, &mdio_regmap_config);
if (IS_ERR(priv->mdio))
return PTR_ERR(priv->mdio);
- priv->mii = devm_platform_ioremap_resource(pdev, 2);
+ priv->mii = devm_regmap_init_mmio(dev, mii, &mii_regmap_config);
if (IS_ERR(priv->mii))
return PTR_ERR(priv->mii);
diff --git a/drivers/net/dsa/lantiq/lantiq_gswip.h b/drivers/net/dsa/lantiq/lantiq_gswip.h
index 69c8d2deff2d..24d759e06e15 100644
--- a/drivers/net/dsa/lantiq/lantiq_gswip.h
+++ b/drivers/net/dsa/lantiq/lantiq_gswip.h
@@ -263,9 +263,9 @@ struct gswip_vlan {
};
struct gswip_priv {
- __iomem void *gswip;
- __iomem void *mdio;
- __iomem void *mii;
+ struct regmap *gswip;
+ struct regmap *mdio;
+ struct regmap *mii;
const struct gswip_hw_info *hw_info;
const struct xway_gphy_match_data *gphy_fw_name_cfg;
struct dsa_switch *ds;
--
2.51.1.dirty
^ permalink raw reply related [flat|nested] 15+ messages in thread
* [PATCH net-next v3 3/7] net: dsa: lantiq_gswip: convert trivial accessor uses to regmap
2025-10-19 12:46 [PATCH net-next v3 0/7] net: dsa: lantiq_gswip: use regmap for register access Daniel Golle
2025-10-19 12:46 ` [PATCH net-next v3 1/7] net: dsa: lantiq_gswip: clarify GSWIP 2.2 VLAN mode in comment Daniel Golle
2025-10-19 12:47 ` [PATCH net-next v3 2/7] net: dsa: lantiq_gswip: convert accessors to use regmap Daniel Golle
@ 2025-10-19 12:48 ` Daniel Golle
2025-10-22 2:35 ` Andrew Lunn
2025-10-19 12:48 ` [PATCH net-next v3 4/7] net: dsa: lantiq_gswip: manually convert remaining uses of read accessors Daniel Golle
` (3 subsequent siblings)
6 siblings, 1 reply; 15+ messages in thread
From: Daniel Golle @ 2025-10-19 12:48 UTC (permalink / raw)
To: Hauke Mehrtens, Andrew Lunn, Vladimir Oltean, David S. Miller,
Eric Dumazet, Jakub Kicinski, Paolo Abeni, Russell King, netdev,
linux-kernel
Cc: Andreas Schirm, Lukas Stockmann, Alexander Sverdlin,
Peter Christen, Avinash Jayaraman, Bing tao Xu, Liang Xu,
Juraj Povazanec, Fanni (Fang-Yi) Chan, Benny (Ying-Tsan) Weng,
Livia M. Rosu, John Crispin
Use coccinelle semantic patch to convert all trivial uses of the register
accessor functions to use the regmap API directly.
// Replace gswip_switch_w with regmap_write
@@
expression priv, val, offset;
@@
- gswip_switch_w(priv, val, offset)
+ regmap_write(priv->gswip, offset, val)
// Replace gswip_mdio_w with regmap_write
@@
expression priv, val, offset;
@@
- gswip_mdio_w(priv, val, offset)
+ regmap_write(priv->mdio, offset, val)
// Replace gswip_switch_r in simple assignment - only for u32
@@
expression priv, offset;
u32 var;
@@
- var = gswip_switch_r(priv, offset)
+ regmap_read(priv->gswip, offset, &var)
// Replace gswip_switch_mask with regmap_set_bits when clear is 0
@@
expression priv, set, offset;
@@
- gswip_switch_mask(priv, 0, set, offset)
+ regmap_set_bits(priv->gswip, offset, set)
// Replace gswip_mdio_mask with regmap_set_bits when clear is 0
@@
expression priv, set, offset;
@@
- gswip_mdio_mask(priv, 0, set, offset)
+ regmap_set_bits(priv->mdio, offset, set)
// Replace gswip_switch_mask with regmap_clear_bits when set is 0
@@
expression priv, clear, offset;
@@
- gswip_switch_mask(priv, clear, 0, offset)
+ regmap_clear_bits(priv->gswip, offset, clear)
// Replace gswip_mdio_mask with regmap_clear_bits when set is 0
@@
expression priv, clear, offset;
@@
- gswip_mdio_mask(priv, clear, 0, offset)
+ regmap_clear_bits(priv->mdio, offset, clear)
Remove gswip_switch_w() and gswip_mdio_w() functions as they now no
longer have any users.
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
---
drivers/net/dsa/lantiq/lantiq_gswip.c | 162 ++++++++++++--------------
1 file changed, 76 insertions(+), 86 deletions(-)
diff --git a/drivers/net/dsa/lantiq/lantiq_gswip.c b/drivers/net/dsa/lantiq/lantiq_gswip.c
index 7ca1767cd60e..8ab16972b2be 100644
--- a/drivers/net/dsa/lantiq/lantiq_gswip.c
+++ b/drivers/net/dsa/lantiq/lantiq_gswip.c
@@ -120,11 +120,6 @@ static u32 gswip_switch_r(struct gswip_priv *priv, u32 offset)
return val;
}
-static void gswip_switch_w(struct gswip_priv *priv, u32 val, u32 offset)
-{
- regmap_write(priv->gswip, offset, val);
-}
-
static void gswip_switch_mask(struct gswip_priv *priv, u32 clear, u32 set,
u32 offset)
{
@@ -149,11 +144,6 @@ static u32 gswip_mdio_r(struct gswip_priv *priv, u32 offset)
return val;
}
-static void gswip_mdio_w(struct gswip_priv *priv, u32 val, u32 offset)
-{
- regmap_write(priv->mdio, offset, val);
-}
-
static void gswip_mdio_mask(struct gswip_priv *priv, u32 clear, u32 set,
u32 offset)
{
@@ -225,11 +213,11 @@ static int gswip_mdio_wr(struct mii_bus *bus, int addr, int reg, u16 val)
return err;
}
- gswip_mdio_w(priv, val, GSWIP_MDIO_WRITE);
- gswip_mdio_w(priv, GSWIP_MDIO_CTRL_BUSY | GSWIP_MDIO_CTRL_WR |
- ((addr & GSWIP_MDIO_CTRL_PHYAD_MASK) << GSWIP_MDIO_CTRL_PHYAD_SHIFT) |
- (reg & GSWIP_MDIO_CTRL_REGAD_MASK),
- GSWIP_MDIO_CTRL);
+ regmap_write(priv->mdio, GSWIP_MDIO_WRITE, val);
+ regmap_write(priv->mdio, GSWIP_MDIO_CTRL,
+ GSWIP_MDIO_CTRL_BUSY | GSWIP_MDIO_CTRL_WR |
+ ((addr & GSWIP_MDIO_CTRL_PHYAD_MASK) << GSWIP_MDIO_CTRL_PHYAD_SHIFT) |
+ (reg & GSWIP_MDIO_CTRL_REGAD_MASK));
return 0;
}
@@ -245,10 +233,10 @@ static int gswip_mdio_rd(struct mii_bus *bus, int addr, int reg)
return err;
}
- gswip_mdio_w(priv, GSWIP_MDIO_CTRL_BUSY | GSWIP_MDIO_CTRL_RD |
- ((addr & GSWIP_MDIO_CTRL_PHYAD_MASK) << GSWIP_MDIO_CTRL_PHYAD_SHIFT) |
- (reg & GSWIP_MDIO_CTRL_REGAD_MASK),
- GSWIP_MDIO_CTRL);
+ regmap_write(priv->mdio, GSWIP_MDIO_CTRL,
+ GSWIP_MDIO_CTRL_BUSY | GSWIP_MDIO_CTRL_RD |
+ ((addr & GSWIP_MDIO_CTRL_PHYAD_MASK) << GSWIP_MDIO_CTRL_PHYAD_SHIFT) |
+ (reg & GSWIP_MDIO_CTRL_REGAD_MASK));
err = gswip_mdio_poll(priv);
if (err) {
@@ -312,7 +300,7 @@ static int gswip_pce_table_entry_read(struct gswip_priv *priv,
return err;
}
- gswip_switch_w(priv, tbl->index, GSWIP_PCE_TBL_ADDR);
+ regmap_write(priv->gswip, GSWIP_PCE_TBL_ADDR, tbl->index);
gswip_switch_mask(priv, GSWIP_PCE_TBL_CTRL_ADDR_MASK |
GSWIP_PCE_TBL_CTRL_OPMOD_MASK,
tbl->table | addr_mode | GSWIP_PCE_TBL_CTRL_BAS,
@@ -362,24 +350,24 @@ static int gswip_pce_table_entry_write(struct gswip_priv *priv,
return err;
}
- gswip_switch_w(priv, tbl->index, GSWIP_PCE_TBL_ADDR);
+ regmap_write(priv->gswip, GSWIP_PCE_TBL_ADDR, tbl->index);
gswip_switch_mask(priv, GSWIP_PCE_TBL_CTRL_ADDR_MASK |
GSWIP_PCE_TBL_CTRL_OPMOD_MASK,
tbl->table | addr_mode,
GSWIP_PCE_TBL_CTRL);
for (i = 0; i < ARRAY_SIZE(tbl->key); i++)
- gswip_switch_w(priv, tbl->key[i], GSWIP_PCE_TBL_KEY(i));
+ regmap_write(priv->gswip, GSWIP_PCE_TBL_KEY(i), tbl->key[i]);
for (i = 0; i < ARRAY_SIZE(tbl->val); i++)
- gswip_switch_w(priv, tbl->val[i], GSWIP_PCE_TBL_VAL(i));
+ regmap_write(priv->gswip, GSWIP_PCE_TBL_VAL(i), tbl->val[i]);
gswip_switch_mask(priv, GSWIP_PCE_TBL_CTRL_ADDR_MASK |
GSWIP_PCE_TBL_CTRL_OPMOD_MASK,
tbl->table | addr_mode,
GSWIP_PCE_TBL_CTRL);
- gswip_switch_w(priv, tbl->mask, GSWIP_PCE_TBL_MASK);
+ regmap_write(priv->gswip, GSWIP_PCE_TBL_MASK, tbl->mask);
crtl = gswip_switch_r(priv, GSWIP_PCE_TBL_CTRL);
crtl &= ~(GSWIP_PCE_TBL_CTRL_TYPE | GSWIP_PCE_TBL_CTRL_VLD |
@@ -390,7 +378,7 @@ static int gswip_pce_table_entry_write(struct gswip_priv *priv,
crtl |= GSWIP_PCE_TBL_CTRL_VLD;
crtl |= (tbl->gmap << 7) & GSWIP_PCE_TBL_CTRL_GMAP_MASK;
crtl |= GSWIP_PCE_TBL_CTRL_BAS;
- gswip_switch_w(priv, crtl, GSWIP_PCE_TBL_CTRL);
+ regmap_write(priv->gswip, GSWIP_PCE_TBL_CTRL, crtl);
err = gswip_switch_r_timeout(priv, GSWIP_PCE_TBL_CTRL,
GSWIP_PCE_TBL_CTRL_BAS);
@@ -469,14 +457,13 @@ static int gswip_port_enable(struct dsa_switch *ds, int port,
}
/* RMON Counter Enable for port */
- gswip_switch_w(priv, GSWIP_BM_PCFG_CNTEN, GSWIP_BM_PCFGp(port));
+ regmap_write(priv->gswip, GSWIP_BM_PCFGp(port), GSWIP_BM_PCFG_CNTEN);
/* enable port fetch/store dma & VLAN Modification */
- gswip_switch_mask(priv, 0, GSWIP_FDMA_PCTRL_EN |
- GSWIP_FDMA_PCTRL_VLANMOD_BOTH,
- GSWIP_FDMA_PCTRLp(port));
- gswip_switch_mask(priv, 0, GSWIP_SDMA_PCTRL_EN,
- GSWIP_SDMA_PCTRLp(port));
+ regmap_set_bits(priv->gswip, GSWIP_FDMA_PCTRLp(port),
+ GSWIP_FDMA_PCTRL_EN | GSWIP_FDMA_PCTRL_VLANMOD_BOTH);
+ regmap_set_bits(priv->gswip, GSWIP_SDMA_PCTRLp(port),
+ GSWIP_SDMA_PCTRL_EN);
return 0;
}
@@ -485,10 +472,10 @@ static void gswip_port_disable(struct dsa_switch *ds, int port)
{
struct gswip_priv *priv = ds->priv;
- gswip_switch_mask(priv, GSWIP_FDMA_PCTRL_EN, 0,
- GSWIP_FDMA_PCTRLp(port));
- gswip_switch_mask(priv, GSWIP_SDMA_PCTRL_EN, 0,
- GSWIP_SDMA_PCTRLp(port));
+ regmap_clear_bits(priv->gswip, GSWIP_FDMA_PCTRLp(port),
+ GSWIP_FDMA_PCTRL_EN);
+ regmap_clear_bits(priv->gswip, GSWIP_SDMA_PCTRLp(port),
+ GSWIP_SDMA_PCTRL_EN);
}
static int gswip_pce_load_microcode(struct gswip_priv *priv)
@@ -499,22 +486,22 @@ static int gswip_pce_load_microcode(struct gswip_priv *priv)
gswip_switch_mask(priv, GSWIP_PCE_TBL_CTRL_ADDR_MASK |
GSWIP_PCE_TBL_CTRL_OPMOD_MASK,
GSWIP_PCE_TBL_CTRL_OPMOD_ADWR, GSWIP_PCE_TBL_CTRL);
- gswip_switch_w(priv, 0, GSWIP_PCE_TBL_MASK);
+ regmap_write(priv->gswip, GSWIP_PCE_TBL_MASK, 0);
for (i = 0; i < priv->hw_info->pce_microcode_size; i++) {
- gswip_switch_w(priv, i, GSWIP_PCE_TBL_ADDR);
- gswip_switch_w(priv, (*priv->hw_info->pce_microcode)[i].val_0,
- GSWIP_PCE_TBL_VAL(0));
- gswip_switch_w(priv, (*priv->hw_info->pce_microcode)[i].val_1,
- GSWIP_PCE_TBL_VAL(1));
- gswip_switch_w(priv, (*priv->hw_info->pce_microcode)[i].val_2,
- GSWIP_PCE_TBL_VAL(2));
- gswip_switch_w(priv, (*priv->hw_info->pce_microcode)[i].val_3,
- GSWIP_PCE_TBL_VAL(3));
+ regmap_write(priv->gswip, GSWIP_PCE_TBL_ADDR, i);
+ regmap_write(priv->gswip, GSWIP_PCE_TBL_VAL(0),
+ (*priv->hw_info->pce_microcode)[i].val_0);
+ regmap_write(priv->gswip, GSWIP_PCE_TBL_VAL(1),
+ (*priv->hw_info->pce_microcode)[i].val_1);
+ regmap_write(priv->gswip, GSWIP_PCE_TBL_VAL(2),
+ (*priv->hw_info->pce_microcode)[i].val_2);
+ regmap_write(priv->gswip, GSWIP_PCE_TBL_VAL(3),
+ (*priv->hw_info->pce_microcode)[i].val_3);
/* start the table access: */
- gswip_switch_mask(priv, 0, GSWIP_PCE_TBL_CTRL_BAS,
- GSWIP_PCE_TBL_CTRL);
+ regmap_set_bits(priv->gswip, GSWIP_PCE_TBL_CTRL,
+ GSWIP_PCE_TBL_CTRL_BAS);
err = gswip_switch_r_timeout(priv, GSWIP_PCE_TBL_CTRL,
GSWIP_PCE_TBL_CTRL_BAS);
if (err)
@@ -522,8 +509,8 @@ static int gswip_pce_load_microcode(struct gswip_priv *priv)
}
/* tell the switch that the microcode is loaded */
- gswip_switch_mask(priv, 0, GSWIP_PCE_GCTRL_0_MC_VALID,
- GSWIP_PCE_GCTRL_0);
+ regmap_set_bits(priv->gswip, GSWIP_PCE_GCTRL_0,
+ GSWIP_PCE_GCTRL_0_MC_VALID);
return 0;
}
@@ -574,7 +561,7 @@ static void gswip_port_commit_pvid(struct gswip_priv *priv, int port)
* However, without the VLANMD bit (9) in PCE_GCTRL_1 (0x457) even
* GSWIP 2.2 and newer hardware maintain the GSWIP 2.1 behavior.
*/
- gswip_switch_w(priv, idx, GSWIP_PCE_DEFPVID(port));
+ regmap_write(priv->gswip, GSWIP_PCE_DEFPVID(port), idx);
}
static int gswip_port_vlan_filtering(struct dsa_switch *ds, int port,
@@ -590,8 +577,8 @@ static int gswip_port_vlan_filtering(struct dsa_switch *ds, int port,
GSWIP_PCE_VCTRL_UVR | GSWIP_PCE_VCTRL_VIMR |
GSWIP_PCE_VCTRL_VEMR | GSWIP_PCE_VCTRL_VID0,
GSWIP_PCE_VCTRL(port));
- gswip_switch_mask(priv, GSWIP_PCE_PCTRL_0_TVM, 0,
- GSWIP_PCE_PCTRL_0p(port));
+ regmap_clear_bits(priv->gswip, GSWIP_PCE_PCTRL_0p(port),
+ GSWIP_PCE_PCTRL_0_TVM);
} else {
/* Use port based VLAN */
gswip_switch_mask(priv,
@@ -599,8 +586,8 @@ static int gswip_port_vlan_filtering(struct dsa_switch *ds, int port,
GSWIP_PCE_VCTRL_VEMR | GSWIP_PCE_VCTRL_VID0,
GSWIP_PCE_VCTRL_VSR,
GSWIP_PCE_VCTRL(port));
- gswip_switch_mask(priv, 0, GSWIP_PCE_PCTRL_0_TVM,
- GSWIP_PCE_PCTRL_0p(port));
+ regmap_set_bits(priv->gswip, GSWIP_PCE_PCTRL_0p(port),
+ GSWIP_PCE_PCTRL_0_TVM);
}
gswip_port_commit_pvid(priv, port);
@@ -615,9 +602,9 @@ static int gswip_setup(struct dsa_switch *ds)
struct dsa_port *cpu_dp;
int err, i;
- gswip_switch_w(priv, GSWIP_SWRES_R0, GSWIP_SWRES);
+ regmap_write(priv->gswip, GSWIP_SWRES, GSWIP_SWRES_R0);
usleep_range(5000, 10000);
- gswip_switch_w(priv, 0, GSWIP_SWRES);
+ regmap_write(priv->gswip, GSWIP_SWRES, 0);
/* disable port fetch/store dma on all ports */
for (i = 0; i < priv->hw_info->max_ports; i++) {
@@ -626,7 +613,7 @@ static int gswip_setup(struct dsa_switch *ds)
}
/* enable Switch */
- gswip_mdio_mask(priv, 0, GSWIP_MDIO_GLOB_ENABLE, GSWIP_MDIO_GLOB);
+ regmap_set_bits(priv->mdio, GSWIP_MDIO_GLOB, GSWIP_MDIO_GLOB_ENABLE);
err = gswip_pce_load_microcode(priv);
if (err) {
@@ -635,9 +622,9 @@ static int gswip_setup(struct dsa_switch *ds)
}
/* Default unknown Broadcast/Multicast/Unicast port maps */
- gswip_switch_w(priv, cpu_ports, GSWIP_PCE_PMAP1);
- gswip_switch_w(priv, cpu_ports, GSWIP_PCE_PMAP2);
- gswip_switch_w(priv, cpu_ports, GSWIP_PCE_PMAP3);
+ regmap_write(priv->gswip, GSWIP_PCE_PMAP1, cpu_ports);
+ regmap_write(priv->gswip, GSWIP_PCE_PMAP2, cpu_ports);
+ regmap_write(priv->gswip, GSWIP_PCE_PMAP3, cpu_ports);
/* Deactivate MDIO PHY auto polling. Some PHYs as the AR8030 have an
* interoperability problem with this auto polling mechanism because
@@ -655,7 +642,7 @@ static int gswip_setup(struct dsa_switch *ds)
* Testing shows that when PHY auto polling is disabled these problems
* go away.
*/
- gswip_mdio_w(priv, 0x0, GSWIP_MDIO_MDC_CFG0);
+ regmap_write(priv->mdio, GSWIP_MDIO_MDC_CFG0, 0x0);
/* Configure the MDIO Clock 2.5 MHz */
gswip_mdio_mask(priv, 0xff, 0x09, GSWIP_MDIO_MDC_CFG1);
@@ -675,22 +662,25 @@ static int gswip_setup(struct dsa_switch *ds)
dsa_switch_for_each_cpu_port(cpu_dp, ds) {
/* enable special tag insertion on cpu port */
- gswip_switch_mask(priv, 0, GSWIP_FDMA_PCTRL_STEN,
- GSWIP_FDMA_PCTRLp(cpu_dp->index));
+ regmap_set_bits(priv->gswip, GSWIP_FDMA_PCTRLp(cpu_dp->index),
+ GSWIP_FDMA_PCTRL_STEN);
/* accept special tag in ingress direction */
- gswip_switch_mask(priv, 0, GSWIP_PCE_PCTRL_0_INGRESS,
- GSWIP_PCE_PCTRL_0p(cpu_dp->index));
+ regmap_set_bits(priv->gswip,
+ GSWIP_PCE_PCTRL_0p(cpu_dp->index),
+ GSWIP_PCE_PCTRL_0_INGRESS);
}
- gswip_switch_mask(priv, 0, GSWIP_BM_QUEUE_GCTRL_GL_MOD,
- GSWIP_BM_QUEUE_GCTRL);
+ regmap_set_bits(priv->gswip, GSWIP_BM_QUEUE_GCTRL,
+ GSWIP_BM_QUEUE_GCTRL_GL_MOD);
/* VLAN aware Switching */
- gswip_switch_mask(priv, 0, GSWIP_PCE_GCTRL_0_VLAN, GSWIP_PCE_GCTRL_0);
+ regmap_set_bits(priv->gswip, GSWIP_PCE_GCTRL_0,
+ GSWIP_PCE_GCTRL_0_VLAN);
/* Flush MAC Table */
- gswip_switch_mask(priv, 0, GSWIP_PCE_GCTRL_0_MTFL, GSWIP_PCE_GCTRL_0);
+ regmap_set_bits(priv->gswip, GSWIP_PCE_GCTRL_0,
+ GSWIP_PCE_GCTRL_0_MTFL);
err = gswip_switch_r_timeout(priv, GSWIP_PCE_GCTRL_0,
GSWIP_PCE_GCTRL_0_MTFL);
@@ -1076,8 +1066,8 @@ static void gswip_port_stp_state_set(struct dsa_switch *ds, int port, u8 state)
switch (state) {
case BR_STATE_DISABLED:
- gswip_switch_mask(priv, GSWIP_SDMA_PCTRL_EN, 0,
- GSWIP_SDMA_PCTRLp(port));
+ regmap_clear_bits(priv->gswip, GSWIP_SDMA_PCTRLp(port),
+ GSWIP_SDMA_PCTRL_EN);
return;
case BR_STATE_BLOCKING:
case BR_STATE_LISTENING:
@@ -1094,8 +1084,8 @@ static void gswip_port_stp_state_set(struct dsa_switch *ds, int port, u8 state)
return;
}
- gswip_switch_mask(priv, 0, GSWIP_SDMA_PCTRL_EN,
- GSWIP_SDMA_PCTRLp(port));
+ regmap_set_bits(priv->gswip, GSWIP_SDMA_PCTRLp(port),
+ GSWIP_SDMA_PCTRL_EN);
gswip_switch_mask(priv, GSWIP_PCE_PCTRL_0_PSTATE_MASK, stp_state,
GSWIP_PCE_PCTRL_0p(port));
}
@@ -1224,19 +1214,19 @@ static int gswip_port_change_mtu(struct dsa_switch *ds, int port, int new_mtu)
*/
if (dsa_is_cpu_port(ds, port)) {
new_mtu += 8;
- gswip_switch_w(priv, VLAN_ETH_HLEN + new_mtu + ETH_FCS_LEN,
- GSWIP_MAC_FLEN);
+ regmap_write(priv->gswip, GSWIP_MAC_FLEN,
+ VLAN_ETH_HLEN + new_mtu + ETH_FCS_LEN);
}
/* Enable MLEN for ports with non-standard MTUs, including the special
* header on the CPU port added above.
*/
if (new_mtu != ETH_DATA_LEN)
- gswip_switch_mask(priv, 0, GSWIP_MAC_CTRL_2_MLEN,
- GSWIP_MAC_CTRL_2p(port));
+ regmap_set_bits(priv->gswip, GSWIP_MAC_CTRL_2p(port),
+ GSWIP_MAC_CTRL_2_MLEN);
else
- gswip_switch_mask(priv, GSWIP_MAC_CTRL_2_MLEN, 0,
- GSWIP_MAC_CTRL_2p(port));
+ regmap_clear_bits(priv->gswip, GSWIP_MAC_CTRL_2p(port),
+ GSWIP_MAC_CTRL_2_MLEN);
return 0;
}
@@ -1538,7 +1528,7 @@ static u32 gswip_bcm_ram_entry_read(struct gswip_priv *priv, u32 table,
u32 result;
int err;
- gswip_switch_w(priv, index, GSWIP_BM_RAM_ADDR);
+ regmap_write(priv->gswip, GSWIP_BM_RAM_ADDR, index);
gswip_switch_mask(priv, GSWIP_BM_RAM_CTRL_ADDR_MASK |
GSWIP_BM_RAM_CTRL_OPMOD,
table | GSWIP_BM_RAM_CTRL_BAS,
@@ -1552,7 +1542,7 @@ static u32 gswip_bcm_ram_entry_read(struct gswip_priv *priv, u32 table,
return 0;
}
- result = gswip_switch_r(priv, GSWIP_BM_RAM_VAL(0));
+ regmap_read(priv->gswip, GSWIP_BM_RAM_VAL(0), &result);
result |= gswip_switch_r(priv, GSWIP_BM_RAM_VAL(1)) << 16;
return result;
@@ -1954,7 +1944,7 @@ static int gswip_probe(struct platform_device *pdev)
priv->ds->phylink_mac_ops = &gswip_phylink_mac_ops;
priv->dev = dev;
mutex_init(&priv->pce_table_lock);
- version = gswip_switch_r(priv, GSWIP_VERSION);
+ regmap_read(priv->gswip, GSWIP_VERSION, &version);
/* The hardware has the 'major/minor' version bytes in the wrong order
* preventing numerical comparisons. Construct a 16-bit unsigned integer
@@ -2011,7 +2001,7 @@ static int gswip_probe(struct platform_device *pdev)
return 0;
disable_switch:
- gswip_mdio_mask(priv, GSWIP_MDIO_GLOB_ENABLE, 0, GSWIP_MDIO_GLOB);
+ regmap_clear_bits(priv->mdio, GSWIP_MDIO_GLOB, GSWIP_MDIO_GLOB_ENABLE);
dsa_unregister_switch(priv->ds);
gphy_fw_remove:
for (i = 0; i < priv->num_gphy_fw; i++)
@@ -2028,7 +2018,7 @@ static void gswip_remove(struct platform_device *pdev)
return;
/* disable the switch */
- gswip_mdio_mask(priv, GSWIP_MDIO_GLOB_ENABLE, 0, GSWIP_MDIO_GLOB);
+ regmap_clear_bits(priv->mdio, GSWIP_MDIO_GLOB, GSWIP_MDIO_GLOB_ENABLE);
dsa_unregister_switch(priv->ds);
--
2.51.1.dirty
^ permalink raw reply related [flat|nested] 15+ messages in thread
* [PATCH net-next v3 4/7] net: dsa: lantiq_gswip: manually convert remaining uses of read accessors
2025-10-19 12:46 [PATCH net-next v3 0/7] net: dsa: lantiq_gswip: use regmap for register access Daniel Golle
` (2 preceding siblings ...)
2025-10-19 12:48 ` [PATCH net-next v3 3/7] net: dsa: lantiq_gswip: convert trivial accessor uses to regmap Daniel Golle
@ 2025-10-19 12:48 ` Daniel Golle
2025-10-19 22:25 ` Jakub Kicinski
2025-10-19 12:48 ` [PATCH net-next v3 5/7] net: dsa: lantiq_gswip: replace *_mask() functions with regmap API Daniel Golle
` (2 subsequent siblings)
6 siblings, 1 reply; 15+ messages in thread
From: Daniel Golle @ 2025-10-19 12:48 UTC (permalink / raw)
To: Hauke Mehrtens, Andrew Lunn, Vladimir Oltean, David S. Miller,
Eric Dumazet, Jakub Kicinski, Paolo Abeni, Russell King, netdev,
linux-kernel
Cc: Andreas Schirm, Lukas Stockmann, Alexander Sverdlin,
Peter Christen, Avinash Jayaraman, Bing tao Xu, Liang Xu,
Juraj Povazanec, Fanni (Fang-Yi) Chan, Benny (Ying-Tsan) Weng,
Livia M. Rosu, John Crispin
Manually convert the remaining uses of the read accessor functions and
remove them now that they are unused.
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
---
drivers/net/dsa/lantiq/lantiq_gswip.c | 65 ++++++++++++++-------------
1 file changed, 34 insertions(+), 31 deletions(-)
diff --git a/drivers/net/dsa/lantiq/lantiq_gswip.c b/drivers/net/dsa/lantiq/lantiq_gswip.c
index 8ab16972b2be..41e59f56a2e9 100644
--- a/drivers/net/dsa/lantiq/lantiq_gswip.c
+++ b/drivers/net/dsa/lantiq/lantiq_gswip.c
@@ -111,15 +111,6 @@ static const struct gswip_rmon_cnt_desc gswip_rmon_cnt[] = {
MIB_DESC(2, 0x0E, "TxGoodBytes"),
};
-static u32 gswip_switch_r(struct gswip_priv *priv, u32 offset)
-{
- u32 val;
-
- regmap_read(priv->gswip, offset, &val);
-
- return val;
-}
-
static void gswip_switch_mask(struct gswip_priv *priv, u32 clear, u32 set,
u32 offset)
{
@@ -135,15 +126,6 @@ static u32 gswip_switch_r_timeout(struct gswip_priv *priv, u32 offset,
!(val & cleared), 20, 50000);
}
-static u32 gswip_mdio_r(struct gswip_priv *priv, u32 offset)
-{
- u32 val;
-
- regmap_read(priv->mdio, offset, &val);
-
- return val;
-}
-
static void gswip_mdio_mask(struct gswip_priv *priv, u32 clear, u32 set,
u32 offset)
{
@@ -225,6 +207,7 @@ static int gswip_mdio_wr(struct mii_bus *bus, int addr, int reg, u16 val)
static int gswip_mdio_rd(struct mii_bus *bus, int addr, int reg)
{
struct gswip_priv *priv = bus->priv;
+ u32 val;
int err;
err = gswip_mdio_poll(priv);
@@ -244,7 +227,11 @@ static int gswip_mdio_rd(struct mii_bus *bus, int addr, int reg)
return err;
}
- return gswip_mdio_r(priv, GSWIP_MDIO_READ);
+ err = regmap_read(priv->mdio, GSWIP_MDIO_READ, &val);
+ if (err)
+ return err;
+
+ return val;
}
static int gswip_mdio(struct gswip_priv *priv)
@@ -288,6 +275,7 @@ static int gswip_pce_table_entry_read(struct gswip_priv *priv,
int i;
int err;
u16 crtl;
+ u32 tmp;
u16 addr_mode = tbl->key_mode ? GSWIP_PCE_TBL_CTRL_OPMOD_KSRD :
GSWIP_PCE_TBL_CTRL_OPMOD_ADRD;
@@ -313,16 +301,29 @@ static int gswip_pce_table_entry_read(struct gswip_priv *priv,
return err;
}
- for (i = 0; i < ARRAY_SIZE(tbl->key); i++)
- tbl->key[i] = gswip_switch_r(priv, GSWIP_PCE_TBL_KEY(i));
-
- for (i = 0; i < ARRAY_SIZE(tbl->val); i++)
- tbl->val[i] = gswip_switch_r(priv, GSWIP_PCE_TBL_VAL(i));
+ for (i = 0; i < ARRAY_SIZE(tbl->key); i++) {
+ err = regmap_read(priv->gswip, GSWIP_PCE_TBL_KEY(i), &tmp);
+ if (err)
+ return err;
+ tbl->key[i] = tmp;
+ }
+ for (i = 0; i < ARRAY_SIZE(tbl->val); i++) {
+ err = regmap_read(priv->gswip, GSWIP_PCE_TBL_VAL(i), &tmp);
+ if (err)
+ return err;
+ tbl->val[i] = tmp;
+ }
- tbl->mask = gswip_switch_r(priv, GSWIP_PCE_TBL_MASK);
+ err = regmap_read(priv->gswip, GSWIP_PCE_TBL_MASK, &tmp);
+ if (err)
+ return err;
- crtl = gswip_switch_r(priv, GSWIP_PCE_TBL_CTRL);
+ tbl->mask = tmp;
+ err = regmap_read(priv->gswip, GSWIP_PCE_TBL_CTRL, &tmp);
+ if (err)
+ return err;
+ crtl = tmp;
tbl->type = !!(crtl & GSWIP_PCE_TBL_CTRL_TYPE);
tbl->valid = !!(crtl & GSWIP_PCE_TBL_CTRL_VLD);
tbl->gmap = (crtl & GSWIP_PCE_TBL_CTRL_GMAP_MASK) >> 7;
@@ -338,6 +339,7 @@ static int gswip_pce_table_entry_write(struct gswip_priv *priv,
int i;
int err;
u16 crtl;
+ u32 tmp;
u16 addr_mode = tbl->key_mode ? GSWIP_PCE_TBL_CTRL_OPMOD_KSWR :
GSWIP_PCE_TBL_CTRL_OPMOD_ADWR;
@@ -369,9 +371,9 @@ static int gswip_pce_table_entry_write(struct gswip_priv *priv,
regmap_write(priv->gswip, GSWIP_PCE_TBL_MASK, tbl->mask);
- crtl = gswip_switch_r(priv, GSWIP_PCE_TBL_CTRL);
- crtl &= ~(GSWIP_PCE_TBL_CTRL_TYPE | GSWIP_PCE_TBL_CTRL_VLD |
- GSWIP_PCE_TBL_CTRL_GMAP_MASK);
+ regmap_read(priv->gswip, GSWIP_PCE_TBL_CTRL, &tmp);
+ crtl = tmp & ~(GSWIP_PCE_TBL_CTRL_TYPE | GSWIP_PCE_TBL_CTRL_VLD |
+ GSWIP_PCE_TBL_CTRL_GMAP_MASK);
if (tbl->type)
crtl |= GSWIP_PCE_TBL_CTRL_TYPE;
if (tbl->valid)
@@ -1525,7 +1527,7 @@ static void gswip_get_strings(struct dsa_switch *ds, int port, u32 stringset,
static u32 gswip_bcm_ram_entry_read(struct gswip_priv *priv, u32 table,
u32 index)
{
- u32 result;
+ u32 result, val;
int err;
regmap_write(priv->gswip, GSWIP_BM_RAM_ADDR, index);
@@ -1543,7 +1545,8 @@ static u32 gswip_bcm_ram_entry_read(struct gswip_priv *priv, u32 table,
}
regmap_read(priv->gswip, GSWIP_BM_RAM_VAL(0), &result);
- result |= gswip_switch_r(priv, GSWIP_BM_RAM_VAL(1)) << 16;
+ regmap_read(priv->gswip, GSWIP_BM_RAM_VAL(1), &val);
+ result |= val << 16;
return result;
}
--
2.51.1.dirty
^ permalink raw reply related [flat|nested] 15+ messages in thread
* [PATCH net-next v3 5/7] net: dsa: lantiq_gswip: replace *_mask() functions with regmap API
2025-10-19 12:46 [PATCH net-next v3 0/7] net: dsa: lantiq_gswip: use regmap for register access Daniel Golle
` (3 preceding siblings ...)
2025-10-19 12:48 ` [PATCH net-next v3 4/7] net: dsa: lantiq_gswip: manually convert remaining uses of read accessors Daniel Golle
@ 2025-10-19 12:48 ` Daniel Golle
2025-10-22 2:36 ` Andrew Lunn
2025-10-19 12:48 ` [PATCH net-next v3 6/7] net: dsa: lantiq_gswip: optimize regmap_write_bits() statements Daniel Golle
2025-10-19 12:48 ` [PATCH net-next v3 7/7] net: dsa: lantiq_gswip: harmonize gswip_mii_mask_*() parameters Daniel Golle
6 siblings, 1 reply; 15+ messages in thread
From: Daniel Golle @ 2025-10-19 12:48 UTC (permalink / raw)
To: Hauke Mehrtens, Andrew Lunn, Vladimir Oltean, David S. Miller,
Eric Dumazet, Jakub Kicinski, Paolo Abeni, Russell King, netdev,
linux-kernel
Cc: Andreas Schirm, Lukas Stockmann, Alexander Sverdlin,
Peter Christen, Avinash Jayaraman, Bing tao Xu, Liang Xu,
Juraj Povazanec, Fanni (Fang-Yi) Chan, Benny (Ying-Tsan) Weng,
Livia M. Rosu, John Crispin
Use coccinelle to replace all uses of *_mask() with an equivalent call
to regmap_write_bits().
// Replace gswip_switch_mask with regmap_write_bits
@@
expression priv, clear, set, offset;
@@
- gswip_switch_mask(priv, clear, set, offset)
+ regmap_write_bits(priv->gswip, offset, clear | set, set)
// Replace gswip_mdio_mask with regmap_write_bits
@@
expression priv, clear, set, offset;
@@
- gswip_mdio_mask(priv, clear, set, offset)
+ regmap_write_bits(priv->mdio, offset, clear | set, set)
// Replace gswip_mii_mask with regmap_write_bits
@@
expression priv, clear, set, offset;
@@
- gswip_mii_mask(priv, clear, set, offset)
+ regmap_write_bits(priv->mii, offset, clear | set, set)
Remove the new unused *_mask() functions.
This naive approach will be further optmized manually in the next commit.
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
---
drivers/net/dsa/lantiq/lantiq_gswip.c | 140 +++++++++++++-------------
1 file changed, 70 insertions(+), 70 deletions(-)
diff --git a/drivers/net/dsa/lantiq/lantiq_gswip.c b/drivers/net/dsa/lantiq/lantiq_gswip.c
index 41e59f56a2e9..25fafa287ada 100644
--- a/drivers/net/dsa/lantiq/lantiq_gswip.c
+++ b/drivers/net/dsa/lantiq/lantiq_gswip.c
@@ -111,12 +111,6 @@ static const struct gswip_rmon_cnt_desc gswip_rmon_cnt[] = {
MIB_DESC(2, 0x0E, "TxGoodBytes"),
};
-static void gswip_switch_mask(struct gswip_priv *priv, u32 clear, u32 set,
- u32 offset)
-{
- regmap_write_bits(priv->gswip, offset, clear | set, set);
-}
-
static u32 gswip_switch_r_timeout(struct gswip_priv *priv, u32 offset,
u32 cleared)
{
@@ -126,18 +120,6 @@ static u32 gswip_switch_r_timeout(struct gswip_priv *priv, u32 offset,
!(val & cleared), 20, 50000);
}
-static void gswip_mdio_mask(struct gswip_priv *priv, u32 clear, u32 set,
- u32 offset)
-{
- regmap_write_bits(priv->mdio, offset, clear | set, set);
-}
-
-static void gswip_mii_mask(struct gswip_priv *priv, u32 clear, u32 set,
- u32 offset)
-{
- regmap_write_bits(priv->mii, offset, clear | set, set);
-}
-
static void gswip_mii_mask_cfg(struct gswip_priv *priv, u32 clear, u32 set,
int port)
{
@@ -149,7 +131,8 @@ static void gswip_mii_mask_cfg(struct gswip_priv *priv, u32 clear, u32 set,
reg_port = port + priv->hw_info->mii_port_reg_offset;
- gswip_mii_mask(priv, clear, set, GSWIP_MII_CFGp(reg_port));
+ regmap_write_bits(priv->mii, GSWIP_MII_CFGp(reg_port), clear | set,
+ set);
}
static void gswip_mii_mask_pcdu(struct gswip_priv *priv, u32 clear, u32 set,
@@ -165,13 +148,16 @@ static void gswip_mii_mask_pcdu(struct gswip_priv *priv, u32 clear, u32 set,
switch (reg_port) {
case 0:
- gswip_mii_mask(priv, clear, set, GSWIP_MII_PCDU0);
+ regmap_write_bits(priv->mii, GSWIP_MII_PCDU0, clear | set,
+ set);
break;
case 1:
- gswip_mii_mask(priv, clear, set, GSWIP_MII_PCDU1);
+ regmap_write_bits(priv->mii, GSWIP_MII_PCDU1, clear | set,
+ set);
break;
case 5:
- gswip_mii_mask(priv, clear, set, GSWIP_MII_PCDU5);
+ regmap_write_bits(priv->mii, GSWIP_MII_PCDU5, clear | set,
+ set);
break;
}
}
@@ -289,10 +275,11 @@ static int gswip_pce_table_entry_read(struct gswip_priv *priv,
}
regmap_write(priv->gswip, GSWIP_PCE_TBL_ADDR, tbl->index);
- gswip_switch_mask(priv, GSWIP_PCE_TBL_CTRL_ADDR_MASK |
- GSWIP_PCE_TBL_CTRL_OPMOD_MASK,
+ regmap_write_bits(priv->gswip, GSWIP_PCE_TBL_CTRL,
+ GSWIP_PCE_TBL_CTRL_ADDR_MASK |
+ GSWIP_PCE_TBL_CTRL_OPMOD_MASK |
tbl->table | addr_mode | GSWIP_PCE_TBL_CTRL_BAS,
- GSWIP_PCE_TBL_CTRL);
+ tbl->table | addr_mode | GSWIP_PCE_TBL_CTRL_BAS);
err = gswip_switch_r_timeout(priv, GSWIP_PCE_TBL_CTRL,
GSWIP_PCE_TBL_CTRL_BAS);
@@ -353,10 +340,11 @@ static int gswip_pce_table_entry_write(struct gswip_priv *priv,
}
regmap_write(priv->gswip, GSWIP_PCE_TBL_ADDR, tbl->index);
- gswip_switch_mask(priv, GSWIP_PCE_TBL_CTRL_ADDR_MASK |
- GSWIP_PCE_TBL_CTRL_OPMOD_MASK,
+ regmap_write_bits(priv->gswip, GSWIP_PCE_TBL_CTRL,
+ GSWIP_PCE_TBL_CTRL_ADDR_MASK |
+ GSWIP_PCE_TBL_CTRL_OPMOD_MASK |
tbl->table | addr_mode,
- GSWIP_PCE_TBL_CTRL);
+ tbl->table | addr_mode);
for (i = 0; i < ARRAY_SIZE(tbl->key); i++)
regmap_write(priv->gswip, GSWIP_PCE_TBL_KEY(i), tbl->key[i]);
@@ -364,10 +352,11 @@ static int gswip_pce_table_entry_write(struct gswip_priv *priv,
for (i = 0; i < ARRAY_SIZE(tbl->val); i++)
regmap_write(priv->gswip, GSWIP_PCE_TBL_VAL(i), tbl->val[i]);
- gswip_switch_mask(priv, GSWIP_PCE_TBL_CTRL_ADDR_MASK |
- GSWIP_PCE_TBL_CTRL_OPMOD_MASK,
+ regmap_write_bits(priv->gswip, GSWIP_PCE_TBL_CTRL,
+ GSWIP_PCE_TBL_CTRL_ADDR_MASK |
+ GSWIP_PCE_TBL_CTRL_OPMOD_MASK |
tbl->table | addr_mode,
- GSWIP_PCE_TBL_CTRL);
+ tbl->table | addr_mode);
regmap_write(priv->gswip, GSWIP_PCE_TBL_MASK, tbl->mask);
@@ -454,8 +443,9 @@ static int gswip_port_enable(struct dsa_switch *ds, int port,
if (phydev)
mdio_phy = phydev->mdio.addr & GSWIP_MDIO_PHY_ADDR_MASK;
- gswip_mdio_mask(priv, GSWIP_MDIO_PHY_ADDR_MASK, mdio_phy,
- GSWIP_MDIO_PHYp(port));
+ regmap_write_bits(priv->mdio, GSWIP_MDIO_PHYp(port),
+ GSWIP_MDIO_PHY_ADDR_MASK | mdio_phy,
+ mdio_phy);
}
/* RMON Counter Enable for port */
@@ -485,9 +475,11 @@ static int gswip_pce_load_microcode(struct gswip_priv *priv)
int i;
int err;
- gswip_switch_mask(priv, GSWIP_PCE_TBL_CTRL_ADDR_MASK |
- GSWIP_PCE_TBL_CTRL_OPMOD_MASK,
- GSWIP_PCE_TBL_CTRL_OPMOD_ADWR, GSWIP_PCE_TBL_CTRL);
+ regmap_write_bits(priv->gswip, GSWIP_PCE_TBL_CTRL,
+ GSWIP_PCE_TBL_CTRL_ADDR_MASK |
+ GSWIP_PCE_TBL_CTRL_OPMOD_MASK |
+ GSWIP_PCE_TBL_CTRL_OPMOD_ADWR,
+ GSWIP_PCE_TBL_CTRL_OPMOD_ADWR);
regmap_write(priv->gswip, GSWIP_PCE_TBL_MASK, 0);
for (i = 0; i < priv->hw_info->pce_microcode_size; i++) {
@@ -554,9 +546,10 @@ static void gswip_port_commit_pvid(struct gswip_priv *priv, int port)
}
vinr = idx ? GSWIP_PCE_VCTRL_VINR_ALL : GSWIP_PCE_VCTRL_VINR_TAGGED;
- gswip_switch_mask(priv, GSWIP_PCE_VCTRL_VINR,
+ regmap_write_bits(priv->gswip, GSWIP_PCE_VCTRL(port),
+ GSWIP_PCE_VCTRL_VINR |
FIELD_PREP(GSWIP_PCE_VCTRL_VINR, vinr),
- GSWIP_PCE_VCTRL(port));
+ FIELD_PREP(GSWIP_PCE_VCTRL_VINR, vinr));
/* Note that in GSWIP 2.2 VLAN mode the VID needs to be programmed
* directly instead of referencing the index in the Active VLAN Tablet.
@@ -574,20 +567,27 @@ static int gswip_port_vlan_filtering(struct dsa_switch *ds, int port,
if (vlan_filtering) {
/* Use tag based VLAN */
- gswip_switch_mask(priv,
- GSWIP_PCE_VCTRL_VSR,
- GSWIP_PCE_VCTRL_UVR | GSWIP_PCE_VCTRL_VIMR |
- GSWIP_PCE_VCTRL_VEMR | GSWIP_PCE_VCTRL_VID0,
- GSWIP_PCE_VCTRL(port));
+ regmap_write_bits(priv->gswip, GSWIP_PCE_VCTRL(port),
+ GSWIP_PCE_VCTRL_VSR |
+ GSWIP_PCE_VCTRL_UVR |
+ GSWIP_PCE_VCTRL_VIMR |
+ GSWIP_PCE_VCTRL_VEMR |
+ GSWIP_PCE_VCTRL_VID0,
+ GSWIP_PCE_VCTRL_UVR |
+ GSWIP_PCE_VCTRL_VIMR |
+ GSWIP_PCE_VCTRL_VEMR |
+ GSWIP_PCE_VCTRL_VID0);
regmap_clear_bits(priv->gswip, GSWIP_PCE_PCTRL_0p(port),
GSWIP_PCE_PCTRL_0_TVM);
} else {
/* Use port based VLAN */
- gswip_switch_mask(priv,
- GSWIP_PCE_VCTRL_UVR | GSWIP_PCE_VCTRL_VIMR |
- GSWIP_PCE_VCTRL_VEMR | GSWIP_PCE_VCTRL_VID0,
+ regmap_write_bits(priv->gswip, GSWIP_PCE_VCTRL(port),
+ GSWIP_PCE_VCTRL_UVR |
+ GSWIP_PCE_VCTRL_VIMR |
+ GSWIP_PCE_VCTRL_VEMR |
+ GSWIP_PCE_VCTRL_VID0 |
GSWIP_PCE_VCTRL_VSR,
- GSWIP_PCE_VCTRL(port));
+ GSWIP_PCE_VCTRL_VSR);
regmap_set_bits(priv->gswip, GSWIP_PCE_PCTRL_0p(port),
GSWIP_PCE_PCTRL_0_TVM);
}
@@ -647,7 +647,7 @@ static int gswip_setup(struct dsa_switch *ds)
regmap_write(priv->mdio, GSWIP_MDIO_MDC_CFG0, 0x0);
/* Configure the MDIO Clock 2.5 MHz */
- gswip_mdio_mask(priv, 0xff, 0x09, GSWIP_MDIO_MDC_CFG1);
+ regmap_write_bits(priv->mdio, GSWIP_MDIO_MDC_CFG1, 0xff | 0x09, 0x09);
/* bring up the mdio bus */
err = gswip_mdio(priv);
@@ -1088,8 +1088,9 @@ static void gswip_port_stp_state_set(struct dsa_switch *ds, int port, u8 state)
regmap_set_bits(priv->gswip, GSWIP_SDMA_PCTRLp(port),
GSWIP_SDMA_PCTRL_EN);
- gswip_switch_mask(priv, GSWIP_PCE_PCTRL_0_PSTATE_MASK, stp_state,
- GSWIP_PCE_PCTRL_0p(port));
+ regmap_write_bits(priv->gswip, GSWIP_PCE_PCTRL_0p(port),
+ GSWIP_PCE_PCTRL_0_PSTATE_MASK | stp_state,
+ stp_state);
}
static int gswip_port_fdb(struct dsa_switch *ds, int port,
@@ -1318,8 +1319,8 @@ static void gswip_port_set_link(struct gswip_priv *priv, int port, bool link)
else
mdio_phy = GSWIP_MDIO_PHY_LINK_DOWN;
- gswip_mdio_mask(priv, GSWIP_MDIO_PHY_LINK_MASK, mdio_phy,
- GSWIP_MDIO_PHYp(port));
+ regmap_write_bits(priv->mdio, GSWIP_MDIO_PHYp(port),
+ GSWIP_MDIO_PHY_LINK_MASK | mdio_phy, mdio_phy);
}
static void gswip_port_set_speed(struct gswip_priv *priv, int port, int speed,
@@ -1359,11 +1360,11 @@ static void gswip_port_set_speed(struct gswip_priv *priv, int port, int speed,
break;
}
- gswip_mdio_mask(priv, GSWIP_MDIO_PHY_SPEED_MASK, mdio_phy,
- GSWIP_MDIO_PHYp(port));
+ regmap_write_bits(priv->mdio, GSWIP_MDIO_PHYp(port),
+ GSWIP_MDIO_PHY_SPEED_MASK | mdio_phy, mdio_phy);
gswip_mii_mask_cfg(priv, GSWIP_MII_CFG_RATE_MASK, mii_cfg, port);
- gswip_switch_mask(priv, GSWIP_MAC_CTRL_0_GMII_MASK, mac_ctrl_0,
- GSWIP_MAC_CTRL_0p(port));
+ regmap_write_bits(priv->gswip, GSWIP_MAC_CTRL_0p(port),
+ GSWIP_MAC_CTRL_0_GMII_MASK | mac_ctrl_0, mac_ctrl_0);
}
static void gswip_port_set_duplex(struct gswip_priv *priv, int port, int duplex)
@@ -1378,10 +1379,10 @@ static void gswip_port_set_duplex(struct gswip_priv *priv, int port, int duplex)
mdio_phy = GSWIP_MDIO_PHY_FDUP_DIS;
}
- gswip_switch_mask(priv, GSWIP_MAC_CTRL_0_FDUP_MASK, mac_ctrl_0,
- GSWIP_MAC_CTRL_0p(port));
- gswip_mdio_mask(priv, GSWIP_MDIO_PHY_FDUP_MASK, mdio_phy,
- GSWIP_MDIO_PHYp(port));
+ regmap_write_bits(priv->gswip, GSWIP_MAC_CTRL_0p(port),
+ GSWIP_MAC_CTRL_0_FDUP_MASK | mac_ctrl_0, mac_ctrl_0);
+ regmap_write_bits(priv->mdio, GSWIP_MDIO_PHYp(port),
+ GSWIP_MDIO_PHY_FDUP_MASK | mdio_phy, mdio_phy);
}
static void gswip_port_set_pause(struct gswip_priv *priv, int port,
@@ -1407,12 +1408,11 @@ static void gswip_port_set_pause(struct gswip_priv *priv, int port,
GSWIP_MDIO_PHY_FCONRX_DIS;
}
- gswip_switch_mask(priv, GSWIP_MAC_CTRL_0_FCON_MASK,
- mac_ctrl_0, GSWIP_MAC_CTRL_0p(port));
- gswip_mdio_mask(priv,
- GSWIP_MDIO_PHY_FCONTX_MASK |
- GSWIP_MDIO_PHY_FCONRX_MASK,
- mdio_phy, GSWIP_MDIO_PHYp(port));
+ regmap_write_bits(priv->gswip, GSWIP_MAC_CTRL_0p(port),
+ GSWIP_MAC_CTRL_0_FCON_MASK | mac_ctrl_0, mac_ctrl_0);
+ regmap_write_bits(priv->mdio, GSWIP_MDIO_PHYp(port),
+ GSWIP_MDIO_PHY_FCONTX_MASK | GSWIP_MDIO_PHY_FCONRX_MASK | mdio_phy,
+ mdio_phy);
}
static void gswip_phylink_mac_config(struct phylink_config *config,
@@ -1531,10 +1531,10 @@ static u32 gswip_bcm_ram_entry_read(struct gswip_priv *priv, u32 table,
int err;
regmap_write(priv->gswip, GSWIP_BM_RAM_ADDR, index);
- gswip_switch_mask(priv, GSWIP_BM_RAM_CTRL_ADDR_MASK |
- GSWIP_BM_RAM_CTRL_OPMOD,
- table | GSWIP_BM_RAM_CTRL_BAS,
- GSWIP_BM_RAM_CTRL);
+ regmap_write_bits(priv->gswip, GSWIP_BM_RAM_CTRL,
+ GSWIP_BM_RAM_CTRL_ADDR_MASK | GSWIP_BM_RAM_CTRL_OPMOD |
+ table | GSWIP_BM_RAM_CTRL_BAS,
+ table | GSWIP_BM_RAM_CTRL_BAS);
err = gswip_switch_r_timeout(priv, GSWIP_BM_RAM_CTRL,
GSWIP_BM_RAM_CTRL_BAS);
--
2.51.1.dirty
^ permalink raw reply related [flat|nested] 15+ messages in thread
* [PATCH net-next v3 6/7] net: dsa: lantiq_gswip: optimize regmap_write_bits() statements
2025-10-19 12:46 [PATCH net-next v3 0/7] net: dsa: lantiq_gswip: use regmap for register access Daniel Golle
` (4 preceding siblings ...)
2025-10-19 12:48 ` [PATCH net-next v3 5/7] net: dsa: lantiq_gswip: replace *_mask() functions with regmap API Daniel Golle
@ 2025-10-19 12:48 ` Daniel Golle
2025-10-19 12:48 ` [PATCH net-next v3 7/7] net: dsa: lantiq_gswip: harmonize gswip_mii_mask_*() parameters Daniel Golle
6 siblings, 0 replies; 15+ messages in thread
From: Daniel Golle @ 2025-10-19 12:48 UTC (permalink / raw)
To: Hauke Mehrtens, Andrew Lunn, Vladimir Oltean, David S. Miller,
Eric Dumazet, Jakub Kicinski, Paolo Abeni, Russell King, netdev,
linux-kernel
Cc: Andreas Schirm, Lukas Stockmann, Alexander Sverdlin,
Peter Christen, Avinash Jayaraman, Bing tao Xu, Liang Xu,
Juraj Povazanec, Fanni (Fang-Yi) Chan, Benny (Ying-Tsan) Weng,
Livia M. Rosu, John Crispin
Further optimize the previous naive conversion of the *_mask() accessor
functions to regmap_write_bits by manually removing redundant mask
operands.
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
---
v2: optimize more of the regmap_write_bits() calls
drivers/net/dsa/lantiq/lantiq_gswip.c | 33 ++++++++++++---------------
1 file changed, 15 insertions(+), 18 deletions(-)
diff --git a/drivers/net/dsa/lantiq/lantiq_gswip.c b/drivers/net/dsa/lantiq/lantiq_gswip.c
index 25fafa287ada..f54fbd0e48f8 100644
--- a/drivers/net/dsa/lantiq/lantiq_gswip.c
+++ b/drivers/net/dsa/lantiq/lantiq_gswip.c
@@ -278,7 +278,7 @@ static int gswip_pce_table_entry_read(struct gswip_priv *priv,
regmap_write_bits(priv->gswip, GSWIP_PCE_TBL_CTRL,
GSWIP_PCE_TBL_CTRL_ADDR_MASK |
GSWIP_PCE_TBL_CTRL_OPMOD_MASK |
- tbl->table | addr_mode | GSWIP_PCE_TBL_CTRL_BAS,
+ GSWIP_PCE_TBL_CTRL_BAS,
tbl->table | addr_mode | GSWIP_PCE_TBL_CTRL_BAS);
err = gswip_switch_r_timeout(priv, GSWIP_PCE_TBL_CTRL,
@@ -342,8 +342,7 @@ static int gswip_pce_table_entry_write(struct gswip_priv *priv,
regmap_write(priv->gswip, GSWIP_PCE_TBL_ADDR, tbl->index);
regmap_write_bits(priv->gswip, GSWIP_PCE_TBL_CTRL,
GSWIP_PCE_TBL_CTRL_ADDR_MASK |
- GSWIP_PCE_TBL_CTRL_OPMOD_MASK |
- tbl->table | addr_mode,
+ GSWIP_PCE_TBL_CTRL_OPMOD_MASK,
tbl->table | addr_mode);
for (i = 0; i < ARRAY_SIZE(tbl->key); i++)
@@ -354,8 +353,7 @@ static int gswip_pce_table_entry_write(struct gswip_priv *priv,
regmap_write_bits(priv->gswip, GSWIP_PCE_TBL_CTRL,
GSWIP_PCE_TBL_CTRL_ADDR_MASK |
- GSWIP_PCE_TBL_CTRL_OPMOD_MASK |
- tbl->table | addr_mode,
+ GSWIP_PCE_TBL_CTRL_OPMOD_MASK,
tbl->table | addr_mode);
regmap_write(priv->gswip, GSWIP_PCE_TBL_MASK, tbl->mask);
@@ -444,7 +442,7 @@ static int gswip_port_enable(struct dsa_switch *ds, int port,
mdio_phy = phydev->mdio.addr & GSWIP_MDIO_PHY_ADDR_MASK;
regmap_write_bits(priv->mdio, GSWIP_MDIO_PHYp(port),
- GSWIP_MDIO_PHY_ADDR_MASK | mdio_phy,
+ GSWIP_MDIO_PHY_ADDR_MASK,
mdio_phy);
}
@@ -547,8 +545,7 @@ static void gswip_port_commit_pvid(struct gswip_priv *priv, int port)
vinr = idx ? GSWIP_PCE_VCTRL_VINR_ALL : GSWIP_PCE_VCTRL_VINR_TAGGED;
regmap_write_bits(priv->gswip, GSWIP_PCE_VCTRL(port),
- GSWIP_PCE_VCTRL_VINR |
- FIELD_PREP(GSWIP_PCE_VCTRL_VINR, vinr),
+ GSWIP_PCE_VCTRL_VINR,
FIELD_PREP(GSWIP_PCE_VCTRL_VINR, vinr));
/* Note that in GSWIP 2.2 VLAN mode the VID needs to be programmed
@@ -647,7 +644,7 @@ static int gswip_setup(struct dsa_switch *ds)
regmap_write(priv->mdio, GSWIP_MDIO_MDC_CFG0, 0x0);
/* Configure the MDIO Clock 2.5 MHz */
- regmap_write_bits(priv->mdio, GSWIP_MDIO_MDC_CFG1, 0xff | 0x09, 0x09);
+ regmap_write_bits(priv->mdio, GSWIP_MDIO_MDC_CFG1, 0xff, 0x09);
/* bring up the mdio bus */
err = gswip_mdio(priv);
@@ -1089,7 +1086,7 @@ static void gswip_port_stp_state_set(struct dsa_switch *ds, int port, u8 state)
regmap_set_bits(priv->gswip, GSWIP_SDMA_PCTRLp(port),
GSWIP_SDMA_PCTRL_EN);
regmap_write_bits(priv->gswip, GSWIP_PCE_PCTRL_0p(port),
- GSWIP_PCE_PCTRL_0_PSTATE_MASK | stp_state,
+ GSWIP_PCE_PCTRL_0_PSTATE_MASK,
stp_state);
}
@@ -1320,7 +1317,7 @@ static void gswip_port_set_link(struct gswip_priv *priv, int port, bool link)
mdio_phy = GSWIP_MDIO_PHY_LINK_DOWN;
regmap_write_bits(priv->mdio, GSWIP_MDIO_PHYp(port),
- GSWIP_MDIO_PHY_LINK_MASK | mdio_phy, mdio_phy);
+ GSWIP_MDIO_PHY_LINK_MASK, mdio_phy);
}
static void gswip_port_set_speed(struct gswip_priv *priv, int port, int speed,
@@ -1361,10 +1358,10 @@ static void gswip_port_set_speed(struct gswip_priv *priv, int port, int speed,
}
regmap_write_bits(priv->mdio, GSWIP_MDIO_PHYp(port),
- GSWIP_MDIO_PHY_SPEED_MASK | mdio_phy, mdio_phy);
+ GSWIP_MDIO_PHY_SPEED_MASK, mdio_phy);
gswip_mii_mask_cfg(priv, GSWIP_MII_CFG_RATE_MASK, mii_cfg, port);
regmap_write_bits(priv->gswip, GSWIP_MAC_CTRL_0p(port),
- GSWIP_MAC_CTRL_0_GMII_MASK | mac_ctrl_0, mac_ctrl_0);
+ GSWIP_MAC_CTRL_0_GMII_MASK, mac_ctrl_0);
}
static void gswip_port_set_duplex(struct gswip_priv *priv, int port, int duplex)
@@ -1380,9 +1377,9 @@ static void gswip_port_set_duplex(struct gswip_priv *priv, int port, int duplex)
}
regmap_write_bits(priv->gswip, GSWIP_MAC_CTRL_0p(port),
- GSWIP_MAC_CTRL_0_FDUP_MASK | mac_ctrl_0, mac_ctrl_0);
+ GSWIP_MAC_CTRL_0_FDUP_MASK, mac_ctrl_0);
regmap_write_bits(priv->mdio, GSWIP_MDIO_PHYp(port),
- GSWIP_MDIO_PHY_FDUP_MASK | mdio_phy, mdio_phy);
+ GSWIP_MDIO_PHY_FDUP_MASK, mdio_phy);
}
static void gswip_port_set_pause(struct gswip_priv *priv, int port,
@@ -1409,9 +1406,9 @@ static void gswip_port_set_pause(struct gswip_priv *priv, int port,
}
regmap_write_bits(priv->gswip, GSWIP_MAC_CTRL_0p(port),
- GSWIP_MAC_CTRL_0_FCON_MASK | mac_ctrl_0, mac_ctrl_0);
+ GSWIP_MAC_CTRL_0_FCON_MASK, mac_ctrl_0);
regmap_write_bits(priv->mdio, GSWIP_MDIO_PHYp(port),
- GSWIP_MDIO_PHY_FCONTX_MASK | GSWIP_MDIO_PHY_FCONRX_MASK | mdio_phy,
+ GSWIP_MDIO_PHY_FCONTX_MASK | GSWIP_MDIO_PHY_FCONRX_MASK,
mdio_phy);
}
@@ -1533,7 +1530,7 @@ static u32 gswip_bcm_ram_entry_read(struct gswip_priv *priv, u32 table,
regmap_write(priv->gswip, GSWIP_BM_RAM_ADDR, index);
regmap_write_bits(priv->gswip, GSWIP_BM_RAM_CTRL,
GSWIP_BM_RAM_CTRL_ADDR_MASK | GSWIP_BM_RAM_CTRL_OPMOD |
- table | GSWIP_BM_RAM_CTRL_BAS,
+ GSWIP_BM_RAM_CTRL_BAS,
table | GSWIP_BM_RAM_CTRL_BAS);
err = gswip_switch_r_timeout(priv, GSWIP_BM_RAM_CTRL,
--
2.51.1.dirty
^ permalink raw reply related [flat|nested] 15+ messages in thread
* [PATCH net-next v3 7/7] net: dsa: lantiq_gswip: harmonize gswip_mii_mask_*() parameters
2025-10-19 12:46 [PATCH net-next v3 0/7] net: dsa: lantiq_gswip: use regmap for register access Daniel Golle
` (5 preceding siblings ...)
2025-10-19 12:48 ` [PATCH net-next v3 6/7] net: dsa: lantiq_gswip: optimize regmap_write_bits() statements Daniel Golle
@ 2025-10-19 12:48 ` Daniel Golle
6 siblings, 0 replies; 15+ messages in thread
From: Daniel Golle @ 2025-10-19 12:48 UTC (permalink / raw)
To: Hauke Mehrtens, Andrew Lunn, Vladimir Oltean, David S. Miller,
Eric Dumazet, Jakub Kicinski, Paolo Abeni, Russell King, netdev,
linux-kernel
Cc: Andreas Schirm, Lukas Stockmann, Alexander Sverdlin,
Peter Christen, Avinash Jayaraman, Bing tao Xu, Liang Xu,
Juraj Povazanec, Fanni (Fang-Yi) Chan, Benny (Ying-Tsan) Weng,
Livia M. Rosu, John Crispin
The 'clear' parameter of gswip_mii_mask_cfg() and gswip_mii_mask_pcdu()
is inconsistent with the semantics of regmap_write_bits() which also
applies the mask to the value to be written.
Change the semantic mask/set of the functions gswip_mii_mask_cfg() and
gswip_mii_mask_pcdu() to follow the regmap_write_bits() pattern.
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
---
drivers/net/dsa/lantiq/lantiq_gswip.c | 17 +++++++----------
1 file changed, 7 insertions(+), 10 deletions(-)
diff --git a/drivers/net/dsa/lantiq/lantiq_gswip.c b/drivers/net/dsa/lantiq/lantiq_gswip.c
index f54fbd0e48f8..44c6f7c8953c 100644
--- a/drivers/net/dsa/lantiq/lantiq_gswip.c
+++ b/drivers/net/dsa/lantiq/lantiq_gswip.c
@@ -120,7 +120,7 @@ static u32 gswip_switch_r_timeout(struct gswip_priv *priv, u32 offset,
!(val & cleared), 20, 50000);
}
-static void gswip_mii_mask_cfg(struct gswip_priv *priv, u32 clear, u32 set,
+static void gswip_mii_mask_cfg(struct gswip_priv *priv, u32 mask, u32 set,
int port)
{
int reg_port;
@@ -131,11 +131,11 @@ static void gswip_mii_mask_cfg(struct gswip_priv *priv, u32 clear, u32 set,
reg_port = port + priv->hw_info->mii_port_reg_offset;
- regmap_write_bits(priv->mii, GSWIP_MII_CFGp(reg_port), clear | set,
+ regmap_write_bits(priv->mii, GSWIP_MII_CFGp(reg_port), mask,
set);
}
-static void gswip_mii_mask_pcdu(struct gswip_priv *priv, u32 clear, u32 set,
+static void gswip_mii_mask_pcdu(struct gswip_priv *priv, u32 mask, u32 set,
int port)
{
int reg_port;
@@ -148,16 +148,13 @@ static void gswip_mii_mask_pcdu(struct gswip_priv *priv, u32 clear, u32 set,
switch (reg_port) {
case 0:
- regmap_write_bits(priv->mii, GSWIP_MII_PCDU0, clear | set,
- set);
+ regmap_write_bits(priv->mii, GSWIP_MII_PCDU0, mask, set);
break;
case 1:
- regmap_write_bits(priv->mii, GSWIP_MII_PCDU1, clear | set,
- set);
+ regmap_write_bits(priv->mii, GSWIP_MII_PCDU1, mask, set);
break;
case 5:
- regmap_write_bits(priv->mii, GSWIP_MII_PCDU5, clear | set,
- set);
+ regmap_write_bits(priv->mii, GSWIP_MII_PCDU5, mask, set);
break;
}
}
@@ -1506,7 +1503,7 @@ static void gswip_phylink_mac_link_up(struct phylink_config *config,
gswip_port_set_pause(priv, port, tx_pause, rx_pause);
}
- gswip_mii_mask_cfg(priv, 0, GSWIP_MII_CFG_EN, port);
+ gswip_mii_mask_cfg(priv, GSWIP_MII_CFG_EN, GSWIP_MII_CFG_EN, port);
}
static void gswip_get_strings(struct dsa_switch *ds, int port, u32 stringset,
--
2.51.1.dirty
^ permalink raw reply related [flat|nested] 15+ messages in thread
* Re: [PATCH net-next v3 4/7] net: dsa: lantiq_gswip: manually convert remaining uses of read accessors
2025-10-19 12:48 ` [PATCH net-next v3 4/7] net: dsa: lantiq_gswip: manually convert remaining uses of read accessors Daniel Golle
@ 2025-10-19 22:25 ` Jakub Kicinski
2025-10-20 0:23 ` Daniel Golle
0 siblings, 1 reply; 15+ messages in thread
From: Jakub Kicinski @ 2025-10-19 22:25 UTC (permalink / raw)
To: Daniel Golle
Cc: Hauke Mehrtens, Andrew Lunn, Vladimir Oltean, David S. Miller,
Eric Dumazet, Paolo Abeni, Russell King, netdev, linux-kernel,
Andreas Schirm, Lukas Stockmann, Alexander Sverdlin,
Peter Christen, Avinash Jayaraman, Bing tao Xu, Liang Xu,
Juraj Povazanec, Fanni (Fang-Yi) Chan, Benny (Ying-Tsan) Weng,
Livia M. Rosu, John Crispin
On Sun, 19 Oct 2025 13:48:36 +0100 Daniel Golle wrote:
> + for (i = 0; i < ARRAY_SIZE(tbl->key); i++) {
> + err = regmap_read(priv->gswip, GSWIP_PCE_TBL_KEY(i), &tmp);
> + if (err)
> + return err;
> + tbl->key[i] = tmp;
> + }
> + for (i = 0; i < ARRAY_SIZE(tbl->val); i++) {
> + err = regmap_read(priv->gswip, GSWIP_PCE_TBL_VAL(i), &tmp);
> + if (err)
> + return err;
> + tbl->val[i] = tmp;
> + }
>
> - tbl->mask = gswip_switch_r(priv, GSWIP_PCE_TBL_MASK);
> + err = regmap_read(priv->gswip, GSWIP_PCE_TBL_MASK, &tmp);
> + if (err)
> + return err;
>
> - crtl = gswip_switch_r(priv, GSWIP_PCE_TBL_CTRL);
> + tbl->mask = tmp;
> + err = regmap_read(priv->gswip, GSWIP_PCE_TBL_CTRL, &tmp);
> + if (err)
> + return err;
Coccicheck points out we're holding a mutex here, can't return directly.
--
pw-bot: cr
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [PATCH net-next v3 4/7] net: dsa: lantiq_gswip: manually convert remaining uses of read accessors
2025-10-19 22:25 ` Jakub Kicinski
@ 2025-10-20 0:23 ` Daniel Golle
0 siblings, 0 replies; 15+ messages in thread
From: Daniel Golle @ 2025-10-20 0:23 UTC (permalink / raw)
To: Jakub Kicinski
Cc: Hauke Mehrtens, Andrew Lunn, Vladimir Oltean, David S. Miller,
Eric Dumazet, Paolo Abeni, Russell King, netdev, linux-kernel,
Andreas Schirm, Lukas Stockmann, Alexander Sverdlin,
Peter Christen, Avinash Jayaraman, Bing tao Xu, Liang Xu,
Juraj Povazanec, Fanni (Fang-Yi) Chan, Benny (Ying-Tsan) Weng,
Livia M. Rosu, John Crispin
On Sun, Oct 19, 2025 at 03:25:45PM -0700, Jakub Kicinski wrote:
> On Sun, 19 Oct 2025 13:48:36 +0100 Daniel Golle wrote:
> > + for (i = 0; i < ARRAY_SIZE(tbl->key); i++) {
> > + err = regmap_read(priv->gswip, GSWIP_PCE_TBL_KEY(i), &tmp);
> > + if (err)
> > + return err;
> > + tbl->key[i] = tmp;
> > + }
> > + for (i = 0; i < ARRAY_SIZE(tbl->val); i++) {
> > + err = regmap_read(priv->gswip, GSWIP_PCE_TBL_VAL(i), &tmp);
> > + if (err)
> > + return err;
> > + tbl->val[i] = tmp;
> > + }
> >
> > - tbl->mask = gswip_switch_r(priv, GSWIP_PCE_TBL_MASK);
> > + err = regmap_read(priv->gswip, GSWIP_PCE_TBL_MASK, &tmp);
> > + if (err)
> > + return err;
> >
> > - crtl = gswip_switch_r(priv, GSWIP_PCE_TBL_CTRL);
> > + tbl->mask = tmp;
> > + err = regmap_read(priv->gswip, GSWIP_PCE_TBL_CTRL, &tmp);
> > + if (err)
> > + return err;
>
> Coccicheck points out we're holding a mutex here, can't return directly.
Correct. Thank you for pointing that out. I will fix this in v4.
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [PATCH net-next v3 1/7] net: dsa: lantiq_gswip: clarify GSWIP 2.2 VLAN mode in comment
2025-10-19 12:46 ` [PATCH net-next v3 1/7] net: dsa: lantiq_gswip: clarify GSWIP 2.2 VLAN mode in comment Daniel Golle
@ 2025-10-22 2:29 ` Andrew Lunn
2025-10-22 7:43 ` Daniel Golle
0 siblings, 1 reply; 15+ messages in thread
From: Andrew Lunn @ 2025-10-22 2:29 UTC (permalink / raw)
To: Daniel Golle
Cc: Hauke Mehrtens, Vladimir Oltean, David S. Miller, Eric Dumazet,
Jakub Kicinski, Paolo Abeni, Russell King, netdev, linux-kernel
On Sun, Oct 19, 2025 at 01:46:54PM +0100, Daniel Golle wrote:
61;8003;1c> The comment above writing the default PVID incorrectly states that
> "GSWIP 2.2 (GRX300) and later program here the VID directly."
> The truth is that even GSWIP 2.2 and newer maintain the behavior of
> GSWIP 2.1 unless the VLANMD bit in PCE Global Control Register 1 is
> set ("GSWIP2.2 VLAN Mode").
> Fix the misleading comment accordingly.
>
> Signed-off-by: Daniel Golle <daniel@makrotopia.org>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Andrew
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [PATCH net-next v3 2/7] net: dsa: lantiq_gswip: convert accessors to use regmap
2025-10-19 12:47 ` [PATCH net-next v3 2/7] net: dsa: lantiq_gswip: convert accessors to use regmap Daniel Golle
@ 2025-10-22 2:34 ` Andrew Lunn
0 siblings, 0 replies; 15+ messages in thread
From: Andrew Lunn @ 2025-10-22 2:34 UTC (permalink / raw)
To: Daniel Golle
Cc: Hauke Mehrtens, Vladimir Oltean, David S. Miller, Eric Dumazet,
Jakub Kicinski, Paolo Abeni, Russell King, netdev, linux-kernel,
Andreas Schirm, Lukas Stockmann, Alexander Sverdlin,
Peter Christen, Avinash Jayaraman, Bing tao Xu, Liang Xu,
Juraj Povazanec, Fanni (Fang-Yi) Chan, Benny (Ying-Tsan) Weng,
Livia M. Rosu, John Crispin
On Sun, Oct 19, 2025 at 01:47:42PM +0100, Daniel Golle wrote:
> Use regmap for register access in preparation for supporting the MaxLinear
> GSW1xx family of switches connected via MDIO or SPI.
> Rewrite the existing accessor read-poll-timeout functions to use calls to
> the regmap API for now.
>
> Signed-off-by: Daniel Golle <daniel@makrotopia.org>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Andrew
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [PATCH net-next v3 3/7] net: dsa: lantiq_gswip: convert trivial accessor uses to regmap
2025-10-19 12:48 ` [PATCH net-next v3 3/7] net: dsa: lantiq_gswip: convert trivial accessor uses to regmap Daniel Golle
@ 2025-10-22 2:35 ` Andrew Lunn
0 siblings, 0 replies; 15+ messages in thread
From: Andrew Lunn @ 2025-10-22 2:35 UTC (permalink / raw)
To: Daniel Golle
Cc: Hauke Mehrtens, Vladimir Oltean, David S. Miller, Eric Dumazet,
Jakub Kicinski, Paolo Abeni, Russell King, netdev, linux-kernel,
Andreas Schirm, Lukas Stockmann, Alexander Sverdlin,
Peter Christen, Avinash Jayaraman, Bing tao Xu, Liang Xu,
Juraj Povazanec, Fanni (Fang-Yi) Chan, Benny (Ying-Tsan) Weng,
Livia M. Rosu, John Crispin
On Sun, Oct 19, 2025 at 01:48:22PM +0100, Daniel Golle wrote:
> Use coccinelle semantic patch to convert all trivial uses of the register
> accessor functions to use the regmap API directly.
>
> // Replace gswip_switch_w with regmap_write
> @@
> expression priv, val, offset;
> @@
> - gswip_switch_w(priv, val, offset)
> + regmap_write(priv->gswip, offset, val)
>
> // Replace gswip_mdio_w with regmap_write
> @@
> expression priv, val, offset;
> @@
> - gswip_mdio_w(priv, val, offset)
> + regmap_write(priv->mdio, offset, val)
>
> // Replace gswip_switch_r in simple assignment - only for u32
> @@
> expression priv, offset;
> u32 var;
> @@
> - var = gswip_switch_r(priv, offset)
> + regmap_read(priv->gswip, offset, &var)
>
> // Replace gswip_switch_mask with regmap_set_bits when clear is 0
> @@
> expression priv, set, offset;
> @@
> - gswip_switch_mask(priv, 0, set, offset)
> + regmap_set_bits(priv->gswip, offset, set)
>
> // Replace gswip_mdio_mask with regmap_set_bits when clear is 0
> @@
> expression priv, set, offset;
> @@
> - gswip_mdio_mask(priv, 0, set, offset)
> + regmap_set_bits(priv->mdio, offset, set)
>
> // Replace gswip_switch_mask with regmap_clear_bits when set is 0
> @@
> expression priv, clear, offset;
> @@
> - gswip_switch_mask(priv, clear, 0, offset)
> + regmap_clear_bits(priv->gswip, offset, clear)
>
> // Replace gswip_mdio_mask with regmap_clear_bits when set is 0
> @@
> expression priv, clear, offset;
> @@
> - gswip_mdio_mask(priv, clear, 0, offset)
> + regmap_clear_bits(priv->mdio, offset, clear)
>
> Remove gswip_switch_w() and gswip_mdio_w() functions as they now no
> longer have any users.
>
> Signed-off-by: Daniel Golle <daniel@makrotopia.org>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Andrew
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [PATCH net-next v3 5/7] net: dsa: lantiq_gswip: replace *_mask() functions with regmap API
2025-10-19 12:48 ` [PATCH net-next v3 5/7] net: dsa: lantiq_gswip: replace *_mask() functions with regmap API Daniel Golle
@ 2025-10-22 2:36 ` Andrew Lunn
0 siblings, 0 replies; 15+ messages in thread
From: Andrew Lunn @ 2025-10-22 2:36 UTC (permalink / raw)
To: Daniel Golle
Cc: Hauke Mehrtens, Vladimir Oltean, David S. Miller, Eric Dumazet,
Jakub Kicinski, Paolo Abeni, Russell King, netdev, linux-kernel,
Andreas Schirm, Lukas Stockmann, Alexander Sverdlin,
Peter Christen, Avinash Jayaraman, Bing tao Xu, Liang Xu,
Juraj Povazanec, Fanni (Fang-Yi) Chan, Benny (Ying-Tsan) Weng,
Livia M. Rosu, John Crispin
On Sun, Oct 19, 2025 at 01:48:43PM +0100, Daniel Golle wrote:
> Use coccinelle to replace all uses of *_mask() with an equivalent call
> to regmap_write_bits().
>
> // Replace gswip_switch_mask with regmap_write_bits
> @@
> expression priv, clear, set, offset;
> @@
> - gswip_switch_mask(priv, clear, set, offset)
> + regmap_write_bits(priv->gswip, offset, clear | set, set)
>
> // Replace gswip_mdio_mask with regmap_write_bits
> @@
> expression priv, clear, set, offset;
> @@
> - gswip_mdio_mask(priv, clear, set, offset)
> + regmap_write_bits(priv->mdio, offset, clear | set, set)
>
> // Replace gswip_mii_mask with regmap_write_bits
> @@
> expression priv, clear, set, offset;
> @@
> - gswip_mii_mask(priv, clear, set, offset)
> + regmap_write_bits(priv->mii, offset, clear | set, set)
>
> Remove the new unused *_mask() functions.
> This naive approach will be further optmized manually in the next commit.
>
> Signed-off-by: Daniel Golle <daniel@makrotopia.org>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Andrew
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [PATCH net-next v3 1/7] net: dsa: lantiq_gswip: clarify GSWIP 2.2 VLAN mode in comment
2025-10-22 2:29 ` Andrew Lunn
@ 2025-10-22 7:43 ` Daniel Golle
0 siblings, 0 replies; 15+ messages in thread
From: Daniel Golle @ 2025-10-22 7:43 UTC (permalink / raw)
To: Andrew Lunn
Cc: Hauke Mehrtens, Vladimir Oltean, David S. Miller, Eric Dumazet,
Jakub Kicinski, Paolo Abeni, Russell King, netdev, linux-kernel
Hi Andrew,
On Wed, Oct 22, 2025 at 04:29:26AM +0200, Andrew Lunn wrote:
> On Sun, Oct 19, 2025 at 01:46:54PM +0100, Daniel Golle wrote:
> 61;8003;1c> The comment above writing the default PVID incorrectly states that
> > "GSWIP 2.2 (GRX300) and later program here the VID directly."
> > The truth is that even GSWIP 2.2 and newer maintain the behavior of
> > GSWIP 2.1 unless the VLANMD bit in PCE Global Control Register 1 is
> > set ("GSWIP2.2 VLAN Mode").
> > Fix the misleading comment accordingly.
> >
> > Signed-off-by: Daniel Golle <daniel@makrotopia.org>
>
> Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Thank you for reviewing, however, you've replied to the surperseded v3
submission while v5 is current. The patches for which you sent a
Reviewed-by:-tag have not changed since v3, except for 2/7 which is now
using the `REGMAP_UPSHIFT(2)` macro instead of `-2` as a plain number.
Would you mind sending the Reviewed-by:-tags again in reply to the v5[1]
patches?
Cheers
Daniel
[1]: https://patchwork.kernel.org/project/netdevbpf/list/?series=1013992
^ permalink raw reply [flat|nested] 15+ messages in thread
end of thread, other threads:[~2025-10-22 7:44 UTC | newest]
Thread overview: 15+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-10-19 12:46 [PATCH net-next v3 0/7] net: dsa: lantiq_gswip: use regmap for register access Daniel Golle
2025-10-19 12:46 ` [PATCH net-next v3 1/7] net: dsa: lantiq_gswip: clarify GSWIP 2.2 VLAN mode in comment Daniel Golle
2025-10-22 2:29 ` Andrew Lunn
2025-10-22 7:43 ` Daniel Golle
2025-10-19 12:47 ` [PATCH net-next v3 2/7] net: dsa: lantiq_gswip: convert accessors to use regmap Daniel Golle
2025-10-22 2:34 ` Andrew Lunn
2025-10-19 12:48 ` [PATCH net-next v3 3/7] net: dsa: lantiq_gswip: convert trivial accessor uses to regmap Daniel Golle
2025-10-22 2:35 ` Andrew Lunn
2025-10-19 12:48 ` [PATCH net-next v3 4/7] net: dsa: lantiq_gswip: manually convert remaining uses of read accessors Daniel Golle
2025-10-19 22:25 ` Jakub Kicinski
2025-10-20 0:23 ` Daniel Golle
2025-10-19 12:48 ` [PATCH net-next v3 5/7] net: dsa: lantiq_gswip: replace *_mask() functions with regmap API Daniel Golle
2025-10-22 2:36 ` Andrew Lunn
2025-10-19 12:48 ` [PATCH net-next v3 6/7] net: dsa: lantiq_gswip: optimize regmap_write_bits() statements Daniel Golle
2025-10-19 12:48 ` [PATCH net-next v3 7/7] net: dsa: lantiq_gswip: harmonize gswip_mii_mask_*() parameters Daniel Golle
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).