Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp1556959ybt; Thu, 18 Jun 2020 11:25:58 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxh0hitvJM3nUnYqvbbH/RbJvAY0iqWs3Imrusy80bbIOIW/Hr3uKlMruY47IASGnRrFEwt X-Received: by 2002:aa7:c2c4:: with SMTP id m4mr5153296edp.299.1592504758524; Thu, 18 Jun 2020 11:25:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1592504758; cv=none; d=google.com; s=arc-20160816; b=QFRQyIvLE3Ic8IqLZYV8H92p3PIFgUZpqC4+z7/m9DShsr5W3PZ8raS15I5YsP6TH5 QSIeUXDQwtcO2YIWtFAVXwNAW6916A3PIr5y7rtVx0ZP6TBvjOzYy3B76Fr4gmOtec+3 1lWRRDT3p3DKi53SW3h6rVpUbqrs50n+kwD06iaV90HmDK5fFP5ylAYK7/AlqkbEMQ9n BELXWaLTAd0uYWHFTe9PvjA+G63J2CPLyBjUg4vfYRea7P2lhOKUc+ZcEEtXEzzmyyiE giOZM7Ye0RuHezhxwute7fd8p50vmD7gC8UH8a6DWfBfhbJlfsXgk9eIK5PPZrRvSLvu C1UQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=jD/vaqPgqn/GbyEshdpFayy0rmaV/B8hrtCZ/Jh2OJE=; b=lIhs/YVInvygFY6RKzJvS20fMBbsne3qV/PR7a/SXV6bxUHTNQzP6g6og8AIhrKs7z xe9T0vrv5SP/2JMj2rfYfU0xU9I4gXSgLA6kKnjJzMZNv4H86R6NgJvpCAIF3yLSYTyY RFuBDFuc8FdNpNqoRxarzV1D0LRh85IgycKIS3RjwAExO3eBvQA+jH047H8waeFcxk9W fDHUPb3IGnBqc8Zm55LVZta8T678qec8NeuGvw7T1vZlh6cXAaRs+fGwbcY6L2YNd8Qj 7UY80UOC+PPSzMoNycqeEFQxCdaiAbYjglvYDNo0JteyKq0BMoF4q1LKGsVXAyeCgD7V 8mpg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=MUhjuTRE; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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. [23.128.96.18]) by mx.google.com with ESMTP id wp10si2307876ejb.56.2020.06.18.11.25.35; Thu, 18 Jun 2020 11:25:58 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=MUhjuTRE; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 S1728979AbgFRO6y (ORCPT + 99 others); Thu, 18 Jun 2020 10:58:54 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59718 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726382AbgFRO6w (ORCPT ); Thu, 18 Jun 2020 10:58:52 -0400 Received: from mail-wr1-x442.google.com (mail-wr1-x442.google.com [IPv6:2a00:1450:4864:20::442]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 749B5C06174E for ; Thu, 18 Jun 2020 07:58:52 -0700 (PDT) Received: by mail-wr1-x442.google.com with SMTP id e1so6405096wrt.5 for ; Thu, 18 Jun 2020 07:58:52 -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 :mime-version:content-transfer-encoding; bh=jD/vaqPgqn/GbyEshdpFayy0rmaV/B8hrtCZ/Jh2OJE=; b=MUhjuTRE41q8DNA4MiAfGDVi5SKnOjfYcFcOhQx7Q0shrPeqQgpSkt8vNdagw81CtD lWLMX4+/HZFFKq9CRKzRPyqosy7lw1AjTREEIydy8HM7KhD0t5cCYtapY8p+iKvwIrJU 7Y88sQstzp0ZvxbnwwQ/GnOgH5HrC0o3bQQGhF1y9V/l2jWwfjAyYqDJ0mEp/rMQv6Bv 4Ijzapji4+JZXd8P9bxQJK/BbyzgGnHZJ85AWAhCegMt6uaB13sZTFWoihMIAObxx9kA VnN/1RVFtOzFZJfnVmAtV2Nbbt8eJXjLOLPUk1vH1u2XdGfLw7QjcUBdogC9RiXY3BIR g9YA== 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=jD/vaqPgqn/GbyEshdpFayy0rmaV/B8hrtCZ/Jh2OJE=; b=FgQYa6ea5x+j1lPrr1GMbDvzMNoccMTEbjyXl5KPRXpfevabZ31iSvqj51DYvSUmgd dlAvLe9itdKlKDVxfnwwynMfXPR9fyjciTjZVjpoViWmJ9ScyMGvlkcpsbrtXtqKLl+D uTicvfF88hVCKlXuzSsFDljPdpiUW8rCkiZsDH2JGyEtY77tn4+geybFWYIdkBgnKnuS BwIiOUuX+0lwjL+6tNeGYpIAA8kgBOdblIiP4XwkrD+ZmsudVtMUCs6ar0bfq+aDGXCT VhCTUc9E7Zck25IBWCJPMrLFmEwZW3E/MjfEUyPJ6G3AeIt7v9vFyJhQm451SaCXsGyd GSYA== X-Gm-Message-State: AOAM533aMNDRPC1wdHj/3p6EscLxYZFSIlJX2ye9J/0u/mUH+pJrTVz7 kPO67W1DK3nEwU7OarrOQ6U= X-Received: by 2002:adf:e2c9:: with SMTP id d9mr4969310wrj.227.1592492331224; Thu, 18 Jun 2020 07:58:51 -0700 (PDT) Received: from kedthinkpad.tpwlan.net ([213.197.144.54]) by smtp.gmail.com with ESMTPSA id e2sm1941346wrt.76.2020.06.18.07.58.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 18 Jun 2020 07:58:50 -0700 (PDT) From: Andrey Lebedev To: Qiang Yu , David Airlie , Daniel Vetter , dri-devel@lists.freedesktop.org, lima@lists.freedesktop.org, linux-kernel@vger.kernel.org Cc: andrey@lebedev.lt, kernel test robot Subject: [PATCH] drm/lima: Expose job_hang_limit module parameter Date: Thu, 18 Jun 2020 17:58:38 +0300 Message-Id: <20200618145838.2956591-1-andrey.lebedev@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Andrey Lebedev Some pp or gp jobs can be successfully repeated even after they time outs. Introduce lima module parameter to specify number of times a job can hang before being dropped. Signed-off-by: Andrey Lebedev --- Fixes for the embarrassing build error Reported-by: kernel test robot drivers/gpu/drm/lima/lima_drv.c | 4 ++++ drivers/gpu/drm/lima/lima_drv.h | 1 + drivers/gpu/drm/lima/lima_sched.c | 5 +++-- 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/lima/lima_drv.c b/drivers/gpu/drm/lima/lima_drv.c index a831565af813..2400b8d52d92 100644 --- a/drivers/gpu/drm/lima/lima_drv.c +++ b/drivers/gpu/drm/lima/lima_drv.c @@ -19,6 +19,7 @@ int lima_sched_timeout_ms; uint lima_heap_init_nr_pages = 8; uint lima_max_error_tasks; +uint lima_job_hang_limit; MODULE_PARM_DESC(sched_timeout_ms, "task run timeout in ms"); module_param_named(sched_timeout_ms, lima_sched_timeout_ms, int, 0444); @@ -29,6 +30,9 @@ module_param_named(heap_init_nr_pages, lima_heap_init_nr_pages, uint, 0444); MODULE_PARM_DESC(max_error_tasks, "max number of error tasks to save"); module_param_named(max_error_tasks, lima_max_error_tasks, uint, 0644); +MODULE_PARM_DESC(job_hang_limit, "number of times to allow a job to hang before dropping it (default 0)"); +module_param_named(job_hang_limit, lima_job_hang_limit, int, 0444); + static int lima_ioctl_get_param(struct drm_device *dev, void *data, struct drm_file *file) { struct drm_lima_get_param *args = data; diff --git a/drivers/gpu/drm/lima/lima_drv.h b/drivers/gpu/drm/lima/lima_drv.h index fdbd4077c768..c738d288547b 100644 --- a/drivers/gpu/drm/lima/lima_drv.h +++ b/drivers/gpu/drm/lima/lima_drv.h @@ -11,6 +11,7 @@ extern int lima_sched_timeout_ms; extern uint lima_heap_init_nr_pages; extern uint lima_max_error_tasks; +extern uint lima_job_hang_limit; struct lima_vm; struct lima_bo; diff --git a/drivers/gpu/drm/lima/lima_sched.c b/drivers/gpu/drm/lima/lima_sched.c index e6cefda00279..1602985dfa04 100644 --- a/drivers/gpu/drm/lima/lima_sched.c +++ b/drivers/gpu/drm/lima/lima_sched.c @@ -503,8 +503,9 @@ int lima_sched_pipe_init(struct lima_sched_pipe *pipe, const char *name) INIT_WORK(&pipe->recover_work, lima_sched_recover_work); - return drm_sched_init(&pipe->base, &lima_sched_ops, 1, 0, - msecs_to_jiffies(timeout), name); + return drm_sched_init(&pipe->base, &lima_sched_ops, 1, + lima_job_hang_limit, msecs_to_jiffies(timeout), + name); } void lima_sched_pipe_fini(struct lima_sched_pipe *pipe) -- 2.25.1