Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp3343355imm; Mon, 6 Aug 2018 03:06:20 -0700 (PDT) X-Google-Smtp-Source: AAOMgpcj5IsqHfgoQWyxYgN/cgWHK1lFZhi7fcE+hu6idsQyqbeOEmti4Yv3RdTxCby4pnAJUwR/ X-Received: by 2002:a62:4695:: with SMTP id o21-v6mr16346721pfi.176.1533549980883; Mon, 06 Aug 2018 03:06:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1533549980; cv=none; d=google.com; s=arc-20160816; b=kxenM9fvGsWrvt0++fMTjjV5W+tC97Fa0+wz0BhBzUzyzGfJQBUAmRjsq71xENDaOw IQvkXYYFHX8lUKSXIE4reYJgBRQ2dpouYU7MVPgKtQ+DkF3Re1J8UoeYdjMv3kMKJV5F Nb9C6zqgdMVR7+Uqp6P63539zVbGb+ldWeqWfsoLirIeTtezOdluteDqMIFbeCrFBX8j cjPU3Q2QZaQ4cMw/hoPO1oWN3jZNa8UQkhez28gKZ7+Y3X7r+qskPSncOrbyc2lbYBEk nQtu6cU5qHEwa8pHYcF9Eo6OfEmMJ4eF2Ze0txlDLNjdSBSoHmxXSft0+BaY4wGgJWuZ NBUQ== 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:dkim-signature :arc-authentication-results; bh=EQ/nC9y3KWB5NjEC872Q8V9Ye6oiyKkHJZMNioiUY8A=; b=bR4dmlMBpO/ycE9KnP8UetYL9SebvAKXHMzYTKGeiboVdooYb/nJTFslQDF5WPh2aX 4kX8yhw3CLUU0nC6RBpk0drvZlxrtAMhMvTCtpA8I6uUdztciOqTUI845B/y+2UYk3pr 8FgmQYb5Ui/Jub8QA4p5KYM3cdPvYQXV+grG3345u0KTgBoohdLNrKzl+Lth+D6gop6x fFDsIglaBgrc8Y6iGq+6Rq3qvxhxckEI8DyhgWfsGGZnowNy+xj/FZmSQ36IRazxRmoI Ceh2XQ8wl0bKrE1raKtVOMKvLbbEvRIWMNl4B1ZK0QIlaQPfjoPiVGbRyn7O/CeqnmTa qrxQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@kapsi.fi header.s=20161220 header.b="Fzuq/vOb"; 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 x13-v6si10345191pgv.389.2018.08.06.03.06.05; Mon, 06 Aug 2018 03:06:20 -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; dkim=fail header.i=@kapsi.fi header.s=20161220 header.b="Fzuq/vOb"; 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 S1728626AbeHFMIq (ORCPT + 99 others); Mon, 6 Aug 2018 08:08:46 -0400 Received: from mail.kapsi.fi ([91.232.154.25]:32993 "EHLO mail.kapsi.fi" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726855AbeHFMIq (ORCPT ); Mon, 6 Aug 2018 08:08:46 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=kapsi.fi; s=20161220; h=Content-Transfer-Encoding:Content-Type:In-Reply-To: MIME-Version:Date:Message-ID:From:References:Cc:To:Subject:Sender:Reply-To: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=EQ/nC9y3KWB5NjEC872Q8V9Ye6oiyKkHJZMNioiUY8A=; b=Fzuq/vOb+tQAa+YrSfo3lubr2H HA2mH/QmiK6m+sB0Yv0agKi8by+30vm7/bD5yESz6XqVAY8ldZxTU4mcCIYdM/PUjnSTekn+4WW4b tQCQwMAvnWS4yxi/9LSgi8fItg/i0FpEdv8/D/3xcCb60PoygEupmAG0tOQJlQi5MD4P66lc2rWEa SiIYAvYHeyOl8UYeXQPVJjR+dhoProI9bUWRS/Eker/57pxrY5iMWj37iSSvh5eZTWbxfkuOSym66 UIdoztjGoKnNWR5l/fp2AMFy4JUCH60MUa7X2Ju5iE1hkQSD8JFntP/IQmag16mHcz96xaFz7C7Yv 3hY5SsCg==; Received: from [193.209.96.43] (helo=[10.21.26.144]) by mail.kapsi.fi with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.89) (envelope-from ) id 1fmcJM-000216-Qu; Mon, 06 Aug 2018 13:00:24 +0300 Subject: Re: [PATCH v1] gpu: host1x: Cancel only job that actually got stuck To: Dmitry Osipenko , Thierry Reding Cc: linux-tegra@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org References: <20180805170131.29263-1-digetx@gmail.com> From: Mikko Perttunen Message-ID: <3eb8099b-8dcb-af37-a67d-463fc7c07c33@kapsi.fi> Date: Mon, 6 Aug 2018 13:00:24 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.7.0 MIME-Version: 1.0 In-Reply-To: <20180805170131.29263-1-digetx@gmail.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-SA-Exim-Connect-IP: 193.209.96.43 X-SA-Exim-Mail-From: cyndis@kapsi.fi X-SA-Exim-Scanned: No (on mail.kapsi.fi); SAEximRunCond expanded to false Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Reviewed-by: Mikko Perttunen On 05.08.2018 20:01, Dmitry Osipenko wrote: > Host1x doesn't have information about jobs inter-dependency, that is > something that will become available once host1x will get a proper > jobs scheduler implementation. Currently a hang job causes other unrelated > jobs to be canceled, that is a relic from downstream driver which is > irrelevant to upstream. Let's cancel only the hanging job and not to touch > other jobs in queue. > > Signed-off-by: Dmitry Osipenko > --- > drivers/gpu/host1x/cdma.c | 30 ++++++------------------------ > 1 file changed, 6 insertions(+), 24 deletions(-) > > diff --git a/drivers/gpu/host1x/cdma.c b/drivers/gpu/host1x/cdma.c > index 91df51e631b2..4d94af4a315f 100644 > --- a/drivers/gpu/host1x/cdma.c > +++ b/drivers/gpu/host1x/cdma.c > @@ -348,13 +348,11 @@ void host1x_cdma_update_sync_queue(struct host1x_cdma *cdma, > } > > /* > - * Walk the sync_queue, first incrementing with the CPU syncpts that > - * are partially executed (the first buffer) or fully skipped while > - * still in the current context (slots are also NOP-ed). > + * Increment with CPU the remaining syncpts of a partially executed job. > * > - * At the point contexts are interleaved, syncpt increments must be > - * done inline with the pushbuffer from a GATHER buffer to maintain > - * the order (slots are modified to be a GATHER of syncpt incrs). > + * Syncpt increments must be done inline with the pushbuffer from a > + * GATHER buffer to maintain the order (slots are modified to be a > + * GATHER of syncpt incrs). > * > * Note: save in restart_addr the location where the timed out buffer > * started in the PB, so we can start the refetch from there (with the > @@ -370,12 +368,8 @@ void host1x_cdma_update_sync_queue(struct host1x_cdma *cdma, > else > restart_addr = cdma->last_pos; > > - /* do CPU increments as long as this context continues */ > - list_for_each_entry_from(job, &cdma->sync_queue, list) { > - /* different context, gets us out of this loop */ > - if (job->client != cdma->timeout.client) > - break; > - > + /* do CPU increments for the remaining syncpts */ > + if (job) { > /* won't need a timeout when replayed */ > job->timeout = 0; > > @@ -388,20 +382,8 @@ void host1x_cdma_update_sync_queue(struct host1x_cdma *cdma, > host1x_hw_cdma_timeout_cpu_incr(host1x, cdma, job->first_get, > syncpt_incrs, job->syncpt_end, > job->num_slots); > - > - syncpt_val += syncpt_incrs; > } > > - /* > - * The following sumbits from the same client may be dependent on the > - * failed submit and therefore they may fail. Force a small timeout > - * to make the queue cleanup faster. > - */ > - > - list_for_each_entry_from(job, &cdma->sync_queue, list) > - if (job->client == cdma->timeout.client) > - job->timeout = min_t(unsigned int, job->timeout, 500); > - > dev_dbg(dev, "%s: finished sync_queue modification\n", __func__); > > /* roll back DMAGET and start up channel again */ >