mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Robert Foss <robert.foss@collabora.com>
To: Rob Clark <robdclark@gmail.com>
Cc: David Airlie <airlied@linux.ie>,
	linux-arm-msm <linux-arm-msm@vger.kernel.org>,
	dri-devel <dri-devel@lists.freedesktop.org>,
	freedreno <freedreno@lists.freedesktop.org>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	Chris Wilson <chris@chris-wilson.co.uk>,
	Greg KH <gregkh@linuxfoundation.org>,
	stable <stable@vger.kernel.org>
Subject: Re: [RESEND PATCH v3] drm/msm: Move fence put to where failure occurs
Date: Wed, 5 Dec 2018 11:36:18 +0100	[thread overview]
Message-ID: <6a911a81-cac0-87bb-26c9-558c20efd360@collabora.com> (raw)
In-Reply-To: <CAF6AEGt+SJPoTChr=zn+g8Vth_F_D39EmWGXpo3qbsUgL=638A@mail.gmail.com>



On 2018-12-04 21:21, Rob Clark wrote:
> On Tue, Dec 4, 2018 at 11:56 AM Robert Foss <robert.foss@collabora.com> wrote:
>>
>> If dma_fence_wait fails to wait for a supplied in-fence in
>> msm_ioctl_gem_submit, make sure we release that in-fence.
>>
>> Also remove this dma_fence_put() from the 'out' label.
>>
>> Signed-off-by: Robert Foss <robert.foss@collabora.com>
>> Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
>> Cc: stable@vger.kernel.org
> 
> Fyi, this is queued up in msm-next/fixes

Ah!

I had a look for it in drm=misc-next, but didn't find it.
Thanks for the heads up!

> 
> BR,
> -R
> 
> 
>> ---
>>   drivers/gpu/drm/msm/msm_gem_submit.c | 15 ++++++++-------
>>   1 file changed, 8 insertions(+), 7 deletions(-)
>>
>> diff --git a/drivers/gpu/drm/msm/msm_gem_submit.c b/drivers/gpu/drm/msm/msm_gem_submit.c
>> index a90aedd6883a..d5e6665a4c8f 100644
>> --- a/drivers/gpu/drm/msm/msm_gem_submit.c
>> +++ b/drivers/gpu/drm/msm/msm_gem_submit.c
>> @@ -411,7 +411,6 @@ int msm_ioctl_gem_submit(struct drm_device *dev, void *data,
>>          struct msm_file_private *ctx = file->driver_priv;
>>          struct msm_gem_submit *submit;
>>          struct msm_gpu *gpu = priv->gpu;
>> -       struct dma_fence *in_fence = NULL;
>>          struct sync_file *sync_file = NULL;
>>          struct msm_gpu_submitqueue *queue;
>>          struct msm_ringbuffer *ring;
>> @@ -444,6 +443,8 @@ int msm_ioctl_gem_submit(struct drm_device *dev, void *data,
>>          ring = gpu->rb[queue->prio];
>>
>>          if (args->flags & MSM_SUBMIT_FENCE_FD_IN) {
>> +               struct dma_fence *in_fence;
>> +
>>                  in_fence = sync_file_get_fence(args->fence_fd);
>>
>>                  if (!in_fence)
>> @@ -453,11 +454,13 @@ int msm_ioctl_gem_submit(struct drm_device *dev, void *data,
>>                   * Wait if the fence is from a foreign context, or if the fence
>>                   * array contains any fence from a foreign context.
>>                   */
>> -               if (!dma_fence_match_context(in_fence, ring->fctx->context)) {
>> +               ret = 0;
>> +               if (!dma_fence_match_context(in_fence, ring->fctx->context))
>>                          ret = dma_fence_wait(in_fence, true);
>> -                       if (ret)
>> -                               return ret;
>> -               }
>> +
>> +               dma_fence_put(in_fence);
>> +               if (ret)
>> +                       return ret;
>>          }
>>
>>          ret = mutex_lock_interruptible(&dev->struct_mutex);
>> @@ -583,8 +586,6 @@ int msm_ioctl_gem_submit(struct drm_device *dev, void *data,
>>          }
>>
>>   out:
>> -       if (in_fence)
>> -               dma_fence_put(in_fence);
>>          submit_cleanup(submit);
>>          if (ret)
>>                  msm_gem_submit_free(submit);
>> --
>> 2.17.1
>>

      reply	other threads:[~2018-12-05 10:36 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-12-04 16:56 Robert Foss
2018-12-04 20:21 ` Rob Clark
2018-12-05 10:36   ` Robert Foss [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=6a911a81-cac0-87bb-26c9-558c20efd360@collabora.com \
    --to=robert.foss@collabora.com \
    --cc=airlied@linux.ie \
    --cc=chris@chris-wilson.co.uk \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=freedreno@lists.freedesktop.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=robdclark@gmail.com \
    --cc=stable@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®