๐Ÿš€ go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: linux.kernel.netdev
Article #27426

Re: [PATCH net] dpll: do not overwrite extack messages set by drivers

#27426
From: netdev-bot+sashiko
Date: Sat, 05 Dec 2026 16:49
139 lines
13141 bytes
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
Technical Details
Message-ID: <179648939103.3146.1181556187853222723@kernel.org>
Path: mbox-mo1.pugleaf.net!news-ams.pugleaf.net!feed-eu-txt.newsdeef.eu!feed-eu-ch.newsdeef.eu!srl.newsdeef.eu!newsfeed.bofh.team!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-378049-linux-kernel-netdev=dewy.ru
References: <20261204155246.425636-1-ivecera@redhat.com>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!news-ams.pugleaf.net!feed-eu-txt.newsdeef.eu!feed-eu-ch.newsdeef.eu!srl.newsdeef.eu!newsfeed.bofh.team!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-378049-linux-kernel-netdev=dewy.ru
From: netdev-bot+sashiko@kernel.org
Newsgroups: linux.kernel.netdev
Subject: Re: [PATCH net] dpll: do not overwrite extack messages set by drivers
Date: Sat, 05 Dec 2026 16:49:51 +0000
Organization: Usenet Network
Message-ID: <179648939103.3146.1181556187853222723@kernel.org>
References: <20261204155246.425636-1-ivecera@redhat.com>
MIME-Version: 1.0
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: 8bit
Injection-Info: usenet.network;
	logging-data="3072317"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:OxxOjc9LIEeTiUqwzU05cjAEzME= sha256:JEjAWVv5lrv23k01VJACIMqAwBOPAoX6/gxScCOTh/A=
	sha1:B5Syy9iNLPhF77Br5iue4USYI+A= sha256:Z1lY9llRumLV7431UGNFYL1qXyLg0XjluSfLgecfmGw=
List-ID: <netdev.vger.kernel.org>
X-Mailpost-Empty-Hdrs: X-Spam-Level
X-Received: from localhost (localhost [127.0.0.1])
	by mail.dewy.ru (Postfix) with ESMTP id 91D47117E5F; Sat,  5 Dec 2026 19:50:15 +0300 (MSK)
X-Virus-Scanned: Debian amavisd-new at usenet.network
X-Spam-Flag: NO
X-Spam-Score: -3.539
X-Spam-Status: No, score=-3.539 tagged_above=-9999 required=6.31
	tests=[DCC_REPUT_70_89=0.1, DKIMWL_WL_HIGH=-0.14, DKIM_SIGNED=0.1,
	DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1,
	MAILING_LIST_MULTI=-1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001,
	SPF_PASS=-0.001, URIBL_BLOCKED=0.001] autolearn=ham autolearn_force=no
X-Authentication-Results: mail.dewy.ru (amavisd-new); dkim=pass (2048-bit key)
	header.d=kernel.org
X-Received: from mail.dewy.ru ([127.0.0.1])
	by localhost (mail.dewy.ru [127.0.0.1]) (amavisd-new, port 10024)
	with ESMTP id ezxrawb0FNMy;
	Sat,  5 Dec 2026 19:50:08 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.234.253.10; helo=sea.lore.kernel.org; envelope-from=netdev+bounces-378049-linux-kernel-netdev=dewy.ru@vger.kernel.org; receiver=<UNKNOWN> 
X-Authentication-Results: OpenDMARC; dmarc=pass (p=quarantine dis=none) header.from=kernel.org
X-Received: from sea.lore.kernel.org (sea.lore.kernel.org [172.234.253.10])
	by mail.dewy.ru (Postfix) with ESMTPS id B271D117E57; Sat,  5 Dec 2026 19:49:58 +0300 (MSK)
X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92])
	by sea.lore.kernel.org (Postfix) with ESMTP id C309B3006E; Sat,  5 Dec 2026 16:49:53 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org; arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1
X-ARC-Seal: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=pass;
	t=1796489393;
	b=wCo49cfEojA8iOE9Ck6KdiIYA1RkJsdCWcC0KOCaDsVZUE+S58WURBSK1W2iPuj9fvK9
	 IUKcMs1BJ+Yyl2RtcUwUSCZhfyUPSpU0uh9ED0bvpZaMg5zUPLIlkXCQ5z225G3mIhZru
	 XCdL3yOjdiIsvvPrONmgrzYioWa3sc+t8/zw38UB52gw6OOd6EAzqgiqMHY8BXYVYr95k
	 Gw+aRSH74H1VZcR+cdsK//QViCUAWM9q0/L0DTi0KnZ4bqfTaBBIBUYUT9XC5Tw6nRxlQ
	 8fH00Tbkdx1doQqSQMV1DvbHiEzNwx4RWQFxRgrjoVMhsXYwHTTqoUatIODGWwxJnTw==
