Skip to content

Commit 6eb89d2

Browse files
airliedopsiff
authored andcommitted
nouveau: fix disabling the nonstall irq due to storm code
[ Upstream commit 0ef5c4e4dbbfcebaa9b2eca18097b43016727dfe ] Nouveau has code that when it gets an IRQ with no allowed handler it disables it to avoid storms. However with nonstall interrupts, we often disable them from the drm driver, but still request their emission via the push submission. Just don't disable nonstall irqs ever in normal operation, the event handling code will filter them out, and the driver will just enable/disable them at load time. This fixes timeouts we've been seeing on/off for a long time, but they became a lot more noticeable on Blackwell. This doesn't fix all of them, there is a subsequent fence emission fix to fix the last few. Fixes: 3ebd64a ("drm/nouveau/intr: support multiple trees, and explicit interfaces") Cc: [email protected] Signed-off-by: Dave Airlie <[email protected]> Link: https://lore.kernel.org/r/[email protected] [ Fix a typo and a minor checkpatch.pl warning; remove "v2" from commit subject. - Danilo ] Signed-off-by: Danilo Krummrich <[email protected]> [ Apply to drivers/gpu/drm/nouveau/nvkm/engine/fifo/r535.c ] Signed-off-by: Sasha Levin <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]> (cherry picked from commit 607b2bf5708fe657c85271edc4dc4226323068f9)
1 parent ef063bb commit 6eb89d2

File tree

5 files changed

+21
-8
lines changed

5 files changed

+21
-8
lines changed

drivers/gpu/drm/nouveau/nvkm/engine/fifo/base.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -352,6 +352,8 @@ nvkm_fifo_dtor(struct nvkm_engine *engine)
352352
mutex_destroy(&fifo->userd.mutex);
353353

354354
nvkm_event_fini(&fifo->nonstall.event);
355+
if (fifo->func->nonstall_dtor)
356+
fifo->func->nonstall_dtor(fifo);
355357
mutex_destroy(&fifo->mutex);
356358

357359
if (fifo->func->dtor)

drivers/gpu/drm/nouveau/nvkm/engine/fifo/ga100.c

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -517,19 +517,11 @@ ga100_fifo_nonstall_intr(struct nvkm_inth *inth)
517517
static void
518518
ga100_fifo_nonstall_block(struct nvkm_event *event, int type, int index)
519519
{
520-
struct nvkm_fifo *fifo = container_of(event, typeof(*fifo), nonstall.event);
521-
struct nvkm_runl *runl = nvkm_runl_get(fifo, index, 0);
522-
523-
nvkm_inth_block(&runl->nonstall.inth);
524520
}
525521

526522
static void
527523
ga100_fifo_nonstall_allow(struct nvkm_event *event, int type, int index)
528524
{
529-
struct nvkm_fifo *fifo = container_of(event, typeof(*fifo), nonstall.event);
530-
struct nvkm_runl *runl = nvkm_runl_get(fifo, index, 0);
531-
532-
nvkm_inth_allow(&runl->nonstall.inth);
533525
}
534526

535527
const struct nvkm_event_func
@@ -564,12 +556,26 @@ ga100_fifo_nonstall_ctor(struct nvkm_fifo *fifo)
564556
if (ret)
565557
return ret;
566558

559+
nvkm_inth_allow(&runl->nonstall.inth);
560+
567561
nr = max(nr, runl->id + 1);
568562
}
569563

570564
return nr;
571565
}
572566

567+
void
568+
ga100_fifo_nonstall_dtor(struct nvkm_fifo *fifo)
569+
{
570+
struct nvkm_runl *runl;
571+
572+
nvkm_runl_foreach(runl, fifo) {
573+
if (runl->nonstall.vector < 0)
574+
continue;
575+
nvkm_inth_block(&runl->nonstall.inth);
576+
}
577+
}
578+
573579
int
574580
ga100_fifo_runl_ctor(struct nvkm_fifo *fifo)
575581
{
@@ -599,6 +605,7 @@ ga100_fifo = {
599605
.runl_ctor = ga100_fifo_runl_ctor,
600606
.mmu_fault = &tu102_fifo_mmu_fault,
601607
.nonstall_ctor = ga100_fifo_nonstall_ctor,
608+
.nonstall_dtor = ga100_fifo_nonstall_dtor,
602609
.nonstall = &ga100_fifo_nonstall,
603610
.runl = &ga100_runl,
604611
.runq = &ga100_runq,

drivers/gpu/drm/nouveau/nvkm/engine/fifo/ga102.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ ga102_fifo = {
3030
.runl_ctor = ga100_fifo_runl_ctor,
3131
.mmu_fault = &tu102_fifo_mmu_fault,
3232
.nonstall_ctor = ga100_fifo_nonstall_ctor,
33+
.nonstall_dtor = ga100_fifo_nonstall_dtor,
3334
.nonstall = &ga100_fifo_nonstall,
3435
.runl = &ga100_runl,
3536
.runq = &ga100_runq,

drivers/gpu/drm/nouveau/nvkm/engine/fifo/priv.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ struct nvkm_fifo_func {
4040
void (*start)(struct nvkm_fifo *, unsigned long *);
4141

4242
int (*nonstall_ctor)(struct nvkm_fifo *);
43+
void (*nonstall_dtor)(struct nvkm_fifo *);
4344
const struct nvkm_event_func *nonstall;
4445

4546
const struct nvkm_runl_func *runl;
@@ -198,6 +199,7 @@ extern const struct nvkm_fifo_func_mmu_fault tu102_fifo_mmu_fault;
198199

199200
int ga100_fifo_runl_ctor(struct nvkm_fifo *);
200201
int ga100_fifo_nonstall_ctor(struct nvkm_fifo *);
202+
void ga100_fifo_nonstall_dtor(struct nvkm_fifo *);
201203
extern const struct nvkm_event_func ga100_fifo_nonstall;
202204
extern const struct nvkm_runl_func ga100_runl;
203205
extern const struct nvkm_runq_func ga100_runq;

drivers/gpu/drm/nouveau/nvkm/engine/fifo/r535.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -660,6 +660,7 @@ r535_fifo_new(const struct nvkm_fifo_func *hw, struct nvkm_device *device,
660660
rm->chan.func = &r535_chan;
661661
rm->nonstall = &ga100_fifo_nonstall;
662662
rm->nonstall_ctor = ga100_fifo_nonstall_ctor;
663+
rm->nonstall_dtor = ga100_fifo_nonstall_dtor;
663664

664665
return nvkm_fifo_new_(rm, device, type, inst, pfifo);
665666
}

0 commit comments

Comments
 (0)