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 7035A32B125; Wed, 23 Sep 2026 14:16:42 +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=1790173003; cv=none; b=GMs0EI+ZHNVEKDf45K+kZU3mSrTJmFwXoibgVHvVZZ6so2akBU1kGZREmQjBI1C94hEOCT78VXx7DUTzzYTUqUZ7gN09SzwJux0dR4rAzqUCorDQOy4Q1oXC2rpcT0ihFX3Ll63eXvo08lpzVdDaFWCwky3GquSL8Ta+hJikFhk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1790173003; c=relaxed/simple; bh=LTBJGKJYowJWYn17wOfmmEQeCPPC9o1R0VzD8i7Jfco=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=jQ3zWbIeIp8ugi8xUqgofjDvAB3tMatxrilT4w1M1YcqWYSw+oISw64YJuO8Ur34cpzblfAFbjXXneW5dFk/mhlMAm7q4Ikfg1+zzbCh5s2UMaJsBILaJBHnouvWbjSvWjUf14vdNrx9OBFhLalEDlktzOI7DPeytFKAUhZ92fE= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=dQMAAYOG; 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="dQMAAYOG" Received: by smtp.kernel.org (Postfix) with ESMTPSA id B4FD31F008A3; Wed, 23 Sep 2026 14:16:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1790173002; bh=9JgtdeRQulYqfhUtquqynmcSPy7KsCrcxjol/79G7Lw=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=dQMAAYOGrB3j2g5XJ+xT0S3KNDVLPe4hMiWIDFv3YohYa38KmHSuPtsHvyauDK4Gy hUPnANBIEA2ws4ym0+O5GjzHIENvRsG7DFwW4AM7fRaINjG3YKo0FW1wTo2RhnboqO i3VZK3JLvyVuAZIS8sIq6Phi5CHnUxmQlF/G0CH0= 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 7.2 126/438] phy: mediatek: phy-mtk-hdmi-mt8195: Fix PLL calc divisor overflow Date: Wed, 23 Sep 2026 16:02:27 +0200 Message-ID: <20260923140648.045596508@linuxfoundation.org> X-Mailer: git-send-email 2.55.0 In-Reply-To: <20260923140644.756254324@linuxfoundation.org> References: <20260923140644.756254324@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 7.2-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 1426a2db984d5..e6ee8e0800222 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