Thread (14 messages) 14 messages, 6 authors, 2020-12-02

Re: [PATCH v2 2/2] net: dsa: qca: ar9331: export stats64

flat view

From: Jakub Kicinski <kuba@kernel.org>
Date: 2020-12-02 18:40:42
Also in: linux-mips, lkml

On Wed,  2 Dec 2020 13:07:12 +0100 Oleksij Rempel wrote:
quoted hunk ↗ jump to hunk
+static void ar9331_read_stats(struct ar9331_sw_port *port)
+{
+	mutex_lock(&port->lock);
+	mutex_unlock(&port->lock);
+}
quoted hunk ↗ jump to hunk
+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);
quoted hunk ↗ jump to hunk
+}
+
 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?
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help