From patchwork Sun Aug 5 17:01:31 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Osipenko X-Patchwork-Id: 10556635 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id A887513B4 for ; Mon, 6 Aug 2018 08:23:00 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9759C205F6 for ; Mon, 6 Aug 2018 08:23:00 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 8BB36212D6; Mon, 6 Aug 2018 08:23:00 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=2.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED, FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 2CB3A205F6 for ; Mon, 6 Aug 2018 08:23:00 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 2897D6E235; Mon, 6 Aug 2018 08:20:31 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-lj1-x242.google.com (mail-lj1-x242.google.com [IPv6:2a00:1450:4864:20::242]) by gabe.freedesktop.org (Postfix) with ESMTPS id 7CF376E0EA for ; Sun, 5 Aug 2018 17:01:55 +0000 (UTC) Received: by mail-lj1-x242.google.com with SMTP id w16-v6so8668232ljh.12 for ; Sun, 05 Aug 2018 10:01:55 -0700 (PDT) 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; bh=Ldr0yoQdF1fCKHSkU/tHvNfIAixV328NcFTPZDoFZ4w=; b=FfHfZg3dYFhzLMp3CwpzKR2LCgbP3kiqTuMNEK+CIkocG2B3BOtXkdzNhuLi090dMe P7bQbwsvpau/Rpv87CBjucX6lQM23uwvhVR6SJkkYFtc+EEgNXma3nQQeWFLRmf+5wB5 LR89Xu93Z6+7GAwXE3G4aRJzIynMbTJ47KdveIQ1vnnxepck/cQIC8fxizsRpNDzONws ndMzOF5JCWsEjrwOEXDDrO12+Zo/PlKj5on/ul336SCOdVCp1pMKm2LCulxMUx0V2NRh ODlwp/v+YfyDAWW/msFOIPfc4G0FkPnqdaOoLWF68qjOE26Qub8xe2IT0ahF4xJmTEZ8 l0hQ== X-Gm-Message-State: AOUpUlG8B2axsyoxH4vMBC73SR4hg4DH0HXjFvd7FE+egXaWn6bEMUAe DF+W3xHI+QRMmiE8YT58QXc= X-Google-Smtp-Source: AAOMgpfQs4k12becx0W4EUuOB/y2/G4rPiBcX/nk8GYf+zolfthgxpGqEekx2nEXbKSB6pjrQXEiyg== X-Received: by 2002:a2e:2bd7:: with SMTP id r84-v6mr10978430ljr.40.1533488513888; Sun, 05 Aug 2018 10:01:53 -0700 (PDT) Received: from localhost.localdomain ([109.252.90.13]) by smtp.gmail.com with ESMTPSA id g11-v6sm1844609ljk.45.2018.08.05.10.01.52 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 05 Aug 2018 10:01:53 -0700 (PDT) From: Dmitry Osipenko To: Thierry Reding , Mikko Perttunen Subject: [PATCH v1] gpu: host1x: Cancel only job that actually got stuck Date: Sun, 5 Aug 2018 20:01:31 +0300 Message-Id: <20180805170131.29263-1-digetx@gmail.com> X-Mailer: git-send-email 2.18.0 X-Mailman-Approved-At: Mon, 06 Aug 2018 08:20:19 +0000 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-tegra@vger.kernel.org, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org MIME-Version: 1.0 Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP 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 | 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 */