summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/nvgpu/gk20a/channel_gk20a.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/gpu/nvgpu/gk20a/channel_gk20a.c')
-rw-r--r--drivers/gpu/nvgpu/gk20a/channel_gk20a.c22
1 files changed, 13 insertions, 9 deletions
diff --git a/drivers/gpu/nvgpu/gk20a/channel_gk20a.c b/drivers/gpu/nvgpu/gk20a/channel_gk20a.c
index 129921ad..38cb368c 100644
--- a/drivers/gpu/nvgpu/gk20a/channel_gk20a.c
+++ b/drivers/gpu/nvgpu/gk20a/channel_gk20a.c
@@ -827,11 +827,12 @@ static int gk20a_init_error_notifier(struct channel_gk20a *ch,
827 return 0; 827 return 0;
828} 828}
829 829
830void gk20a_set_error_notifier(struct channel_gk20a *ch, __u32 error) 830/**
831 * gk20a_set_error_notifier_locked()
832 * Should be called with ch->error_notifier_mutex held
833 */
834void gk20a_set_error_notifier_locked(struct channel_gk20a *ch, __u32 error)
831{ 835{
832 bool notifier_set = false;
833
834 mutex_lock(&ch->error_notifier_mutex);
835 if (ch->error_notifier_ref) { 836 if (ch->error_notifier_ref) {
836 struct timespec time_data; 837 struct timespec time_data;
837 u64 nsec; 838 u64 nsec;
@@ -845,13 +846,16 @@ void gk20a_set_error_notifier(struct channel_gk20a *ch, __u32 error)
845 ch->error_notifier->info32 = error; 846 ch->error_notifier->info32 = error;
846 ch->error_notifier->status = 0xffff; 847 ch->error_notifier->status = 0xffff;
847 848
848 notifier_set = true;
849 }
850 mutex_unlock(&ch->error_notifier_mutex);
851
852 if (notifier_set)
853 gk20a_err(dev_from_gk20a(ch->g), 849 gk20a_err(dev_from_gk20a(ch->g),
854 "error notifier set to %d for ch %d", error, ch->hw_chid); 850 "error notifier set to %d for ch %d", error, ch->hw_chid);
851 }
852}
853
854void gk20a_set_error_notifier(struct channel_gk20a *ch, __u32 error)
855{
856 mutex_lock(&ch->error_notifier_mutex);
857 gk20a_set_error_notifier_locked(ch, error);
858 mutex_unlock(&ch->error_notifier_mutex);
855} 859}
856 860
857static void gk20a_free_error_notifiers(struct channel_gk20a *ch) 861static void gk20a_free_error_notifiers(struct channel_gk20a *ch)