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=-20.2 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,MENTIONS_GIT_HOSTING,NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED,USER_AGENT_SANE_1 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 301F3C433DB for ; Thu, 4 Feb 2021 14:18:09 +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 8EF5F64F3F for ; Thu, 4 Feb 2021 14:18:06 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 8EF5F64F3F Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=igalia.com 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 DED6D6ED85; Thu, 4 Feb 2021 14:18:05 +0000 (UTC) X-Greylist: delayed 1420 seconds by postgrey-1.36 at gabe; Thu, 04 Feb 2021 14:18:04 UTC Received: from fanzine.igalia.com (fanzine.igalia.com [178.60.130.6]) by gabe.freedesktop.org (Postfix) with ESMTPS id 774816ED85 for ; Thu, 4 Feb 2021 14:18:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=igalia.com; s=20170329; h=Content-Transfer-Encoding:Content-Type:In-Reply-To:MIME-Version:Date:Message-ID:From:References:Cc:To:Subject; bh=Wd62viddt+iw8X6Ld4I3X5EG1RRTcCilLHqUFE853sI=; b=LFCseJJQP/UUqXtSVTwIsLQ/WuIewIiAnGpFhS8SXQMvy5EBNMVDu14uSobCR0zFydS1wqNaIa25T44SSCmOemZGj5wjYLhqk6qYvXRRtC4UTyIUOq7zcf5FCqJOe1QTcVq7ne1vg7ssw367rUjF167wt7M/3VA8Iho5ie6NDXCN7t1d2kafsYZXCPxcKmtpymG5wFNt8X0Tcxun1pr8sutUEHd1zk3DwZW+whadW1b7AI0W7XcorpKZP9xQ7Pke1nzSHyTRpk1FvNNVUSUVVzfkriVK4qPRySQ7gp82yS4tBJ/897oX4W5xy5e8lHZVPa2Wci/A9q/5+FMUE8dPMw==; Received: from 91.34.165.83.dynamic.reverse-mundo-r.com ([83.165.34.91] helo=[192.168.50.10]) by fanzine.igalia.com with esmtpsa (Cipher TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim) id 1l7f5Q-0003Gj-Me; Thu, 04 Feb 2021 14:54:20 +0100 Subject: Re: [PATCH 1/3] drm/v3d: Don't resubmit guilty CSD jobs To: Yukimasa Sugizaki , dri-devel@lists.freedesktop.org References: <20200903164821.2879-1-i.can.speak.c.and.basic@gmail.com> <20200903164821.2879-2-i.can.speak.c.and.basic@gmail.com> From: Chema Casanova Message-ID: Date: Thu, 4 Feb 2021 14:54:11 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.7.0 MIME-Version: 1.0 In-Reply-To: <20200903164821.2879-2-i.can.speak.c.and.basic@gmail.com> Content-Language: en-US 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 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="us-ascii"; Format="flowed" Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" I've tested the patch and confirmed that applies correctly over drm-next. I've also confirmed that the timeout happens with the described test case by the developer. https://github.com/raspberrypi/linux/pull/3816#issuecomment-682251862 Considering this is my first review of a patch in v3d kernel side I think this patch is fine. Reviewed-by: Jose Maria Casanova Crespo On 3/9/20 18:48, Yukimasa Sugizaki wrote: > 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 > _______________________________________________ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel