Skip to content

Commit 651b253

Browse files
dangowrtPaolo Abeni
authored andcommitted
net: dsa: mxl-gsw1xx: fix .shutdown driver operation
The .shutdown operation should call dsa_switch_shutdown() just like it is done also by the sibling lantiq_gswip driver. Not doing that results in shutdown or reboot hanging and waiting for the CPU port becoming free, which introduces a longer delay and a WARNING before shutdown or reboot in case the driver is built-into the kernel. Fix this by calling dsa_switch_shutdown() in the driver's shutdown operation, harmonizing it with what is done in the lantiq_gswip driver. As a side-effect this now allows to remove the previously exported gswip_disable_switch() function which no longer got any users. Fixes: 2233593 ("net: dsa: add driver for MaxLinear GSW1xx switch family") Signed-off-by: Daniel Golle <daniel@makrotopia.org> Link: https://patch.msgid.link/77ed91a5206e5dbf5d3e83d7e364ebfda90d31fd.1765241054.git.daniel@makrotopia.org Reviewed-by: Vladimir Oltean <olteanv@gmail.com> Signed-off-by: Paolo Abeni <pabeni@redhat.com>
1 parent 8e4c0f0 commit 651b253

File tree

3 files changed

+2
-10
lines changed

3 files changed

+2
-10
lines changed

drivers/net/dsa/lantiq/lantiq_gswip.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -294,8 +294,6 @@ struct gswip_priv {
294294
u16 version;
295295
};
296296

297-
void gswip_disable_switch(struct gswip_priv *priv);
298-
299297
int gswip_probe_common(struct gswip_priv *priv, u32 version);
300298

301299
#endif /* __LANTIQ_GSWIP_H */

drivers/net/dsa/lantiq/lantiq_gswip_common.c

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1664,12 +1664,6 @@ static const struct dsa_switch_ops gswip_switch_ops = {
16641664
.port_hsr_leave = dsa_port_simple_hsr_leave,
16651665
};
16661666

1667-
void gswip_disable_switch(struct gswip_priv *priv)
1668-
{
1669-
regmap_clear_bits(priv->mdio, GSWIP_MDIO_GLOB, GSWIP_MDIO_GLOB_ENABLE);
1670-
}
1671-
EXPORT_SYMBOL_GPL(gswip_disable_switch);
1672-
16731667
static int gswip_validate_cpu_port(struct dsa_switch *ds)
16741668
{
16751669
struct gswip_priv *priv = ds->priv;

drivers/net/dsa/lantiq/mxl-gsw1xx.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -662,9 +662,9 @@ static void gsw1xx_shutdown(struct mdio_device *mdiodev)
662662
if (!priv)
663663
return;
664664

665-
dev_set_drvdata(&mdiodev->dev, NULL);
665+
dsa_switch_shutdown(priv->ds);
666666

667-
gswip_disable_switch(priv);
667+
dev_set_drvdata(&mdiodev->dev, NULL);
668668
}
669669

670670
static const struct gswip_hw_info gsw12x_data = {

0 commit comments

Comments
 (0)