From patchwork Fri Sep 4 08:15:51 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yukimasa Sugizaki X-Patchwork-Id: 11756233 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id CB408109A for ; Fri, 4 Sep 2020 08:17:05 +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 A982D206C9 for ; Fri, 4 Sep 2020 08:17:05 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=idein-jp.20150623.gappssmtp.com header.i=@idein-jp.20150623.gappssmtp.com header.b="fFnPtrRl" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org A982D206C9 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=idein.jp Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id BD0D26E262; Fri, 4 Sep 2020 08:17:04 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-pj1-x1041.google.com (mail-pj1-x1041.google.com [IPv6:2607:f8b0:4864:20::1041]) by gabe.freedesktop.org (Postfix) with ESMTPS id CD1C16E270 for ; Fri, 4 Sep 2020 08:17:03 +0000 (UTC) Received: by mail-pj1-x1041.google.com with SMTP id n3so4888986pjq.1 for ; Fri, 04 Sep 2020 01:17:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=idein-jp.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=X8d+hfgA9Ii9/0R8jrf0w6bherNqm+Veb9EADkBuhkw=; b=fFnPtrRlqEFeiiNKuxhcwPC7u7l0mp4nTHM+n19g2H1tDnhDn+Mai/hADyD1bVvHLg wgaXB9cqujbPJ0DjsCh1gAoOQlmsK0YsJyhk2Rk2je5hjii4LEPEoGibbcFfR81cJUIa YaUp932aZXZ9+m+YXWoXU23q8HQhqE4Rgmgk7cQyIgYanvs/EK8S+YEoJ87c1rLN7K1v mj11ghs5BagMJOa0e1ULnAGagwDTgbR64lEVYPMSLcdOmeFsdQ0iB+7rlHevWuyqfN6i fgt4/1y8f6cftEQ6UYsy6g8zZ/axNWbuAXv1NaL3xj65X9x2CcLfrGWr6LR/4RO3CQd0 3TVQ== 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:mime-version:content-transfer-encoding; bh=X8d+hfgA9Ii9/0R8jrf0w6bherNqm+Veb9EADkBuhkw=; b=XwMTMfroTNgSIp3+/oaqxypehifn4cFYOVzAswnRdT/QhhuZoh/a5aQuEpTP+Ys4cd 8cPsj1zFVigPA51KHuY+1Oau3+et8/FdlerVFatoLSnRWVcMmw308GhNfV8JxhT1ROOE R09vPaccCSyAdMWLBTcslousBpSNxGacGUSzNVJPE8tUN6LELHC0EUHiCZswLKeHm4JN ospXY3UB+S1rH3xp9hJIAqjmWz07Aomw6YesHjuDPPJ2T3/FBS4VJDwtqXl+ZBLquYAi WaArvigz+OLJ8qlBqV/YGrcTDmI5i8SnxKBzC7m51sJrQu6LTU1vEugM4o2GpAzrhLT0 fu6Q== X-Gm-Message-State: AOAM531GhCCP1qhVHK/5eVrE5KqRi+nflRKiwKSuiKYVAtUtDx8awNCv Epd4tHQojpbzRWT1fq95ESTkXwiUj5CMbSR3zQ== X-Google-Smtp-Source: ABdhPJyXCYCK5wyYdKH2S9UAASeHxeqjgDG6XS64tlEQtMmSqrGS66d+BiyfDIT3gA/xhrMalOPgSA== X-Received: by 2002:a17:902:6b85:: with SMTP id p5mr7730070plk.235.1599207423032; Fri, 04 Sep 2020 01:17:03 -0700 (PDT) Received: from localhost.localdomain (i220-221-200-167.s41.a008.ap.plala.or.jp. [220.221.200.167]) by smtp.googlemail.com with ESMTPSA id i16sm20202630pjv.0.2020.09.04.01.17.00 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Fri, 04 Sep 2020 01:17:02 -0700 (PDT) From: Yukimasa Sugizaki To: dri-devel@lists.freedesktop.org Subject: [PATCH 1/3] drm/v3d: Don't resubmit guilty CSD jobs Date: Fri, 4 Sep 2020 17:15:51 +0900 Message-Id: <20200904081552.38052-2-ysugi@idein.jp> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200904081552.38052-1-ysugi@idein.jp> References: <20200904081552.38052-1-ysugi@idein.jp> MIME-Version: 1.0 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: , Cc: David Airlie , Yukimasa Sugizaki Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" The previous code misses a check for the timeout error set by drm_sched_resubmit_jobs(), which results in an infinite GPU reset loop if once a timeout occurs: [ 178.799106] v3d fec00000.v3d: [drm:v3d_reset [v3d]] *ERROR* Resetting GPU for hang. [ 178.807836] v3d fec00000.v3d: [drm:v3d_reset [v3d]] *ERROR* V3D_ERR_STAT: 0x00001000 [ 179.839132] v3d fec00000.v3d: [drm:v3d_reset [v3d]] *ERROR* Resetting GPU for hang. [ 179.847865] v3d fec00000.v3d: [drm:v3d_reset [v3d]] *ERROR* V3D_ERR_STAT: 0x00001000 [ 180.879146] v3d fec00000.v3d: [drm:v3d_reset [v3d]] *ERROR* Resetting GPU for hang. [ 180.887925] v3d fec00000.v3d: [drm:v3d_reset [v3d]] *ERROR* V3D_ERR_STAT: 0x00001000 [ 181.919188] v3d fec00000.v3d: [drm:v3d_reset [v3d]] *ERROR* Resetting GPU for hang. [ 181.928002] v3d fec00000.v3d: [drm:v3d_reset [v3d]] *ERROR* V3D_ERR_STAT: 0x00001000 ... This commit adds the check for timeout as in v3d_{bin,render}_job_run(): [ 66.408962] v3d fec00000.v3d: [drm:v3d_reset [v3d]] *ERROR* Resetting GPU for hang. [ 66.417734] v3d fec00000.v3d: [drm:v3d_reset [v3d]] *ERROR* V3D_ERR_STAT: 0x00001000 [ 66.428296] [drm] Skipping CSD job resubmission due to previous error (-125) , where -125 is -ECANCELED, though users currently have no way other than inspecting the dmesg to check if the timeout has occurred. Signed-off-by: Yukimasa Sugizaki --- drivers/gpu/drm/v3d/v3d_sched.c | 11 +++++++++++ 1 file changed, 11 insertions(+) -- 2.7.4 diff --git a/drivers/gpu/drm/v3d/v3d_sched.c b/drivers/gpu/drm/v3d/v3d_sched.c index 0747614a78f0..001216f22017 100644 --- a/drivers/gpu/drm/v3d/v3d_sched.c +++ b/drivers/gpu/drm/v3d/v3d_sched.c @@ -226,6 +226,17 @@ v3d_csd_job_run(struct drm_sched_job *sched_job) struct dma_fence *fence; int i; + /* This error is set to -ECANCELED by drm_sched_resubmit_jobs() if this + * job timed out more than sched_job->sched->hang_limit times. + */ + int error = sched_job->s_fence->finished.error; + + if (unlikely(error < 0)) { + DRM_WARN("Skipping CSD job resubmission due to previous error (%d)\n", + error); + return ERR_PTR(error); + } + v3d->csd_job = job; v3d_invalidate_caches(v3d); From patchwork Fri Sep 4 08:15:52 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yukimasa Sugizaki X-Patchwork-Id: 11756235 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id A13BC109A for ; Fri, 4 Sep 2020 08:17:11 +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 7FEF9206C9 for ; Fri, 4 Sep 2020 08:17:11 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=idein-jp.20150623.gappssmtp.com header.i=@idein-jp.20150623.gappssmtp.com header.b="g+EcxEwL" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 7FEF9206C9 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=idein.jp Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 8304D6E270; Fri, 4 Sep 2020 08:17:10 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-pf1-x444.google.com (mail-pf1-x444.google.com [IPv6:2607:f8b0:4864:20::444]) by gabe.freedesktop.org (Postfix) with ESMTPS id 665796E270 for ; Fri, 4 Sep 2020 08:17:09 +0000 (UTC) Received: by mail-pf1-x444.google.com with SMTP id u128so4195715pfb.6 for ; Fri, 04 Sep 2020 01:17:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=idein-jp.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=+JeVLT/WaUYTSHSWdrjuLzdLGSzem2YaDGxkRD0Qvmg=; b=g+EcxEwLcsXGmrEDWVxy+SuwHKvezP1OKoJF4cFtCiz03Yk6l0pDwqwbDRp9FM5brH CR4MeSOBFl7BmJYLC3auA3DcFw5fHQ39PEeu/EtvO44GK/j+cvrM4aptkHzgKtKUrWzz 36igMpwAcNrp62UOKrb/PELQY42Z/YLghmWqSefTqUFcbpKolfVOB9uwMXE2uUfhnHLm 4RPwcKQ4IUTf5n1o9F5Q/JcnZSJ/BxZmads7eoQ8qqO75T7/14sMR1cuJmqPWI4kDLHj /2JYuPfm9N2VvK7459oYeybwDNKmsOoM7q+FpuwRh1i3dGaiqR6QzIMyUtnwk2MISSnN 5bQg== 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:mime-version:content-transfer-encoding; bh=+JeVLT/WaUYTSHSWdrjuLzdLGSzem2YaDGxkRD0Qvmg=; b=N90u5HDFOa/3OkwJJss1C8yj9zstIz3kJm8twCp6A/r4QP3rTadSqaWQE2l8zjVN5k pRsOEaNzAu15WQmazuDDsvClu43kLYDChZGk3xqsUS9uxyvZUFpMSBrM6CbRUtgRZVg4 rnI/RFWdiLJJyqAh2KgdIlruIAvG4VMi6XXGrH2wI7IlZeuFgQB6J0cP4w9q3U1CDd+P UFSi6nIVDQM5xBSamLh5Yxxy8njQO5GAzhe0JohKsc29rtqX7e4ECmbl/8IHtXY1I9Sx Agl6C/rz9Cz46e7UAlBout3T/t+aQUkHyojBae1WvFjg//3kOjsbdWpa4+KUcsKC+I+T kGQQ== X-Gm-Message-State: AOAM533pbWrnsG0g3p3cAM6KHUQqphrtgtlb6ulgpesRmO37cYLExAk0 3AjEg8Cush1SxALCOShIRJp8FDd4BLNTEWUzjg== X-Google-Smtp-Source: ABdhPJx1Twn8R9iiLL2f/YS21M0XvQUr7e3trAyQcFohW4v9mHn8X2uKVkaZUVko0SJC89aLiuD1Ww== X-Received: by 2002:a62:1a95:0:b029:13c:1611:66bd with SMTP id a143-20020a621a950000b029013c161166bdmr5962989pfa.8.1599207428577; Fri, 04 Sep 2020 01:17:08 -0700 (PDT) Received: from localhost.localdomain (i220-221-200-167.s41.a008.ap.plala.or.jp. [220.221.200.167]) by smtp.googlemail.com with ESMTPSA id i16sm20202630pjv.0.2020.09.04.01.17.05 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Fri, 04 Sep 2020 01:17:07 -0700 (PDT) From: Yukimasa Sugizaki To: dri-devel@lists.freedesktop.org Subject: [PATCH 2/3] drm/v3d: Correctly restart the timer when progress is made Date: Fri, 4 Sep 2020 17:15:52 +0900 Message-Id: <20200904081552.38052-3-ysugi@idein.jp> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200904081552.38052-1-ysugi@idein.jp> References: <20200904081552.38052-1-ysugi@idein.jp> MIME-Version: 1.0 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: , Cc: Emily Deng , David Airlie , =?utf-8?q?Christian_K=C3=B6nig?= , Yukimasa Sugizaki Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" The V3D scheduler wants a timed-out job to continue running if it made progress. However, the current DRM scheduler removes the timed-out job from ring_mirror_list and thus the timer is not restarted automatically, resulting in an infinite timeout. We need stop and restart the DRM scheduler to rearm the timer. Fixes: 135517d3565b ("drm/scheduler: Avoid accessing freed bad job.") Signed-off-by: Yukimasa Sugizaki --- drivers/gpu/drm/v3d/v3d_sched.c | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) -- 2.7.4 diff --git a/drivers/gpu/drm/v3d/v3d_sched.c b/drivers/gpu/drm/v3d/v3d_sched.c index 001216f22017..feef0c749e68 100644 --- a/drivers/gpu/drm/v3d/v3d_sched.c +++ b/drivers/gpu/drm/v3d/v3d_sched.c @@ -312,9 +312,24 @@ v3d_cl_job_timedout(struct drm_sched_job *sched_job, enum v3d_queue q, u32 ctca = V3D_CORE_READ(0, V3D_CLE_CTNCA(q)); u32 ctra = V3D_CORE_READ(0, V3D_CLE_CTNRA(q)); + /* If we've made progress, skip reset and let the timer get + * rearmed. + */ if (*timedout_ctca != ctca || *timedout_ctra != ctra) { *timedout_ctca = ctca; *timedout_ctra = ctra; + + /* Because the timed-out job has been removed from + * ring_mirror_list in drm_sched_job_timedout(), we need to + * stop and restart the scheduler to rearm the timer. + * Holding the reset_lock is necessary for concurrent + * v3d_gpu_reset_for_timeout(). + */ + mutex_lock(&v3d->reset_lock); + drm_sched_stop(sched_job->sched, sched_job); + drm_sched_start(sched_job->sched, sched_job); + mutex_unlock(&v3d->reset_lock); + return; } @@ -359,6 +374,18 @@ v3d_csd_job_timedout(struct drm_sched_job *sched_job) */ if (job->timedout_batches != batches) { job->timedout_batches = batches; + + /* Because the timed-out job has been removed from + * ring_mirror_list in drm_sched_job_timedout(), we need to + * stop and restart the scheduler to rearm the timer. + * Holding the reset_lock is necessary for concurrent + * v3d_gpu_reset_for_timeout(). + */ + mutex_lock(&v3d->reset_lock); + drm_sched_stop(sched_job->sched, sched_job); + drm_sched_start(sched_job->sched, sched_job); + mutex_unlock(&v3d->reset_lock); + return; } From patchwork Fri Sep 4 08:15:53 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yukimasa Sugizaki X-Patchwork-Id: 11756237 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 2CD8E138C for ; Fri, 4 Sep 2020 08:17:16 +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 0B88F206CA for ; Fri, 4 Sep 2020 08:17:16 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=idein-jp.20150623.gappssmtp.com header.i=@idein-jp.20150623.gappssmtp.com header.b="F7jbJ5UI" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 0B88F206CA Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=idein.jp Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id B12F66E28E; Fri, 4 Sep 2020 08:17:14 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-pl1-x642.google.com (mail-pl1-x642.google.com [IPv6:2607:f8b0:4864:20::642]) by gabe.freedesktop.org (Postfix) with ESMTPS id A5BB86E28E for ; Fri, 4 Sep 2020 08:17:13 +0000 (UTC) Received: by mail-pl1-x642.google.com with SMTP id l9so800412plt.8 for ; Fri, 04 Sep 2020 01:17:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=idein-jp.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=IsU/lTesxrJHtJsifPoUQaikOUBIO2uCBbf1RwnYScs=; b=F7jbJ5UIgSL9mD6ha15CKCm8vi8hPNFUgMyauBFEqN8Ech1vqH6vCHIR4c70zxdgzD HWhYh1wZHt62z3xSWD/UBqougIfmJc3+OpZ7b4A7hB5nJg/Ic+YfpTWLu+D7SXlSCpmv Bpw6tYfh+DiGrWx98y+QxjUTilD0GySEV+fWJMp9ZA7Ze2/jj5S2DfE8UurmH2jrk45g rc355y5W3kUl+Rhj1/Gn76oav1vHxO//xffN0oxmgKiHhiI/s5Bt1/JEvM9KEWLajdGq 5dgpO4zbq6KEKzhkAWpc68zmIuM76aMFjhVTlkmjB6jTP40JTMHPHkUj31KXBKbnpJjs yVGw== 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:mime-version:content-transfer-encoding; bh=IsU/lTesxrJHtJsifPoUQaikOUBIO2uCBbf1RwnYScs=; b=WPecUOptI18Luyyl577rapqrdoG4uIl+rDdFxOiG+cvkLHBfbqojYqqKNjZN8ZIYZG WJhJ9i/QeJnwjBzceEovx5YknPyumR6ASroSQwt9TzeB3hO/qyl1ps4qhDR4ENUpmVt5 p2KcIz5lUzgQdgBhc7CCkb3aEClLS85g1um1YtwCbDQjt9PJ3nKAa8r9AQ9Yl52Z0J8n hoJRmGOQFfEIm4Xy2HLIn8W4EjsRW6w1vLeQMI8qkQ67Z7MYVJE4wJD9F70NVqVKkJSg gjZZfsa0+StxL1D3cUph3+TIPj4cfMJMuM4AkzfFuNH3FGcGMAzOmWFLKojZvOLl8CQd sy5Q== X-Gm-Message-State: AOAM530iPl+J/CPxZ9gGkM2KzgfcSPLF0/JdMNgsQIuP7iYMdpNdnAAq igaIVN98k0X+OkE9WFgE2RT5jzbz42tgkx0kRQ== X-Google-Smtp-Source: ABdhPJwEkVQhOUuGRtt6sntpPjOqXjCmFM3D+15S2FI6gGkgEZOrmfj8sBfobukjSV26I37I3A0iEw== X-Received: by 2002:a17:90a:aa8e:: with SMTP id l14mr7435155pjq.67.1599207432898; Fri, 04 Sep 2020 01:17:12 -0700 (PDT) Received: from localhost.localdomain (i220-221-200-167.s41.a008.ap.plala.or.jp. [220.221.200.167]) by smtp.googlemail.com with ESMTPSA id i16sm20202630pjv.0.2020.09.04.01.17.10 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Fri, 04 Sep 2020 01:17:12 -0700 (PDT) From: Yukimasa Sugizaki To: dri-devel@lists.freedesktop.org Subject: [PATCH 3/3] drm/v3d: Add job timeout module param Date: Fri, 4 Sep 2020 17:15:53 +0900 Message-Id: <20200904081552.38052-4-ysugi@idein.jp> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200904081552.38052-1-ysugi@idein.jp> References: <20200904081552.38052-1-ysugi@idein.jp> MIME-Version: 1.0 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: , Cc: David Airlie , Yukimasa Sugizaki Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" The default timeout is 500 ms which is too short for some workloads including Piglit. Adding this parameter will help users to run heavier tasks. Signed-off-by: Yukimasa Sugizaki --- drivers/gpu/drm/v3d/v3d_sched.c | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) -- 2.7.4 diff --git a/drivers/gpu/drm/v3d/v3d_sched.c b/drivers/gpu/drm/v3d/v3d_sched.c index feef0c749e68..983efb018560 100644 --- a/drivers/gpu/drm/v3d/v3d_sched.c +++ b/drivers/gpu/drm/v3d/v3d_sched.c @@ -19,11 +19,17 @@ */ #include +#include #include "v3d_drv.h" #include "v3d_regs.h" #include "v3d_trace.h" +static uint timeout = 500; +module_param(timeout, uint, 0444); +MODULE_PARM_DESC(timeout, + "Timeout for a job in ms (0 means infinity and default is 500 ms)"); + static struct v3d_job * to_v3d_job(struct drm_sched_job *sched_job) { @@ -432,13 +438,13 @@ v3d_sched_init(struct v3d_dev *v3d) { int hw_jobs_limit = 1; int job_hang_limit = 0; - int hang_limit_ms = 500; + long timeout_jiffies = timeout ? + msecs_to_jiffies(timeout) : MAX_SCHEDULE_TIMEOUT; int ret; ret = drm_sched_init(&v3d->queue[V3D_BIN].sched, &v3d_bin_sched_ops, - hw_jobs_limit, job_hang_limit, - msecs_to_jiffies(hang_limit_ms), + hw_jobs_limit, job_hang_limit, timeout_jiffies, "v3d_bin"); if (ret) { dev_err(v3d->drm.dev, "Failed to create bin scheduler: %d.", ret); @@ -447,8 +453,7 @@ v3d_sched_init(struct v3d_dev *v3d) ret = drm_sched_init(&v3d->queue[V3D_RENDER].sched, &v3d_render_sched_ops, - hw_jobs_limit, job_hang_limit, - msecs_to_jiffies(hang_limit_ms), + hw_jobs_limit, job_hang_limit, timeout_jiffies, "v3d_render"); if (ret) { dev_err(v3d->drm.dev, "Failed to create render scheduler: %d.", @@ -459,8 +464,7 @@ v3d_sched_init(struct v3d_dev *v3d) ret = drm_sched_init(&v3d->queue[V3D_TFU].sched, &v3d_tfu_sched_ops, - hw_jobs_limit, job_hang_limit, - msecs_to_jiffies(hang_limit_ms), + hw_jobs_limit, job_hang_limit, timeout_jiffies, "v3d_tfu"); if (ret) { dev_err(v3d->drm.dev, "Failed to create TFU scheduler: %d.", @@ -472,8 +476,7 @@ v3d_sched_init(struct v3d_dev *v3d) if (v3d_has_csd(v3d)) { ret = drm_sched_init(&v3d->queue[V3D_CSD].sched, &v3d_csd_sched_ops, - hw_jobs_limit, job_hang_limit, - msecs_to_jiffies(hang_limit_ms), + hw_jobs_limit, job_hang_limit, timeout_jiffies, "v3d_csd"); if (ret) { dev_err(v3d->drm.dev, "Failed to create CSD scheduler: %d.", @@ -484,8 +487,7 @@ v3d_sched_init(struct v3d_dev *v3d) ret = drm_sched_init(&v3d->queue[V3D_CACHE_CLEAN].sched, &v3d_cache_clean_sched_ops, - hw_jobs_limit, job_hang_limit, - msecs_to_jiffies(hang_limit_ms), + hw_jobs_limit, job_hang_limit, timeout_jiffies, "v3d_cache_clean"); if (ret) { dev_err(v3d->drm.dev, "Failed to create CACHE_CLEAN scheduler: %d.",