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 Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 860DAEB64DD for ; Fri, 21 Jul 2023 12:03:46 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230482AbjGUMDp (ORCPT ); Fri, 21 Jul 2023 08:03:45 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55854 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230218AbjGUMDo (ORCPT ); Fri, 21 Jul 2023 08:03:44 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6332830DB for ; Fri, 21 Jul 2023 05:03:22 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 53AE460BA6 for ; Fri, 21 Jul 2023 12:03:20 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id EEFFFC433D9; Fri, 21 Jul 2023 12:03:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1689940999; bh=uqQQuMAk27TIY5Lsqd33fKjcUdUY2I36r/j2unmOqDA=; h=Subject:To:Cc:From:Date:From; b=08we5EVNgQCD6fsknTzx132r/rNdYbKVOY+kHibzxJFUk8Nt6k5Zd+t4cW2ZXyuyk aa5HTmjDMq5qI2+vUxgBdN7NnVX/aO3bgUTAJQvxKzGmzo4WF7bSuybEXQ1XCUuqTb pU7l6pVlDN+vD/PMQJRziAbmJrP9i/dHRsivCtV4= Subject: FAILED: patch "[PATCH] drm/ttm: never consider pinned BOs for eviction&swap" failed to apply to 5.4-stable tree To: christian.koenig@amd.com, Pierre-eric.Pelloux-prayer@amd.com, alexander.deucher@amd.com Cc: From: Date: Fri, 21 Jul 2023 14:03:16 +0200 Message-ID: <2023072116-underwent-bartender-da8d@gregkh> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org The patch below does not apply to the 5.4-stable tree. If someone wants it applied there, or to any other stable or longterm tree, then please email the backport, including the original git commit id to . To reproduce the conflict and resubmit, you may use the following commands: git fetch https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/ linux-5.4.y git checkout FETCH_HEAD git cherry-pick -x a2848d08742c8e8494675892c02c0d22acbe3cf8 # git commit -s git send-email --to '' --in-reply-to '2023072116-underwent-bartender-da8d@gregkh' --subject-prefix 'PATCH 5.4.y' HEAD^.. Possible dependencies: a2848d08742c ("drm/ttm: never consider pinned BOs for eviction&swap") thanks, greg k-h ------------------ original commit in Linus's tree ------------------ >From a2848d08742c8e8494675892c02c0d22acbe3cf8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christian=20K=C3=B6nig?= Date: Fri, 7 Jul 2023 11:25:00 +0200 Subject: [PATCH] drm/ttm: never consider pinned BOs for eviction&swap MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit There is a small window where we have already incremented the pin count but not yet moved the bo from the lru to the pinned list. Signed-off-by: Christian König Reported-by: Pelloux-Prayer, Pierre-Eric Tested-by: Pelloux-Prayer, Pierre-Eric Acked-by: Alex Deucher Cc: stable@vger.kernel.org Link: https://patchwork.freedesktop.org/patch/msgid/20230707120826.3701-1-christian.koenig@amd.com diff --git a/drivers/gpu/drm/ttm/ttm_bo.c b/drivers/gpu/drm/ttm/ttm_bo.c index 1a1cfd675cc4..7139a522b2f3 100644 --- a/drivers/gpu/drm/ttm/ttm_bo.c +++ b/drivers/gpu/drm/ttm/ttm_bo.c @@ -517,6 +517,12 @@ static bool ttm_bo_evict_swapout_allowable(struct ttm_buffer_object *bo, { bool ret = false; + if (bo->pin_count) { + *locked = false; + *busy = false; + return false; + } + if (bo->base.resv == ctx->resv) { dma_resv_assert_held(bo->base.resv); if (ctx->allow_res_evict)