linux-mips.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Marc Kleine-Budde <mkl@pengutronix.de>
To: Oleksij Rempel <o.rempel@pengutronix.de>
Cc: Andrew Lunn <andrew@lunn.ch>,
	Florian Fainelli <f.fainelli@gmail.com>,
	linux-mips@vger.kernel.org, Russell King <linux@armlinux.org.uk>,
	"David S. Miller" <davem@davemloft.net>,
	Pengutronix Kernel Team <kernel@pengutronix.de>,
	netdev@vger.kernel.org, Jakub Kicinski <kuba@kernel.org>,
	Vladimir Oltean <olteanv@gmail.com>,
	Vivien Didelot <vivien.didelot@gmail.com>,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2 2/2] net: dsa: qca: ar9331: export stats64
Date: Wed, 2 Dec 2020 13:47:17 +0100	[thread overview]
Message-ID: <f80ea68e-9515-0d4e-b2e3-1ae9e8296cd0@pengutronix.de> (raw)
In-Reply-To: <20201202124317.vehujtj2fdur2ed2@pengutronix.de>


[-- Attachment #1.1: Type: text/plain, Size: 912 bytes --]

On 12/2/20 1:43 PM, Oleksij Rempel wrote:
>>> +struct ar9331_sw_priv;
>>> +struct ar9331_sw_port {
>>> +	int idx;
>>> +	struct ar9331_sw_priv *priv;
>>> +	struct delayed_work mib_read;
>>> +	struct ar9331_sw_stats stats;
>>> +	struct mutex lock;		/* stats access */
>>
>> What does the lock protect? It's only used a single time.
> 
> The ar9331_read_stats() function is called from two different contests:
> from worker over ar9331_do_stats_poll() and from user space over
> ar9331_get_stats64().
> 
> The mutex lock should prevent a race in the read modify write operations
> for in the stats->*

Makes sense!

Marc

-- 
Pengutronix e.K.                 | Marc Kleine-Budde           |
Embedded Linux                   | https://www.pengutronix.de  |
Vertretung West/Dortmund         | Phone: +49-231-2826-924     |
Amtsgericht Hildesheim, HRA 2686 | Fax:   +49-5121-206917-5555 |


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

  reply	other threads:[~2020-12-02 12:48 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-12-02 12:07 [PATCH v2 0/2] net: dsa: add stats64 support Oleksij Rempel
2020-12-02 12:07 ` [PATCH v2 1/2] net: dsa: add optional " Oleksij Rempel
2020-12-02 12:59   ` Vladimir Oltean
2020-12-02 15:03   ` Andrew Lunn
2020-12-02 17:12   ` Florian Fainelli
2020-12-02 12:07 ` [PATCH v2 2/2] net: dsa: qca: ar9331: export stats64 Oleksij Rempel
2020-12-02 12:15   ` Marc Kleine-Budde
2020-12-02 12:43     ` Oleksij Rempel
2020-12-02 12:47       ` Marc Kleine-Budde [this message]
2020-12-02 13:04   ` Vladimir Oltean
2020-12-02 13:51     ` Oleksij Rempel
2020-12-02 15:11   ` Andrew Lunn
2020-12-02 15:37   ` Vladimir Oltean
2020-12-02 18:39   ` Jakub Kicinski

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=f80ea68e-9515-0d4e-b2e3-1ae9e8296cd0@pengutronix.de \
    --to=mkl@pengutronix.de \
    --cc=andrew@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=f.fainelli@gmail.com \
    --cc=kernel@pengutronix.de \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mips@vger.kernel.org \
    --cc=linux@armlinux.org.uk \
    --cc=netdev@vger.kernel.org \
    --cc=o.rempel@pengutronix.de \
    --cc=olteanv@gmail.com \
    --cc=vivien.didelot@gmail.com \
    /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).