From patchwork Thu Jun 13 10:20:18 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sebastian Andrzej Siewior X-Patchwork-Id: 13696571 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 B4536C2BA18 for ; Thu, 13 Jun 2024 10:28:32 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 6B7C710EA0C; Thu, 13 Jun 2024 10:28:30 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; secure) header.d=linutronix.de header.i=@linutronix.de header.b="k7vy+Pd1"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="C7zCCfqQ"; dkim-atps=neutral Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) by gabe.freedesktop.org (Postfix) with ESMTPS id 452A110EA10; Thu, 13 Jun 2024 10:28:26 +0000 (UTC) From: Sebastian Andrzej Siewior DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1718274504; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=6biI+eKGjVQElr8oWwnoj0tluG+dFmxY+y11rh7jyaU=; b=k7vy+Pd1/jJRaSFxkqza3HazrenZ1lifcxnoLjojtuHNJyWMhiHaGcEVp2hJanxXF4G3nD asZlYiujhduWexSa8gSJctoJfNtpEHfD+U29kJL7l9/txireFCgC2pqyySDAuCJ0k3y4Ar ZRHUkQTlamjeGlIzGueANI5syEJxzDkSNqHG+YwnDgyXvMFN/GmrE1vmr+okrzOo8LQJaK 0fu5rn26uiL3NRuapgP7zHCLCQWYfXABfnT5o6T55bOc1O597h8WeDJ4aWsuZQVe3mk/fQ bkMrP18NVxJC4/9E6Hzx79s+MzNaq88HV6N6i3bNkmqG0EOxlrQ1TTN1utOkvQ== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1718274504; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=6biI+eKGjVQElr8oWwnoj0tluG+dFmxY+y11rh7jyaU=; b=C7zCCfqQacYloQe16Tb4f+GKd4KiWyex6hcRB1+4poyYkwz31ipYtQHpqQk/xtNQQvLkV/ pIvQPJot0Ti5OpDg== To: intel-gfx@lists.freedesktop.org, intel-xe@lists.freedesktop.org Cc: Jani Nikula , Joonas Lahtinen , Rodrigo Vivi , Thomas Gleixner , Tvrtko Ursulin , Mike Galbraith , Mario Kleiner , Sebastian Andrzej Siewior Subject: [PATCH v2 1/8] drm/i915: Use preempt_disable/enable_rt() where recommended Date: Thu, 13 Jun 2024 12:20:18 +0200 Message-ID: <20240613102818.4056866-2-bigeasy@linutronix.de> In-Reply-To: <20240613102818.4056866-1-bigeasy@linutronix.de> References: <20240613102818.4056866-1-bigeasy@linutronix.de> MIME-Version: 1.0 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: , Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" From: Mike Galbraith Mario Kleiner suggest in commit ad3543ede630f ("drm/intel: Push get_scanout_position() timestamping into kms driver.") a spots where preemption should be disabled on PREEMPT_RT. The difference is that on PREEMPT_RT the intel_uncore::lock disables neither preemption nor interrupts and so region remains preemptible. The area covers only register reads and writes. The part that worries me is: - __intel_get_crtc_scanline() the worst case is 100us if no match is found. - intel_crtc_scanlines_since_frame_timestamp() not sure how long this may take in the worst case. It was in the RT queue for a while and nobody complained. Disable preemption on PREEPMPT_RT during timestamping. [bigeasy: patch description.] Cc: Mario Kleiner Signed-off-by: Mike Galbraith Signed-off-by: Thomas Gleixner Signed-off-by: Sebastian Andrzej Siewior --- drivers/gpu/drm/i915/display/intel_vblank.c | 38 +++++++++++++++------ 1 file changed, 28 insertions(+), 10 deletions(-) diff --git a/drivers/gpu/drm/i915/display/intel_vblank.c b/drivers/gpu/drm/i915/display/intel_vblank.c index baf7354cb6e2c..71d6071121460 100644 --- a/drivers/gpu/drm/i915/display/intel_vblank.c +++ b/drivers/gpu/drm/i915/display/intel_vblank.c @@ -276,6 +276,26 @@ int intel_crtc_scanline_to_hw(struct intel_crtc *crtc, int scanline) * all register accesses to the same cacheline to be serialized, * otherwise they may hang. */ +static void intel_vblank_section_enter_irqsave(struct drm_i915_private *i915, unsigned long *flags) + __acquires(i915->uncore.lock) +{ +#ifdef I915 + spin_lock_irqsave(&i915->uncore.lock, *flags); +#else + *flags = 0; +#endif +} + +static void intel_vblank_section_exit_irqrestore(struct drm_i915_private *i915, unsigned long flags) + __releases(i915->uncore.lock) +{ +#ifdef I915 + spin_unlock_irqrestore(&i915->uncore.lock, flags); +#else + if (flags) + return; +#endif +} static void intel_vblank_section_enter(struct drm_i915_private *i915) __acquires(i915->uncore.lock) { @@ -333,10 +353,10 @@ static bool i915_get_crtc_scanoutpos(struct drm_crtc *_crtc, * timing critical raw register reads, potentially with * preemption disabled, so the following code must not block. */ - local_irq_save(irqflags); - intel_vblank_section_enter(dev_priv); + intel_vblank_section_enter_irqsave(dev_priv, &irqflags); - /* preempt_disable_rt() should go right here in PREEMPT_RT patchset. */ + if (IS_ENABLED(CONFIG_PREEMPT_RT)) + preempt_disable(); /* Get optional system timestamp before query. */ if (stime) @@ -400,10 +420,10 @@ static bool i915_get_crtc_scanoutpos(struct drm_crtc *_crtc, if (etime) *etime = ktime_get(); - /* preempt_enable_rt() should go right here in PREEMPT_RT patchset. */ + if (IS_ENABLED(CONFIG_PREEMPT_RT)) + preempt_enable(); - intel_vblank_section_exit(dev_priv); - local_irq_restore(irqflags); + intel_vblank_section_exit_irqrestore(dev_priv, irqflags); /* * While in vblank, position will be negative @@ -441,13 +461,11 @@ int intel_get_crtc_scanline(struct intel_crtc *crtc) unsigned long irqflags; int position; - local_irq_save(irqflags); - intel_vblank_section_enter(dev_priv); + intel_vblank_section_enter_irqsave(dev_priv, &irqflags); position = __intel_get_crtc_scanline(crtc); - intel_vblank_section_exit(dev_priv); - local_irq_restore(irqflags); + intel_vblank_section_exit_irqrestore(dev_priv, irqflags); return position; } From patchwork Thu Jun 13 10:20:19 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sebastian Andrzej Siewior X-Patchwork-Id: 13696574 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 BF202C27C4F for ; Thu, 13 Jun 2024 10:28:37 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 0D4A610EA20; Thu, 13 Jun 2024 10:28:37 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; secure) header.d=linutronix.de header.i=@linutronix.de header.b="PfKzSUPN"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="KLZe3TYX"; dkim-atps=neutral Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) by gabe.freedesktop.org (Postfix) with ESMTPS id 4378410EA0C; Thu, 13 Jun 2024 10:28:26 +0000 (UTC) From: Sebastian Andrzej Siewior DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1718274504; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=klSNWQQYRArbUq1sdGb5aifUF4FwgxDjzil4nZonFY4=; b=PfKzSUPNvC85exFqsrILD9WsMOOq0ofRF5GRAoeUrtIimqNiEAfhjNeyg8eTwCXMCpjcDP NffeX8zgFQsZIbgyrL8urUyjYBzOh3LJ2COy+Z1Vxw1vj/vTIJviaPwdYgegUgjbL08t6u Lxa1jS+u87JiCuUCc6Ji0TnC8S6D0NRA8sx95snIRAO5y84znD3RVDk+mz4UMexvqU2CD9 eKuRMjF3eIWP9auUcKV82KJljqqDJneoO9rds3LWKNMgQ4I9jg0jTqq4I9RGO+yu91p076 dvWuu0GCFzn8MNjW3YrTAzaKzYMq1MOYZd0FVwRIrIdUOA23zDonw9wgeHbh0Q== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1718274504; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=klSNWQQYRArbUq1sdGb5aifUF4FwgxDjzil4nZonFY4=; b=KLZe3TYXFB15J3rLYBwrIyesgUWJ2FA8kOQVQoJanTJ8uo7FGEYWduDhprSVLHN9SXjhlI Hfbg0jrohlS9nVDA== To: intel-gfx@lists.freedesktop.org, intel-xe@lists.freedesktop.org Cc: Jani Nikula , Joonas Lahtinen , Rodrigo Vivi , Thomas Gleixner , Tvrtko Ursulin , Mike Galbraith , Sebastian Andrzej Siewior Subject: [PATCH v2 2/8] drm/i915: Don't disable interrupts on PREEMPT_RT during atomic updates Date: Thu, 13 Jun 2024 12:20:19 +0200 Message-ID: <20240613102818.4056866-3-bigeasy@linutronix.de> In-Reply-To: <20240613102818.4056866-1-bigeasy@linutronix.de> References: <20240613102818.4056866-1-bigeasy@linutronix.de> MIME-Version: 1.0 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: , Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" From: Mike Galbraith Commit 8d7849db3eab7 ("drm/i915: Make sprite updates atomic") started disabling interrupts across atomic updates. This breaks on PREEMPT_RT because within this section the code attempt to acquire spinlock_t locks which are sleeping locks on PREEMPT_RT. According to the comment the interrupts are disabled to avoid random delays and not required for protection or synchronisation. If this needs to happen with disabled interrupts on PREEMPT_RT, and the whole section is restricted to register access then all sleeping locks need to be acquired before interrupts are disabled and some function maybe moved after enabling interrupts again. This includes: - prepare_to_wait() + finish_wait() due its wake queue. - drm_crtc_vblank_put() -> vblank_disable_fn() drm_device::vbl_lock. - skl_pfit_enable(), intel_update_plane(), vlv_atomic_update_fifo() and maybe others due to intel_uncore::lock - drm_crtc_arm_vblank_event() due to drm_device::event_lock and drm_device::vblank_time_lock. Don't disable interrupts on PREEMPT_RT during atomic updates. [bigeasy: drop local locks, commit message] Signed-off-by: Mike Galbraith Signed-off-by: Sebastian Andrzej Siewior --- drivers/gpu/drm/i915/display/intel_crtc.c | 9 ++++++--- drivers/gpu/drm/i915/display/intel_vblank.c | 6 ++++-- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/drivers/gpu/drm/i915/display/intel_crtc.c b/drivers/gpu/drm/i915/display/intel_crtc.c index 25593f6aae7de..22b80004574fa 100644 --- a/drivers/gpu/drm/i915/display/intel_crtc.c +++ b/drivers/gpu/drm/i915/display/intel_crtc.c @@ -512,7 +512,8 @@ void intel_pipe_update_start(struct intel_atomic_state *state, */ intel_psr_wait_for_idle_locked(new_crtc_state); - local_irq_disable(); + if (!IS_ENABLED(CONFIG_PREEMPT_RT)) + local_irq_disable(); crtc->debug.min_vbl = evade.min; crtc->debug.max_vbl = evade.max; @@ -530,7 +531,8 @@ void intel_pipe_update_start(struct intel_atomic_state *state, return; irq_disable: - local_irq_disable(); + if (!IS_ENABLED(CONFIG_PREEMPT_RT)) + local_irq_disable(); } #if IS_ENABLED(CONFIG_DRM_I915_DEBUG_VBLANK_EVADE) @@ -632,7 +634,8 @@ void intel_pipe_update_end(struct intel_atomic_state *state, */ intel_vrr_send_push(new_crtc_state); - local_irq_enable(); + if (!IS_ENABLED(CONFIG_PREEMPT_RT)) + local_irq_enable(); if (intel_vgpu_active(dev_priv)) goto out; diff --git a/drivers/gpu/drm/i915/display/intel_vblank.c b/drivers/gpu/drm/i915/display/intel_vblank.c index 71d6071121460..d639b51a49195 100644 --- a/drivers/gpu/drm/i915/display/intel_vblank.c +++ b/drivers/gpu/drm/i915/display/intel_vblank.c @@ -700,11 +700,13 @@ int intel_vblank_evade(struct intel_vblank_evade_ctx *evade) break; } - local_irq_enable(); + if (!IS_ENABLED(CONFIG_PREEMPT_RT)) + local_irq_enable(); timeout = schedule_timeout(timeout); - local_irq_disable(); + if (!IS_ENABLED(CONFIG_PREEMPT_RT)) + local_irq_disable(); } finish_wait(wq, &wait); From patchwork Thu Jun 13 10:20:20 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sebastian Andrzej Siewior X-Patchwork-Id: 13696570 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 4B4E9C27C75 for ; Thu, 13 Jun 2024 10:28:30 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 54B4210EA17; Thu, 13 Jun 2024 10:28:29 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; secure) header.d=linutronix.de header.i=@linutronix.de header.b="r3k1+xJY"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="e0uQweyT"; dkim-atps=neutral Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) by gabe.freedesktop.org (Postfix) with ESMTPS id 5862A10EA11; Thu, 13 Jun 2024 10:28:26 +0000 (UTC) From: Sebastian Andrzej Siewior DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1718274505; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=r0ec/2247Gx7VIiLEY3/25TsR/Rd3HiyDAk6kFtNqn0=; b=r3k1+xJYcFSzvC0HM5DcNgErM9HjAIjEMyddW/PKcCFq6YArpFkruCbpEpamuFtuXaP2p0 RdKMXwMDWCNwKLskm6X6kI/Ie8hcs+U1NWirFZtn8KoHFmQ5QdQyx+fQIZNrYNfQgfjqDp kYr3EJQGCJ+9ocgu9/ayCOQGPgUHvErLxIy3B6PMHsD3zB6jYf/3g/vImsMt5hSzgFddxy DPQGYrahfLBmbndc7bSp0/0YpTc5HXQXwHwR+3ngJcd7Y/LQ41wNjVyekpZTIBAhlrVZ/+ hkT5UcaTxMatj9gXqTxIdsd6uQKPIRoMCvEpdSLVgazUc8K4H+i/bHA/Sn6gZw== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1718274505; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=r0ec/2247Gx7VIiLEY3/25TsR/Rd3HiyDAk6kFtNqn0=; b=e0uQweyTDztP3v9FbxDkJ0NFZbugMgN3wL7qRxBezvCzUCIRSjM6gXz3nDJM0RYe4DQaa5 0KpRjqNddOs4uyAg== To: intel-gfx@lists.freedesktop.org, intel-xe@lists.freedesktop.org Cc: Jani Nikula , Joonas Lahtinen , Rodrigo Vivi , Thomas Gleixner , Tvrtko Ursulin , Sebastian Andrzej Siewior Subject: [PATCH v2 3/8] drm/i915: Don't check for atomic context on PREEMPT_RT Date: Thu, 13 Jun 2024 12:20:20 +0200 Message-ID: <20240613102818.4056866-4-bigeasy@linutronix.de> In-Reply-To: <20240613102818.4056866-1-bigeasy@linutronix.de> References: <20240613102818.4056866-1-bigeasy@linutronix.de> MIME-Version: 1.0 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: , Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" The !in_atomic() check in _wait_for_atomic() triggers on PREEMPT_RT because the uncore::lock is a spinlock_t and does not disable preemption or interrupts. Changing the uncore:lock to a raw_spinlock_t doubles the worst case latency on an otherwise idle testbox during testing. Therefore I'm currently unsure about changing this. Link: https://lore.kernel.org/all/20211006164628.s2mtsdd2jdbfyf7g@linutronix.de/ Signed-off-by: Sebastian Andrzej Siewior Reviewed-by: Tvrtko Ursulin Reviewed-by: Tvrtko Ursulin Signed-off-by: Sebastian Andrzej Siewior --- drivers/gpu/drm/i915/i915_utils.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/i915/i915_utils.h b/drivers/gpu/drm/i915/i915_utils.h index 06ec6ceb61d57..2ca54bc235925 100644 --- a/drivers/gpu/drm/i915/i915_utils.h +++ b/drivers/gpu/drm/i915/i915_utils.h @@ -274,7 +274,7 @@ wait_remaining_ms_from_jiffies(unsigned long timestamp_jiffies, int to_wait_ms) #define wait_for(COND, MS) _wait_for((COND), (MS) * 1000, 10, 1000) /* If CONFIG_PREEMPT_COUNT is disabled, in_atomic() always reports false. */ -#if defined(CONFIG_DRM_I915_DEBUG) && defined(CONFIG_PREEMPT_COUNT) +#if defined(CONFIG_DRM_I915_DEBUG) && defined(CONFIG_PREEMPT_COUNT) && !defined(CONFIG_PREEMPT_RT) # define _WAIT_FOR_ATOMIC_CHECK(ATOMIC) WARN_ON_ONCE((ATOMIC) && !in_atomic()) #else # define _WAIT_FOR_ATOMIC_CHECK(ATOMIC) do { } while (0) From patchwork Thu Jun 13 10:20:21 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sebastian Andrzej Siewior X-Patchwork-Id: 13696568 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 656B8C27C4F for ; Thu, 13 Jun 2024 10:28:29 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 0850B10EA08; Thu, 13 Jun 2024 10:28:28 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; secure) header.d=linutronix.de header.i=@linutronix.de header.b="clmV4emR"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="KxyzfoQp"; dkim-atps=neutral Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) by gabe.freedesktop.org (Postfix) with ESMTPS id DA9FA10EA12; Thu, 13 Jun 2024 10:28:26 +0000 (UTC) From: Sebastian Andrzej Siewior DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1718274505; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=oFkT7c54ylLrE7OJgrLojn/6KU06qll74prdvYfGu4w=; b=clmV4emRAwlT4gaLDWpnFx+w1e2iuFgL1JJWVXCR7/t5+UVClwoMNT4kc9tKzmOzorkjoJ sR1nHACMKw1DevHex+jws6suDtJiHXJtVzBTMJGyHZp4y3tHo4MU4fDWL1y5CquJup/Gso LRygIv5GmuHaUqkOcOxP2azeHJOgHLv/EqXfMk3KKQ1eYNa4yBHrpmbccQsAgGj0WVEAj+ pPESgTf0IMy5HTebydUdHw/FkqTZgvhlaRBB4eEC09M5y20WzA2F2JK5CPOpmlev8zBPRg GBRQCgLHxyofk7210tMYQq9QwEJngrz9r/Fi3Ow//RCrQAMBEP7NBAqA/topxA== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1718274505; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=oFkT7c54ylLrE7OJgrLojn/6KU06qll74prdvYfGu4w=; b=KxyzfoQpifKgh4CR1rbYa0rxZA2I8jhKjK9EkYAlrKoSBdOa/tRumWJD9ThBzGVJoVxnng uawjefY8B+b83ZBw== To: intel-gfx@lists.freedesktop.org, intel-xe@lists.freedesktop.org Cc: Jani Nikula , Joonas Lahtinen , Rodrigo Vivi , Thomas Gleixner , Tvrtko Ursulin , Sebastian Andrzej Siewior , Luca Abeni , Steven Rostedt Subject: [PATCH v2 4/8] drm/i915: Disable tracing points on PREEMPT_RT Date: Thu, 13 Jun 2024 12:20:21 +0200 Message-ID: <20240613102818.4056866-5-bigeasy@linutronix.de> In-Reply-To: <20240613102818.4056866-1-bigeasy@linutronix.de> References: <20240613102818.4056866-1-bigeasy@linutronix.de> MIME-Version: 1.0 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: , Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" Luca Abeni reported this: | BUG: scheduling while atomic: kworker/u8:2/15203/0x00000003 | CPU: 1 PID: 15203 Comm: kworker/u8:2 Not tainted 4.19.1-rt3 #10 | Call Trace: | rt_spin_lock+0x3f/0x50 | gen6_read32+0x45/0x1d0 [i915] | g4x_get_vblank_counter+0x36/0x40 [i915] | trace_event_raw_event_i915_pipe_update_start+0x7d/0xf0 [i915] The tracing events use trace_intel_pipe_update_start() among other events use functions acquire spinlock_t locks which are transformed into sleeping locks on PREEMPT_RT. A few trace points use intel_get_crtc_scanline(), others use ->get_vblank_counter() wich also might acquire a sleeping locks on PREEMPT_RT. At the time the arguments are evaluated within trace point, preemption is disabled and so the locks must not be acquired on PREEMPT_RT. Based on this I don't see any other way than disable trace points on PREMPT_RT. Reported-by: Luca Abeni Cc: Steven Rostedt Signed-off-by: Sebastian Andrzej Siewior Acked-by: Tvrtko Ursulin --- drivers/gpu/drm/i915/display/intel_display_trace.h | 4 ++++ drivers/gpu/drm/i915/i915_trace.h | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/drivers/gpu/drm/i915/display/intel_display_trace.h b/drivers/gpu/drm/i915/display/intel_display_trace.h index 49a5e6d9dc0d7..b15c999d91e68 100644 --- a/drivers/gpu/drm/i915/display/intel_display_trace.h +++ b/drivers/gpu/drm/i915/display/intel_display_trace.h @@ -9,6 +9,10 @@ #if !defined(__INTEL_DISPLAY_TRACE_H__) || defined(TRACE_HEADER_MULTI_READ) #define __INTEL_DISPLAY_TRACE_H__ +#if defined(CONFIG_PREEMPT_RT) && !defined(NOTRACE) +#define NOTRACE +#endif + #include #include #include diff --git a/drivers/gpu/drm/i915/i915_trace.h b/drivers/gpu/drm/i915/i915_trace.h index ce1cbee1b39dd..247e7d9448d70 100644 --- a/drivers/gpu/drm/i915/i915_trace.h +++ b/drivers/gpu/drm/i915/i915_trace.h @@ -6,6 +6,10 @@ #if !defined(_I915_TRACE_H_) || defined(TRACE_HEADER_MULTI_READ) #define _I915_TRACE_H_ +#if defined(CONFIG_PREEMPT_RT) && !defined(NOTRACE) +#define NOTRACE +#endif + #include #include #include From patchwork Thu Jun 13 10:20:22 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sebastian Andrzej Siewior X-Patchwork-Id: 13696573 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 D0175C27C75 for ; Thu, 13 Jun 2024 10:28:34 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 2DA6C10EA1D; Thu, 13 Jun 2024 10:28:32 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; secure) header.d=linutronix.de header.i=@linutronix.de header.b="QqbLWHkr"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="myP2UD1Z"; dkim-atps=neutral Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) by gabe.freedesktop.org (Postfix) with ESMTPS id 541F910EA0C; Thu, 13 Jun 2024 10:28:28 +0000 (UTC) From: Sebastian Andrzej Siewior DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1718274505; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=QUNTO0UfshytQe0+4dGuteCafLmjnva+iste5V2OTf4=; b=QqbLWHkr1BWTqXGIiBPt+yLA8vCXKFgte4XcdwO2UKml4VtY2bjhgMh7a49NCiTLkHdePi Hv9Q8+GV7fj8GuNt//nUVHuKt7gyMnb0v8O4yFNDolTmo9wCRCHPSdWksloON++K84mL6o 4tZwzQzMFK0pwHBdFzAeeqB6bVio2cXipU5qS2KDKkUwFudKMmYc8qxULAlJgxKRuI1X0F oWvfEldCovxUWs62mAPL6HPA3Ffzh32S2sjc84CSqf4Qcql+znS/qotyNYD2X73wWakKju WIzoYcGMF3dWAfL6ZofjdA7aakkn53aIaNxQ4f9qbodSqkiBvbPPScR1kR069Q== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1718274505; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=QUNTO0UfshytQe0+4dGuteCafLmjnva+iste5V2OTf4=; b=myP2UD1ZqWtoCezXP9b6/jBpepupf8ZB6So7XzXlGTeY8I9yDsOcP+a7NdK7rmS30wBqhl mP1xeRzwKlIkJmDg== To: intel-gfx@lists.freedesktop.org, intel-xe@lists.freedesktop.org Cc: Jani Nikula , Joonas Lahtinen , Rodrigo Vivi , Thomas Gleixner , Tvrtko Ursulin , Sebastian Andrzej Siewior , Clark Williams , Maarten Lankhorst Subject: [PATCH v2 5/8] drm/i915/gt: Use spin_lock_irq() instead of local_irq_disable() + spin_lock() Date: Thu, 13 Jun 2024 12:20:22 +0200 Message-ID: <20240613102818.4056866-6-bigeasy@linutronix.de> In-Reply-To: <20240613102818.4056866-1-bigeasy@linutronix.de> References: <20240613102818.4056866-1-bigeasy@linutronix.de> MIME-Version: 1.0 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: , Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" execlists_dequeue() is invoked from a function which uses local_irq_disable() to disable interrupts so the spin_lock() behaves like spin_lock_irq(). This breaks PREEMPT_RT because local_irq_disable() + spin_lock() is not the same as spin_lock_irq(). execlists_dequeue_irq() and execlists_dequeue() has each one caller only. If intel_engine_cs::active::lock is acquired and released with the _irq suffix then it behaves almost as if execlists_dequeue() would be invoked with disabled interrupts. The difference is the last part of the function which is then invoked with enabled interrupts. I can't tell if this makes a difference. From looking at it, it might work to move the last unlock at the end of the function as I didn't find anything that would acquire the lock again. Reported-by: Clark Williams Signed-off-by: Sebastian Andrzej Siewior Reviewed-by: Maarten Lankhorst --- .../drm/i915/gt/intel_execlists_submission.c | 17 +++++------------ 1 file changed, 5 insertions(+), 12 deletions(-) diff --git a/drivers/gpu/drm/i915/gt/intel_execlists_submission.c b/drivers/gpu/drm/i915/gt/intel_execlists_submission.c index 21829439e6867..ed29a2dd6ea0a 100644 --- a/drivers/gpu/drm/i915/gt/intel_execlists_submission.c +++ b/drivers/gpu/drm/i915/gt/intel_execlists_submission.c @@ -1303,7 +1303,7 @@ static void execlists_dequeue(struct intel_engine_cs *engine) * and context switches) submission. */ - spin_lock(&sched_engine->lock); + spin_lock_irq(&sched_engine->lock); /* * If the queue is higher priority than the last @@ -1403,7 +1403,7 @@ static void execlists_dequeue(struct intel_engine_cs *engine) * Even if ELSP[1] is occupied and not worthy * of timeslices, our queue might be. */ - spin_unlock(&sched_engine->lock); + spin_unlock_irq(&sched_engine->lock); return; } } @@ -1429,7 +1429,7 @@ static void execlists_dequeue(struct intel_engine_cs *engine) if (last && !can_merge_rq(last, rq)) { spin_unlock(&ve->base.sched_engine->lock); - spin_unlock(&engine->sched_engine->lock); + spin_unlock_irq(&engine->sched_engine->lock); return; /* leave this for another sibling */ } @@ -1591,7 +1591,7 @@ static void execlists_dequeue(struct intel_engine_cs *engine) */ sched_engine->queue_priority_hint = queue_prio(sched_engine); i915_sched_engine_reset_on_empty(sched_engine); - spin_unlock(&sched_engine->lock); + spin_unlock_irq(&sched_engine->lock); /* * We can skip poking the HW if we ended up with exactly the same set @@ -1617,13 +1617,6 @@ static void execlists_dequeue(struct intel_engine_cs *engine) } } -static void execlists_dequeue_irq(struct intel_engine_cs *engine) -{ - local_irq_disable(); /* Suspend interrupts across request submission */ - execlists_dequeue(engine); - local_irq_enable(); /* flush irq_work (e.g. breadcrumb enabling) */ -} - static void clear_ports(struct i915_request **ports, int count) { memset_p((void **)ports, NULL, count); @@ -2478,7 +2471,7 @@ static void execlists_submission_tasklet(struct tasklet_struct *t) } if (!engine->execlists.pending[0]) { - execlists_dequeue_irq(engine); + execlists_dequeue(engine); start_timeslice(engine); } From patchwork Thu Jun 13 10:20:23 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sebastian Andrzej Siewior X-Patchwork-Id: 13696572 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 CE593C2BA1A for ; Thu, 13 Jun 2024 10:28:33 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id E786A10EA18; Thu, 13 Jun 2024 10:28:30 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; secure) header.d=linutronix.de header.i=@linutronix.de header.b="JiQJxhfV"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="ZsDPtgBJ"; dkim-atps=neutral Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) by gabe.freedesktop.org (Postfix) with ESMTPS id 7D2D510EA12; Thu, 13 Jun 2024 10:28:28 +0000 (UTC) From: Sebastian Andrzej Siewior DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1718274506; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=JGSmjArusF1lmM7xxq4EzrB6RjHqaWLj4654SVALGo8=; b=JiQJxhfVgqwtPy8PUDpDYskljaBY0mxWJT9eHL9OGd2ZHKbnFBQVco2DTAfuQ+O9hVXTUW DejcCAuuq26R/setVzu87W/eLMfbbPkmXSK+WOmkC3qHAwItdGUbdj8TwwFgz5b+f4Gigm zozx0Za+rsjw29bTJCJPktWXxC47zymnfksqxOzRYVLyt3WBJHToUNFrJVCYGxc9gCXeb3 m3SCacut4VVI59f+cng07HI1JolNPqVwmAw4fAbjuHFLG0dT4c4SGesXgTSDwnq1KJDY1G NJKmk8HoHF5WMFlQ6RAnZB5MMQxnUb3HCWyLyF7Bu+3I/yuSaPwfwsqU7OkDTQ== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1718274506; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=JGSmjArusF1lmM7xxq4EzrB6RjHqaWLj4654SVALGo8=; b=ZsDPtgBJXgji89kxKPtSLNy/wRtIjUe/bdH1GGqRqACVcme4jKUTOq6s8+q7R3NVMfAYgA MD/s3zNShy9vU2DQ== To: intel-gfx@lists.freedesktop.org, intel-xe@lists.freedesktop.org Cc: Jani Nikula , Joonas Lahtinen , Rodrigo Vivi , Thomas Gleixner , Tvrtko Ursulin , Sebastian Andrzej Siewior , Maarten Lankhorst Subject: [PATCH v2 6/8] drm/i915: Drop the irqs_disabled() check Date: Thu, 13 Jun 2024 12:20:23 +0200 Message-ID: <20240613102818.4056866-7-bigeasy@linutronix.de> In-Reply-To: <20240613102818.4056866-1-bigeasy@linutronix.de> References: <20240613102818.4056866-1-bigeasy@linutronix.de> MIME-Version: 1.0 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: , Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" The !irqs_disabled() check triggers on PREEMPT_RT even with i915_sched_engine::lock acquired. The reason is the lock is transformed into a sleeping lock on PREEMPT_RT and does not disable interrupts. There is no need to check for disabled interrupts. The lockdep annotation below already check if the lock has been acquired by the caller and will yell if the interrupts are not disabled. Remove the !irqs_disabled() check. Reported-by: Maarten Lankhorst Signed-off-by: Sebastian Andrzej Siewior Acked-by: Tvrtko Ursulin --- drivers/gpu/drm/i915/i915_request.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/drivers/gpu/drm/i915/i915_request.c b/drivers/gpu/drm/i915/i915_request.c index 519e096c607cd..466b5ee8ed6d2 100644 --- a/drivers/gpu/drm/i915/i915_request.c +++ b/drivers/gpu/drm/i915/i915_request.c @@ -608,7 +608,6 @@ bool __i915_request_submit(struct i915_request *request) RQ_TRACE(request, "\n"); - GEM_BUG_ON(!irqs_disabled()); lockdep_assert_held(&engine->sched_engine->lock); /* @@ -717,7 +716,6 @@ void __i915_request_unsubmit(struct i915_request *request) */ RQ_TRACE(request, "\n"); - GEM_BUG_ON(!irqs_disabled()); lockdep_assert_held(&engine->sched_engine->lock); /* From patchwork Thu Jun 13 10:20:24 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sebastian Andrzej Siewior X-Patchwork-Id: 13696575 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 4A6C6C27C7B for ; Thu, 13 Jun 2024 10:28:39 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 720B310EA21; Thu, 13 Jun 2024 10:28:38 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; secure) header.d=linutronix.de header.i=@linutronix.de header.b="g6bo0wpT"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="O/i5dtYk"; dkim-atps=neutral Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) by gabe.freedesktop.org (Postfix) with ESMTPS id 64A9A10EA11; Thu, 13 Jun 2024 10:28:28 +0000 (UTC) From: Sebastian Andrzej Siewior DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1718274506; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=AA2zfxjtkVY5UVBSS4SHCEYagP/l342CiKwYNj0Le48=; b=g6bo0wpTAx3SpwWMk0Ai6ouTNno1Eez5G0zFr/nt34tPxJBAmFgH8hQ/9QkU9T4f9lHIUu kQt8i5OU5TaioDKCrjOtmFrzn+5q0WJ3lio3v2aAjBhdwH58VgIkg9AuolILykteuC7gnY sRwtEYFGMDLJhDLTC8EYyzvqTe130NhvFzywU1/jyae+ZCCnj46xUH6uk0f+GOgc9Xu/AQ EBc9zbvsfXxsFLYPsYly2togpXYt7KxRjWC2qy3jhGp+WWPGuxRMiI/rVSo7kwSJx2gPfi EccQi08TiAFoyQ5Oj65hJjTGeouKfiZZKa1tqmmf/9W27f+5mqkebZgBMSCsug== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1718274506; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=AA2zfxjtkVY5UVBSS4SHCEYagP/l342CiKwYNj0Le48=; b=O/i5dtYk9bA9+0YfJNJWCwqvQ/iYEdhuLFyH39wNC8G/Wakdf2i2lIp5agIyhf6T7McBPL xo60bxqbyyHNPkBg== To: intel-gfx@lists.freedesktop.org, intel-xe@lists.freedesktop.org Cc: Jani Nikula , Joonas Lahtinen , Rodrigo Vivi , Thomas Gleixner , Tvrtko Ursulin , Sebastian Andrzej Siewior , "John B. Wyatt IV" Subject: [PATCH v2 7/8] drm/i915/guc: Consider also RCU depth in busy loop. Date: Thu, 13 Jun 2024 12:20:24 +0200 Message-ID: <20240613102818.4056866-8-bigeasy@linutronix.de> In-Reply-To: <20240613102818.4056866-1-bigeasy@linutronix.de> References: <20240613102818.4056866-1-bigeasy@linutronix.de> MIME-Version: 1.0 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: , Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" 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 --- 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 57b9031327767..ff213b79ba83d 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 From patchwork Thu Jun 13 10:20:25 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sebastian Andrzej Siewior X-Patchwork-Id: 13696576 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 11790C27C79 for ; Thu, 13 Jun 2024 10:28:40 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 3480710EA24; Thu, 13 Jun 2024 10:28:39 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; secure) header.d=linutronix.de header.i=@linutronix.de header.b="toT8+Dh5"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="GICWUzcf"; dkim-atps=neutral Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) by gabe.freedesktop.org (Postfix) with ESMTPS id 6260F10EA10; Thu, 13 Jun 2024 10:28:28 +0000 (UTC) From: Sebastian Andrzej Siewior DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1718274506; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=D6qn5+yaI5GAOUknM5SDGHdUpKNmQlIj5/33BjmhmPM=; b=toT8+Dh5BybsxQXDdOYZIbrYoq8nDYpEKU8PCjgFR8cZkDOpb/jWk/i/zjtpcSzqAuENLR lp9vtHYGyg7W15MpGtZGGOyO1nRd9JTMUsvzUBihEkaJ2H5WMuo+ESNBrUWthJdQfrja01 fiBZPvZpiO93QlwuJlwrO+tPZwX4HbquyaLtAiG6i554uTf5MJkU4+ddgTHmWH4bj6qp6j zEOAirJ+kcG5Q9iexQbh/WOF8aPw685YaKTvyczGtVn8eyYjREjoekk0FVX4+J0P2ivlyd hc8XTkAYrA9xp7ey3uHFRVGDwsdQvo7iXJx7Z6bDTNrzPJRObp8e3XZRUUWf6Q== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1718274506; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=D6qn5+yaI5GAOUknM5SDGHdUpKNmQlIj5/33BjmhmPM=; b=GICWUzcfSdmifLTzVh7fYvvzKnRJWsJSRYwKU8F5jCYPGS5SyotXvGr/7Kr6GWZxansE4P L92TXJyQy8SubuCw== To: intel-gfx@lists.freedesktop.org, intel-xe@lists.freedesktop.org Cc: Jani Nikula , Joonas Lahtinen , Rodrigo Vivi , Thomas Gleixner , Tvrtko Ursulin , Sebastian Andrzej Siewior Subject: [PATCH v2 8/8] Revert "drm/i915: Depend on !PREEMPT_RT." Date: Thu, 13 Jun 2024 12:20:25 +0200 Message-ID: <20240613102818.4056866-9-bigeasy@linutronix.de> In-Reply-To: <20240613102818.4056866-1-bigeasy@linutronix.de> References: <20240613102818.4056866-1-bigeasy@linutronix.de> MIME-Version: 1.0 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: , Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" Once the known issues are addressed, it should be safe to enable the driver. Signed-off-by: Sebastian Andrzej Siewior Acked-by: Tvrtko Ursulin --- drivers/gpu/drm/i915/Kconfig | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/gpu/drm/i915/Kconfig b/drivers/gpu/drm/i915/Kconfig index 5932024f8f954..a02162d6b710e 100644 --- a/drivers/gpu/drm/i915/Kconfig +++ b/drivers/gpu/drm/i915/Kconfig @@ -3,7 +3,6 @@ config DRM_I915 tristate "Intel 8xx/9xx/G3x/G4x/HD Graphics" depends on DRM depends on X86 && PCI - depends on !PREEMPT_RT select INTEL_GTT if X86 select INTERVAL_TREE # we need shmfs for the swappable backing store, and in particular