Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp4745857yba; Wed, 10 Apr 2019 04:09:56 -0700 (PDT) X-Google-Smtp-Source: APXvYqxqFq1Ss4nHXpTG2VUITxCU1xdm0uYjOYyZvqwF4rIgehkhP+y7JkXeQUPyrpuaH2cs2HpH X-Received: by 2002:a63:1d45:: with SMTP id d5mr18957507pgm.184.1554894596290; Wed, 10 Apr 2019 04:09:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1554894596; cv=none; d=google.com; s=arc-20160816; b=0lPXBdR50IKCF3mdh0gDnu1PefezYTvdV//gtYq8CpyC+qQ0mXlkZf+BOR0nva5Bj1 4Q0AdqPkKOHBPYXnfEbsf8UPXoNNxYfidehlKyVIxzqXjMwU0yXt9kxbNjWsm2N+Pi87 fGcefG1Gxdi1FZFTYbRPAlVyqjgPb1uCfuMZvJs99D6QvXPTkvl++2YKZxA9PMt+uK5U 4DmzgTvarkIXBVJQbfdt2Xgp2y1ackJ0pDD8oPsrIEGRXCZA/0f73kVbK9fp1jhqYwtI RK2sm/uht/MwmmgwAcLu8579sVIb9C2Wae9BlV+L6iBHK12mD0hcRSn8wMaFuxgMtKm6 PA7g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject; bh=hKAdb1jJwDHQHVC6c+Bm72SsE2MZXFxOvLMzKx3EkXE=; b=hUWRgI7QZn32Hg/zVlSQgGwzyjwCbqORKcJX9AzporiZee4m3TKu9C8u/69DYCoT3T yCzvD0NjXP+eTd1cmZHgqS7sdSNj8zqyPxJytuDTJGOCfvRK03p20BN82fgeFQ+HOyjo JwtNqllNbvwjhpZteCFjUsdGvm8M17nryouzUs7Po9SP5O+fmJc+geykdm8w3n+Ru8DW lQNUhv3DIlqBTgx81TZFzh3xXgBqVCMZTUUsVIo4qtB05q9RveOpCBlsl9lAyY+mzUwZ ghsMuR6Q2h+zMAOxxUgI41rRZzBGRf6mJ3RNBK4bOL0L33+rk/X5/vD2nN6Jb0dfzGno kScw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id q23si25130315pll.21.2019.04.10.04.09.40; Wed, 10 Apr 2019 04:09:56 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729843AbfDJK2b (ORCPT + 99 others); Wed, 10 Apr 2019 06:28:31 -0400 Received: from foss.arm.com ([217.140.101.70]:51432 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727943AbfDJK2b (ORCPT ); Wed, 10 Apr 2019 06:28:31 -0400 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id D65EB15BE; Wed, 10 Apr 2019 03:28:30 -0700 (PDT) Received: from [10.1.196.69] (e112269-lin.cambridge.arm.com [10.1.196.69]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 872D73F59C; Wed, 10 Apr 2019 03:28:28 -0700 (PDT) Subject: Re: [PATCH v2 3/3] drm/panfrost: Add initial panfrost driver To: Rob Herring , Tomeu Vizoso Cc: Neil Armstrong , Maxime Ripard , Sean Paul , Will Deacon , "linux-kernel@vger.kernel.org" , dri-devel , David Airlie , Linux IOMMU , Alyssa Rosenzweig , "Marty E . Plummer" , Robin Murphy , "moderated list:ARM/FREESCALE IMX / MXC ARM ARCHITECTURE" References: <20190401074730.12241-1-robh@kernel.org> <20190401074730.12241-4-robh@kernel.org> <5efdc3cb-7367-65e1-d1bf-14051db5da10@arm.com> From: Steven Price Message-ID: <9036b1e7-bb1b-d681-829b-10088bc4c227@arm.com> Date: Wed, 10 Apr 2019 11:28:27 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.5.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-GB Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 09/04/2019 17:15, Rob Herring wrote: > On Tue, Apr 9, 2019 at 10:56 AM Tomeu Vizoso wrote: >> >> On Mon, 8 Apr 2019 at 23:04, Rob Herring wrote: >>> >>> On Fri, Apr 5, 2019 at 7:30 AM Steven Price wrote: >>>> >>>> On 01/04/2019 08:47, Rob Herring wrote: >>>>> This adds the initial driver for panfrost which supports Arm Mali >>>>> Midgard and Bifrost family of GPUs. Currently, only the T860 and >>>>> T760 Midgard GPUs have been tested. >>> >>> [...] >>>>> + >>>>> + if (status & JOB_INT_MASK_ERR(j)) { >>>>> + job_write(pfdev, JS_COMMAND_NEXT(j), JS_COMMAND_NOP); >>>>> + job_write(pfdev, JS_COMMAND(j), JS_COMMAND_HARD_STOP_0); >>>> >>>> Hard-stopping an already completed job isn't likely to do very much :) >>>> Also you are using the "_0" version which is only valid when "job chain >>>> disambiguation" is present. >> >> Yeah, guess that can be removed. > > Steven, TBC, are you suggesting removing both lines or leaving > JS_COMMAND_NOP? I don't think we can ever have a pending job at this > point as there's no queuing. So the NOP probably isn't needed, but > doesn't hurt to have it either. Both lines are redundant and can be removed. But equally neither will cause any problems. Writing NOP into the next register is basically only needed if you know there's a job there which you no longer want to execute. kbase does this in certain situations. The main one is on a GPU without command chain disambiguation if you want to kill a particular job there's a potential race. For example: * Submit job A, followed by job B to slot 0. Job A is currently executing, job B is waiting in the _NEXT registers. * Kernel decides it wants to kill job A (it's taking too long, or the application has quit). * Simply executing a JS_COMMAND_HARD_STOP is racy. If job A finishes just before doing the register write, then it's actually job B that gets killed (and it's not always safe to just re-execute a killed job). * Instead write NOP to JS_COMMAND_NEXT, then check (again) whether the job currently running is the one you want. When you then HARD_STOP you either hit the correct job, or 'miss' and do nothing. Job chain disambiguation solves this problem by allowing the kernel to tag each job with a flag, the hard-stop can then be targetted at the job with the correct flag. Writing NOP into JS_COMMAND_NEXT is also useful if in the above situation you want to kill job B. In that case you can't hard-stop it (it hasn't start), so you simply want to remove it from the _NEXT registers. >>>> I suspect in this case you should also be signalling the fence? At the >>>> moment you rely on the GPU timeout recovering from the fault. >>> >>> I'll defer to Tomeu who wrote this (IIRC). >> >> Yes, that would be an improvement. > > Actually, I think that would break recovery because the job timeout > will bail out if the done fence is signaled already. Perhaps we want > to timeout immediately if that is possible with the scheduler. Ideally you would signal the fence with an error code (which is presumably what recovery does). There's no actual need to trigger a timeout. I'm not sure quite how the DRM infrastructure handles this though. Steve