linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jakub Kicinski <kuba@kernel.org>
To: Oleksij Rempel <o.rempel@pengutronix.de>
Cc: Andrew Lunn <andrew@lunn.ch>,
	Vivien Didelot <vivien.didelot@gmail.com>,
	Florian Fainelli <f.fainelli@gmail.com>,
	Vladimir Oltean <olteanv@gmail.com>,
	"David S. Miller" <davem@davemloft.net>,
	Russell King <linux@armlinux.org.uk>,
	Pengutronix Kernel Team <kernel@pengutronix.de>,
	netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
	linux-mips@vger.kernel.org
Subject: Re: [PATCH v2 2/2] net: dsa: qca: ar9331: export stats64
Date: Wed, 2 Dec 2020 10:39:37 -0800	[thread overview]
Message-ID: <20201202103937.137e587b@kicinski-fedora-pc1c0hjn.DHCP.thefacebook.com> (raw)
In-Reply-To: <20201202120712.6212-3-o.rempel@pengutronix.de>

On Wed,  2 Dec 2020 13:07:12 +0100 Oleksij Rempel wrote:
> +static void ar9331_read_stats(struct ar9331_sw_port *port)
> +{
> +	mutex_lock(&port->lock);

> +	mutex_unlock(&port->lock);
> +}

> +static void ar9331_get_stats64(struct dsa_switch *ds, int port,
> +			       struct rtnl_link_stats64 *s)
> +{
> +	struct ar9331_sw_priv *priv = (struct ar9331_sw_priv *)ds->priv;
> +	struct ar9331_sw_port *p = &priv->port[port];
> +
> +	ar9331_read_stats(p);

> +}
> +
>  static const struct dsa_switch_ops ar9331_sw_ops = {

> +	.get_stats64		= ar9331_get_stats64,
>  };

You can't take sleeping locks from .ndo_get_stats64.

Also regmap may sleep?

+	ret = regmap_read(priv->regmap, reg, &val);

Am I missing something?

      parent reply	other threads:[~2020-12-02 18:40 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
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 [this message]

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=20201202103937.137e587b@kicinski-fedora-pc1c0hjn.DHCP.thefacebook.com \
    --to=kuba@kernel.org \
    --cc=andrew@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=f.fainelli@gmail.com \
    --cc=kernel@pengutronix.de \
    --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).