summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/nvgpu/vgpu/fifo_vgpu.c
diff options
context:
space:
mode:
authorAingara Paramakuru <aparamakuru@nvidia.com>2014-12-24 12:24:33 -0500
committerDan Willemsen <dwillemsen@nvidia.com>2015-04-04 21:03:43 -0400
commit624d7a2830370ec13402b964a1c8ff564249ddb6 (patch)
tree5ac2f3f5eef19db41ebecf4567bdc459aad02218 /drivers/gpu/nvgpu/vgpu/fifo_vgpu.c
parentf6587d13e4b33cd45841c42bd493faae8a7a7658 (diff)
gpu: nvgpu: vgpu: handle fifo and gr exceptions
Handle the gr and fifo exceptions delivered from the server and update the channel state as needed. Bug 1551865 Change-Id: Ie19626c6e8a72f92ffd134983fe6d84e5c6c8736 Signed-off-by: Aingara Paramakuru <aparamakuru@nvidia.com> Reviewed-on: http://git-master/r/670329 Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com>
Diffstat (limited to 'drivers/gpu/nvgpu/vgpu/fifo_vgpu.c')
-rw-r--r--drivers/gpu/nvgpu/vgpu/fifo_vgpu.c53
1 files changed, 52 insertions, 1 deletions
diff --git a/drivers/gpu/nvgpu/vgpu/fifo_vgpu.c b/drivers/gpu/nvgpu/vgpu/fifo_vgpu.c
index 24b9f4be..45d956a2 100644
--- a/drivers/gpu/nvgpu/vgpu/fifo_vgpu.c
+++ b/drivers/gpu/nvgpu/vgpu/fifo_vgpu.c
@@ -1,7 +1,7 @@
1/* 1/*
2 * Virtualized GPU Fifo 2 * Virtualized GPU Fifo
3 * 3 *
4 * Copyright (c) 2014 NVIDIA CORPORATION. All rights reserved. 4 * Copyright (c) 2014-2015, NVIDIA CORPORATION. All rights reserved.
5 * 5 *
6 * This program is free software; you can redistribute it and/or modify it 6 * This program is free software; you can redistribute it and/or modify it
7 * under the terms and conditions of the GNU General Public License, 7 * under the terms and conditions of the GNU General Public License,
@@ -551,6 +551,57 @@ static int vgpu_fifo_wait_engine_idle(struct gk20a *g)
551 return 0; 551 return 0;
552} 552}
553 553
554static void vgpu_fifo_set_ctx_mmu_error(struct gk20a *g,
555 struct channel_gk20a *ch)
556{
557 if (ch->error_notifier) {
558 if (ch->error_notifier->status == 0xffff) {
559 /* If error code is already set, this mmu fault
560 * was triggered as part of recovery from other
561 * error condition.
562 * Don't overwrite error flag. */
563 } else {
564 gk20a_set_error_notifier(ch,
565 NVGPU_CHANNEL_FIFO_ERROR_MMU_ERR_FLT);
566 }
567 }
568 /* mark channel as faulted */
569 ch->has_timedout = true;
570 wmb();
571 /* unblock pending waits */
572 wake_up(&ch->semaphore_wq);
573 wake_up(&ch->notifier_wq);
574 wake_up(&ch->submit_wq);
575}
576
577int vgpu_fifo_isr(struct gk20a *g, struct tegra_vgpu_fifo_intr_info *info)
578{
579 struct fifo_gk20a *f = &g->fifo;
580 struct channel_gk20a *ch = &f->channel[info->chid];
581
582 gk20a_err(dev_from_gk20a(g), "fifo intr (%d) on ch %u",
583 info->type, info->chid);
584
585 switch (info->type) {
586 case TEGRA_VGPU_FIFO_INTR_PBDMA:
587 gk20a_set_error_notifier(ch, NVGPU_CHANNEL_PBDMA_ERROR);
588 break;
589 case TEGRA_VGPU_FIFO_INTR_CTXSW_TIMEOUT:
590 gk20a_set_error_notifier(ch,
591 NVGPU_CHANNEL_FIFO_ERROR_IDLE_TIMEOUT);
592 break;
593 case TEGRA_VGPU_FIFO_INTR_MMU_FAULT:
594 gk20a_channel_abort(ch);
595 vgpu_fifo_set_ctx_mmu_error(g, ch);
596 break;
597 default:
598 WARN_ON(1);
599 break;
600 }
601
602 return 0;
603}
604
554void vgpu_init_fifo_ops(struct gpu_ops *gops) 605void vgpu_init_fifo_ops(struct gpu_ops *gops)
555{ 606{
556 gops->fifo.bind_channel = vgpu_channel_bind; 607 gops->fifo.bind_channel = vgpu_channel_bind;