Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1795027199; b=r2EpJqwfdQLNQqqpc0TQAabR5v4YYKipGY0MbXn9CKV1+Y33KyICFiKjEuoa+WRR6xvs Co/9q+2D+BGydiYHLsAWbR5UABhDjGlBryKXRn1GNWMm2KFACLbwZHiPeLGN69ajxm3I7 Y7vLkgKVvirsRTEwXnvk051I3tmjCvYskDhDoERoKrvKhpaAyuh482G+9WYuVF8BTghEa KymTkJKWO2fnVKt0HD8XwwADtT70UeMFkVtMxRPAcGLKu17aMBzteE12kc5pN8iT4fPb+ GsUigzGuj6zSbmm5OS8UAoDCXe0lJJgBNe5y9O/ZtX3Bm4TFp9BB6xWmUsJT11UWqEQ== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1795027199; h=Received:DKIM-Signature:From:To:Cc:Subject:Date:Message-ID:X-Mailer: In-Reply-To:References:User-Agent:X-stable:X-Patchwork-Hint: MIME-Version:Content-Transfer-Encoding; bh=JYZhh14MXzujALtE0BkbPMZPqJhncGvqon8zg2G9jSM=; b=PtINEiDg1cmD3jb+SEmcoswDSTEnbVU8MnKY/s3875Cmv+HB6ePv7mx6iuc9kJBbua57 CSQh8wnNDUkIDIBxMOHWbAmHRA//FjLpdlIQYhreO2ha/pU4a/fkB4owGSM1/uzGoUfHG vfkqDncnqMvAxRSmrW/B9f5g42baDYKfTybQQ5sTsuF6pKHrJWOisaGHd4budvwbNh7xY IGP+FWrs0lFDCTD5xLF89j8GPjjdoMd9Ik8e4oXHBhXpvmBiJf0C19u9m82rgTc607wCo BBBofY4uDlt/eFmYGCqTBiw612t8u8eNzfvNgNVlym69VZNh4THQVhp3l8eG1lP7qtA== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=linuxfoundation.org header.i=@linuxfoundation.org header.a=rsa-sha256 header.s=korg header.b=MkMyPLGC; arc=none smtp.remote-ip=100.103.45.18 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 4B410606A31C; Wed, 18 Nov 2026 18:39:59 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.a=rsa-sha256 header.s=korg header.b=MkMyPLGC Received: by smtp.kernel.org (Postfix) with ESMTPSA id 9BA1B1F000C4; Wed, 18 Nov 2026 18:39:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1795027199; bh=JYZhh14MXzujALtE0BkbPMZPqJhncGvqon8zg2G9jSM=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=MkMyPLGCGgZPklnvl52BX5xPHTvjlRFn7oXNYlTtReVWf6c9XUhrR5C9e/CexicgG Jza8R24S1tOHlg6wvuGkFZ8vKWjAdD1lmbDIPcwW/F1wMOAG2Ona/yCumrDahy/nhe GX5PGKL5l5EyvpQj6iSBGgKGoVbuJX/1j5kLPgds= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Petr Oros , Ivan Vecera , Jakub Kicinski , Sasha Levin Subject: [PATCH 6.18 1706/2151] dpll: zl3073x: reject output frequencies with too small divisor Date: Wed, 18 Nov 2026 15:57:21 +0100 Message-ID: <20261118150223.963042527@linuxfoundation.org> X-Mailer: git-send-email 2.56.0 In-Reply-To: <20261118150121.603863898@linuxfoundation.org> References: <20261118150121.603863898@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore X-Mailing-List: patches@lists.linux.dev List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.18-stable review patch. If anyone has any objections, please let me know. ------------------ From: Ivan Vecera [ Upstream commit 456027325c9cd2be94229687f2c412ae6f351bd8 ] The output divisor has to be at least 2: a divisor of 1 bypasses the divider and the hardware then ignores the pulse width and eSync registers. For the N-pin of an N-divided output the N divider (>= 2) applies on top, so its effective divisor has to be at least 4. zl3073x_pin_check_freq() only checked that the frequency divides the synth frequency. Require also the minimum divisor. For N-divided outputs this is necessary but not sufficient, the rest is checked by the frequency set callback. Hit during development: an N-pin frequency that needs an N divider of 1 was accepted, and with esync_n_period = 1 the N-pin produced no output on an oscilloscope. Fixes: a99a9f0ebdaa ("dpll: zl3073x: Read DPLL types and pin properties from system firmware") Reviewed-by: Petr Oros Signed-off-by: Ivan Vecera Link: https://patch.msgid.link/20261011061211.448373-4-ivecera@redhat.com Signed-off-by: Jakub Kicinski Signed-off-by: Sasha Levin --- drivers/dpll/zl3073x/prop.c | 33 +++++++++++++++++++++++++++------ 1 file changed, 27 insertions(+), 6 deletions(-) diff --git a/drivers/dpll/zl3073x/prop.c b/drivers/dpll/zl3073x/prop.c index 9a1911427eb7e..d80f62a500bc9 100644 --- a/drivers/dpll/zl3073x/prop.c +++ b/drivers/dpll/zl3073x/prop.c @@ -22,7 +22,8 @@ * The function checks the given frequency is valid for the device. For input * pins it checks that the frequency can be factorized using supported base * frequencies. For output pins it checks that the frequency divides connected - * synth frequency without remainder. + * synth frequency without remainder and that the resulting divisor is not + * below the minimum the driver supports. * * Return: true if the frequency is valid, false if not. */ @@ -41,18 +42,38 @@ zl3073x_pin_check_freq(struct zl3073x_dev *zldev, enum dpll_pin_direction dir, if (rc) goto err_inv_freq; } else { - u32 synth_freq; - u8 out, synth; + u32 synth_freq, div, min_div, rem; + const struct zl3073x_out *out; + u8 out_id, synth; /* Get output pin synthesizer */ - out = zl3073x_output_pin_out_get(id); - synth = zl3073x_dev_out_synth_get(zldev, out); + out_id = zl3073x_output_pin_out_get(id); + synth = zl3073x_dev_out_synth_get(zldev, out_id); /* Get synth frequency */ synth_freq = zl3073x_dev_synth_freq_get(zldev, synth); /* 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 driver requires an output divisor of at least 2 - + * below that the hardware bypasses the divider and ignores + * the pulse width and eSync registers the driver programs. + * For the N-pin of an N-divided output the effective divisor + * also includes the N divider (>= 2), so the minimum is 4. + * For N-divided outputs this is only a necessary condition - + * whether the frequency can be set also depends on the output + * divisor shared by both pins, which is checked when the + * frequency is set. + */ + 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; } -- 2.53.0