On 2022-09-20 00:39, Vladimir Oltean wrote:
quoted
+void mv88e6xxx_master_state_change(struct dsa_switch *ds, const struct net_device *master,
+ bool operational)
+{
+ struct dsa_port *cpu_dp = master->dsa_ptr;
+ struct mv88e6xxx_chip *chip = ds->priv;
+ int port;
+ int ret;
+
+ port = dsa_towards_port(ds, cpu_dp->ds->index, cpu_dp->index);
+
+ mv88e6xxx_reg_lock(chip);
+
+ if (operational && chip->info->ops->rmu_enable) {
This all needs to be rewritten. Like here, if the master is operational
but the chip->info->ops->rmu_enable method is not populated, you call
mv88e6xxx_disable_rmu(). Why?
So what should we do in this case? If the master is operational but we cannot
enable rmu (bc no funcptr), we cannot use RMU -> disable RMU.
/Mattias
quoted
+ ret = chip->info->ops->rmu_enable(chip, port);
+
+ if (ret == -EOPNOTSUPP)
+ goto out;
+
+ if (!ret) {
+ dev_dbg(chip->dev, "RMU: Enabled on port %d", port);
+
+ ret = mv88e6xxx_enable_check_rmu(master, chip, port);
+ if (!ret)
+ goto out;