From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-12.8 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2F6AFC28E83 for ; Fri, 4 Sep 2020 07:12:18 +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 E51AC206D4 for ; Fri, 4 Sep 2020 07:12:17 +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="10qKDtDh" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org E51AC206D4 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 97DEE6EAAB; Fri, 4 Sep 2020 07:11:35 +0000 (UTC) Received: from mail-pf1-x442.google.com (mail-pf1-x442.google.com [IPv6:2607:f8b0:4864:20::442]) by gabe.freedesktop.org (Postfix) with ESMTPS id 2BB0A6E202 for ; Thu, 3 Sep 2020 16:49:26 +0000 (UTC) Received: by mail-pf1-x442.google.com with SMTP id f18so2772432pfa.10 for ; Thu, 03 Sep 2020 09:49:26 -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=+yb8hoZtskHzNjveRfuAP0h+6punyflsDh2kuJbWG58=; b=10qKDtDhWG53ztWXB9FdVsqU1Cr/G4Ah6xK9585E49E37PtE8erHQztqfiAg4j8DNj 863AuV5ZGunrSM7SS4DDUmnE9VzMS2AM1fBF9efQq9GRujRFwUHKVZ+jChhBjWpEGCyK BscZPfPgGgVinrPsRBmHgp882hUVQJWnAZImJkWb2eaNB4XacQp/zTSmopGrr/mDHCyU kc/rQ0PRiKr2kyVD3QqcDYup3gdMUgf7IUlLX936VWSFR/HPpCd29KhiDu1UisrX5sKv QssRz8uF/YWHVLgKGk/8pXEdowgrnAi8k/Tm/Zcb99GYeGqgSnuLunobaZRUJBMkYKCb Bk4w== 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=+yb8hoZtskHzNjveRfuAP0h+6punyflsDh2kuJbWG58=; b=UrKSoJ1Zwl32YeAfntsXo1SSXLNqefu15CcZOEiN7Tab9izepkH5WgIt2G7CQJimhX uHHdyLi3z+DpyprManIO2pjXz7StTOmCSiTtI2vN7rfTlRefLIYr6sxk1g86LnnnJSBX 2I0KJqyFoCyz02xE9B7KTIbeijIuD8xgEKDir30sum+aO+gLK3FI6n+UW7QSb8XpaBdg NqDsVF2N2l+OwutsHcTQ19naqJf9MdEib6NoDDH2RU8bkEs+3oFBGaJGESyTIMcJDPgI 0V2mMQy9TN/8WOZW06uZhZ9Mf/OjxzhJrUPiL1wF0lprW5HQ6CrhWOHrDJABDD2EwGC6 zxHw== X-Gm-Message-State: AOAM5324i69qALeG+qX5t1cQQj0cSjs4yFJBa35S/H/trqiXpzJMsj5D jxGIRI+7F75zRBI0uo4y9ODa3yfTHKemvGs= X-Google-Smtp-Source: ABdhPJxcWynpg53+rkz8YHfacxSAefCvnxu58Ha9bQWNEGqtSJUJPWA5kTQulhi1awUeHqkqNDOGGw== X-Received: by 2002:a63:cc49:: with SMTP id q9mr3588094pgi.390.1599151765272; Thu, 03 Sep 2020 09:49:25 -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 mw8sm2897411pjb.47.2020.09.03.09.49.22 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Thu, 03 Sep 2020 09:49:24 -0700 (PDT) From: Yukimasa Sugizaki X-Google-Original-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 01:48:19 +0900 Message-Id: <20200903164821.2879-2-i.can.speak.c.and.basic@gmail.com> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200903164821.2879-1-i.can.speak.c.and.basic@gmail.com> References: <20200903164821.2879-1-i.can.speak.c.and.basic@gmail.com> MIME-Version: 1.0 X-Mailman-Approved-At: Fri, 04 Sep 2020 07:11:29 +0000 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 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" From: Yukimasa Sugizaki 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(+) 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); -- 2.7.4 _______________________________________________ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel