mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH 1/2] drm/nouveau/bar/gf100: fix hang when calling ->fini() before ->init()
@ 2017-12-04 18:37 Guillaume Tucker
  2017-12-04 18:37 ` [PATCH 2/2] drm/tegra: sor: Fix hang on tegra124 due to NULL clk_out Guillaume Tucker
  2017-12-05 14:30 ` [PATCH 1/2] drm/nouveau/bar/gf100: fix hang when calling ->fini() before ->init() Jon Hunter
  0 siblings, 2 replies; 6+ messages in thread
From: Guillaume Tucker @ 2017-12-04 18:37 UTC (permalink / raw)
  To: Jonathan Hunter, David Airlie
  Cc: dri-devel, linux-tegra, linux-kernel, linux-arm-kernel,
	Guillaume Tucker, Ben Skeggs

If the firmware fails to load then ->fini() will be called before the
device has been initialised, causing the kernel to hang while trying
to write to a register.  Add a test in ->fini() to avoid this issue.

This fixes a kernel hang on tegra124.

Fixes: b17de35a2ebbe ("drm/nouveau/bar: implement bar1 teardown")
Signed-off-by: Guillaume Tucker <guillaume.tucker@collabora.com>
CC: Ben Skeggs <bskeggs@redhat.com>
---
 drivers/gpu/drm/nouveau/nvkm/subdev/bar/gf100.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/bar/gf100.c b/drivers/gpu/drm/nouveau/nvkm/subdev/bar/gf100.c
index a3ba7f50198b..95e2aba64aad 100644
--- a/drivers/gpu/drm/nouveau/nvkm/subdev/bar/gf100.c
+++ b/drivers/gpu/drm/nouveau/nvkm/subdev/bar/gf100.c
@@ -43,9 +43,12 @@ gf100_bar_bar1_wait(struct nvkm_bar *base)
 }
 
 void
-gf100_bar_bar1_fini(struct nvkm_bar *bar)
+gf100_bar_bar1_fini(struct nvkm_bar *base)
 {
-	nvkm_mask(bar->subdev.device, 0x001704, 0x80000000, 0x00000000);
+	struct nvkm_device *device = base->subdev.device;
+
+	if (base->subdev.oneinit)
+		nvkm_mask(device, 0x001704, 0x80000000, 0x00000000);
 }
 
 void
-- 
2.11.0

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2017-12-19 22:05 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-12-04 18:37 [PATCH 1/2] drm/nouveau/bar/gf100: fix hang when calling ->fini() before ->init() Guillaume Tucker
2017-12-04 18:37 ` [PATCH 2/2] drm/tegra: sor: Fix hang on tegra124 due to NULL clk_out Guillaume Tucker
2017-12-05 14:30 ` [PATCH 1/2] drm/nouveau/bar/gf100: fix hang when calling ->fini() before ->init() Jon Hunter
     [not found]   ` <CABDvA=krahNw3q+qpEPbbv8Y9fvX4jXc_B54qafwtgFyWpqKWg@mail.gmail.com>
2017-12-06  9:22     ` Guillaume Tucker
2017-12-06 17:18       ` Jon Hunter
2017-12-19 22:05         ` Jon Hunter

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®