From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.3 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_SANE_1 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0DA7FC432BE for ; Wed, 1 Sep 2021 11:30:05 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id CCF7160F6C for ; Wed, 1 Sep 2021 11:30:03 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org CCF7160F6C Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=arm.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 27EF46E198; Wed, 1 Sep 2021 11:30:03 +0000 (UTC) Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by gabe.freedesktop.org (Postfix) with ESMTP id EFD486E198 for ; Wed, 1 Sep 2021 11:30:01 +0000 (UTC) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id A160B1042; Wed, 1 Sep 2021 04:30:01 -0700 (PDT) Received: from [192.168.1.179] (unknown [172.31.20.19]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 97C243F766; Wed, 1 Sep 2021 04:30:00 -0700 (PDT) Subject: Re: [PATCH] panfrost: Don't cleanup the job if it was successfully queued To: Boris Brezillon , Rob Herring , Tomeu Vizoso , Alyssa Rosenzweig , Robin Murphy Cc: Daniel Vetter , dri-devel@lists.freedesktop.org References: <20210831133556.236984-1-boris.brezillon@collabora.com> From: Steven Price Message-ID: <74446d0b-f4db-ecd5-f6b7-84748abe3399@arm.com> Date: Wed, 1 Sep 2021 12:29:59 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.11.0 MIME-Version: 1.0 In-Reply-To: <20210831133556.236984-1-boris.brezillon@collabora.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-GB Content-Transfer-Encoding: 8bit X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" On 31/08/2021 14:35, Boris Brezillon wrote: > The labels are misleading. Even though they are all prefixed with 'fail_' > the success case also takes that path, and we should definitely not > cleanup the job if it's been queued. While at it, let's rename those > labels so we don't do the same mistake again. > > Fixes: 53516280cc38 ("drm/panfrost: use scheduler dependency tracking") > Signed-off-by: Boris Brezillon Reviewed-by: Steven Price And also unlike last time... Tested-by: Steven Price Thanks for the clean up - I should have actually tested the previous patch, but from the diff (and the previous label names) it was obviously correctâ„¢! But it of course blows up pretty quickly without this change. Thanks, Steve > --- > drivers/gpu/drm/panfrost/panfrost_drv.c | 19 ++++++++++--------- > 1 file changed, 10 insertions(+), 9 deletions(-) > > diff --git a/drivers/gpu/drm/panfrost/panfrost_drv.c b/drivers/gpu/drm/panfrost/panfrost_drv.c > index 16212b6b202e..077cbbfa506b 100644 > --- a/drivers/gpu/drm/panfrost/panfrost_drv.c > +++ b/drivers/gpu/drm/panfrost/panfrost_drv.c > @@ -253,7 +253,7 @@ static int panfrost_ioctl_submit(struct drm_device *dev, void *data, > job = kzalloc(sizeof(*job), GFP_KERNEL); > if (!job) { > ret = -ENOMEM; > - goto fail_out_sync; > + goto out_put_syncout; > } > > kref_init(&job->refcount); > @@ -270,29 +270,30 @@ static int panfrost_ioctl_submit(struct drm_device *dev, void *data, > &job->file_priv->sched_entity[slot], > NULL); > if (ret) > - goto fail_job_put; > + goto out_put_job; > > ret = panfrost_copy_in_sync(dev, file, args, job); > if (ret) > - goto fail_job; > + goto out_cleanup_job; > > ret = panfrost_lookup_bos(dev, file, args, job); > if (ret) > - goto fail_job; > + goto out_cleanup_job; > > ret = panfrost_job_push(job); > if (ret) > - goto fail_job; > + goto out_cleanup_job; > > /* Update the return sync object for the job */ > if (sync_out) > drm_syncobj_replace_fence(sync_out, job->render_done_fence); > > -fail_job: > - drm_sched_job_cleanup(&job->base); > -fail_job_put: > +out_cleanup_job: > + if (ret) > + drm_sched_job_cleanup(&job->base); > +out_put_job: > panfrost_job_put(job); > -fail_out_sync: > +out_put_syncout: > if (sync_out) > drm_syncobj_put(sync_out); > >