From: Vladimir Oltean <vladimir.oltean@nxp.com>
To: Andrew Lunn <andrew@lunn.ch>
Cc: netdev <netdev@vger.kernel.org>,
"mattias.forsblad@gmail.com" <mattias.forsblad@gmail.com>,
Florian Fainelli <f.fainelli@gmail.com>,
Christian Marangi <ansuelsmth@gmail.com>
Subject: Re: [PATCH rfc v2 02/10] net: dsa: qca8k: Move completion into DSA core
Date: Thu, 22 Sep 2022 18:59:23 +0000 [thread overview]
Message-ID: <20220922185922.uvioryx7ct3u7bza@skbuf> (raw)
In-Reply-To: <20220922175821.4184622-3-andrew@lunn.ch>
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.
next prev parent reply other threads:[~2022-09-22 18:59 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-09-22 17:58 [PATCH rfc v2 00/10] DSA: Move parts of inband signalling into the DSA Andrew Lunn
2022-09-22 17:58 ` [PATCH rfc v2 01/10] net: dsa: qca8k: Fix inconsistent use of jiffies vs milliseconds Andrew Lunn
2022-09-22 17:58 ` [PATCH rfc v2 02/10] net: dsa: qca8k: Move completion into DSA core Andrew Lunn
2022-09-22 18:59 ` Vladimir Oltean [this message]
2022-09-22 17:58 ` [PATCH rfc v2 03/10] net: dsa: qca8K: Move queuing for request frame into the core Andrew Lunn
2022-09-22 17:58 ` [PATCH rfc v2 04/10] net: dsa: qca8k: dsa_inband_request: More normal return values Andrew Lunn
2022-09-22 17:58 ` [PATCH rfc v2 05/10] net: dsa: qca8k: Drop replies with wrong sequence numbers Andrew Lunn
2022-09-22 17:58 ` [PATCH rfc v2 06/10] net: dsa: qca8k: Move request sequence number handling into core Andrew Lunn
2022-09-22 17:58 ` [PATCH rfc v2 07/10] net: dsa: qca8k: Refactor sequence number mismatch to use error code Andrew Lunn
2022-09-22 17:58 ` [PATCH rfc v2 08/10] net: dsa: qca8k: Pass error code from reply decoder to requester Andrew Lunn
2022-09-23 22:42 ` Vladimir Oltean
2022-09-24 14:32 ` Andrew Lunn
2022-09-24 14:42 ` Vladimir Oltean
2022-09-24 15:27 ` Andrew Lunn
2022-09-24 14:45 ` Ansuel Smith
2022-09-22 17:58 ` [PATCH rfc v2 09/10] net: dsa: qca8k: Pass response buffer via dsa_rmu_request Andrew Lunn
2022-09-22 17:58 ` [PATCH rfc v2 10/10] net: dsa: qca8: Move inband mutex into DSA core Andrew Lunn
2022-09-22 18:09 ` [PATCH rfc v2 00/10] DSA: Move parts of inband signalling into the DSA Christian Marangi
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20220922185922.uvioryx7ct3u7bza@skbuf \
--to=vladimir.oltean@nxp.com \
--cc=andrew@lunn.ch \
--cc=ansuelsmth@gmail.com \
--cc=f.fainelli@gmail.com \
--cc=mattias.forsblad@gmail.com \
--cc=netdev@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).