Skip to content

Commit 1650bdb

Browse files
vladimirolteandavem330
authored andcommitted
net: dsa: felix: re-enable TX flow control in ocelot_port_flush()
Because flow control is set up statically in ocelot_init_port(), and not in phylink_mac_link_up(), what happens is that after the blamed commit, the flow control remains disabled after the port flushing procedure. Fixes: eb4733d ("net: dsa: felix: implement port flushing on .phylink_mac_link_down") Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent 49bfcbf commit 1650bdb

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

drivers/net/ethernet/mscc/ocelot.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -379,6 +379,7 @@ static u32 ocelot_read_eq_avail(struct ocelot *ocelot, int port)
379379

380380
int ocelot_port_flush(struct ocelot *ocelot, int port)
381381
{
382+
unsigned int pause_ena;
382383
int err, val;
383384

384385
/* Disable dequeuing from the egress queues */
@@ -387,6 +388,7 @@ int ocelot_port_flush(struct ocelot *ocelot, int port)
387388
QSYS_PORT_MODE, port);
388389

389390
/* Disable flow control */
391+
ocelot_fields_read(ocelot, port, SYS_PAUSE_CFG_PAUSE_ENA, &pause_ena);
390392
ocelot_fields_write(ocelot, port, SYS_PAUSE_CFG_PAUSE_ENA, 0);
391393

392394
/* Disable priority flow control */
@@ -422,6 +424,9 @@ int ocelot_port_flush(struct ocelot *ocelot, int port)
422424
/* Clear flushing again. */
423425
ocelot_rmw_gix(ocelot, 0, REW_PORT_CFG_FLUSH_ENA, REW_PORT_CFG, port);
424426

427+
/* Re-enable flow control */
428+
ocelot_fields_write(ocelot, port, SYS_PAUSE_CFG_PAUSE_ENA, pause_ena);
429+
425430
return err;
426431
}
427432
EXPORT_SYMBOL(ocelot_port_flush);

0 commit comments

Comments
 (0)