From 1c7dcfdeef3b0672317fca947cb2097e97c623a9 Mon Sep 17 00:00:00 2001 From: Deepak Nibade Date: Wed, 10 Sep 2014 16:34:32 +0530 Subject: gpu: nvgpu: use TSG recover API Use TSG specific API gk20a_fifo_recover_tsg() in following cases : - IOCTL_CHANNEL_FORCE_RESET to force reset a channel in TSG, reset all the channels - handle pbdma intr while resetting in case of pbdma intr, if channel is part of TSG, recover entire TSG - TSG preempt failure when TSG preempt times out, use TSG recover API Use preempt_tsg() API to preempt if channel is part of TSG Add below two generic APIs which will take care of preempting/ recovering either of channel or TSG as required gk20a_fifo_preempt() gk20a_fifo_force_reset_ch() Bug 1470692 Change-Id: I8d46e252af79136be85a9a2accf8b51bd924ca8c Signed-off-by: Deepak Nibade Reviewed-on: http://git-master/r/497875 Reviewed-by: Automatic_Commit_Validation_User GVS: Gerrit_Virtual_Submit Reviewed-by: Terje Bergstrom --- drivers/gpu/nvgpu/gk20a/channel_gk20a.c | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) (limited to 'drivers/gpu/nvgpu/gk20a/channel_gk20a.c') diff --git a/drivers/gpu/nvgpu/gk20a/channel_gk20a.c b/drivers/gpu/nvgpu/gk20a/channel_gk20a.c index 7a3132c9..1e71c1c7 100644 --- a/drivers/gpu/nvgpu/gk20a/channel_gk20a.c +++ b/drivers/gpu/nvgpu/gk20a/channel_gk20a.c @@ -2293,8 +2293,6 @@ long gk20a_channel_ioctl(struct file *filp, gk20a_idle(dev); break; case NVHOST_IOCTL_CHANNEL_PREEMPT: - if (gk20a_is_channel_marked_as_tsg(ch)) - return -EINVAL; err = gk20a_busy(dev); if (err) { dev_err(&dev->dev, @@ -2302,8 +2300,7 @@ long gk20a_channel_ioctl(struct file *filp, __func__, cmd); return err; } - /* preempt channel */ - err = gk20a_fifo_preempt_channel(ch->g, ch->hw_chid); + err = gk20a_fifo_preempt(ch->g, ch); gk20a_idle(dev); break; case NVHOST_IOCTL_CHANNEL_FORCE_RESET: @@ -2314,9 +2311,7 @@ long gk20a_channel_ioctl(struct file *filp, __func__, cmd); return err; } - gk20a_set_error_notifier(ch, - NVHOST_CHANNEL_RESETCHANNEL_VERIF_ERROR); - gk20a_fifo_recover_ch(ch->g, ch->hw_chid, true); + err = gk20a_fifo_force_reset_ch(ch, true); gk20a_idle(dev); break; default: -- cgit v1.2.2