linux-next: manual merge of the net-next tree with the net tree

From: Stephen Rothwell
Date: Sun Jul 14 2024 - 22:32:24 EST


Hi all,

Today's linux-next merge of the net-next tree got a conflict in:

net/ethtool/pse-pd.c

between commits:

93c3a96c301f ("net: pse-pd: Do not return EOPNOSUPP if config is null")
4cddb0f15ea9 ("net: ethtool: pse-pd: Fix possible null-deref")

from the net tree and commit:

30d7b6727724 ("net: ethtool: Add new power limit get and set features")

from the net-next tree.

I fixed it up (see below) and can carry the fix as necessary. This
is now fixed as far as linux-next is concerned, but any non trivial
conflicts should be mentioned to your upstream maintainer when your tree
is submitted for merging. You may also want to consider cooperating
with the maintainer of the conflicting tree to minimise any particularly
complex conflicts.

--
Cheers,
Stephen Rothwell

diff --cc net/ethtool/pse-pd.c
index 776ac96cdadc,ba46c9c8b12d..000000000000
--- a/net/ethtool/pse-pd.c
+++ b/net/ethtool/pse-pd.c
@@@ -172,21 -256,39 +256,39 @@@ static in
ethnl_set_pse(struct ethnl_req_info *req_info, struct genl_info *info)
{
struct net_device *dev = req_info->dev;
- struct pse_control_config config = {};
struct nlattr **tb = info->attrs;
struct phy_device *phydev;
+ int ret = 0;

phydev = dev->phydev;
- /* These values are already validated by the ethnl_pse_set_policy */
- if (tb[ETHTOOL_A_PODL_PSE_ADMIN_CONTROL])
- config.podl_admin_control = nla_get_u32(tb[ETHTOOL_A_PODL_PSE_ADMIN_CONTROL]);
- if (tb[ETHTOOL_A_C33_PSE_ADMIN_CONTROL])
- config.c33_admin_control = nla_get_u32(tb[ETHTOOL_A_C33_PSE_ADMIN_CONTROL]);

- /* Return errno directly - PSE has no notification
- * pse_ethtool_set_config() will do nothing if the config is null
- */
- return pse_ethtool_set_config(phydev->psec, info->extack, &config);
+ if (tb[ETHTOOL_A_C33_PSE_AVAIL_PW_LIMIT]) {
+ unsigned int pw_limit;
+
+ pw_limit = nla_get_u32(tb[ETHTOOL_A_C33_PSE_AVAIL_PW_LIMIT]);
+ ret = pse_ethtool_set_pw_limit(phydev->psec, info->extack,
+ pw_limit);
+ if (ret)
+ return ret;
+ }
+
+ /* These values are already validated by the ethnl_pse_set_policy */
+ if (tb[ETHTOOL_A_PODL_PSE_ADMIN_CONTROL] ||
+ tb[ETHTOOL_A_C33_PSE_ADMIN_CONTROL]) {
+ struct pse_control_config config = {};
+
- if (pse_has_podl(phydev->psec))
++ if (tb[ETHTOOL_A_PODL_PSE_ADMIN_CONTROL])
+ config.podl_admin_control = nla_get_u32(tb[ETHTOOL_A_PODL_PSE_ADMIN_CONTROL]);
- if (pse_has_c33(phydev->psec))
++ if (tb[ETHTOOL_A_C33_PSE_ADMIN_CONTROL])
+ config.c33_admin_control = nla_get_u32(tb[ETHTOOL_A_C33_PSE_ADMIN_CONTROL]);
+
+ ret = pse_ethtool_set_config(phydev->psec, info->extack,
+ &config);
+ if (ret)
+ return ret;
+ }
+
+ return ret;
}

const struct ethnl_request_ops ethnl_pse_request_ops = {

Attachment: pgpxXrTOCZlBr.pgp
Description: OpenPGP digital signature