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 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 smtp.lore.kernel.org (Postfix) with ESMTPS id 0799BFD2D76 for ; Tue, 10 Mar 2026 11:57:54 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id D37E210E6E6; Tue, 10 Mar 2026 11:57:46 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=lankhorst.se header.i=@lankhorst.se header.b="SQW7Vu5o"; dkim-atps=neutral Received: from lankhorst.se (unknown [141.105.120.124]) by gabe.freedesktop.org (Postfix) with ESMTPS id 0940610E6D9; Tue, 10 Mar 2026 11:57:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=lankhorst.se; s=default; t=1773143860; bh=LA3hIjGi9cA+PnG6A3TfKFJX6Y7TpnsugvkmMDZPIGM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=SQW7Vu5oXhCvF5trGl7S0iwyQq7kY6skjQlvmYfXsB3iYfI/BWLbfh3CfsSmZVCr4 tMKkEN8D23HpMNDtwQaAi9SCuqiieTX7Yg5fy3a/qAXtN6+MZ/cdGxnSoruwjR0fJq s4hgOJNesqORXfFu7sdZ+NEiSndqU2zT+EiOEiGoWdTsQZ0lE/T2xW4PfnbVGbmBQB ZhwcL9UxlnRS/7dHL7aFE+lXZnjfglSXacO2MU+yN8gTppPQh3rpzaNu8kUMk/EJ4s 9FFVDkYZqLNAMRZlIYL1eE+IuyuH/xKDhccqwc8RXC0gFsXx3b2w00Gm0FsuGA5/Ij 6yk/G5gwKl8TA== From: Maarten Lankhorst To: intel-xe@lists.freedesktop.org, intel-gfx@lists.freedesktop.org Cc: dri-devel@lists.freedesktop.org, Sebastian Andrzej Siewior , "John B. Wyatt IV" , Rodrigo Vivi , Maarten Lankhorst Subject: [PATCH v7 18/26] drm/i915/guc: Consider also RCU depth in busy loop. Date: Tue, 10 Mar 2026 12:57:00 +0100 Message-ID: <20260310115709.2276203-19-dev@lankhorst.se> X-Mailer: git-send-email 2.51.0 In-Reply-To: <20260310115709.2276203-1-dev@lankhorst.se> References: <20260310115709.2276203-1-dev@lankhorst.se> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" From: Sebastian Andrzej Siewior intel_guc_send_busy_loop() looks at in_atomic() and irqs_disabled() to decide if it should busy-spin while waiting or if it may sleep. Both checks will report false on PREEMPT_RT if sleeping spinlocks are acquired leading to RCU splats while the function sleeps. Check also if RCU has been disabled. Reported-by: "John B. Wyatt IV" Reviewed-by: Rodrigo Vivi Signed-off-by: Sebastian Andrzej Siewior Signed-off-by: Maarten Lankhorst --- drivers/gpu/drm/i915/gt/uc/intel_guc.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/i915/gt/uc/intel_guc.h b/drivers/gpu/drm/i915/gt/uc/intel_guc.h index 053780f562c1a..b25fa8f4dc4bd 100644 --- a/drivers/gpu/drm/i915/gt/uc/intel_guc.h +++ b/drivers/gpu/drm/i915/gt/uc/intel_guc.h @@ -362,7 +362,7 @@ static inline int intel_guc_send_busy_loop(struct intel_guc *guc, { int err; unsigned int sleep_period_ms = 1; - bool not_atomic = !in_atomic() && !irqs_disabled(); + bool not_atomic = !in_atomic() && !irqs_disabled() && !rcu_preempt_depth(); /* * FIXME: Have caller pass in if we are in an atomic context to avoid -- 2.51.0