From mboxrd@z Thu Jan 1 00:00:00 1970 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 A0F28329C7C; Wed, 23 Sep 2026 14:41:50 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1790174511; cv=none; b=JV3lqAGYNXqTm5jafiuCZtxwIrLDe5jphCA2n2iTpF7IV/avJud+Gii9V5gkfraNDuyxAolt9kLGF1DzrWFau7N9porm4NcGvvKTDepG+zzU746+cAdAINFN9T7K17LEDa9Irq3d5Wz/dSF/dOtYZmYxzadzrcQbbPUXosYhY5I= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1790174511; c=relaxed/simple; bh=y1RAYHd84URFfC24cEp0SnhwWon+KtYw1lWjhpPlzUA=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=bEtWPV5sPabw4uprr+vROOhrqUec1jJ8qK0Ny9le03ykE8Q5Qwwtaxg4LxSfvpP8A2HpEZZcxlD4fbIIUqU7CGETfnXxjUhxNjekenVZ9rGfPiyAiSIPs0Yk7Q7qcqTSWsXxv40m51HEkdS1pMu2BucK5CoZI6Knbi1e/VAXvSA= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=tZGix58m; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="tZGix58m" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 02F111F000FF; Wed, 23 Sep 2026 14:41:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1790174510; bh=dKOMJUo3dLdx0AYPcYe+vzugjY0zNQFTeQGjC25wjWM=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=tZGix58mGzxCc8eLEuoQkIOfgeuKVynH6040qAQDPdckDs4PZa2VSGWMh8dmgXrGl Ihv5uWp7loHfU7+i5luW8oTg4g+lPB8+2I6L1/I9ILO47+j4bIRxL67CW0o3S3K9jo 1TniXhTM3DRy3PCiMGLBrSHI90/tTZ0JiKz1Gygg= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Manivannan Sadhasivam , AngeloGioacchino Del Regno , Vinod Koul , Sasha Levin Subject: [PATCH 6.18 105/398] phy: mediatek: phy-mtk-hdmi-mt8195: Fix PLL calc divisor overflow Date: Wed, 23 Sep 2026 16:02:59 +0200 Message-ID: <20260923140646.160378485@linuxfoundation.org> X-Mailer: git-send-email 2.55.0 In-Reply-To: <20260923140643.441954610@linuxfoundation.org> References: <20260923140643.441954610@linuxfoundation.org> User-Agent: quilt/0.69 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 6.18-stable review patch. If anyone has any objections, please let me know. ------------------ From: AngeloGioacchino Del Regno [ Upstream commit de7f29a1fe1dc2864d8a47f8c39d508442cae167 ] When trying to calculate a PLL rate for target display resolutions above 2560x1440, 24bpp, 30Hz, the pixel clock value will be more than 32-bits long but the division to finally calculate the digital clock divider is being done with div_u64(), which expects a 32bit unsigned divisor. Fix the overflow by using div64_u64() instead. Fixes: 9d9ff3d2a4a5 ("phy: mediatek: hdmi: mt8195: fix wrong pll calculus") Reviewed-by: Manivannan Sadhasivam Signed-off-by: AngeloGioacchino Del Regno Link: https://patch.msgid.link/20260911074015.9994-2-angelogioacchino.delregno@collabora.com Signed-off-by: Vinod Koul Signed-off-by: Sasha Levin --- drivers/phy/mediatek/phy-mtk-hdmi-mt8195.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/phy/mediatek/phy-mtk-hdmi-mt8195.c b/drivers/phy/mediatek/phy-mtk-hdmi-mt8195.c index b38f3ae26b3f3..829d329af1732 100644 --- a/drivers/phy/mediatek/phy-mtk-hdmi-mt8195.c +++ b/drivers/phy/mediatek/phy-mtk-hdmi-mt8195.c @@ -290,7 +290,7 @@ static int mtk_hdmi_pll_calc(struct mtk_hdmi_phy *hdmi_phy, struct clk_hw *hw, posdiv2 = 1; /* Digital clk divider, max /32 */ - digital_div = div_u64(ns_hdmipll_ck, posdiv1 * posdiv2 * pixel_clk); + digital_div = div64_u64(ns_hdmipll_ck, posdiv1 * posdiv2 * pixel_clk); if (!(digital_div <= 32 && digital_div >= 1)) return -EINVAL; -- 2.53.0