mirror of
git://git.yoctoproject.org/linux-yocto.git
synced 2025-07-05 13:25:20 +02:00
memory: tegra: Fix integer overflow on tick value calculation
commit b906c056b6
upstream.
Multiplying the Memory Controller clock rate by the tick count results
in an integer overflow and in result the truncated tick value is being
programmed into hardware, such that the GR3D memory client performance is
reduced by two times.
Cc: stable <stable@vger.kernel.org>
Signed-off-by: Dmitry Osipenko <digetx@gmail.com>
Signed-off-by: Thierry Reding <treding@nvidia.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
dda71c1663
commit
c82da3e43c
|
@ -280,7 +280,7 @@ static int tegra_mc_setup_latency_allowance(struct tegra_mc *mc)
|
||||||
u32 value;
|
u32 value;
|
||||||
|
|
||||||
/* compute the number of MC clock cycles per tick */
|
/* compute the number of MC clock cycles per tick */
|
||||||
tick = mc->tick * clk_get_rate(mc->clk);
|
tick = (unsigned long long)mc->tick * clk_get_rate(mc->clk);
|
||||||
do_div(tick, NSEC_PER_SEC);
|
do_div(tick, NSEC_PER_SEC);
|
||||||
|
|
||||||
value = readl(mc->regs + MC_EMEM_ARB_CFG);
|
value = readl(mc->regs + MC_EMEM_ARB_CFG);
|
||||||
|
|
Loading…
Reference in New Issue
Block a user