diff options
Diffstat (limited to 'drivers/gpu/nvgpu/gk20a')
-rw-r--r-- | drivers/gpu/nvgpu/gk20a/fifo_gk20a.c | 20 | ||||
-rw-r--r-- | drivers/gpu/nvgpu/gk20a/fifo_gk20a.h | 3 |
2 files changed, 12 insertions, 11 deletions
diff --git a/drivers/gpu/nvgpu/gk20a/fifo_gk20a.c b/drivers/gpu/nvgpu/gk20a/fifo_gk20a.c index 709631d4..48982a04 100644 --- a/drivers/gpu/nvgpu/gk20a/fifo_gk20a.c +++ b/drivers/gpu/nvgpu/gk20a/fifo_gk20a.c | |||
@@ -522,7 +522,7 @@ void gk20a_fifo_delete_runlist(struct fifo_gk20a *f) | |||
522 | nvgpu_kfree(g, runlist->active_tsgs); | 522 | nvgpu_kfree(g, runlist->active_tsgs); |
523 | runlist->active_tsgs = NULL; | 523 | runlist->active_tsgs = NULL; |
524 | 524 | ||
525 | nvgpu_mutex_destroy(&runlist->mutex); | 525 | nvgpu_mutex_destroy(&runlist->runlist_lock); |
526 | 526 | ||
527 | } | 527 | } |
528 | memset(f->runlist_info, 0, (sizeof(struct fifo_runlist_info_gk20a) * | 528 | memset(f->runlist_info, 0, (sizeof(struct fifo_runlist_info_gk20a) * |
@@ -716,7 +716,7 @@ static int init_runlist(struct gk20a *g, struct fifo_gk20a *f) | |||
716 | goto clean_up_runlist; | 716 | goto clean_up_runlist; |
717 | } | 717 | } |
718 | } | 718 | } |
719 | nvgpu_mutex_init(&runlist->mutex); | 719 | nvgpu_mutex_init(&runlist->runlist_lock); |
720 | 720 | ||
721 | /* None of buffers is pinned if this value doesn't change. | 721 | /* None of buffers is pinned if this value doesn't change. |
722 | Otherwise, one of them (cur_buffer) must have been pinned. */ | 722 | Otherwise, one of them (cur_buffer) must have been pinned. */ |
@@ -2771,7 +2771,7 @@ int gk20a_fifo_preempt_channel(struct gk20a *g, u32 chid) | |||
2771 | 2771 | ||
2772 | /* we have no idea which runlist we are using. lock all */ | 2772 | /* we have no idea which runlist we are using. lock all */ |
2773 | for (i = 0; i < g->fifo.max_runlists; i++) | 2773 | for (i = 0; i < g->fifo.max_runlists; i++) |
2774 | nvgpu_mutex_acquire(&f->runlist_info[i].mutex); | 2774 | nvgpu_mutex_acquire(&f->runlist_info[i].runlist_lock); |
2775 | 2775 | ||
2776 | mutex_ret = nvgpu_pmu_mutex_acquire(&g->pmu, PMU_MUTEX_ID_FIFO, &token); | 2776 | mutex_ret = nvgpu_pmu_mutex_acquire(&g->pmu, PMU_MUTEX_ID_FIFO, &token); |
2777 | 2777 | ||
@@ -2781,7 +2781,7 @@ int gk20a_fifo_preempt_channel(struct gk20a *g, u32 chid) | |||
2781 | nvgpu_pmu_mutex_release(&g->pmu, PMU_MUTEX_ID_FIFO, &token); | 2781 | nvgpu_pmu_mutex_release(&g->pmu, PMU_MUTEX_ID_FIFO, &token); |
2782 | 2782 | ||
2783 | for (i = 0; i < g->fifo.max_runlists; i++) | 2783 | for (i = 0; i < g->fifo.max_runlists; i++) |
2784 | nvgpu_mutex_release(&f->runlist_info[i].mutex); | 2784 | nvgpu_mutex_release(&f->runlist_info[i].runlist_lock); |
2785 | 2785 | ||
2786 | return ret; | 2786 | return ret; |
2787 | } | 2787 | } |
@@ -2798,7 +2798,7 @@ int gk20a_fifo_preempt_tsg(struct gk20a *g, u32 tsgid) | |||
2798 | 2798 | ||
2799 | /* we have no idea which runlist we are using. lock all */ | 2799 | /* we have no idea which runlist we are using. lock all */ |
2800 | for (i = 0; i < g->fifo.max_runlists; i++) | 2800 | for (i = 0; i < g->fifo.max_runlists; i++) |
2801 | nvgpu_mutex_acquire(&f->runlist_info[i].mutex); | 2801 | nvgpu_mutex_acquire(&f->runlist_info[i].runlist_lock); |
2802 | 2802 | ||
2803 | mutex_ret = nvgpu_pmu_mutex_acquire(&g->pmu, PMU_MUTEX_ID_FIFO, &token); | 2803 | mutex_ret = nvgpu_pmu_mutex_acquire(&g->pmu, PMU_MUTEX_ID_FIFO, &token); |
2804 | 2804 | ||
@@ -2808,7 +2808,7 @@ int gk20a_fifo_preempt_tsg(struct gk20a *g, u32 tsgid) | |||
2808 | nvgpu_pmu_mutex_release(&g->pmu, PMU_MUTEX_ID_FIFO, &token); | 2808 | nvgpu_pmu_mutex_release(&g->pmu, PMU_MUTEX_ID_FIFO, &token); |
2809 | 2809 | ||
2810 | for (i = 0; i < g->fifo.max_runlists; i++) | 2810 | for (i = 0; i < g->fifo.max_runlists; i++) |
2811 | nvgpu_mutex_release(&f->runlist_info[i].mutex); | 2811 | nvgpu_mutex_release(&f->runlist_info[i].runlist_lock); |
2812 | 2812 | ||
2813 | return ret; | 2813 | return ret; |
2814 | } | 2814 | } |
@@ -3385,7 +3385,7 @@ int gk20a_fifo_reschedule_runlist(struct gk20a *g, u32 runlist_id) | |||
3385 | int ret = 0; | 3385 | int ret = 0; |
3386 | 3386 | ||
3387 | runlist = &g->fifo.runlist_info[runlist_id]; | 3387 | runlist = &g->fifo.runlist_info[runlist_id]; |
3388 | if (nvgpu_mutex_tryacquire(&runlist->mutex)) { | 3388 | if (nvgpu_mutex_tryacquire(&runlist->runlist_lock)) { |
3389 | mutex_ret = nvgpu_pmu_mutex_acquire( | 3389 | mutex_ret = nvgpu_pmu_mutex_acquire( |
3390 | &g->pmu, PMU_MUTEX_ID_FIFO, &token); | 3390 | &g->pmu, PMU_MUTEX_ID_FIFO, &token); |
3391 | 3391 | ||
@@ -3396,7 +3396,7 @@ int gk20a_fifo_reschedule_runlist(struct gk20a *g, u32 runlist_id) | |||
3396 | if (!mutex_ret) | 3396 | if (!mutex_ret) |
3397 | nvgpu_pmu_mutex_release( | 3397 | nvgpu_pmu_mutex_release( |
3398 | &g->pmu, PMU_MUTEX_ID_FIFO, &token); | 3398 | &g->pmu, PMU_MUTEX_ID_FIFO, &token); |
3399 | nvgpu_mutex_release(&runlist->mutex); | 3399 | nvgpu_mutex_release(&runlist->runlist_lock); |
3400 | } else { | 3400 | } else { |
3401 | /* someone else is writing fifo_runlist_r so not needed here */ | 3401 | /* someone else is writing fifo_runlist_r so not needed here */ |
3402 | ret = -EBUSY; | 3402 | ret = -EBUSY; |
@@ -3421,7 +3421,7 @@ int gk20a_fifo_update_runlist(struct gk20a *g, u32 runlist_id, u32 chid, | |||
3421 | 3421 | ||
3422 | runlist = &f->runlist_info[runlist_id]; | 3422 | runlist = &f->runlist_info[runlist_id]; |
3423 | 3423 | ||
3424 | nvgpu_mutex_acquire(&runlist->mutex); | 3424 | nvgpu_mutex_acquire(&runlist->runlist_lock); |
3425 | 3425 | ||
3426 | mutex_ret = nvgpu_pmu_mutex_acquire(&g->pmu, PMU_MUTEX_ID_FIFO, &token); | 3426 | mutex_ret = nvgpu_pmu_mutex_acquire(&g->pmu, PMU_MUTEX_ID_FIFO, &token); |
3427 | 3427 | ||
@@ -3431,7 +3431,7 @@ int gk20a_fifo_update_runlist(struct gk20a *g, u32 runlist_id, u32 chid, | |||
3431 | if (!mutex_ret) | 3431 | if (!mutex_ret) |
3432 | nvgpu_pmu_mutex_release(&g->pmu, PMU_MUTEX_ID_FIFO, &token); | 3432 | nvgpu_pmu_mutex_release(&g->pmu, PMU_MUTEX_ID_FIFO, &token); |
3433 | 3433 | ||
3434 | nvgpu_mutex_release(&runlist->mutex); | 3434 | nvgpu_mutex_release(&runlist->runlist_lock); |
3435 | return ret; | 3435 | return ret; |
3436 | } | 3436 | } |
3437 | 3437 | ||
diff --git a/drivers/gpu/nvgpu/gk20a/fifo_gk20a.h b/drivers/gpu/nvgpu/gk20a/fifo_gk20a.h index ea9f4528..c6d34945 100644 --- a/drivers/gpu/nvgpu/gk20a/fifo_gk20a.h +++ b/drivers/gpu/nvgpu/gk20a/fifo_gk20a.h | |||
@@ -91,7 +91,8 @@ struct fifo_runlist_info_gk20a { | |||
91 | u32 reset_eng_bitmask; /* engines to be reset during recovery */ | 91 | u32 reset_eng_bitmask; /* engines to be reset during recovery */ |
92 | bool stopped; | 92 | bool stopped; |
93 | bool support_tsg; | 93 | bool support_tsg; |
94 | struct nvgpu_mutex mutex; /* protect channel preempt and runlist update */ | 94 | /* protect ch/tsg/runlist preempt & runlist update */ |
95 | struct nvgpu_mutex runlist_lock; | ||
95 | }; | 96 | }; |
96 | 97 | ||
97 | enum { | 98 | enum { |