From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 D5282223339; Mon, 23 Jun 2025 21:39:12 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1750714752; cv=none; b=qQbu/SjT+NTl53bSu/J76N7iZgustghBg1Bxe8dgsYisce1X1AEAtTR2Gt8PJN0WymScA9O8OYjLvB9kIGUq1qLc3ujteaR3YDltsh+kUlSZmoR0hbGaRMOBYxZKxPHDrI1cQdwDDUoewKQ59Snlb+myCKO3rKMQedR+jlrV6j4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1750714752; c=relaxed/simple; bh=NbcncAI/3XDoklTQCCPeTgK0FLZwds0U+rMslPKBje4=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=HJ+AXzzLOIi9sE8C3dqyKR5yns3Yxqsi+Fx5SbuU0mBcMglNtjO0FMY0sPg2vy8Mg3BWt+2kzIReCTWEER7x2MjaUGKoHxOQlkx4aF/dDwfdXzaCzy46DSkq/i4mLlp13nV+wJ5c/kbU+VqRY0hTpIsMTr4jDCIMm9i8J72A8D8= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=1V5QuPOf; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="1V5QuPOf" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 6E0B4C4CEEA; Mon, 23 Jun 2025 21:39:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1750714752; bh=NbcncAI/3XDoklTQCCPeTgK0FLZwds0U+rMslPKBje4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=1V5QuPOfuIkgU6zhEdoPVHpG6k41izWIxWXHthJQzGT+SIB8p8rFvsEQvWM5Y0Tsu xigNPZRx7qe6amRA8caTX7Km6gxI/2MmzT0Ly4z2ySmT5ejQU1rOWi+jltKNmO1i1B OhaZyglIiti6VSVyb3bSzwVP6K8KrW+K31+LUcYQ= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Sakari Ailus , Laurent Pinchart , Hans Verkuil Subject: [PATCH 5.15 207/411] media: ccs-pll: Start OP pre-PLL multiplier search from correct value Date: Mon, 23 Jun 2025 15:05:51 +0200 Message-ID: <20250623130638.883386175@linuxfoundation.org> X-Mailer: git-send-email 2.50.0 In-Reply-To: <20250623130632.993849527@linuxfoundation.org> References: <20250623130632.993849527@linuxfoundation.org> User-Agent: quilt/0.68 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 5.15-stable review patch. If anyone has any objections, please let me know. ------------------ From: Sakari Ailus commit 660e613d05e449766784c549faf5927ffaf281f1 upstream. The ccs_pll_calculate() function does a search over possible PLL configurations to find the "best" one. If the sensor does not support odd pre-PLL divisors and the minimum value (with constraints) isn't 1, other odd values could be errorneously searched (and selected) for the pre-PLL divisor. Fix this. Fixes: 415ddd993978 ("media: ccs-pll: Split limits and PLL configuration into front and back parts") Cc: stable@vger.kernel.org Signed-off-by: Sakari Ailus Reviewed-by: Laurent Pinchart Signed-off-by: Hans Verkuil Signed-off-by: Greg Kroah-Hartman --- drivers/media/i2c/ccs-pll.c | 2 ++ 1 file changed, 2 insertions(+) --- a/drivers/media/i2c/ccs-pll.c +++ b/drivers/media/i2c/ccs-pll.c @@ -817,6 +817,8 @@ int ccs_pll_calculate(struct device *dev one_or_more( DIV_ROUND_UP(op_lim_fr->max_pll_op_clk_freq_hz, pll->ext_clk_freq_hz)))); + if (!(pll->flags & CCS_PLL_FLAG_EXT_IP_PLL_DIVIDER)) + min_op_pre_pll_clk_div = clk_div_even(min_op_pre_pll_clk_div); dev_dbg(dev, "pll_op check: min / max op_pre_pll_clk_div: %u / %u\n", min_op_pre_pll_clk_div, max_op_pre_pll_clk_div);