diff --git a/drivers/gpu/nvgpu/hal/fifo/pbdma_gv11b.h b/drivers/gpu/nvgpu/hal/fifo/pbdma_gv11b.h index e47f586f9..5c15191be 100644 --- a/drivers/gpu/nvgpu/hal/fifo/pbdma_gv11b.h +++ b/drivers/gpu/nvgpu/hal/fifo/pbdma_gv11b.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017-2019, NVIDIA CORPORATION. All rights reserved. + * Copyright (c) 2017-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"), @@ -37,6 +37,6 @@ u32 gv11b_pbdma_channel_fatal_0_intr_descs(void); u32 gv11b_pbdma_get_fc_pb_header(void); u32 gv11b_pbdma_get_fc_target(void); u32 gv11b_pbdma_set_channel_info_veid(u32 subctx_id); -u32 gv11b_pbdma_config_userd_writeback_enable(void); +u32 gv11b_pbdma_config_userd_writeback_enable(u32 v); #endif /* NVGPU_PBDMA_GV11B_H */ diff --git a/drivers/gpu/nvgpu/hal/fifo/pbdma_gv11b_fusa.c b/drivers/gpu/nvgpu/hal/fifo/pbdma_gv11b_fusa.c index bde5a0392..df3d9329d 100644 --- a/drivers/gpu/nvgpu/hal/fifo/pbdma_gv11b_fusa.c +++ b/drivers/gpu/nvgpu/hal/fifo/pbdma_gv11b_fusa.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017-2019, NVIDIA CORPORATION. All rights reserved. + * Copyright (c) 2017-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"), @@ -275,8 +275,9 @@ u32 gv11b_pbdma_set_channel_info_veid(u32 subctx_id) return pbdma_set_channel_info_veid_f(subctx_id); } -u32 gv11b_pbdma_config_userd_writeback_enable(void) +u32 gv11b_pbdma_config_userd_writeback_enable(u32 v) { - return pbdma_config_userd_writeback_enable_f(); + return set_field(v, pbdma_config_userd_writeback_m(), + pbdma_config_userd_writeback_enable_f()); } diff --git a/drivers/gpu/nvgpu/hal/fifo/ramfc_gv11b_fusa.c b/drivers/gpu/nvgpu/hal/fifo/ramfc_gv11b_fusa.c index e64d1c498..986c14ba6 100644 --- a/drivers/gpu/nvgpu/hal/fifo/ramfc_gv11b_fusa.c +++ b/drivers/gpu/nvgpu/hal/fifo/ramfc_gv11b_fusa.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015-2019, NVIDIA CORPORATION. All rights reserved. + * Copyright (c) 2015-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"), @@ -99,7 +99,7 @@ int gv11b_ramfc_setup(struct nvgpu_channel *ch, u64 gpfifo_base, /* Enable userd writeback */ data = nvgpu_mem_rd32(g, mem, ram_fc_config_w()); - data = data | g->ops.pbdma.config_userd_writeback_enable(); + data = g->ops.pbdma.config_userd_writeback_enable(data); nvgpu_mem_wr32(g, mem, ram_fc_config_w(), data); return g->ops.ramfc.commit_userd(ch); diff --git a/drivers/gpu/nvgpu/hal/fifo/ramfc_tu104.c b/drivers/gpu/nvgpu/hal/fifo/ramfc_tu104.c index 86a4a2d2c..ab5ab13ba 100644 --- a/drivers/gpu/nvgpu/hal/fifo/ramfc_tu104.c +++ b/drivers/gpu/nvgpu/hal/fifo/ramfc_tu104.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2019, NVIDIA CORPORATION. All rights reserved. + * Copyright (c) 2018-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"), @@ -83,7 +83,7 @@ int tu104_ramfc_setup(struct nvgpu_channel *ch, u64 gpfifo_base, /* Enable userd writeback */ data = nvgpu_mem_rd32(g, mem, ram_fc_config_w()); - data = data | g->ops.pbdma.config_userd_writeback_enable(); + data = g->ops.pbdma.config_userd_writeback_enable(data); nvgpu_mem_wr32(g, mem, ram_fc_config_w(), data); return g->ops.ramfc.commit_userd(ch); diff --git a/drivers/gpu/nvgpu/include/nvgpu/gops_pbdma.h b/drivers/gpu/nvgpu/include/nvgpu/gops_pbdma.h index 5b43d6986..ed45e75bd 100644 --- a/drivers/gpu/nvgpu/include/nvgpu/gops_pbdma.h +++ b/drivers/gpu/nvgpu/include/nvgpu/gops_pbdma.h @@ -79,7 +79,7 @@ struct gops_pbdma { u32 (*get_fc_runlist_timeslice)(void); u32 (*get_config_auth_level_privileged)(void); u32 (*set_channel_info_veid)(u32 subctx_id); - u32 (*config_userd_writeback_enable)(void); + u32 (*config_userd_writeback_enable)(u32 v); u32 (*allowed_syncpoints_0_index_f)(u32 syncpt); u32 (*allowed_syncpoints_0_valid_f)(void); u32 (*allowed_syncpoints_0_index_v)(u32 offset); diff --git a/drivers/gpu/nvgpu/include/nvgpu/hw/gv11b/hw_pbdma_gv11b.h b/drivers/gpu/nvgpu/include/nvgpu/hw/gv11b/hw_pbdma_gv11b.h index 730b992d7..5ad193678 100644 --- a/drivers/gpu/nvgpu/include/nvgpu/hw/gv11b/hw_pbdma_gv11b.h +++ b/drivers/gpu/nvgpu/include/nvgpu/hw/gv11b/hw_pbdma_gv11b.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016-2019, NVIDIA CORPORATION. All rights reserved. + * Copyright (c) 2016-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"), @@ -160,6 +160,7 @@ #define pbdma_config_ce_split_disable_f() (0x10U) #define pbdma_config_auth_level_non_privileged_f() (0x0U) #define pbdma_config_auth_level_privileged_f() (0x100U) +#define pbdma_config_userd_writeback_m() (U32(0x1U) << 12U) #define pbdma_config_userd_writeback_disable_f() (0x0U) #define pbdma_config_userd_writeback_enable_f() (0x1000U) #define pbdma_userd_hi_r(i)\ diff --git a/userspace/units/fifo/pbdma/gv11b/nvgpu-pbdma-gv11b.c b/userspace/units/fifo/pbdma/gv11b/nvgpu-pbdma-gv11b.c index b691d0a0b..8c0607849 100644 --- a/userspace/units/fifo/pbdma/gv11b/nvgpu-pbdma-gv11b.c +++ b/userspace/units/fifo/pbdma/gv11b/nvgpu-pbdma-gv11b.c @@ -369,7 +369,7 @@ int test_gv11b_pbdma_config_userd_writeback_enable(struct unit_module *m, { int ret = UNIT_FAIL; - unit_assert(gv11b_pbdma_config_userd_writeback_enable() == + unit_assert(gv11b_pbdma_config_userd_writeback_enable(0U) == pbdma_config_userd_writeback_enable_f(), goto done); ret = UNIT_SUCCESS; diff --git a/userspace/units/fifo/ramfc/gv11b/nvgpu-ramfc-gv11b.c b/userspace/units/fifo/ramfc/gv11b/nvgpu-ramfc-gv11b.c index 0ce32de1e..5ba37d79f 100644 --- a/userspace/units/fifo/ramfc/gv11b/nvgpu-ramfc-gv11b.c +++ b/userspace/units/fifo/ramfc/gv11b/nvgpu-ramfc-gv11b.c @@ -119,7 +119,7 @@ static u32 stub_pbdma_get_ctrl_hce_priv_mode_yes(void) return 0U; } -static u32 stub_pbdma_config_userd_writeback_enable(void) +static u32 stub_pbdma_config_userd_writeback_enable(u32 v) { global_count++; return 5U;