Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7B704C433EF for ; Mon, 4 Oct 2021 13:05:44 +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 2F3AD61A03 for ; Mon, 4 Oct 2021 13:05:44 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 2F3AD61A03 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 04A5C6E0AC; Mon, 4 Oct 2021 13:05:43 +0000 (UTC) Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by gabe.freedesktop.org (Postfix) with ESMTP id 38F1B6E0AC for ; Mon, 4 Oct 2021 13:05:42 +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 AFE931FB; Mon, 4 Oct 2021 06:05:41 -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 66C6D3F70D; Mon, 4 Oct 2021 06:05:40 -0700 (PDT) Subject: Re: [PATCH v5 6/8] drm/panfrost: Support synchronization jobs To: Boris Brezillon Cc: Rob Herring , Tomeu Vizoso , Alyssa Rosenzweig , Robin Murphy , dri-devel@lists.freedesktop.org, Daniel Vetter , Jason Ekstrand , Daniel Stone , =?UTF-8?Q?Christian_K=c3=b6nig?= References: <20210930190954.1525933-1-boris.brezillon@collabora.com> <20210930190954.1525933-7-boris.brezillon@collabora.com> <9ed27061-54f3-1804-936d-18aecf3d8872@arm.com> <20211004142424.09afb418@collabora.com> From: Steven Price Message-ID: <5e279d45-0159-b58d-0871-788f1e1562e4@arm.com> Date: Mon, 4 Oct 2021 14:05:25 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.13.0 MIME-Version: 1.0 In-Reply-To: <20211004142424.09afb418@collabora.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-GB Content-Transfer-Encoding: 7bit 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 04/10/2021 13:24, Boris Brezillon wrote: > On Mon, 4 Oct 2021 12:30:42 +0100 > Steven Price wrote: [...] >> >> It took me a while to convince myself that the reference counting for >> the PM reference is correct. Before panfrost_job_hw_submit() always >> returned with an extra reference, but now we have a case which doesn't. >> AFAICT this is probably fine because we dereference on the path where >> the hardware has completed the job (which obviously won't happen here). >> But I'm still a bit uneasy whether the reference counts are always correct. > > I think it is. We only decrement the PM count in the interrupt handler > path, and as you pointed out, we won't reach that path here. But if > that helps, I can move this if to `panfrost_job_run()`: > > /* Nothing to execute, signal the fence directly. */ > if (job->requirements & PANFROST_JD_REQ_DEP_ONLY) > dma_fence_signal_locked(job->done_fence); > else > panfrost_job_hw_submit(job, slot); > I think that would make it a bit more readable - really panfrost_job_hw_submit() needs a bit of TLC, I did post a patch ages ago[1] but it didn't get any feedback and then I forgot about it. Things have moved on so it would need a little bit of rework. Thanks, Steve [1] https://lore.kernel.org/dri-devel/20210512152419.30003-1-steven.price@arm.com/