Re: [PATCH net-next 9/9] net: pse-pd: Add PD692x0 PSE controller driver

From: Andrew Lunn
Date: Thu Nov 16 2023 - 17:54:16 EST


I'm reading this patch first, so this might be a dumb question...

> +static int pd692x0_recv_msg(struct pd692x0_priv *priv,
> + struct pd692x0_msg *msg,
> + struct pd692x0_msg_content *buf)
> +{

...

> + i2c_master_recv(client, (u8 *)buf, sizeof(*buf));
> + if (buf->key)
> + goto out;
> +
> + msleep(10000);

That is 10 seconds, right?

> +static int pd692x0_sendrecv_msg(struct pd692x0_priv *priv,
> + struct pd692x0_msg *msg,
> + struct pd692x0_msg_content *buf)
> +{
> + struct device *dev = &priv->client->dev;
> + int ret;
> +
> + ret = pd692x0_send_msg(priv, msg);
> + if (ret)
> + return ret;
> +
> + ret = pd692x0_recv_msg(priv, msg, buf);

So this function takes at least 10 seconds?

> +static int pd692x0_ethtool_set_config(struct pse_controller_dev *pcdev,
> + unsigned long id,
> + struct netlink_ext_ack *extack,
> + const struct pse_control_config *config)
> +{

....

> + switch (config->admin_control) {
> + case ETHTOOL_PSE_ADMIN_STATE_ENABLED:
> + msg.content.data[0] = 0x1;
> + break;
> + case ETHTOOL_PSE_ADMIN_STATE_DISABLED:
> + msg.content.data[0] = 0x0;
> + break;
> + default:
> + return -EOPNOTSUPP;
> + }
> +
> + msg.content.sub[2] = id;
> + ret = pd692x0_sendrecv_msg(priv, &msg, &buf);

So this is also 10 seconds?

Given its name, it looks like this is called via ethtool? Is the
ethtool core holding RTNL? It is generally considered bad to hold RTNL for
that long.

Andrew