From: netdev-bot+sashiko@kernel.org
To: ivecera@redhat.com
Cc: netdev@vger.kernel.org, sashiko-bot@kernel.org,
vadim.fedorenko@linux.dev, arkadiusz.kubalewski@intel.com,
jiri@resnulli.us, davem@davemloft.net, edumazet@kernel.org,
kuba@kernel.org, pabeni@redhat.com, willemb@google.com,
horms@kernel.org, aleksandr.loktionov@intel.com,
przemyslaw.kitszel@intel.com, milena.olech@intel.com
Subject: Re: [PATCH net] dpll: do not overwrite extack messages set by drivers
Date: Sat, 05 Dec 2026 16:49:51 +0000 [thread overview]
Message-ID: <179648939103.3146.1181556187853222723@kernel.org> (raw)
In-Reply-To: <20261204155246.425636-1-ivecera@redhat.com>
Thank you for your contribution! Sashiko AI review found 2 potential
issue(s) to consider.
Critical: 0 · High: 0 · Medium: 1 · Low: 1
If you believe none of the issues are legitimate, please reply to each
issue of Medium severity or higher and explain why the AI is wrong.
If any of them are legitimate and you plan to respin, please let patchwork
know by including "pw-bot: cr" as a separate line at the end of your reply
(one such reply per series is enough).
- [Medium] The fix is incomplete against its own subject line ("do not
overwrite extack messages set by drivers").
- [Low] netlink: missing NL_SET_ERR_MSG_FMT_WEAK in
newline_in_nl_msg.cocci
--
dpll: do not overwrite extack messages set by drivers
When the frequency_set(), esync_set(), ref_sync_set() or
phase_adjust_set() pin callbacks fail, the DPLL core now keeps any extack
message the driver already set. Before, its generic "... set failed for
dpll_id:N" message replaced it. The patch adds NL_SET_ERR_MSG_FMT_WEAK()
to include/linux/netlink.h for this and uses it in the four set paths of
drivers/dpll/dpll_netlink.c.
> diff --git a/drivers/dpll/dpll_netlink.c b/drivers/dpll/dpll_netlink.c
> index e5380d95f238b..422e3fa3a632a 100644
> --- a/drivers/dpll/dpll_netlink.c
> +++ b/drivers/dpll/dpll_netlink.c
[ ... ]
> @@ -1186,9 +1186,9 @@ dpll_pin_esync_set(struct dpll_pin *pin, struct nlattr *a,
> ret = ops->esync_set(pin, dpll_pin_on_dpll_priv(dpll, pin), dpll,
> dpll_priv(dpll), freq, extack);
> if (ret) {
> - NL_SET_ERR_MSG_FMT(extack,
> - "embedded sync frequency set failed for dpll_id: %u",
> - dpll->id);
> + NL_SET_ERR_MSG_FMT_WEAK(extack,
> + "embedded sync frequency set failed for dpll_id: %u",
> + dpll->id);
> return ret;
> }
> __dpll_pin_change_ntf(pin);
[Severity: Medium]
The subject says the core no longer overwrites extack messages set by
drivers. Does that also hold for the get callback that runs just before
esync_set() in this function?
Earlier in dpll_pin_esync_set():
ret = ops->esync_get(pin, dpll_pin_on_dpll_priv(dpll, pin), dpll,
dpll_priv(dpll), &esync, extack);
if (ret) {
NL_SET_ERR_MSG(extack, "unable to get current embedded sync frequency value");
return ret;
}
In ice, ice_dpll_input_esync_get(), ice_dpll_output_esync_get() and
ice_dpll_input_ref_sync_get() all start with:
if (ice_dpll_is_reset(pf, extack))
return -EBUSY;
ice_dpll_is_reset() sets "PF reset in progress". These callbacks are wired
as .esync_get and .ref_sync_get in the ice pin ops.
So during a PF reset, a DPLL_CMD_PIN_SET request for esync or ref-sync on
an ice pin would follow this path:
dpll_pin_esync_set() -> ops->esync_get() -> ice_dpll_is_reset()
The reply would still carry the generic "unable to get ..." string from the
core, not the driver's reason.
The other pin set paths call plain NL_SET_ERR_MSG() after their get
callback in the same way:
dpll_pin_freq_set(): "unable to get old frequency value"
dpll_pin_ref_sync_state_set(): "unable to get old reference sync state"
dpll_pin_phase_adj_set(): "unable to get old phase adjust value"
The device-level paths dpll_mode_set(), dpll_phase_offset_monitor_set()
and dpll_freq_monitor_set() do the same with their "unable to get ..."
messages.
Should these also switch to NL_SET_ERR_MSG_WEAK()? Or should the subject
be narrowed to cover only the set callbacks?
[ ... ]
> diff --git a/include/linux/netlink.h b/include/linux/netlink.h
> --- a/include/linux/netlink.h
> +++ b/include/linux/netlink.h
> @@ -143,6 +143,13 @@ struct netlink_ext_ack {
> NL_SET_ERR_MSG_MOD((extack), msg); \
> } while (0)
>
> +#define NL_SET_ERR_MSG_FMT_WEAK(extack, fmt, args...) do { \
> + struct netlink_ext_ack *__extack_weak = (extack); \
> + \
> + if (__extack_weak && !__extack_weak->_msg) \
> + NL_SET_ERR_MSG_FMT(__extack_weak, fmt, ##args); \
> +} while (0)
> +
> #define NL_SET_BAD_ATTR_POLICY(extack, attr, pol) do { \
> if ((extack)) { \
> (extack)->bad_attr = (attr); \
>
[Severity: Low]
This adds a new member to the NL_SET_ERR_MSG* family, but
scripts/coccinelle/misc/newline_in_nl_msg.cocci was not updated to
know about it.
That script lists the extack helpers from include/linux/netlink.h and
include/net/genetlink.h. The list includes GENL_SET_ERR_MSG,
NL_SET_ERR_MSG_FMT, NL_SET_ERR_MSG_WEAK, NL_SET_ERR_MSG_WEAK_MOD and
NL_SET_ERR_MSG_ATTR_FMT, among others. The script flags message
literals passed to those helpers that end in a newline.
NL_SET_ERR_MSG_FMT_WEAK is not in that disjunction. A later caller
that passes something like "frequency set failed\n" to the new macro
would therefore not be reported by make coccicheck.
There is no runtime impact, and the four dpll callers in this patch
are fine. The list has been brought in sync with these headers
before, though. Could you add NL_SET_ERR_MSG_FMT_WEAK to the
newline_in_nl_msg.cocci match list, either in this patch or as a
small follow-up?
--
Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261204155246.425636-1-ivecera%40redhat.com
prev parent reply other threads:[~2026-12-05 16:49 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-12-04 15:52 [PATCH net] dpll: do not overwrite extack messages set by drivers Ivan Vecera
2026-12-04 17:47 ` Vadim Fedorenko
2026-12-05 16:49 ` netdev-bot+sashiko [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=179648939103.3146.1181556187853222723@kernel.org \
--to=netdev-bot+sashiko@kernel.org \
--cc=aleksandr.loktionov@intel.com \
--cc=arkadiusz.kubalewski@intel.com \
--cc=davem@davemloft.net \
--cc=edumazet@kernel.org \
--cc=horms@kernel.org \
--cc=ivecera@redhat.com \
--cc=jiri@resnulli.us \
--cc=kuba@kernel.org \
--cc=milena.olech@intel.com \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=przemyslaw.kitszel@intel.com \
--cc=sashiko-bot@kernel.org \
--cc=vadim.fedorenko@linux.dev \
--cc=willemb@google.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