[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20220922185922.uvioryx7ct3u7bza@skbuf>
Date: Thu, 22 Sep 2022 18:59:23 +0000
From: Vladimir Oltean <vladimir.oltean@....com>
To: Andrew Lunn <andrew@...n.ch>
CC: netdev <netdev@...r.kernel.org>,
"mattias.forsblad@...il.com" <mattias.forsblad@...il.com>,
Florian Fainelli <f.fainelli@...il.com>,
Christian Marangi <ansuelsmth@...il.com>
Subject: Re: [PATCH rfc v2 02/10] net: dsa: qca8k: Move completion into DSA
core
On Thu, Sep 22, 2022 at 07:58:13PM +0200, Andrew Lunn wrote:
> @@ -1528,7 +1516,7 @@ static void qca8k_mib_autocast_handler(struct dsa_switch *ds, struct sk_buff *sk
> exit:
> /* Complete on receiving all the mib packet */
> if (refcount_dec_and_test(&mib_eth_data->port_parsed))
> - complete(&mib_eth_data->rw_done);
> + dsa_inband_complete(&mib_eth_data->inband);
> }
>
> static int
> @@ -1543,8 +1531,6 @@ qca8k_get_ethtool_stats_eth(struct dsa_switch *ds, int port, u64 *data)
>
> mutex_lock(&mib_eth_data->mutex);
>
> - reinit_completion(&mib_eth_data->rw_done);
> -
> mib_eth_data->req_port = dp->index;
> mib_eth_data->data = data;
> refcount_set(&mib_eth_data->port_parsed, QCA8K_NUM_PORTS);
> @@ -1562,7 +1548,8 @@ qca8k_get_ethtool_stats_eth(struct dsa_switch *ds, int port, u64 *data)
> if (ret)
> goto exit;
>
> - ret = wait_for_completion_timeout(&mib_eth_data->rw_done, QCA8K_ETHERNET_TIMEOUT);
> + ret = dsa_inband_wait_for_completion(&mib_eth_data->inband,
> + QCA8K_ETHERNET_TIMEOUT);
Doesn't the reinit_completion from qca8k_get_ethtool_stats_eth() still
race with qca8k_mib_autocast_handler()? From the comments, it appears to
me that the regmap_update_bits() call is what triggers a MIB autocast,
and so, reinit_completion() needs to be before that.
Powered by blists - more mailing lists