From b7767a604ffa2d55068da5f7506eb6cf0f3cfdd6 Mon Sep 17 00:00:00 2001 From: Seema Khowala Date: Sun, 15 Mar 2020 16:34:57 -0700 Subject: [PATCH] gpu: nvgpu: add intr_top_enable fifo gops This is required for enabling fifo interrupts for nvgpu-next. JIRA NVGPU-4864 Change-Id: I5c09105296a01b82505023ecf576d71ce74f7a31 Signed-off-by: Seema Khowala Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2313013 Reviewed-by: automaticguardword Reviewed-by: svc-mobile-coverity Reviewed-by: svc-mobile-misra Reviewed-by: svc-mobile-cert Reviewed-by: Seshendra Gadagottu Reviewed-by: Vinod Gopalakrishnakurup Reviewed-by: mobile promotions Tested-by: mobile promotions GVS: Gerrit_Virtual_Submit --- drivers/gpu/nvgpu/common/fifo/fifo.c | 8 ++++++-- drivers/gpu/nvgpu/include/nvgpu/gops_fifo.h | 3 ++- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/nvgpu/common/fifo/fifo.c b/drivers/gpu/nvgpu/common/fifo/fifo.c index 8f8f5a1ce..343630b77 100644 --- a/drivers/gpu/nvgpu/common/fifo/fifo.c +++ b/drivers/gpu/nvgpu/common/fifo/fifo.c @@ -256,10 +256,14 @@ static void disable_fifo_interrupts(struct gk20a *g) g->ops.fifo.intr_0_enable(g, false); g->ops.fifo.intr_1_enable(g, false); - nvgpu_mc_intr_stall_unit_config(g, MC_INTR_UNIT_FIFO, + if (g->ops.fifo.intr_top_enable == NULL) { + nvgpu_mc_intr_stall_unit_config(g, MC_INTR_UNIT_FIFO, MC_INTR_DISABLE); - nvgpu_mc_intr_nonstall_unit_config(g, MC_INTR_UNIT_FIFO, + nvgpu_mc_intr_nonstall_unit_config(g, MC_INTR_UNIT_FIFO, MC_INTR_DISABLE); + } else { + g->ops.fifo.intr_top_enable(g, MC_INTR_DISABLE); + } } int nvgpu_fifo_suspend(struct gk20a *g) diff --git a/drivers/gpu/nvgpu/include/nvgpu/gops_fifo.h b/drivers/gpu/nvgpu/include/nvgpu/gops_fifo.h index a8dbb173d..cfe2b5492 100644 --- a/drivers/gpu/nvgpu/include/nvgpu/gops_fifo.h +++ b/drivers/gpu/nvgpu/include/nvgpu/gops_fifo.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019, NVIDIA CORPORATION. All rights reserved. + * Copyright (c) 2019-2020, NVIDIA CORPORATION. All rights reserved. * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), @@ -189,6 +189,7 @@ struct gops_fifo { unsigned int id_type); void (*intr_set_recover_mask)(struct gk20a *g); void (*intr_unset_recover_mask)(struct gk20a *g); + void (*intr_top_enable)(struct gk20a *g, bool enable); void (*intr_0_enable)(struct gk20a *g, bool enable); void (*intr_1_enable)(struct gk20a *g, bool enable); bool (*handle_sched_error)(struct gk20a *g);