diff options
author | Seema Khowala <seemaj@nvidia.com> | 2017-06-28 01:10:49 -0400 |
---|---|---|
committer | mobile promotions <svcmobile_promotions@nvidia.com> | 2017-07-02 13:20:21 -0400 |
commit | 5cda5a3074e4c7dae1857e1dfdf55017b0450786 (patch) | |
tree | d560ec2929650c91016ae13b9ae2b3f3f30e4982 /drivers/gpu/nvgpu/gv11b/fifo_gv11b.c | |
parent | 8a0221cfc735f79c94447ff5922e26c313e0f177 (diff) |
gpu: nvgpu: gv11b: add a function to reset pbdma and eng faulted
When Host receives a page fault signal from a CE, Host will immediately
set _ENG_FAULTED bit in the NV_PCCSR_CHANNEL register for the channel
and will trigger a preempt of the TSG/channel.
A channel will only be scheduled when _ENABLED=1, _ENG_FAULTED=0
and _PBDMA_FAULTED=0 in pccsr_channel reg for the channel.
If a TSG has a faulted channel, Host will not schedule the entire TSG
agin until all _FAULTED bits from channels in the TSG are cleared by SW.
This function will be required for ce page fault handling.
JIRA GPUT19X-46
JIRA GPUT19X-12
Change-Id: Ib58dff7aa24aa144e970f11b5261877dec03f3e6
Signed-off-by: Seema Khowala <seemaj@nvidia.com>
Reviewed-on: https://git-master/r/1509776
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Diffstat (limited to 'drivers/gpu/nvgpu/gv11b/fifo_gv11b.c')
-rw-r--r-- | drivers/gpu/nvgpu/gv11b/fifo_gv11b.c | 38 |
1 files changed, 27 insertions, 11 deletions
diff --git a/drivers/gpu/nvgpu/gv11b/fifo_gv11b.c b/drivers/gpu/nvgpu/gv11b/fifo_gv11b.c index 3e73a29e..a1f6d258 100644 --- a/drivers/gpu/nvgpu/gv11b/fifo_gv11b.c +++ b/drivers/gpu/nvgpu/gv11b/fifo_gv11b.c | |||
@@ -564,6 +564,29 @@ static void gv11b_reset_pbdma_faulted_tsg(struct tsg_gk20a *tsg) | |||
564 | up_read(&tsg->ch_list_lock); | 564 | up_read(&tsg->ch_list_lock); |
565 | } | 565 | } |
566 | 566 | ||
567 | void gv11b_fifo_reset_pbdma_and_eng_faulted(struct gk20a *g, | ||
568 | struct channel_gk20a *refch, | ||
569 | u32 faulted_pbdma, u32 faulted_engine) | ||
570 | { | ||
571 | struct tsg_gk20a *tsg; | ||
572 | |||
573 | nvgpu_log(g, gpu_dbg_intr, "reset faulted pbdma:0x%x eng:0x%x", | ||
574 | faulted_pbdma, faulted_engine); | ||
575 | |||
576 | if (gk20a_is_channel_marked_as_tsg(refch)) { | ||
577 | tsg = &g->fifo.tsg[refch->tsgid]; | ||
578 | if (faulted_pbdma != FIFO_INVAL_PBDMA_ID) | ||
579 | gv11b_reset_pbdma_faulted_tsg(tsg); | ||
580 | if (faulted_engine != FIFO_INVAL_ENGINE_ID) | ||
581 | gv11b_reset_eng_faulted_tsg(tsg); | ||
582 | } else { | ||
583 | if (faulted_pbdma != FIFO_INVAL_PBDMA_ID) | ||
584 | gv11b_reset_pbdma_faulted_ch(g, refch->chid); | ||
585 | if (faulted_engine != FIFO_INVAL_ENGINE_ID) | ||
586 | gv11b_reset_eng_faulted_ch(g, refch->chid); | ||
587 | } | ||
588 | } | ||
589 | |||
567 | static u32 gv11b_fifo_get_runlists_mask(struct gk20a *g, u32 act_eng_bitmask, | 590 | static u32 gv11b_fifo_get_runlists_mask(struct gk20a *g, u32 act_eng_bitmask, |
568 | u32 id, unsigned int id_type, unsigned int rc_type, | 591 | u32 id, unsigned int id_type, unsigned int rc_type, |
569 | struct mmu_fault_info *mmfault) | 592 | struct mmu_fault_info *mmfault) |
@@ -928,18 +951,11 @@ static void gv11b_fifo_teardown_ch_tsg(struct gk20a *g, u32 act_eng_bitmask, | |||
928 | if (rc_type == RC_TYPE_MMU_FAULT && mmfault && mmfault->refch) { | 951 | if (rc_type == RC_TYPE_MMU_FAULT && mmfault && mmfault->refch) { |
929 | refch = mmfault->refch; | 952 | refch = mmfault->refch; |
930 | client_type = mmfault->client_type; | 953 | client_type = mmfault->client_type; |
931 | if (gk20a_is_channel_marked_as_tsg(refch)) { | 954 | if (gk20a_is_channel_marked_as_tsg(refch)) |
932 | tsg = &g->fifo.tsg[refch->tsgid]; | 955 | tsg = &g->fifo.tsg[refch->tsgid]; |
933 | if (mmfault->faulted_pbdma != FIFO_INVAL_PBDMA_ID) | 956 | gv11b_fifo_reset_pbdma_and_eng_faulted(g, refch, |
934 | gv11b_reset_pbdma_faulted_tsg(tsg); | 957 | mmfault->faulted_pbdma, |
935 | if (mmfault->faulted_engine != FIFO_INVAL_ENGINE_ID) | 958 | mmfault->faulted_engine); |
936 | gv11b_reset_eng_faulted_tsg(tsg); | ||
937 | } else { | ||
938 | if (mmfault->faulted_pbdma != FIFO_INVAL_PBDMA_ID) | ||
939 | gv11b_reset_pbdma_faulted_ch(g, refch->chid); | ||
940 | if (mmfault->faulted_engine != FIFO_INVAL_ENGINE_ID) | ||
941 | gv11b_reset_eng_faulted_ch(g, refch->chid); | ||
942 | } | ||
943 | } else { | 959 | } else { |
944 | if (id_type == ID_TYPE_TSG) | 960 | if (id_type == ID_TYPE_TSG) |
945 | tsg = &g->fifo.tsg[id]; | 961 | tsg = &g->fifo.tsg[id]; |