Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp269836imu; Thu, 8 Nov 2018 08:05:49 -0800 (PST) X-Google-Smtp-Source: AJdET5dF20kYpGL/cJtq3ITagf7g37Req0geVhWXopIFThtmtcScveaKpDx1boV2PFn/+/ACqolO X-Received: by 2002:a17:902:5a09:: with SMTP id q9-v6mr5137660pli.186.1541693149392; Thu, 08 Nov 2018 08:05:49 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1541693149; cv=none; d=google.com; s=arc-20160816; b=TiWOk5uyoUvAwcc7Ny8+VCHb73owQN8sYT22m65ou56LXSX3bblc3VQiLFQB5FKTpV ThC+rFIFEGUovYa7z5R4fSBYznjsHmZbKTEYjLNx4rm4V22lCbvS6z6UYQ6c1qbf7MW4 vc6NYYXL3xzwFviufy8iQm1UhajhCIXYnx9DT9GA22/jg8fzf31gNrnUJrXeYDRgfdMn wcw1GUph7oA8ZGh9+3TcUAgZNhgDCyT7V5V7aUzZ0A0KedHkPR54n22RyWgCydeH+CnO ADzyFHbPuIUZudP8Y1R3zXzDsvxm6t14qldFX9nGeSl6V2WAe8+nTVJoY+1NnxrWpLe/ MHPQ== 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; bh=kPZKIoDOV+ycd4h9ISV6cq6LLQqKDsSUCvmFlhr2d0s=; b=d+L+JHDrbCTGjoNwA9EUVkYIFYIxQlnfo6tg3TynBMwNv6NPqK/c6+hoZ5LlrvWHNR R4+FAewTix49/G4aESfB044R9pxGxsCatRfjYe/T2kHd/FswEQgP9+m9j+gJIUk/3UyJ ZqxtfHdQmyXaIZrU0CtclG0z7bIbx/Y5bs/k92XBX9Ov24E0CI+64QyGFeDDmB1OVhQK wfs2JOShzioc1/Gi5OXfkj9S/t43WkfIBQeWoz9HksFW6/G/Pu3LQnLMO0oVg0KQ4WLS Djs3rXVhRgNBAo/79oUmWK8KkX25O+8gYI0kSNE+LTdR/gveKKtS3TGKEBvxPk2m0cV+ +JVA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id u9si4173657pgu.570.2018.11.08.08.05.19; Thu, 08 Nov 2018 08:05:49 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727434AbeKIBke (ORCPT + 99 others); Thu, 8 Nov 2018 20:40:34 -0500 Received: from anholt.net ([50.246.234.109]:33198 "EHLO anholt.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726738AbeKIBke (ORCPT ); Thu, 8 Nov 2018 20:40:34 -0500 Received: from localhost (localhost [127.0.0.1]) by anholt.net (Postfix) with ESMTP id 13C3D10A1314; Thu, 8 Nov 2018 08:04:25 -0800 (PST) X-Virus-Scanned: Debian amavisd-new at anholt.net Received: from anholt.net ([127.0.0.1]) by localhost (kingsolver.anholt.net [127.0.0.1]) (amavisd-new, port 10024) with LMTP id CLRm8vxMDk-K; Thu, 8 Nov 2018 08:04:23 -0800 (PST) Received: from eliezer.anholt.net (localhost [127.0.0.1]) by anholt.net (Postfix) with ESMTP id 1076E10A04D0; Thu, 8 Nov 2018 08:04:23 -0800 (PST) Received: by eliezer.anholt.net (Postfix, from userid 1000) id 511812FE1B8E; Thu, 8 Nov 2018 08:04:22 -0800 (PST) From: Eric Anholt To: dri-devel@lists.freedesktop.org Cc: linux-kernel@vger.kernel.org, Eric Anholt , =?UTF-8?q?Christian=20K=C3=B6nig?= , Nayan Deshmukh , Alex Deucher Subject: [PATCH 1/2] Revert "drm/sched: fix timeout handling v2" Date: Thu, 8 Nov 2018 08:04:21 -0800 Message-Id: <20181108160422.17743-2-eric@anholt.net> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20181108160422.17743-1-eric@anholt.net> References: <20181108160422.17743-1-eric@anholt.net> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This reverts commit 0efd2d2f68cd5dbddf4ecd974c33133257d16a8e. Fixes this failure in V3D GPU reset: [ 1418.227796] Unable to handle kernel NULL pointer dereference at virtual address 00000018 [ 1418.235947] pgd = dc4c55ca [ 1418.238695] [00000018] *pgd=80000040004003, *pmd=00000000 [ 1418.244132] Internal error: Oops: 206 [#1] SMP ARM [ 1418.248934] Modules linked in: [ 1418.252001] CPU: 0 PID: 10253 Comm: kworker/0:0 Not tainted 4.19.0-rc6+ #486 [ 1418.259058] Hardware name: Broadcom STB (Flattened Device Tree) [ 1418.265002] Workqueue: events drm_sched_job_timedout [ 1418.269986] PC is at dma_fence_remove_callback+0x8/0x50 [ 1418.275218] LR is at drm_sched_job_timedout+0x4c/0x118 ... [ 1418.415891] [] (dma_fence_remove_callback) from [] (drm_sched_job_timedout+0x4c/0x118) [ 1418.425571] [] (drm_sched_job_timedout) from [] (process_one_work+0x2c8/0x7bc) [ 1418.434552] [] (process_one_work) from [] (worker_thread+0x44/0x590) [ 1418.442663] [] (worker_thread) from [] (kthread+0x160/0x168) [ 1418.450076] [] (kthread) from [] (ret_from_fork+0x14/0x28) Cc: Christian König Cc: Nayan Deshmukh Cc: Alex Deucher Signed-off-by: Eric Anholt --- drivers/gpu/drm/scheduler/sched_main.c | 30 +------------------------- 1 file changed, 1 insertion(+), 29 deletions(-) diff --git a/drivers/gpu/drm/scheduler/sched_main.c b/drivers/gpu/drm/scheduler/sched_main.c index 44fe587aaef9..bd7d11c47202 100644 --- a/drivers/gpu/drm/scheduler/sched_main.c +++ b/drivers/gpu/drm/scheduler/sched_main.c @@ -249,41 +249,13 @@ static void drm_sched_job_timedout(struct work_struct *work) { struct drm_gpu_scheduler *sched; struct drm_sched_job *job; - int r; sched = container_of(work, struct drm_gpu_scheduler, work_tdr.work); - - spin_lock(&sched->job_list_lock); - list_for_each_entry_reverse(job, &sched->ring_mirror_list, node) { - struct drm_sched_fence *fence = job->s_fence; - - if (!dma_fence_remove_callback(fence->parent, &fence->cb)) - goto already_signaled; - } - job = list_first_entry_or_null(&sched->ring_mirror_list, struct drm_sched_job, node); - spin_unlock(&sched->job_list_lock); if (job) - sched->ops->timedout_job(job); - - spin_lock(&sched->job_list_lock); - list_for_each_entry(job, &sched->ring_mirror_list, node) { - struct drm_sched_fence *fence = job->s_fence; - - if (!fence->parent || !list_empty(&fence->cb.node)) - continue; - - r = dma_fence_add_callback(fence->parent, &fence->cb, - drm_sched_process_job); - if (r) - drm_sched_process_job(fence->parent, &fence->cb); - -already_signaled: - ; - } - spin_unlock(&sched->job_list_lock); + job->sched->ops->timedout_job(job); } /** -- 2.19.1