Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

gpu: host1x: Fix hang on Tegra186+

Tegra186+ hangs if host1x hardware is disabled at a kernel boot time
because we touch hardware before runtime PM is resumed. Move sync point
assignment initialization to the RPM-resume callback. Older SoCs were
unaffected because they skip that sync point initialization.

Tested-by: Jon Hunter <jonathanh@nvidia.com> # T186
Reported-by: Jon Hunter <jonathanh@nvidia.com> # T186
Fixes: 6b6776e2ab8a ("gpu: host1x: Add initial runtime PM and OPP support")
Signed-off-by: Dmitry Osipenko <digetx@gmail.com>
Signed-off-by: Thierry Reding <treding@nvidia.com>

authored by

Dmitry Osipenko and committed by
Thierry Reding
22d7ee32 e783362e

+8 -8
+8 -8
drivers/gpu/host1x/syncpt.c
··· 137 137 struct host1x_syncpt *sp_base = host->syncpt; 138 138 unsigned int i; 139 139 140 - for (i = 0; i < host1x_syncpt_nb_pts(host); i++) 140 + for (i = 0; i < host1x_syncpt_nb_pts(host); i++) { 141 + /* 142 + * Unassign syncpt from channels for purposes of Tegra186 143 + * syncpoint protection. This prevents any channel from 144 + * accessing it until it is reassigned. 145 + */ 146 + host1x_hw_syncpt_assign_to_channel(host, sp_base + i, NULL); 141 147 host1x_hw_syncpt_restore(host, sp_base + i); 148 + } 142 149 143 150 for (i = 0; i < host1x_syncpt_nb_bases(host); i++) 144 151 host1x_hw_syncpt_restore_wait_base(host, sp_base + i); ··· 359 352 for (i = 0; i < host->info->nb_pts; i++) { 360 353 syncpt[i].id = i; 361 354 syncpt[i].host = host; 362 - 363 - /* 364 - * Unassign syncpt from channels for purposes of Tegra186 365 - * syncpoint protection. This prevents any channel from 366 - * accessing it until it is reassigned. 367 - */ 368 - host1x_hw_syncpt_assign_to_channel(host, &syncpt[i], NULL); 369 355 } 370 356 371 357 for (i = 0; i < host->info->nb_bases; i++)