From 4439a8e311e09b1f3af1a70d4111c75e002a607d Mon Sep 17 00:00:00 2001 From: Deepak Nibade Date: Wed, 13 Aug 2014 15:04:21 +0530 Subject: gpu: nvgpu: add ioctl to force reset channel Add below ioctl to force channel reset/recovery. NVHOST_IOCTL_CHANNEL_FORCE_RESET This recovery/reset is initiated by triggering mmu fault on channel so as to force the channel out (as oppose to waiting until channel is preempted) Bug 200027958 Change-Id: Idd3c10ef5fa691d746e34a8b890bd79aca815a20 Signed-off-by: Deepak Nibade Reviewed-on: http://git-master/r/456084 Reviewed-by: Automatic_Commit_Validation_User GVS: Gerrit_Virtual_Submit Reviewed-by: Terje Bergstrom --- drivers/gpu/nvgpu/gk20a/channel_gk20a.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'drivers') diff --git a/drivers/gpu/nvgpu/gk20a/channel_gk20a.c b/drivers/gpu/nvgpu/gk20a/channel_gk20a.c index f7cafc52..45757884 100644 --- a/drivers/gpu/nvgpu/gk20a/channel_gk20a.c +++ b/drivers/gpu/nvgpu/gk20a/channel_gk20a.c @@ -2306,6 +2306,19 @@ long gk20a_channel_ioctl(struct file *filp, err = gk20a_fifo_preempt_channel(ch->g, ch->hw_chid); gk20a_idle(dev); break; + case NVHOST_IOCTL_CHANNEL_FORCE_RESET: + err = gk20a_busy(dev); + if (err) { + dev_err(&dev->dev, + "%s: failed to host gk20a for ioctl cmd: 0x%x", + __func__, cmd); + return err; + } + gk20a_set_error_notifier(ch, + NVHOST_CHANNEL_RESETCHANNEL_VERIF_ERROR); + gk20a_fifo_recover_ch(ch->g, ch->hw_chid, true); + gk20a_idle(dev); + break; default: dev_err(&dev->dev, "unrecognized ioctl cmd: 0x%x", cmd); err = -ENOTTY; -- cgit v1.2.2