mirror of
https://github.com/torvalds/linux.git
synced 2026-11-06 21:58:01 +01:00
hte: tegra194: Initialize slice locks before registering chip
Registering the HTE chip publishes its request callbacks to consumers.
Initialize every slice lock before registration so a concurrent HTE
request cannot use an uninitialized lock.
Signed-off-by: Runyu Xiao <runyu.xiao@seu.edu.cn>
Fixes: 09574cca6a ("hte: Add Tegra194 HTE kernel provider")
Cc: stable@vger.kernel.org
Acked-by: Dipen Patel <dipenp@nvidia.com>
Signed-off-by: Dipen Patel <dipenp@nvidia.com>
This commit is contained in:
parent
c21530a75b
commit
1329abe1ba
|
|
@ -908,17 +908,17 @@ static int tegra_hte_probe(struct platform_device *pdev)
|
|||
|
||||
hte_dev->chip = gc;
|
||||
|
||||
for (i = 0; i < slices; i++) {
|
||||
hte_dev->sl[i].flags = 0;
|
||||
spin_lock_init(&hte_dev->sl[i].s_lock);
|
||||
}
|
||||
|
||||
ret = devm_hte_register_chip(hte_dev->chip);
|
||||
if (ret) {
|
||||
dev_err(gc->dev, "hte chip register failed");
|
||||
return ret;
|
||||
}
|
||||
|
||||
for (i = 0; i < slices; i++) {
|
||||
hte_dev->sl[i].flags = 0;
|
||||
spin_lock_init(&hte_dev->sl[i].s_lock);
|
||||
}
|
||||
|
||||
val = HTE_TECTRL_ENABLE_ENABLE |
|
||||
(HTE_TECTRL_INTR_ENABLE << HTE_TECTRL_INTR_SHIFT) |
|
||||
(hte_dev->itr_thrshld << HTE_TECTRL_OCCU_SHIFT);
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user