mirror of
git://nv-tegra.nvidia.com/linux-nvgpu.git
synced 2025-12-25 11:04:51 +03:00
gpu: nvgpu: remove circular dependency between gr and fifo
channel.c calling nvgpu_gr_flush_channel_tlb() creating circular dependency between gr and fifo. Avoid this by moving channel tlb related data to struct nvgpu_gr_intr in gr_intr_priv.h and initialized this data in gr_intr.c. Created following new gr intr hal and called this new hal from channel.c void (*flush_channel_tlb)(struct gk20a *g); JIRA NVGPU-3214 Change-Id: I2d259bf52db967273030680f50065af94a17f417 Signed-off-by: Seshendra Gadagottu <sgadagottu@nvidia.com> Reviewed-on: https://git-master.nvidia.com/r/2109274 Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com> Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
This commit is contained in:
committed by
mobile promotions
parent
7581601f80
commit
57be9a09fd
@@ -25,6 +25,7 @@
|
||||
#include <nvgpu/unit.h>
|
||||
#include <nvgpu/gr/gr.h>
|
||||
#include <nvgpu/gr/config.h>
|
||||
#include <nvgpu/gr/gr_intr.h>
|
||||
#include <nvgpu/gr/zbc.h>
|
||||
#include <nvgpu/gr/zcull.h>
|
||||
#include <nvgpu/netlist.h>
|
||||
@@ -151,7 +152,7 @@ int nvgpu_gr_suspend(struct gk20a *g)
|
||||
/* disable all exceptions */
|
||||
g->ops.gr.intr.enable_exceptions(g, g->gr->config, false);
|
||||
|
||||
nvgpu_gr_flush_channel_tlb(g);
|
||||
g->ops.gr.intr.flush_channel_tlb(g);
|
||||
|
||||
g->gr->initialized = false;
|
||||
|
||||
@@ -159,15 +160,6 @@ int nvgpu_gr_suspend(struct gk20a *g)
|
||||
return ret;
|
||||
}
|
||||
|
||||
/* invalidate channel lookup tlb */
|
||||
void nvgpu_gr_flush_channel_tlb(struct gk20a *g)
|
||||
{
|
||||
nvgpu_spinlock_acquire(&g->gr->ch_tlb_lock);
|
||||
(void) memset(g->gr->chid_tlb, 0,
|
||||
sizeof(struct gr_channel_map_tlb_entry) *
|
||||
GR_CHANNEL_MAP_TLB_SIZE);
|
||||
nvgpu_spinlock_release(&g->gr->ch_tlb_lock);
|
||||
}
|
||||
|
||||
static int gr_init_setup_hw(struct gk20a *g)
|
||||
{
|
||||
@@ -279,6 +271,9 @@ static void gr_remove_support(struct gk20a *g)
|
||||
nvgpu_gr_falcon_remove_support(g, gr->falcon);
|
||||
gr->falcon = NULL;
|
||||
|
||||
nvgpu_gr_intr_remove_support(g, gr->intr);
|
||||
gr->intr = NULL;
|
||||
|
||||
nvgpu_gr_zbc_deinit(g, gr->zbc);
|
||||
nvgpu_gr_zcull_deinit(g, gr->zcull);
|
||||
nvgpu_gr_obj_ctx_deinit(g, gr->golden_image);
|
||||
@@ -458,7 +453,11 @@ static int gr_init_setup_sw(struct gk20a *g)
|
||||
goto clean_up;
|
||||
}
|
||||
|
||||
nvgpu_spinlock_init(&gr->ch_tlb_lock);
|
||||
gr->intr = nvgpu_gr_intr_init_support(g);
|
||||
if (gr->intr == NULL) {
|
||||
err = -ENOMEM;
|
||||
goto clean_up;
|
||||
}
|
||||
|
||||
gr->remove_support = gr_remove_support;
|
||||
gr->sw_ready = true;
|
||||
|
||||
Reference in New Issue
Block a user