提交 5e43e259 编写于 作者: T Thierry Reding

clk: tegra: Register the proper number of resets

The number of resets controls is 32 times the number of peripheral
register banks rather than 32 times the number of clocks. This reduces
(drastically) the number of reset controls registered from 10080 (315
clocks * 32) to 224 (6 peripheral register banks * 32).

This also fixes a potential crash because trying to use any of the
excess reset controls (224-10079) would have caused accesses beyond
the array bounds of the peripheral register banks definition array.

Cc: Peter De Schrijver <pdeschrijver@nvidia.com>
Cc: Prashant Gaikwad <pgaikwad@nvidia.com>
Fixes: 6d5b988e ("clk: tegra: implement a reset driver")
Cc: stable@vger.kernel.org # 3.14+
Signed-off-by: NThierry Reding <treding@nvidia.com>
上级 44a6f3db
...@@ -272,7 +272,7 @@ void __init tegra_add_of_provider(struct device_node *np) ...@@ -272,7 +272,7 @@ void __init tegra_add_of_provider(struct device_node *np)
of_clk_add_provider(np, of_clk_src_onecell_get, &clk_data); of_clk_add_provider(np, of_clk_src_onecell_get, &clk_data);
rst_ctlr.of_node = np; rst_ctlr.of_node = np;
rst_ctlr.nr_resets = clk_num * 32; rst_ctlr.nr_resets = periph_banks * 32;
reset_controller_register(&rst_ctlr); reset_controller_register(&rst_ctlr);
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册