Skip to content

Commit fc988f3

Browse files
airliedgregkh
authored andcommitted
nouveau: fix disabling the nonstall irq due to storm code
commit 0ef5c4e upstream. 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]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent 897f64b commit fc988f3

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
@@ -350,6 +350,8 @@ nvkm_fifo_dtor(struct nvkm_engine *engine)
350350
nvkm_chid_unref(&fifo->chid);
351351

352352
nvkm_event_fini(&fifo->nonstall.event);
353+
if (fifo->func->nonstall_dtor)
354+
fifo->func->nonstall_dtor(fifo);
353355
mutex_destroy(&fifo->mutex);
354356

355357
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
@@ -41,6 +41,7 @@ struct nvkm_fifo_func {
4141
void (*start)(struct nvkm_fifo *, unsigned long *);
4242

4343
int (*nonstall_ctor)(struct nvkm_fifo *);
44+
void (*nonstall_dtor)(struct nvkm_fifo *);
4445
const struct nvkm_event_func *nonstall;
4546

4647
const struct nvkm_runl_func *runl;
@@ -200,6 +201,7 @@ u32 tu102_chan_doorbell_handle(struct nvkm_chan *);
200201

201202
int ga100_fifo_runl_ctor(struct nvkm_fifo *);
202203
int ga100_fifo_nonstall_ctor(struct nvkm_fifo *);
204+
void ga100_fifo_nonstall_dtor(struct nvkm_fifo *);
203205
extern const struct nvkm_event_func ga100_fifo_nonstall;
204206
extern const struct nvkm_runl_func ga100_runl;
205207
extern const struct nvkm_runq_func ga100_runq;

drivers/gpu/drm/nouveau/nvkm/subdev/gsp/rm/r535/fifo.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -601,6 +601,7 @@ r535_fifo_new(const struct nvkm_fifo_func *hw, struct nvkm_device *device,
601601
rm->chan.func = &r535_chan;
602602
rm->nonstall = &ga100_fifo_nonstall;
603603
rm->nonstall_ctor = ga100_fifo_nonstall_ctor;
604+
rm->nonstall_dtor = ga100_fifo_nonstall_dtor;
604605

605606
return nvkm_fifo_new_(rm, device, type, inst, pfifo);
606607
}

0 commit comments

Comments
 (0)