Skip to content

Commit d68a373

Browse files
vladimirolteankuba-moo
authored andcommitted
net: dsa: felix: keep QSYS_TAG_CONFIG_INIT_GATE_STATE(0xFF) out of rmw
In vsc9959_tas_clock_adjust(), the INIT_GATE_STATE field is not changed, only the ENABLE field. Similarly for the disabling of the time-aware shaper in vsc9959_qos_port_tas_set(). To reflect this, keep the QSYS_TAG_CONFIG_INIT_GATE_STATE_M mask out of the read-modify-write procedure to make it clearer what is the intention of the code. Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com> Signed-off-by: Jakub Kicinski <kuba@kernel.org>
1 parent 1c9017e commit d68a373

File tree

1 file changed

+5
-12
lines changed

1 file changed

+5
-12
lines changed

drivers/net/dsa/ocelot/felix_vsc9959.c

Lines changed: 5 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1204,10 +1204,7 @@ static int vsc9959_qos_port_tas_set(struct ocelot *ocelot, int port,
12041204
mutex_lock(&ocelot->tas_lock);
12051205

12061206
if (!taprio->enable) {
1207-
ocelot_rmw_rix(ocelot,
1208-
QSYS_TAG_CONFIG_INIT_GATE_STATE(0xFF),
1209-
QSYS_TAG_CONFIG_ENABLE |
1210-
QSYS_TAG_CONFIG_INIT_GATE_STATE_M,
1207+
ocelot_rmw_rix(ocelot, 0, QSYS_TAG_CONFIG_ENABLE,
12111208
QSYS_TAG_CONFIG, port);
12121209

12131210
taprio_offload_free(ocelot_port->taprio);
@@ -1315,10 +1312,8 @@ static void vsc9959_tas_clock_adjust(struct ocelot *ocelot)
13151312
QSYS_TAS_PARAM_CFG_CTRL_PORT_NUM_M,
13161313
QSYS_TAS_PARAM_CFG_CTRL);
13171314

1318-
ocelot_rmw_rix(ocelot,
1319-
QSYS_TAG_CONFIG_INIT_GATE_STATE(0xFF),
1320-
QSYS_TAG_CONFIG_ENABLE |
1321-
QSYS_TAG_CONFIG_INIT_GATE_STATE_M,
1315+
/* Disable time-aware shaper */
1316+
ocelot_rmw_rix(ocelot, 0, QSYS_TAG_CONFIG_ENABLE,
13221317
QSYS_TAG_CONFIG, port);
13231318

13241319
vsc9959_new_base_time(ocelot, taprio->base_time,
@@ -1337,11 +1332,9 @@ static void vsc9959_tas_clock_adjust(struct ocelot *ocelot)
13371332
QSYS_TAS_PARAM_CFG_CTRL_CONFIG_CHANGE,
13381333
QSYS_TAS_PARAM_CFG_CTRL);
13391334

1340-
ocelot_rmw_rix(ocelot,
1341-
QSYS_TAG_CONFIG_INIT_GATE_STATE(0xFF) |
1335+
/* Re-enable time-aware shaper */
1336+
ocelot_rmw_rix(ocelot, QSYS_TAG_CONFIG_ENABLE,
13421337
QSYS_TAG_CONFIG_ENABLE,
1343-
QSYS_TAG_CONFIG_ENABLE |
1344-
QSYS_TAG_CONFIG_INIT_GATE_STATE_M,
13451338
QSYS_TAG_CONFIG, port);
13461339
}
13471340
mutex_unlock(&ocelot->tas_lock);

0 commit comments

Comments
 (0)