[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <2be57208-61fe-95f6-f70a-b3a86f5024a1@gmail.com>
Date: Tue, 20 Sep 2022 13:53:36 +0200
From: Mattias Forsblad <mattias.forsblad@...il.com>
To: Vladimir Oltean <olteanv@...il.com>
Cc: netdev@...r.kernel.org, Andrew Lunn <andrew@...n.ch>,
Vivien Didelot <vivien.didelot@...il.com>,
Florian Fainelli <f.fainelli@...il.com>,
"David S . Miller" <davem@...emloft.net>,
Eric Dumazet <edumazet@...gle.com>,
Jakub Kicinski <kuba@...nel.org>,
Paolo Abeni <pabeni@...hat.com>, linux@...linux.org.uk,
ansuelsmth@...il.com
Subject: Re: [PATCH net-next v14 4/7] net: dsa: mv88e6xxxx: Add RMU
functionality.
On 2022-09-20 00:39, Vladimir Oltean wrote:
>> +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
>> + 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;
Powered by blists - more mailing lists