X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1796489393;
	h=X-Original-To:Received:Received:DKIM-Signature:Subject:From:To:Cc:
	 Date:Message-ID:In-Reply-To:References:X-sashiko-severity:
	 Content-Type:Content-Transfer-Encoding:X-Mailing-List:List-Id:
	 List-Post:List-Help:List-Subscribe:List-Unsubscribe:List-Owner:
	 Precedence:MIME-Version;
	bh=Ttg7XZA1Tdfebs9dNi085OMkYUPZdsqUlmyto6jVktM=;
	b=bKRT524k9dVM77flEnzOTjzYwoT8DkpmveUZ8Ztrwx4QZqwYiWJw16M+/esQ2ac3wja/
	 OqqplsQy9kBxqSSg/g/1K3+wTzetq5A22NQmPXu/Ppq/T2iLEKst5qDkfn+/+XMArab3o
	 RMpTou5psHoESUUzi5fVlv0QQDLnfYg5alq6YvT5Y1zUPKEGSvkeNmiVvrmuZEOmE4xkZ
	 I77eZ8RBRLpoWLJW+a3W8JSgjm+lLxA+6aN565I9WlGw4ieI+726Rlg9dOZ3KrPMpk3W/
	 fSVZwxf89vBBV4GCyIPBnZ+aMtSN9E4bG8Wh6SC+2Rwb1MgthMzxBM6AEqjz1crwgqw==
X-ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; 
	dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=RAjd5YQx;
	arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1
X-Received: from localhost.localdomain (localhost [127.0.0.1])
	by smtp.subspace.kernel.org (Postfix) with ESMTP id 9B2E1606A335;
	Sat,  5 Dec 2026 16:49:53 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org;
	dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=RAjd5YQx
X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18
X-ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none;
	t=1796489392;
	b=jdEZemvMfYR6CdCu/+kAsGBCrJg8H422IIT++kCxoN65000fUTwconTXkqySY2hWeC75
	 MbsFho9efH0SntmbNtGJMK0yYTYAvmZLiPs9segm9qPrqs84Aq/r78UkMfa2AQZd/OV5G
	 Cav8I2hZxfgy08ZAZEqmxxV+jSgh6I7WghTvVBRK5C2dg23zK+1zQlyehX8SdF5W3+53Y
	 s+RsWLUQYpHAX4n5yWrT6N0nduwGwmLfiQfHabO9Epji/4yAddq4zxrSWArI/Bwj2rDuV
	 BWzUrVdzgpstfN/2MZ4LkKyrr2QMqwH4e7hY06V3nuBg+JrEuPMlCBeDqauwCWHfVUw==
X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1796489392;
	h=Received:DKIM-Signature:Subject:From:To:Cc:Date:Message-ID:
	 In-Reply-To:References:X-sashiko-severity:Content-Type:
	 Content-Transfer-Encoding:MIME-Version;
	bh=Ttg7XZA1Tdfebs9dNi085OMkYUPZdsqUlmyto6jVktM=;
	b=3WILbqhgUWjB0RMzGiJEHjtXg2bHiFTaWCs+bTu05ozym8lttz9AwuRrlVQqQzrK4ECe
	 EzF+k0HVsdGywh7/SceIh3IgegdxefVJDLyX+v3WY2cPKfdbA5Agkh0KbucZ+pvzap1hL
	 nlxzL+sO21v6bBNc81VmOVb9U/lRhvTXZrABbHSo1WVxbvIg3OIm73yKFvyxrS4129cZF
	 RMbCBCHG9nN5GKZi+6xXRpifU+BBr9bJKUu1Zkv2WKtxDeXvcuMTBFfBUxzhyXb3WLd3I
	 5zfYIT6ceKkWIwQuAquRNtUgLXLeEu6dY3evEVThbhWo7DElDGX8VuPyE2DiowOt7Bw==
X-ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; 
	dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=RAjd5YQx;
	arc=none smtp.remote-ip=100.103.45.18
X-Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18])
	(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
	 key-exchange X25519 server-signature ECDSA (prime256v1))
	(No client certificate requested)
	by smtp.subspace.kernel.org (Postfix) with ESMTPS id BB858606A330
	for <netdev@vger.kernel.org>; Sat,  5 Dec 2026 16:49:52 +0000 (UTC)
X-Received: by smtp.kernel.org (Postfix) with ESMTPSA id 836781F00936;
	Sat,  5 Dec 2026 16:49:51 +0000 (UTC)
X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org;
	s=k20260515; t=1796489392;
	bh=Ttg7XZA1Tdfebs9dNi085OMkYUPZdsqUlmyto6jVktM=;
	h=Subject:From:To:Cc:Date:In-Reply-To:References;
	b=RAjd5YQxfEV6Swd+uJlQ64m0B5q1juPB/gj5oMcRXP0C1gIm1UGKFcZfGH6MXLG5F
	 wE+4HWDKNcvNg/cHl7a+gCCH99En/qX2PqCPlxj39ved8HaZObqbqkBdg6pgYvd89Y
	 HuYnNHSk62RX7Zd9OBafSVL5fjGFTAgYYUZXzqu8n0MHhcH9G/9zvkHU4bWn+ibjWb
	 hMW3P8XWIZjqVU6d5S43074Pp65lIE2VgIQ+2+qm59nAkrOne2ESAvzwO932dWJ4iT
	 6o103scKmizcLcFAua/u67urwlTfZl2Qmku4l5RuDsb5EbcD/8o9c9bNlHQDOgnTII
	 CONQ3kuYtTnlQ==
X-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
X-In-Reply-To: <20261204155246.425636-1-ivecera@redhat.com>
X-sashiko-severity: Medium
X-Mailing-List: netdev@vger.kernel.org
X-List-Post: <mailto:netdev@vger.kernel.org>
X-List-Help: <mailto:netdev+help@vger.kernel.org>
X-List-Subscribe: <mailto:netdev+subscribe@vger.kernel.org>
X-List-Unsubscribe: <mailto:netdev+unsubscribe@vger.kernel.org>
X-List-Owner: <mailto:netdev+owner@vger.kernel.org>
X-Precedence: list