Received: by 2002:a05:7412:5112:b0:fa:6e18:a558 with SMTP id fm18csp868617rdb; Tue, 23 Jan 2024 19:03:06 -0800 (PST) X-Google-Smtp-Source: AGHT+IGbWztxTVjaQX5OsWiEOdB+PNI8rGgIoaPkDIIIShbMDdylgA4KgSFipczsk9G/hi48V1P1 X-Received: by 2002:a17:906:f148:b0:a30:b37f:4d76 with SMTP id gw8-20020a170906f14800b00a30b37f4d76mr384606ejb.109.1706065386504; Tue, 23 Jan 2024 19:03:06 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706065386; cv=pass; d=google.com; s=arc-20160816; b=kfZbY1ogTqnbBySwGGyuDmpCQHx2rcOuS2udYrULVUowr6kqhqTJfylWdY5veMXee+ li554/tX08UlL4jBUbTn435PMjoe8yhTjyNbfn7k80ZeGZh6s7nrJgOdLkaVcwF3rg1H UgFmpV0zgZBqIs2yrXNRoaAsxWpEyYgXdUkEnNZBWpJlTTOzar1HshLXttGtovjzLczH 2Q89KZ6o+bKls4iVYdgaFW+uFzG1Pksy65Q1xKFNURlOD9ApBpEZ72OJPtPb8wjRxTh1 Rn05bYLF5dLmHLQlaSOHUlgZMUgd3e1efoDOJmmzHS8EnAcLgWL5PdU9ipP7CgfR7rwh Nxfg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=CPOuKECiwusygEzLYMH/0TGCGdxpS/EWgBvieVarlTc=; fh=ZATWbw1ckX/b/NMeD3w5zBmTW7Tllx597BFkkpq0f/4=; b=vTG04X5PBr5HiwQKoMTsKEwJN33Je6TGe6OzezJP5Wuyh/oOQp7P10fJz4czGX5cHK K6iQhfqx0G+TFAU4WEyduqy97+YXWaP0mDzzrP8bTE6s6xG+iIHA72pdBOHtJiYHdV8t B73cbm2BuTZr/qOdMfYjLxwV119gRUv5kTNJYhVhDTviGeNVmq57Yjhc4e9U7BpAUU6n tV3OPClEbZB+9zrxIDfXA0JTToB+7ubZvEO04i52DMOxLyRmBjXV6u0loFu4YUDK7oKs AQ2VTIbM/Y3UE0zVczwWh0kqzEnEaFwLdiM50BuEILDAjktI6hunUXiZd7rWPQOvy+pi ALkg== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=EgXtL6ly; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-36375-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-36375-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id k21-20020a170906129500b00a28b71df9e8si12713570ejb.683.2024.01.23.19.03.06 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 23 Jan 2024 19:03:06 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-36375-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=EgXtL6ly; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-36375-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-36375-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id C84891F25BC0 for ; Wed, 24 Jan 2024 03:01:35 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id F28B1101CA; Wed, 24 Jan 2024 03:00:18 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="EgXtL6ly" Received: from mail-wm1-f50.google.com (mail-wm1-f50.google.com [209.85.128.50]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 474F4DDD6 for ; Wed, 24 Jan 2024 03:00:16 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.50 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706065218; cv=none; b=Mmrf0m+BUzcdw+msAxcJCbPclxngrcUhRUTVwQj6N2d0BarChm36RSBrtqODnGVfbrF/6x+RBGWNItBoMp1T+i463sTXaikC556qNQ7Dnl42lkRqRc4oyQM82QWSHplgxgqOAwmyPTtZ15O5VAMLUxTZ9jxACLIg9F4NZF4JnIo= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706065218; c=relaxed/simple; bh=CAAyd6m6zHz9mQ5m5c51BGdzwELNqXW4ebqMAmJGEBE=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=c+hac85C6sfkMhT7DyDbK45m9URhN+JfMi9Nfx43tqm2nVoTElGeZwbLRU1soI0zIubFVI1AG4XNsQs6202TsJYXqg5gCDwTFEV3erHNOgVgAVH6SLQVLjnmZDJcgz4SlJOsSDwLEfTu9gE2e4ofq62Ck9UsmbpoC1oVmloiGOE= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=EgXtL6ly; arc=none smtp.client-ip=209.85.128.50 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-wm1-f50.google.com with SMTP id 5b1f17b1804b1-40eb99a72dcso14183315e9.1 for ; Tue, 23 Jan 2024 19:00:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1706065214; x=1706670014; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=CPOuKECiwusygEzLYMH/0TGCGdxpS/EWgBvieVarlTc=; b=EgXtL6lyP/SnIbHjYdglYO8uOyygJM53ibpBl4MZkwObBHC2PtuLMpGSlpA9XNLzgd W7e4yi0T97LzPhnEH1MsyQrbJvA/aAxWmgZDkDT3OMiFPgRvv0L4ncIHIRgvHbtogXZO 6eO6ROPsOw3jobbsXO1vgQpJf9qtUPDr6vC+E89YiFZr/3hiimOc8Ly8VpiUmWCMUftE Q1BIekkQIDsN3hkaGak2EYgGeu0ArE46Ncig35dEp0H8tkWR4kWE1vAtLRYQhU0QRVRP ONbZlqd5wl0gORT6Ka8s/KxQ4CahqwZTpQ1BBvmp6wIvD3AZMbMwjEdzrdeBqIzkXlIA 91DA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1706065214; x=1706670014; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=CPOuKECiwusygEzLYMH/0TGCGdxpS/EWgBvieVarlTc=; b=O/oDRg1W8YBWqE5sELz16D5ZiVUlhxLRzVRorvmXQEzhTThuSZahrAIlwh0HNeyWZM rzDes0Ew/uoIUkeg6soVPU+/4Qi70mRW8wr8/LRyIswZ8CTX8x/EZKj3cIKiBWQUYRAy dShXeOvJsLw3peOO1sfJFLweoIw99ZzdgLgPlTD6b4I3y6vgq1H6rgC0/S2f+mm3GLz7 pnaJniEh6rQHXk7FIqiAMs7DiDMyaXZVB6aBrjPjrFcZn7kFXnmy8fbDMKZGoLgLd7TO xf7R4A8RzoCE2RHrENJtgnwwYEcVEHg/8IzxY8xRnzjaQ6qBlsLmFuY6/fsaKshfdUwt bIqQ== X-Gm-Message-State: AOJu0YzEpeFWaeqhtytWVIAwi2fBz7dOyBuVnfHaRebecHAc3pXS1DVZ 4SGzBaqsX3LbCJuU/cLd8lzb4y0GTwYnxW8TApieTOHcGmdhnCH+ X-Received: by 2002:a05:600c:45c9:b0:40e:6238:e9e8 with SMTP id s9-20020a05600c45c900b0040e6238e9e8mr642304wmo.1.1706065214435; Tue, 23 Jan 2024 19:00:14 -0800 (PST) Received: from mosaic.enunes.eu (ip-78-45-66-209.bb.vodafone.cz. [78.45.66.209]) by smtp.gmail.com with ESMTPSA id dj17-20020a05640231b100b00559bb146ecbsm9637914edb.6.2024.01.23.19.00.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 23 Jan 2024 19:00:13 -0800 (PST) From: Erico Nunes To: Qiang Yu , anarsoul@gmail.com, christian.koenig@amd.com, dri-devel@lists.freedesktop.org, lima@lists.freedesktop.org Cc: Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Daniel Vetter , Sumit Semwal , linux-kernel@vger.kernel.org, Erico Nunes Subject: [PATCH v2 6/8] drm/lima: remove guilty drm_sched context handling Date: Wed, 24 Jan 2024 03:59:45 +0100 Message-ID: <20240124025947.2110659-7-nunes.erico@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240124025947.2110659-1-nunes.erico@gmail.com> References: <20240124025947.2110659-1-nunes.erico@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Marking the context as guilty currently only makes the application which hits a single timeout problem to stop its rendering context entirely. All jobs submitted later are dropped from the guilty context. Lima runs on fairly underpowered hardware for modern standards and it is not entirely unreasonable that a rendering job may time out occasionally due to high system load or too demanding application stack. In this case it would be generally preferred to report the error but try to keep the application going. Other similar embedded GPU drivers don't make use of the guilty context flag. Now that there are reliability improvements to the lima timeout recovery handling, drop the guilty contexts to let the application keep running in this case. Signed-off-by: Erico Nunes Acked-by: Christian König Reviewed-by: Vasily Khoruzhick --- drivers/gpu/drm/lima/lima_ctx.c | 2 +- drivers/gpu/drm/lima/lima_ctx.h | 1 - drivers/gpu/drm/lima/lima_sched.c | 5 ++--- drivers/gpu/drm/lima/lima_sched.h | 3 +-- 4 files changed, 4 insertions(+), 7 deletions(-) diff --git a/drivers/gpu/drm/lima/lima_ctx.c b/drivers/gpu/drm/lima/lima_ctx.c index 8389f2d7d021..0e668fc1e0f9 100644 --- a/drivers/gpu/drm/lima/lima_ctx.c +++ b/drivers/gpu/drm/lima/lima_ctx.c @@ -19,7 +19,7 @@ int lima_ctx_create(struct lima_device *dev, struct lima_ctx_mgr *mgr, u32 *id) kref_init(&ctx->refcnt); for (i = 0; i < lima_pipe_num; i++) { - err = lima_sched_context_init(dev->pipe + i, ctx->context + i, &ctx->guilty); + err = lima_sched_context_init(dev->pipe + i, ctx->context + i); if (err) goto err_out0; } diff --git a/drivers/gpu/drm/lima/lima_ctx.h b/drivers/gpu/drm/lima/lima_ctx.h index 74e2be09090f..5b1063ce968b 100644 --- a/drivers/gpu/drm/lima/lima_ctx.h +++ b/drivers/gpu/drm/lima/lima_ctx.h @@ -13,7 +13,6 @@ struct lima_ctx { struct kref refcnt; struct lima_device *dev; struct lima_sched_context context[lima_pipe_num]; - atomic_t guilty; /* debug info */ char pname[TASK_COMM_LEN]; diff --git a/drivers/gpu/drm/lima/lima_sched.c b/drivers/gpu/drm/lima/lima_sched.c index 814428564637..c2e78605e43e 100644 --- a/drivers/gpu/drm/lima/lima_sched.c +++ b/drivers/gpu/drm/lima/lima_sched.c @@ -154,13 +154,12 @@ void lima_sched_task_fini(struct lima_sched_task *task) } int lima_sched_context_init(struct lima_sched_pipe *pipe, - struct lima_sched_context *context, - atomic_t *guilty) + struct lima_sched_context *context) { struct drm_gpu_scheduler *sched = &pipe->base; return drm_sched_entity_init(&context->base, DRM_SCHED_PRIORITY_NORMAL, - &sched, 1, guilty); + &sched, 1, NULL); } void lima_sched_context_fini(struct lima_sched_pipe *pipe, diff --git a/drivers/gpu/drm/lima/lima_sched.h b/drivers/gpu/drm/lima/lima_sched.h index 6a11764d87b3..6bd4f3b70109 100644 --- a/drivers/gpu/drm/lima/lima_sched.h +++ b/drivers/gpu/drm/lima/lima_sched.h @@ -91,8 +91,7 @@ int lima_sched_task_init(struct lima_sched_task *task, void lima_sched_task_fini(struct lima_sched_task *task); int lima_sched_context_init(struct lima_sched_pipe *pipe, - struct lima_sched_context *context, - atomic_t *guilty); + struct lima_sched_context *context); void lima_sched_context_fini(struct lima_sched_pipe *pipe, struct lima_sched_context *context); struct dma_fence *lima_sched_context_queue_task(struct lima_sched_task *task); -- 2.43.0