From f19f22fcc8ef21b363b873c499cbd2e690af29f8 Mon Sep 17 00:00:00 2001 From: Terje Bergstrom Date: Fri, 15 Dec 2017 10:25:22 -0800 Subject: gpu: nvgpu: Remove support for channel events Remove support for events for bare channels. All users have already moved to TSGs and TSG events. Bug 1842197 Change-Id: Ib3ff68134ad9515ee761d0f0e19a3150a0b744ab Signed-off-by: Terje Bergstrom Reviewed-on: https://git-master.nvidia.com/r/1618906 Reviewed-by: Deepak Nibade Reviewed-by: mobile promotions Tested-by: mobile promotions --- drivers/gpu/nvgpu/gk20a/channel_gk20a.c | 22 +-------------------- drivers/gpu/nvgpu/gk20a/channel_gk20a.h | 26 ------------------------- drivers/gpu/nvgpu/gk20a/fifo_gk20a.c | 1 - drivers/gpu/nvgpu/gk20a/gr_gk20a.c | 34 +++++++++------------------------ drivers/gpu/nvgpu/gk20a/tsg_gk20a.h | 19 ++++++++++++++++++ 5 files changed, 29 insertions(+), 73 deletions(-) (limited to 'drivers/gpu/nvgpu/gk20a') diff --git a/drivers/gpu/nvgpu/gk20a/channel_gk20a.c b/drivers/gpu/nvgpu/gk20a/channel_gk20a.c index e10be3c9..07ae5a16 100644 --- a/drivers/gpu/nvgpu/gk20a/channel_gk20a.c +++ b/drivers/gpu/nvgpu/gk20a/channel_gk20a.c @@ -689,7 +689,6 @@ struct channel_gk20a *gk20a_open_new_channel(struct gk20a *g, { struct fifo_gk20a *f = &g->fifo; struct channel_gk20a *ch; - struct gk20a_event_id_data *event_id_data, *event_id_data_temp; /* compatibility with existing code */ if (!gk20a_fifo_is_valid_runlist_id(g, runlist_id)) { @@ -730,16 +729,6 @@ struct channel_gk20a *gk20a_open_new_channel(struct gk20a *g, ch->pid = current->pid; ch->tgid = current->tgid; /* process granularity for FECS traces */ - /* unhook all events created on this channel */ - nvgpu_mutex_acquire(&ch->event_id_list_lock); - nvgpu_list_for_each_entry_safe(event_id_data, event_id_data_temp, - &ch->event_id_list, - gk20a_event_id_data, - event_id_node) { - nvgpu_list_del(&event_id_data->event_id_node); - } - nvgpu_mutex_release(&ch->event_id_list_lock); - /* By default, channel is regular (non-TSG) channel */ ch->tsgid = NVGPU_INVALID_TSG_ID; @@ -2134,7 +2123,6 @@ int gk20a_init_channel_support(struct gk20a *g, u32 chid) nvgpu_init_list_node(&c->joblist.dynamic.jobs); nvgpu_init_list_node(&c->dbg_s_list); - nvgpu_init_list_node(&c->event_id_list); nvgpu_init_list_node(&c->worker_item); err = nvgpu_mutex_init(&c->ioctl_lock); @@ -2157,19 +2145,14 @@ int gk20a_init_channel_support(struct gk20a *g, u32 chid) if (err) goto fail_5; #endif - err = nvgpu_mutex_init(&c->event_id_list_lock); - if (err) - goto fail_6; err = nvgpu_mutex_init(&c->dbg_s_lock); if (err) - goto fail_7; + goto fail_6; nvgpu_list_add(&c->free_chs, &g->fifo.free_chs); return 0; -fail_7: - nvgpu_mutex_destroy(&c->event_id_list_lock); fail_6: #if defined(CONFIG_GK20A_CYCLE_STATS) nvgpu_mutex_destroy(&c->cs_client_mutex); @@ -2286,9 +2269,6 @@ void gk20a_channel_semaphore_wakeup(struct gk20a *g, bool post_events) gk20a_tsg_event_id_post_event(tsg, NVGPU_EVENT_ID_BLOCKING_SYNC); - } else { - gk20a_channel_event_id_post_event(c, - NVGPU_EVENT_ID_BLOCKING_SYNC); } } /* diff --git a/drivers/gpu/nvgpu/gk20a/channel_gk20a.h b/drivers/gpu/nvgpu/gk20a/channel_gk20a.h index e6f73cf6..b43c5638 100644 --- a/drivers/gpu/nvgpu/gk20a/channel_gk20a.h +++ b/drivers/gpu/nvgpu/gk20a/channel_gk20a.h @@ -124,27 +124,6 @@ struct channel_gk20a_timeout { u64 pb_get; }; -struct gk20a_event_id_data { - struct gk20a *g; - - int id; /* ch or tsg */ - bool is_tsg; - u32 event_id; - - bool event_posted; - - struct nvgpu_cond event_id_wq; - struct nvgpu_mutex lock; - struct nvgpu_list_node event_id_node; -}; - -static inline struct gk20a_event_id_data * -gk20a_event_id_data_from_event_id_node(struct nvgpu_list_node *node) -{ - return (struct gk20a_event_id_data *) - ((uintptr_t)node - offsetof(struct gk20a_event_id_data, event_id_node)); -}; - /* * Track refcount actions, saving their stack traces. This number specifies how * many most recent actions are stored in a buffer. Set to 0 to disable. 128 @@ -265,9 +244,6 @@ struct channel_gk20a { struct nvgpu_mutex dbg_s_lock; struct nvgpu_list_node dbg_s_list; - struct nvgpu_list_node event_id_list; - struct nvgpu_mutex event_id_list_lock; - bool has_timedout; u32 timeout_ms_max; bool timeout_debug_dump; @@ -385,8 +361,6 @@ int gk20a_channel_get_timescale_from_timeslice(struct gk20a *g, int *__timeslice_timeout, int *__timeslice_scale); int gk20a_channel_set_runlist_interleave(struct channel_gk20a *ch, u32 level); -void gk20a_channel_event_id_post_event(struct channel_gk20a *ch, - u32 event_id); int channel_gk20a_alloc_job(struct channel_gk20a *c, struct channel_gk20a_job **job_out); diff --git a/drivers/gpu/nvgpu/gk20a/fifo_gk20a.c b/drivers/gpu/nvgpu/gk20a/fifo_gk20a.c index c5c06df9..fc71e907 100644 --- a/drivers/gpu/nvgpu/gk20a/fifo_gk20a.c +++ b/drivers/gpu/nvgpu/gk20a/fifo_gk20a.c @@ -564,7 +564,6 @@ static void gk20a_remove_fifo_support(struct fifo_gk20a *f) nvgpu_mutex_destroy(&c->cyclestate.cyclestate_buffer_mutex); nvgpu_mutex_destroy(&c->cs_client_mutex); #endif - nvgpu_mutex_destroy(&c->event_id_list_lock); nvgpu_mutex_destroy(&c->dbg_s_lock); } diff --git a/drivers/gpu/nvgpu/gk20a/gr_gk20a.c b/drivers/gpu/nvgpu/gk20a/gr_gk20a.c index ea4d1d24..f07a54b1 100644 --- a/drivers/gpu/nvgpu/gk20a/gr_gk20a.c +++ b/drivers/gpu/nvgpu/gk20a/gr_gk20a.c @@ -5256,16 +5256,10 @@ static int gk20a_gr_handle_semaphore_pending(struct gk20a *g, { struct fifo_gk20a *f = &g->fifo; struct channel_gk20a *ch = &f->channel[isr_data->chid]; + struct tsg_gk20a *tsg = &g->fifo.tsg[ch->tsgid]; - if (gk20a_is_channel_marked_as_tsg(ch)) { - struct tsg_gk20a *tsg = &g->fifo.tsg[ch->tsgid]; - - gk20a_tsg_event_id_post_event(tsg, - NVGPU_EVENT_ID_GR_SEMAPHORE_WRITE_AWAKEN); - } else { - gk20a_channel_event_id_post_event(ch, - NVGPU_EVENT_ID_GR_SEMAPHORE_WRITE_AWAKEN); - } + gk20a_tsg_event_id_post_event(tsg, + NVGPU_EVENT_ID_GR_SEMAPHORE_WRITE_AWAKEN); nvgpu_cond_broadcast(&ch->semaphore_wq); @@ -5806,26 +5800,16 @@ static int gk20a_gr_post_bpt_events(struct gk20a *g, struct channel_gk20a *ch, u32 global_esr) { if (global_esr & gr_gpc0_tpc0_sm_hww_global_esr_bpt_int_pending_f()) { - if (gk20a_is_channel_marked_as_tsg(ch)) { - struct tsg_gk20a *tsg = &g->fifo.tsg[ch->tsgid]; + struct tsg_gk20a *tsg = &g->fifo.tsg[ch->tsgid]; - gk20a_tsg_event_id_post_event(tsg, - NVGPU_EVENT_ID_BPT_INT); - } else { - gk20a_channel_event_id_post_event(ch, - NVGPU_EVENT_ID_BPT_INT); - } + gk20a_tsg_event_id_post_event(tsg, + NVGPU_EVENT_ID_BPT_INT); } if (global_esr & gr_gpc0_tpc0_sm_hww_global_esr_bpt_pause_pending_f()) { - if (gk20a_is_channel_marked_as_tsg(ch)) { - struct tsg_gk20a *tsg = &g->fifo.tsg[ch->tsgid]; + struct tsg_gk20a *tsg = &g->fifo.tsg[ch->tsgid]; - gk20a_tsg_event_id_post_event(tsg, - NVGPU_EVENT_ID_BPT_PAUSE); - } else { - gk20a_channel_event_id_post_event(ch, - NVGPU_EVENT_ID_BPT_PAUSE); - } + gk20a_tsg_event_id_post_event(tsg, + NVGPU_EVENT_ID_BPT_PAUSE); } return 0; diff --git a/drivers/gpu/nvgpu/gk20a/tsg_gk20a.h b/drivers/gpu/nvgpu/gk20a/tsg_gk20a.h index 5e2b9b82..08fe0365 100644 --- a/drivers/gpu/nvgpu/gk20a/tsg_gk20a.h +++ b/drivers/gpu/nvgpu/gk20a/tsg_gk20a.h @@ -87,5 +87,24 @@ u32 gk20a_tsg_get_timeslice(struct tsg_gk20a *tsg); int gk20a_tsg_set_priority(struct gk20a *g, struct tsg_gk20a *tsg, u32 priority); +struct gk20a_event_id_data { + struct gk20a *g; + + int id; /* ch or tsg */ + u32 event_id; + + bool event_posted; + + struct nvgpu_cond event_id_wq; + struct nvgpu_mutex lock; + struct nvgpu_list_node event_id_node; +}; + +static inline struct gk20a_event_id_data * +gk20a_event_id_data_from_event_id_node(struct nvgpu_list_node *node) +{ + return (struct gk20a_event_id_data *) + ((uintptr_t)node - offsetof(struct gk20a_event_id_data, event_id_node)); +}; #endif /* __TSG_GK20A_H_ */ -- cgit v1.2.2