mirror of
git://nv-tegra.nvidia.com/linux-nv-oot.git
synced 2025-12-22 09:11:26 +03:00
Use DIV_ROUND_DOWN_ULL consistently for frequency calculations to match QNX implementation. For 30Hz signals, reference ticks were calculated as 1041667 for a value of 1041666.67, while QNX correctly uses 1041666. When generating precise frequencies, this rounding difference affects how extra ticks distribute across periods (covering the 0.67 gap over 3 periods). The QNX implementation works correctly because it rounds down, while the Linux implementation was rounding up. This change ensures proper fractional tick distribution and prevents signal drift over time for frequencies that aren't exact multiples of the TSC clock unit. Bug 5223558 Change-Id: I5fbeafd1e37c92fe95f2f3605d1ae225eacb88c8 Signed-off-by: Mohit Ingale <mohiti@nvidia.com> Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3348278 Reviewed-by: Justin Kim (SW-TEGRA) <juskim@nvidia.com> GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com> Reviewed-by: Frank Chen <frankc@nvidia.com> Reviewed-by: Ian Kaszubski <ikaszubski@nvidia.com>