diff --git a/drivers/gpu/nvgpu/common/fifo/channel.c b/drivers/gpu/nvgpu/common/fifo/channel.c index 61d7fc5c9..3ee6d0844 100644 --- a/drivers/gpu/nvgpu/common/fifo/channel.c +++ b/drivers/gpu/nvgpu/common/fifo/channel.c @@ -46,6 +46,7 @@ #include #include #include +#include #include #include #include diff --git a/drivers/gpu/nvgpu/hal/ce/ce2_gk20a.c b/drivers/gpu/nvgpu/hal/ce/ce2_gk20a.c index 77c65a9c6..06f80f56b 100644 --- a/drivers/gpu/nvgpu/hal/ce/ce2_gk20a.c +++ b/drivers/gpu/nvgpu/hal/ce/ce2_gk20a.c @@ -30,6 +30,7 @@ #include #include #include +#include #include #include @@ -69,8 +70,8 @@ u32 gk20a_ce2_nonstall_isr(struct gk20a *g, u32 inst_id, u32 pri_base) nvgpu_log(g, gpu_dbg_intr, "ce2 non-blocking pipe interrupt"); nvgpu_writel(g, ce2_intr_status_r(), ce2_intr_status_nonblockpipe_pending_f()); - ops |= (GK20A_NONSTALL_OPS_WAKEUP_SEMAPHORE | - GK20A_NONSTALL_OPS_POST_EVENTS); + ops |= (NVGPU_NONSTALL_OPS_WAKEUP_SEMAPHORE | + NVGPU_NONSTALL_OPS_POST_EVENTS); } return ops; } diff --git a/drivers/gpu/nvgpu/hal/ce/ce_gp10b_fusa.c b/drivers/gpu/nvgpu/hal/ce/ce_gp10b_fusa.c index ec0459f4b..e6622d974 100644 --- a/drivers/gpu/nvgpu/hal/ce/ce_gp10b_fusa.c +++ b/drivers/gpu/nvgpu/hal/ce/ce_gp10b_fusa.c @@ -24,6 +24,7 @@ #include #include +#include #include #include "ce_gp10b.h" @@ -69,8 +70,8 @@ u32 gp10b_ce_nonstall_isr(struct gk20a *g, u32 inst_id, u32 pri_base) GPU_CE_NONBLOCK_PIPE, ce_intr); nvgpu_writel(g, ce_intr_status_r(inst_id), ce_intr_status_nonblockpipe_pending_f()); - ops |= (GK20A_NONSTALL_OPS_WAKEUP_SEMAPHORE | - GK20A_NONSTALL_OPS_POST_EVENTS); + ops |= (NVGPU_NONSTALL_OPS_WAKEUP_SEMAPHORE | + NVGPU_NONSTALL_OPS_POST_EVENTS); } return ops; diff --git a/drivers/gpu/nvgpu/hal/fifo/fifo_intr_gk20a_fusa.c b/drivers/gpu/nvgpu/hal/fifo/fifo_intr_gk20a_fusa.c index 5cdb52d7c..cf4289f72 100644 --- a/drivers/gpu/nvgpu/hal/fifo/fifo_intr_gk20a_fusa.c +++ b/drivers/gpu/nvgpu/hal/fifo/fifo_intr_gk20a_fusa.c @@ -21,6 +21,7 @@ */ #include +#include #include #include #include @@ -63,7 +64,7 @@ u32 gk20a_fifo_intr_1_isr(struct gk20a *g) nvgpu_writel(g, fifo_intr_0_r(), clear_intr); - return GK20A_NONSTALL_OPS_WAKEUP_SEMAPHORE; + return NVGPU_NONSTALL_OPS_WAKEUP_SEMAPHORE; } void gk20a_fifo_intr_handle_chsw_error(struct gk20a *g) diff --git a/drivers/gpu/nvgpu/hal/gr/intr/gr_intr_gm20b_fusa.c b/drivers/gpu/nvgpu/hal/gr/intr/gr_intr_gm20b_fusa.c index 2f494c7ba..ca4d3224e 100644 --- a/drivers/gpu/nvgpu/hal/gr/intr/gr_intr_gm20b_fusa.c +++ b/drivers/gpu/nvgpu/hal/gr/intr/gr_intr_gm20b_fusa.c @@ -21,6 +21,7 @@ */ #include +#include #include #include #include @@ -415,8 +416,8 @@ u32 gm20b_gr_intr_nonstall_isr(struct gk20a *g) /* Clear the interrupt */ nvgpu_writel(g, gr_intr_nonstall_r(), gr_intr_nonstall_trap_pending_f()); - ops |= (GK20A_NONSTALL_OPS_WAKEUP_SEMAPHORE | - GK20A_NONSTALL_OPS_POST_EVENTS); + ops |= (NVGPU_NONSTALL_OPS_WAKEUP_SEMAPHORE | + NVGPU_NONSTALL_OPS_POST_EVENTS); } return ops; } diff --git a/drivers/gpu/nvgpu/hal/mc/mc_tu104.c b/drivers/gpu/nvgpu/hal/mc/mc_tu104.c index 4a8be8d02..37b115572 100644 --- a/drivers/gpu/nvgpu/hal/mc/mc_tu104.c +++ b/drivers/gpu/nvgpu/hal/mc/mc_tu104.c @@ -315,8 +315,8 @@ u32 intr_tu104_isr_nonstall(struct gk20a *g) NV_CPU_INTR_TOP_NONSTALL_SUBTREE)), nonstall_intr_mask_hi); - ops |= (GK20A_NONSTALL_OPS_WAKEUP_SEMAPHORE | - GK20A_NONSTALL_OPS_POST_EVENTS); + ops |= (NVGPU_NONSTALL_OPS_WAKEUP_SEMAPHORE | + NVGPU_NONSTALL_OPS_POST_EVENTS); } } diff --git a/drivers/gpu/nvgpu/include/nvgpu/gk20a.h b/drivers/gpu/nvgpu/include/nvgpu/gk20a.h index 68dd1018f..8535b3310 100644 --- a/drivers/gpu/nvgpu/include/nvgpu/gk20a.h +++ b/drivers/gpu/nvgpu/include/nvgpu/gk20a.h @@ -1372,10 +1372,6 @@ static inline u32 nvgpu_get_poll_timeout(struct gk20a *g) g->poll_timeout_default : U32_MAX; } -/** Operations that will need to be executed on non stall workqueue. */ -#define GK20A_NONSTALL_OPS_WAKEUP_SEMAPHORE BIT32(0) -#define GK20A_NONSTALL_OPS_POST_EVENTS BIT32(1) - /** IO Resource in the device tree for BAR0 */ #define GK20A_BAR0_IORESOURCE_MEM 0U /** IO Resource in the device tree for BAR1 */ @@ -1412,8 +1408,6 @@ int gk20a_do_unidle_impl(struct gk20a *g); /** tu104 HW version */ #define NVGPU_GPUID_TU104 0x00000164U -void nvgpu_wait_for_deferred_interrupts(struct gk20a *g); - bool nvgpu_has_syncpoints(struct gk20a *g); /** diff --git a/drivers/gpu/nvgpu/include/nvgpu/gops_fifo.h b/drivers/gpu/nvgpu/include/nvgpu/gops_fifo.h index 008f2c698..a6b235548 100644 --- a/drivers/gpu/nvgpu/include/nvgpu/gops_fifo.h +++ b/drivers/gpu/nvgpu/include/nvgpu/gops_fifo.h @@ -168,7 +168,7 @@ struct gops_fifo { * - Read interrupt status. * - Clear channel interrupt if pending. * - * @return: #GK20A_NONSTALL_OPS_WAKEUP_SEMAPHORE + * @return: #NVGPU_NONSTALL_OPS_WAKEUP_SEMAPHORE */ u32 (*intr_1_isr)(struct gk20a *g); diff --git a/drivers/gpu/nvgpu/include/nvgpu/mc.h b/drivers/gpu/nvgpu/include/nvgpu/mc.h index 5016ed45d..c1d0dde37 100644 --- a/drivers/gpu/nvgpu/include/nvgpu/mc.h +++ b/drivers/gpu/nvgpu/include/nvgpu/mc.h @@ -45,6 +45,11 @@ enum nvgpu_unit { #define NVGPU_MC_INTR_STALLING 0U #define NVGPU_MC_INTR_NONSTALLING 1U +/** Operations that will need to be executed on non stall workqueue. */ +#define NVGPU_NONSTALL_OPS_WAKEUP_SEMAPHORE BIT32(0) +#define NVGPU_NONSTALL_OPS_POST_EVENTS BIT32(1) + u32 nvgpu_mc_boot_0(struct gk20a *g, u32 *arch, u32 *impl, u32 *rev); +void nvgpu_wait_for_deferred_interrupts(struct gk20a *g); #endif diff --git a/drivers/gpu/nvgpu/os/linux/intr.c b/drivers/gpu/nvgpu/os/linux/intr.c index 546c82cbe..2ff27c176 100644 --- a/drivers/gpu/nvgpu/os/linux/intr.c +++ b/drivers/gpu/nvgpu/os/linux/intr.c @@ -17,6 +17,7 @@ #include #include +#include #include #include @@ -129,9 +130,9 @@ static void mc_gk20a_handle_intr_nonstall(struct gk20a *g, u32 ops) bool semaphore_wakeup, post_events; semaphore_wakeup = - (((ops & GK20A_NONSTALL_OPS_WAKEUP_SEMAPHORE) != 0U) ? + (((ops & NVGPU_NONSTALL_OPS_WAKEUP_SEMAPHORE) != 0U) ? true : false); - post_events = (((ops & GK20A_NONSTALL_OPS_POST_EVENTS) != 0U) ? + post_events = (((ops & NVGPU_NONSTALL_OPS_POST_EVENTS) != 0U) ? true: false); if (semaphore_wakeup) { diff --git a/drivers/gpu/nvgpu/os/linux/module.c b/drivers/gpu/nvgpu/os/linux/module.c index 820f9fac0..b62eece4e 100644 --- a/drivers/gpu/nvgpu/os/linux/module.c +++ b/drivers/gpu/nvgpu/os/linux/module.c @@ -56,6 +56,7 @@ #include #include #include +#include #include "platform_gk20a.h" #include "sysfs.h"