Article View: linux.kernel.netdev
Article #737Re: [PATCH net v3 1/4] dpll: zl3073x: reject output frequencies with too small divisor
From: netdev-bot+sashiko
Date: Thu, 08 Oct 2026 15:31
Date: Thu, 08 Oct 2026 15:31
101 lines
8945 bytes
8945 bytes
Thank you for your contribution! Sashiko AI review found more severe
issue(s) in other patches of this series. This mail is only an FYI, in case
you want to address the nit picks below when you respin.
Low priority / nit picks for your consideration:
- [Low] In N-div output mode, the new probe-time check in
zl3073x_pin_check_freq() (drivers/dpll/zl3073x/prop.c) only requires…
--
dpll: zl3073x: reject output frequencies with too small divisor
This patch tightens zl3073x_pin_check_freq() so output pin frequencies
from firmware must divide the synth frequency with a divisor of at
least 2. For the N-pin of an N-divided output the minimum is 4. It also
rejects a zero frequency so the division cannot be by zero.
> diff --git a/drivers/dpll/zl3073x/prop.c b/drivers/dpll/zl3073x/prop.c
> index ac9d41d0f978e..a4bdc3878590f 100644
> --- a/drivers/dpll/zl3073x/prop.c
> +++ b/drivers/dpll/zl3073x/prop.c
[ ... ]
> @@ -41,18 +42,32 @@ zl3073x_pin_check_freq(struct zl3073x_dev *zldev, enum dpll_pin_direction dir,
[ ... ]
> /* Check the frequency divides synth frequency */
> - if (synth_freq % (u32)freq)
> + div = div_u64_rem(synth_freq, freq, &rem);
> + if (rem)
> + goto err_inv_freq;
> +
> + /* The output divisor has to be at least 2. For the N-pin of an
> + * N-divided output the effective divisor also includes the N
> + * divider (>= 2), so the minimum is 4.
> + */
> + out = zl3073x_out_state_get(zldev, out_id);
> + if (zl3073x_out_is_ndiv(out) && zl3073x_is_n_pin(id))
> + min_div = 4;
> + else
> + min_div = 2;
> + if (div < min_div)
> goto err_inv_freq;
[Severity: Low]
For N-divided outputs, the new check compares the effective divisor
only against the synth. It does not look at the shared output divider
(out->div). Does that let an N-pin frequency pass this filter even
though no valid N divider exists for it?
In this patch, zl3073x_dpll_output_pin_frequency_set() in
drivers/dpll/zl3073x/dpll.c computes the N divider with a truncating
division and only rejects a result of 0:
drivers/dpll/zl3073x/dpll.c:zl3073x_dpll_output_pin_frequency_set() {
...
} else {
...
out.esync_n_period = div64_u64(synth_freq, frequency * out.div);
if (!out.esync_n_period)
return -EINVAL;
}
...
}
Take a 1 GHz synth with P-pin divider 10:
N-pin request of 100 MHz: div = 10 >= 4, so it passes here.
esync_n_period then works out to 1, and that is committed to
hardware.
N-pin request of 40 MHz: div = 25 >= 4, so it also passes.
esync_n_period is truncated from 2.5 to 2. The output runs at
50 MHz, but the call reports success.
The P-pin branch has the same truncation and zero-only check:
out.esync_n_period = (out.esync_n_period * out.div) / new_div;
if (!out.esync_n_period)
return -EINVAL;
The later commit in this series, "dpll: zl3073x: reject inexact
frequencies for N-divided outputs", fixes this. It adds remainder
checks and esync_n_period >= 2 checks to both branches, and returns
-EINVAL with an extack message.
After that commit, one gap remains. Some frequencies have an effective
divisor that cannot be split into out_div >= 2 times n_div >= 2, such
as synth/5. They still appear in freq_supported, but setting them is
rejected. Since this check is necessary but not sufficient, should the
commit message or the comment say so?
> }
>
--
Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261006153116.347497-1-ivecera%40redhat.com
Technical Details
Message-ID:
<179147350175.434549.6966003929996681994@kernel.org>Path:
mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-343076-linux-kernel-netdev=dewy.ruReferences:
<20261006153116.347497-2-ivecera@redhat.com>Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-343076-linux-kernel-netdev=dewy.ru From: netdev-bot+sashiko@kernel.org Newsgroups: linux.kernel.netdev Subject: Re: [PATCH net v3 1/4] dpll: zl3073x: reject output frequencies with too small divisor Date: Thu, 08 Oct 2026 15:31:41 +0000 Organization: Usenet Network Message-ID: <179147350175.434549.6966003929996681994@kernel.org> References: <20261006153116.347497-2-ivecera@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit Injection-Info: usenet.network; logging-data="909296"; mail-complaints-to="abuse@usenet.network" Cancel-Lock: sha1:m/UN35w9iBTQ4t2/VnGN3x66tE8= sha256:S20szMSBvTooC51jnLqIdA8ddRxbXZlFsQXCX3GzK1U= sha1:M54NFAX9vsgIah2Vi2ABjfSMwLY= sha256:GYlrq3CUpNGBbn0YjS2EJc6ZcHRmDwhDD/WdRM13KnA= 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 EBC4510F3A0; Thu, 8 Oct 2026 18:32:03 +0300 (MSK) X-Virus-Scanned: Debian amavisd-new at usenet.network X-Spam-Flag: NO X-Spam-Score: -1.44 X-Spam-Status: No, score=-1.44 tagged_above=-9999 required=6.31 tests=[DKIMWL_WL_HIGH=-0.241, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, MAILING_LIST_MULTI=-1, 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 KyBSDzxz779c; Thu, 8 Oct 2026 18:32:00 +0300 (MSK) X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.232.135.74; helo=sto.lore.kernel.org; envelope-from=netdev+bounces-343076-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 sto.lore.kernel.org (sto.lore.kernel.org [172.232.135.74]) by mail.dewy.ru (Postfix) with ESMTPS id 4ECAE10F43A; Thu, 8 Oct 2026 18:31:57 +0300 (MSK) X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.90.174.1]) by sto.lore.kernel.org (Postfix) with ESMTP id 7C2A160624A; Thu, 8 Oct 2026 15:31:47 +0000 (UTC) X-Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 542E84E5352; Thu, 8 Oct 2026 15:31:44 +0000 (UTC) X-Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="Oo/yIYzx" X-Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 2BB414E534A; Thu, 8 Oct 2026 15:31:42 +0000 (UTC) X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 X-ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1791473504; cv=none; b=lSUP+nCZE7UAGJ7b7318UOiRbPrgjQYHNSnCOGC9WtKbN90sJ4vMMABmjf4FRmQi6G5c4xkHkewOBViS0rSJ+4E3DnK90hMgvjsaYjkJVfuVcKvG6b/7h/tM3zvQpLi7mxcRcaF/8DNmsqRfw43c0q2gmH3Iyhfv+cM5trD/L0A= X-ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1791473504; c=relaxed/simple; bh=oKq3LCIVxlEANL5mRyYb815Z8ciFvkq79Mo9KztKqx4=; h=Subject:From:To:Cc:Date:Message-ID:In-Reply-To:References: Content-Type:MIME-Version; b=WYO8LsFQUc57yy3oVL1OVmx+YQxuypZH1UuJxtNF6qcfEZDr8CPgvC9VLxaoOuguCYQcWDFJIfwTRDTgqwwDs2UgqEMImkZ0kxl5uVvjbbzeBSXAnemqvdJ6peS668ogVx5u54MU285CcwHpWwxAE/F0HHWHYwqiyKnZDjDH8ug= X-ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=Oo/yIYzx; arc=none smtp.client-ip=100.103.45.18 X-Received: by smtp.kernel.org (Postfix) with ESMTPSA id 41CB11F000FF; Thu, 8 Oct 2026 15:31:42 +0000 (UTC) X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1791473502; bh=dJ+dI6fVl0ppHHe5Erg5+7zCijhVgWIpo/k6OR0FjDs=; h=Subject:From:To:Cc:Date:In-Reply-To:References; b=Oo/yIYzxTW+k/cVURWxWXc417qbyMxV3LEU9s6d8Z3OWG1FS9l1g4tdPLMF2/Kiw6 nYnYN16j5P1TWsVtZpjlOAHpw0zBTNBpEm+Pcl1wg5whKUHIqZu1Hc7FiyrDqSVpuw /MzDYJaEJkNFDe3Gx4VSVnVQbhsZlsf2iMbCUFfUm7tztYj9q0jK4DgXIbb/d7qfBp GTMOnLQrphst+qof2os1CUhS0TxryQ6Xh6eay2WZkzXP4VDAfa1jbKFe8pqeMmvWcJ 1HF2kuRUJ9thxcQSG89Hy915C4iJGr+H7Tag9zptm+njcFFDC/ZdjGApwk2kSbk0js 2J5qZpaUP3Vgw== X-Cc: netdev@vger.kernel.org, min.li@microchip.com, vadim.fedorenko@linux.dev, arkadiusz.kubalewski@intel.com, jiri@resnulli.us, kuba@kernel.org, Prathosh.Satish@microchip.com, pabeni@redhat.com, linux-kernel@vger.kernel.org X-In-Reply-To: <20261006153116.347497-2-ivecera@redhat.com> X-sashiko-severity: Low X-Precedence: bulk X-Mailing-List: netdev@vger.kernel.org X-List-Subscribe: <mailto:netdev+subscribe@vger.kernel.org> X-List-Unsubscribe: <mailto:netdev+unsubscribe@vger.kernel.org>