Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp4711203imm; Tue, 7 Aug 2018 06:12:15 -0700 (PDT) X-Google-Smtp-Source: AAOMgpdDzRKTL44A1UtCzU4kDyhR1d/6PT8KhR/aDR8tsLPT3zzJ1KZEXWWBZ+angIkbcr2MypZ9 X-Received: by 2002:a17:902:70cc:: with SMTP id l12-v6mr18014823plt.132.1533647535605; Tue, 07 Aug 2018 06:12:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1533647535; cv=none; d=google.com; s=arc-20160816; b=OuO2y1IBi72bMRaqOB6voTxZvtJljM46HNzDBc75SUNYkSfhYIdav+lmtoozLP6rLv TPSwBUdv/vPvvpgNcGR10hhkIqFYevNk8xdckXYuu1nYQrgAdW5MdoUQvBcVCzqKNBot Uio3bpjlq+61gCrIis2ZZR8I1h6dIYx9VuQN3VBWylKFmhy0aFlxs7ns//DlvsyDzgI0 2YjEJv1jDOThpWEIY1l81U5pCEKt4W4SNaTpaR6ny5J9/3hUo5sJKQxjigawug9z9ASd M+8FiwIAOScjPeXn5X2tbrffELs2/uXQYDMb7HexhSnisQ/3nCNeGGfYcZzUdW/JMzLN dVUQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:arc-authentication-results; bh=lsOtx16AxfbBHSko8SMIaVbUyhKMO7+gBiA+J7XcJzs=; b=NMW7otlJPJWOZSaQLxeAt/WXBQ+A6N78c1GrGrnATzhC7wr8ZAxopFMhFQBX0B6HiM w2ejh8a6sSTnaTJR4r8ss9eKU4faMv53nfQcDfTuxQXG1DHCDx+qmS7z9tnqlJCOV27n VEi5NmsJVOujdUGiuS2MtztLFkDXh0XDpEfY3kOJWTsvuFbqI0/fxRzhMjyw2V8TqUU6 p3H7cOUYQ4+Zj4Gt6FcRXCh+xvGqORc7JpuhcP8iQPtPQ206aIQhr3Wf0sklVkGtXVQe Jx8iUwzzk7Ihn+jY/cuROIzlN5ykj9KyO+LgUPBeHbUiPeOVW6IRQYO8zhJZlDANrfAM FpbA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=V70a9Q7g; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id c38-v6si1384141pgb.489.2018.08.07.06.12.01; Tue, 07 Aug 2018 06:12:15 -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=pass header.i=@gmail.com header.s=20161025 header.b=V70a9Q7g; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388950AbeHGPXr (ORCPT + 99 others); Tue, 7 Aug 2018 11:23:47 -0400 Received: from mail-pl0-f68.google.com ([209.85.160.68]:34168 "EHLO mail-pl0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388540AbeHGPXr (ORCPT ); Tue, 7 Aug 2018 11:23:47 -0400 Received: by mail-pl0-f68.google.com with SMTP id f6-v6so7115059plo.1; Tue, 07 Aug 2018 06:09:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=lsOtx16AxfbBHSko8SMIaVbUyhKMO7+gBiA+J7XcJzs=; b=V70a9Q7g/He681U5/rsuJ64Y6CUyUrNMV/kgGWqgSbJV9shccikPAZUArvLRcTy1xC VVsZV0Zn/F429OX35e5O81G6j+GunhO8dLcmAPUNYHYQE6Xtr74mnswuga4rF5Ay7+EB G02VVwp0ZxdS6wZBEDPk+jaj8ygfL3T37ZfYmbPpxL7IS1QYpdT7uGBUCNnQJRTXS1PQ iNKURoVmGXMbNWbDjllNAm6zzKArK5JN8U8nWAeDkEVpx+hQGX5ihpWf6oyLx1oFVk6t h0e2QfCxRD9wUPMX2m0WOa4/y3hp922LtODaNB6FioJ4YA3NpXJSkzi1kVPVlVGoztF0 lcXw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=lsOtx16AxfbBHSko8SMIaVbUyhKMO7+gBiA+J7XcJzs=; b=pFwL13buKNbirQcqxJCoNYm6skoXEKhSaCn5ZhfjV8ahrNYb1AvyEp3pEi0Acoq1I8 HKyRwVpE01GM85OWAj21ugSdBW/xlFuVMyCDjzCq4cZLIMEZ8t+Q2ttpigVuoQ1K+o38 dhlJ8K9u+YsIiKztX+QnrzNyniD5WTMP5HMkCj/aQfrcadtdHeeS9g0TXsqLeLAuy1Dy VX0PL459dejFvglFRdz/CCT3nGqoH8JWo6AngYqMbN5MaazbNKwa5uiYQlCe5hh5jvDb BJPGTXAt4KeH4bjE+7qAAZMf0x1sDhWylsdQaDCsdSPTPej09QNy8UeRXeCmXZG+oZIp NX1Q== X-Gm-Message-State: AOUpUlE57J9aklqqtwNm0/KGYtQ6Rfawz34jKMhFmT1rTE4ONmq5mvoO qUH6+o1/dYf2cLH44kXhoNs= X-Received: by 2002:a17:902:9a01:: with SMTP id v1-v6mr18059215plp.20.1533647371539; Tue, 07 Aug 2018 06:09:31 -0700 (PDT) Received: from localhost.localdomain (109-252-90-13.nat.spd-mgts.ru. [109.252.90.13]) by smtp.gmail.com with ESMTPSA id 73-v6sm5339229pfu.20.2018.08.07.06.09.27 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 07 Aug 2018 06:09:31 -0700 (PDT) From: Dmitry Osipenko To: Thierry Reding , Mikko Perttunen Cc: linux-tegra@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 1/3] gpu: host1x: Cancel only job that actually got stuck Date: Tue, 7 Aug 2018 16:07:11 +0300 Message-Id: <20180807130713.1016-2-digetx@gmail.com> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20180807130713.1016-1-digetx@gmail.com> References: <20180807130713.1016-1-digetx@gmail.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 Reviewed-by: Mikko Perttunen --- drivers/gpu/host1x/cdma.c | 33 +++++++-------------------------- 1 file changed, 7 insertions(+), 26 deletions(-) diff --git a/drivers/gpu/host1x/cdma.c b/drivers/gpu/host1x/cdma.c index 91df51e631b2..75f339f5df6f 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 @@ -362,20 +360,15 @@ void host1x_cdma_update_sync_queue(struct host1x_cdma *cdma, * properly for this buffer and resources are freed. */ - dev_dbg(dev, "%s: perform CPU incr on pending same ctx buffers\n", - __func__); + dev_dbg(dev, "%s: perform CPU incr on pending buffers\n", __func__); if (!list_empty(&cdma->sync_queue)) restart_addr = job->first_get; 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 +381,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 */ -- 2.18.0