diff options
| author | Cristian Ciocaltea <cristian.ciocaltea@collabora.com> | 2026-08-11 18:44:43 +0300 |
|---|---|---|
| committer | Vinod Koul <vkoul@kernel.org> | 2026-08-11 22:24:02 +0530 |
| commit | c4fe5a9f379055ce0ec930f6495ae62aad237b89 (patch) | |
| tree | d01d7534a9c86b1bc7a6011e3af6fffe9f0af0fc /include | |
| parent | f0c2c9c58a48b621b1cb90f0821da422b31af814 (diff) | |
phy: rockchip: samsung-hdptx: Prevent divide-by-zero when computing clk rate
Calculating 'sdm' fraction in rk_hdptx_phy_clk_calc_rate_from_pll_cfg()
could trigger a divide-by-zero, as it uses div_u64() with a denominator
read directly from hardware: the values ropll_hw.sdm_deno,
ropll_hw.sdc_deno, ropll_hw.sdc_n, and ropll_hw.sdc_num are populated
from PLL registers which, in theory, could be left by the bootloader
uninitialized/misconfigured.
Provide the necessary sanitization to avoid trusting the hardware state.
Reported-by: Sashiko <sashiko-bot@kernel.org>
Closes: https://sashiko.dev/#/patchset/20260611-hdptx-clk-fixes-v3-0-67b1b0c00e16@collabora.com?part=1
Fixes: 3481fc04d969 ("phy: rockchip: samsung-hdptx: Compute clk rate from PLL config")
Tested-by: Diederik de Haas <diederik@cknow-tech.com> # NanoPC-T6 LTS
Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
Reviewed-by: Andy Yan <andy.yan@rock-chips.com>
Signed-off-by: Cristian Ciocaltea <cristian.ciocaltea@collabora.com>
Link: https://patch.msgid.link/20260811-hdptx-clk-fixes-v6-2-75bca0ee5753@collabora.com
Signed-off-by: Vinod Koul <vkoul@kernel.org>
Diffstat (limited to 'include')
0 files changed, 0 insertions, 0 deletions
