From patchwork Mon Jul 12 17:53:47 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Daniel Vetter X-Patchwork-Id: 12372199 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=-16.6 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,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 50CA5C07E9C for ; Mon, 12 Jul 2021 20:02:36 +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 1DF7F611F1 for ; Mon, 12 Jul 2021 20:02:36 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 1DF7F611F1 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=ffwll.ch Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=intel-gfx-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 979D089E1D; Mon, 12 Jul 2021 20:02:15 +0000 (UTC) Received: from mail-wr1-x42c.google.com (mail-wr1-x42c.google.com [IPv6:2a00:1450:4864:20::42c]) by gabe.freedesktop.org (Postfix) with ESMTPS id 00F6389E06 for ; Mon, 12 Jul 2021 20:02:11 +0000 (UTC) Received: by mail-wr1-x42c.google.com with SMTP id d2so27320339wrn.0 for ; Mon, 12 Jul 2021 13:02:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ffwll.ch; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=A4+2/pgGBCJxzVgU/zlbGWzgj/dEC4nIap1p/ExGlZw=; b=XhL8QyxOXp7z6Hg6bktsegyq+iQE0VwQKJd5eOzrkBbaKaJUAXR7KUnTN/PAHylsZ/ FtW7akJ5YjRHbXteKqQdn9KzqNO50IDz8f0DeZzhP5cNrEIML3c9tx0Z//4Gf/Y3Phyj IXMvzWgqPHCNq9RdnW2KRAdfdERjEKpJZo1tQ= 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=A4+2/pgGBCJxzVgU/zlbGWzgj/dEC4nIap1p/ExGlZw=; b=MmcMSpqxLyOnA5hbLXaRe4EWF0x/Y2KIbExLet/NySeSejO0GH8R6kfYN3ukkAJ19L KrqR77JofdLIR+fZajz82ZxiyXUTfa/8zvcKovXOiWlTM/xudePVcJ/NKPq5q8l05EpC FU+Df9SfynyxwXguIwxTU5HLWnlWx5q71A57UmKiIn6mtIJTJ2DQUxHPIUpxEcDRRxW6 zQq+F9CA4FUD05sd35NZwJHBPRaLBR2MqiPNrsAa9ZA2vokjFdqoybzh+9/uIIPhuR+h vVyVGP0wMo7ocLF3DnVtnDBeE7b+x50r2MhBZe7RAbWK5FvikdhhHc12pImBaiTG6+c/ bBuw== X-Gm-Message-State: AOAM530JVcDrP5OXD4Eqw+y+vA3Vlg4MjG6bB1VKm4CBxYGz/4jgI1lw i6txD7WoUOTxD3kZQg05s3MqCg== X-Google-Smtp-Source: ABdhPJzBZz63JTQIH2tUHA1ojZohKCYhhXtyA7mYW5eUzZDSgsXk8ZANd0/YxLZA1e1lQp5qwP+0kA== X-Received: by 2002:adf:ef11:: with SMTP id e17mr840935wro.71.1626120130732; Mon, 12 Jul 2021 13:02:10 -0700 (PDT) Received: from phenom.ffwll.local ([2a02:168:57f4:0:efd0:b9e5:5ae6:c2fa]) by smtp.gmail.com with ESMTPSA id l14sm9858221wrs.22.2021.07.12.13.02.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 12 Jul 2021 13:02:10 -0700 (PDT) From: Daniel Vetter To: DRI Development Date: Mon, 12 Jul 2021 19:53:47 +0200 Message-Id: <20210712175352.802687-14-daniel.vetter@ffwll.ch> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210712175352.802687-1-daniel.vetter@ffwll.ch> References: <20210712175352.802687-1-daniel.vetter@ffwll.ch> MIME-Version: 1.0 Subject: [Intel-gfx] [PATCH v4 13/18] drm/sched: Check locking in drm_sched_job_await_implicit X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Andrey Grodzovsky , Jack Zhang , Daniel Vetter , Intel Graphics Development , Luben Tuikov , Alex Deucher , Daniel Vetter , =?utf-8?q?Christian_K=C3=B6nig?= Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" You really need to hold the reservation here or all kinds of funny things can happen between grabbing the dependencies and inserting the new fences. Signed-off-by: Daniel Vetter Cc: "Christian König" Cc: Daniel Vetter Cc: Luben Tuikov Cc: Andrey Grodzovsky Cc: Alex Deucher Cc: Jack Zhang --- drivers/gpu/drm/scheduler/sched_main.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/gpu/drm/scheduler/sched_main.c b/drivers/gpu/drm/scheduler/sched_main.c index fd52db906b90..6fa6ccd30d2a 100644 --- a/drivers/gpu/drm/scheduler/sched_main.c +++ b/drivers/gpu/drm/scheduler/sched_main.c @@ -714,6 +714,8 @@ int drm_sched_job_await_implicit(struct drm_sched_job *job, struct dma_fence **fences; unsigned int i, fence_count; + dma_resv_assert_held(obj->resv); + if (!write) { struct dma_fence *fence = dma_resv_get_excl_unlocked(obj->resv);