From patchwork Fri Jun 28 12:58:00 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: 13716096 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 C2043C3064D for ; Fri, 28 Jun 2024 13:06:11 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 2429F10EC3D; Fri, 28 Jun 2024 13:06:10 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; secure) header.d=linutronix.de header.i=@linutronix.de header.b="kQwfCFeW"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="ZRlQPali"; dkim-atps=neutral Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) by gabe.freedesktop.org (Postfix) with ESMTPS id 124F210EC36; Fri, 28 Jun 2024 13:06:08 +0000 (UTC) From: Sebastian Andrzej Siewior DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1719579966; 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=yk1BVJ895M/wOlZ+mv5+lpnrINNFPO2fh4If4qICeVw=; b=kQwfCFeWuPucdbrsikc+p9yhETUMiL0zp03BuZzIZtOiiM9XhHJaw0kksAnJYsMPLEZV6K wSI7pBcpK2YdBm5nU4u5XF3vUTqreJNcywivKjER6i6cWEwsS8vZIMXzGt4wV1djMgHzaQ oIQ1rh7pv3egPl+6v7wwFyhSjQ1aJr/PQ5qoPMXWTah+F3O46Og5wiaCZR5NWvruGmZY60 BmBV+YQFzNJ8lOz8U8v6pqnMmNQwsykSUI4A49AdCQvo3bnJ7h/C12X25vAFvtkdGioCzv uJ6+4qyFsXwGtBMkschtQDbDX/+LNbf4L1Cpdztbc6exdEfGJk4FQRLB/dDIHQ== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1719579966; 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=yk1BVJ895M/wOlZ+mv5+lpnrINNFPO2fh4If4qICeVw=; b=ZRlQPaliBZet4HfmibqMWt8bHcBf71JDpLIWU6h6a+FmIx8X8r54Q68BE5P/+wNancYTpD H8Wq0u+u3W8OE7Cw== 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 v3 1/8] drm/i915: Use preempt_disable/enable_rt() where recommended Date: Fri, 28 Jun 2024 14:58:00 +0200 Message-ID: <20240628130601.1772849-2-bigeasy@linutronix.de> In-Reply-To: <20240628130601.1772849-1-bigeasy@linutronix.de> References: <20240628130601.1772849-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 Fri Jun 28 12:58:01 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: 13716100 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 AA8ECC3065B for ; Fri, 28 Jun 2024 13:06:16 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 52F8710EC4A; Fri, 28 Jun 2024 13:06:12 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; secure) header.d=linutronix.de header.i=@linutronix.de header.b="0uq9RFdT"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="XVk54KdT"; dkim-atps=neutral Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) by gabe.freedesktop.org (Postfix) with ESMTPS id 12ACC10EC3D; Fri, 28 Jun 2024 13:06:08 +0000 (UTC) From: Sebastian Andrzej Siewior DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1719579966; 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=UXgMZNJcLD6SXsXrrQCAlXc5Nd7zx7riN68jC0FEqBo=; b=0uq9RFdT9rUqjni2IzjW8Tkq1w88pFvEnja9zeMJJO7Tc1CtwD2fgr8VeQopQyBH6+M802 /tEZOGyyn9L7JxL++6ZfCPQJBfyU8TlWH6z8vDNNjwBzDTzd+VVxNGbyKhTHvy6MlV4mPN rZSMzE2wmDr+qeVYP9jscljLXB6rkLPs0EQSyosOuk9Gxoh8Gqy3Sx7gizYIv01NjWtfTe b2/UDMiH/L1zIjOV5rV1qnsnw/QNI8HBnbNSxF7yStNkBoQgwKWvFnKqbPxgjZZeyRVFoT mCUwhh+ajbIlGe8LkEipbbefl3GnwSZTQ939CJAM9eLJB3KXG2/FfiXaipqdWA== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1719579966; 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=UXgMZNJcLD6SXsXrrQCAlXc5Nd7zx7riN68jC0FEqBo=; b=XVk54KdTG8rPvir9TxAdnbLvGWfu143oLAyGdTbb+X3bKZ+TKa7m9I1zFXRkRKrZ2rbdsm oqDoVKGV2NPabdCA== 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 v3 2/8] drm/i915: Don't disable interrupts on PREEMPT_RT during atomic updates Date: Fri, 28 Jun 2024 14:58:01 +0200 Message-ID: <20240628130601.1772849-3-bigeasy@linutronix.de> In-Reply-To: <20240628130601.1772849-1-bigeasy@linutronix.de> References: <20240628130601.1772849-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 Fri Jun 28 12:58:02 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: 13716101 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 824CAC3064D for ; Fri, 28 Jun 2024 13:06:17 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 5CBD710EC4B; Fri, 28 Jun 2024 13:06:12 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; secure) header.d=linutronix.de header.i=@linutronix.de header.b="sEPb0Bzg"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="JElxYQ3V"; dkim-atps=neutral Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) by gabe.freedesktop.org (Postfix) with ESMTPS id 4537B10EC3E; Fri, 28 Jun 2024 13:06:08 +0000 (UTC) From: Sebastian Andrzej Siewior DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1719579966; 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=nDRiXqdZUrRJml/pYgW8ySo5l4Ui2vAz5hfNGnk7Y4c=; b=sEPb0BzgacOLGuCfvr9v06KSPJZY0r4ZCoJEGvBJzkDDKcdpPVxQmbMdvpUu/agvCnuLhO qlCfn4YCub0f+ooZ1rRkRNOS6ODcwglLU2uu5gjswAYoJOUj1RZKgQVcDhSMbnOdpMX4jH CylvA07zOWuNHFcKvU6VBYlLM+o+Er9ogPYTNK4Sq/MzWne5qDXrlgewy6wtMtTF4XvZVS LyiSa85302BMViHOEOLXs0FnkuOGmizSGBKtPtr919WYZrksFpP1QA6HNVcCAnoyNwkFUk IiSc6EEmuybBlLzD1QrwDMYAfoJDMV/jtkET/h12DItJS/eAS/BM3VquBlgS7w== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1719579966; 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=nDRiXqdZUrRJml/pYgW8ySo5l4Ui2vAz5hfNGnk7Y4c=; b=JElxYQ3V8n3Et8CMETNtqe4Yyv8+4yEwnDCtKGkOSOPHAk0/eGh/IXeuxPMPOihmAC9UKK 5qMQ2aS9DHIqIoDw== 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 , Tvrtko Ursulin Subject: [PATCH v3 3/8] drm/i915: Don't check for atomic context on PREEMPT_RT Date: Fri, 28 Jun 2024 14:58:02 +0200 Message-ID: <20240628130601.1772849-4-bigeasy@linutronix.de> In-Reply-To: <20240628130601.1772849-1-bigeasy@linutronix.de> References: <20240628130601.1772849-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. Ignore _WAIT_FOR_ATOMIC_CHECK() on PREEMPT_RT. Reviewed-by: Tvrtko Ursulin Link: https://lore.kernel.org/all/20211006164628.s2mtsdd2jdbfyf7g@linutronix.de/ Signed-off-by: Sebastian Andrzej Siewior --- drivers/gpu/drm/i915/i915_utils.h | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/i915/i915_utils.h b/drivers/gpu/drm/i915/i915_utils.h index 06ec6ceb61d57..12cbf04990182 100644 --- a/drivers/gpu/drm/i915/i915_utils.h +++ b/drivers/gpu/drm/i915/i915_utils.h @@ -273,8 +273,13 @@ wait_remaining_ms_from_jiffies(unsigned long timestamp_jiffies, int to_wait_ms) (Wmax)) #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 CONFIG_PREEMPT_COUNT is disabled, in_atomic() always reports false. + * On PREEMPT_RT the context isn't becoming atomic because it is used in an + * interrupt handler or because a spinlock_t is acquired. This leads to + * warnings which don't occur otherwise and therefore the check is disabled. + */ +#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 Fri Jun 28 12:58:03 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: 13716103 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 7F561C30658 for ; Fri, 28 Jun 2024 13:06:26 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id C591610EC50; Fri, 28 Jun 2024 13:06:25 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; secure) header.d=linutronix.de header.i=@linutronix.de header.b="2zYIyDci"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="+lMQ6UWs"; dkim-atps=neutral Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) by gabe.freedesktop.org (Postfix) with ESMTPS id A456710EC3D; Fri, 28 Jun 2024 13:06:08 +0000 (UTC) From: Sebastian Andrzej Siewior DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1719579967; 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=LClj3izlGXaMQIAeLbUmdyrhrmCGtl3RogJfw1vnch0=; b=2zYIyDci8NBP/NN7DSu0YXamEIBfd+7d+Y7yCR13wPXuWQajQdxZnVnDhTrSpfDY5x56gr OH0zo1vnK/iNnJeQEy1EuQ3+HJ9vAYMAkPDRKucuNXmhgGuhBMV2zk2KtBv07ivYR05CaM nxLeX6rSqOxLtzRX1ZDpffwEs253CpdrOdYjIq99tQCHqxzUlbZSDbNKPAz8ziceKXZVbw MkdlXd/PcT9ZuWf/jdYwZrFQzfl3WYtIbMGDOJ2U6jrdASqBfTBC8VbHwS7uMLff5WEl30 RAjxb/asmFTrCO6mOPyTpJFG3T4Z6P+c5g36Y264tt6Fh2xYyQQVhO3Irkhofw== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1719579967; 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=LClj3izlGXaMQIAeLbUmdyrhrmCGtl3RogJfw1vnch0=; b=+lMQ6UWsnbKyzEvfevQJ82gMw1Odozv/Hbzq2++Mh8tJw1WSpJ5zwDiygKa04HzOZsFloD me7/IapFbSsB4lAA== 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 , Tvrtko Ursulin , Luca Abeni , Steven Rostedt Subject: [PATCH v3 4/8] drm/i915: Disable tracing points on PREEMPT_RT Date: Fri, 28 Jun 2024 14:58:03 +0200 Message-ID: <20240628130601.1772849-5-bigeasy@linutronix.de> In-Reply-To: <20240628130601.1772849-1-bigeasy@linutronix.de> References: <20240628130601.1772849-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. Acked-by: Tvrtko Ursulin Reported-by: Luca Abeni Cc: Steven Rostedt Signed-off-by: Sebastian Andrzej Siewior --- 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 Fri Jun 28 12:58:04 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: 13716099 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 E6975C30658 for ; Fri, 28 Jun 2024 13:06:15 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 4847010EC48; Fri, 28 Jun 2024 13:06:11 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; secure) header.d=linutronix.de header.i=@linutronix.de header.b="JAmCdGcI"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="6gHegUWK"; dkim-atps=neutral Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) by gabe.freedesktop.org (Postfix) with ESMTPS id 8FADE10EC3D; Fri, 28 Jun 2024 13:06:09 +0000 (UTC) From: Sebastian Andrzej Siewior DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1719579967; 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=fjq5VyonfAPnN9PeL+PDQ4UWGBptU2Ie5BlwPrLO9HE=; b=JAmCdGcIKRxP3nT2RntMGhpTrqXRcG/7bn680DElPsx8mbkHq8o9ZxqTH3Pe2wK1SZx2JE MPXjhqtrqw0QBfE+woYvxVd/zZQ6cW2O8zsL45JJFBIyyF+MkkjJOE0fOYWS9j7irzsWze 6DpOxXNxg/wfxQmoLOY2Tz8SD6pVitchUX2VvwGm7wV1XRTBVWt7aTNwXCCfcn9V+bZeZ/ DzVe7gDP4+kjkNZUcZw0Kp5sxQRSKZoxS6RRvQo6SZ0k1h2r6zhUMkGMDsbxk9KdE/ZNAU xkvKQc+NkrX+DOLv9dgK2ZqnKwAIJI6oQpSrQ0KZii34KkDS5maNhyxu0FOVjA== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1719579967; 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=fjq5VyonfAPnN9PeL+PDQ4UWGBptU2Ie5BlwPrLO9HE=; b=6gHegUWKYl/d2oLUWSErRmFBM8klP+hnTeM2Zx6IhLA+W5TJd5WtKL/ZiDB01yx/RZ0xye KQ9bXS95KlRfZ9Ag== 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 v3 5/8] drm/i915/gt: Use spin_lock_irq() instead of local_irq_disable() + spin_lock() Date: Fri, 28 Jun 2024 14:58:04 +0200 Message-ID: <20240628130601.1772849-6-bigeasy@linutronix.de> In-Reply-To: <20240628130601.1772849-1-bigeasy@linutronix.de> References: <20240628130601.1772849-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 Fri Jun 28 12:58:05 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: 13716098 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 BD605C3064D for ; Fri, 28 Jun 2024 13:06:14 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 2CBDE10EC42; Fri, 28 Jun 2024 13:06:11 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; secure) header.d=linutronix.de header.i=@linutronix.de header.b="w5ihT7tO"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="f3yuEQJl"; dkim-atps=neutral Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) by gabe.freedesktop.org (Postfix) with ESMTPS id 954CE10EC3E; Fri, 28 Jun 2024 13:06:09 +0000 (UTC) From: Sebastian Andrzej Siewior DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1719579967; 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=aSXJB0QPwx57XIMNHUpDO7fz+i0r/BRxLazBwWVlZsk=; b=w5ihT7tOwTESJmHDskat99KpK+Ty63wmiluJkQ9oli5YmGvRmoDkQf/QG9DoFTY5QYpPeV pWmsLldcLYmzAIStm6AOewc+UVYzzdMqeqRMF+ND7OHzdrw2CfltXO8qxRaGDlfk6M5GUP fYIMnN7G0Ve7WEIfjb9ALfHlB7Rbb62zN5QgPCe31dYRMSQMAuB06mdRSasgusUQCbvp/b fKRtTR1AelGNUQdKGcm4mXU/+eI9u5fHndWdowBvJMtK8EDYPSgAcfWBHITWVxZ/lpF8qW ZIYrUZOr3oGx8P9J+mm0VcUd3iw+X3/IFiiRFF09sKcpPjFnm6GZgBheNPXkvQ== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1719579967; 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=aSXJB0QPwx57XIMNHUpDO7fz+i0r/BRxLazBwWVlZsk=; b=f3yuEQJlm/bnETjj9Rra+/y7WZhs5G91o9OlmfOiWLWWU0o97KICsagi/o7mOOWHeNjxyl gtQ01IFazwKymGDA== 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 , Tvrtko Ursulin Subject: [PATCH v3 6/8] drm/i915: Drop the irqs_disabled() check Date: Fri, 28 Jun 2024 14:58:05 +0200 Message-ID: <20240628130601.1772849-7-bigeasy@linutronix.de> In-Reply-To: <20240628130601.1772849-1-bigeasy@linutronix.de> References: <20240628130601.1772849-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 Acked-by: Tvrtko Ursulin Signed-off-by: Sebastian Andrzej Siewior --- 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 Fri Jun 28 12:58:06 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: 13716097 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 58CBEC30658 for ; Fri, 28 Jun 2024 13:06:13 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id AF1B510EC3E; Fri, 28 Jun 2024 13:06:10 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; secure) header.d=linutronix.de header.i=@linutronix.de header.b="oHVctR6c"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="8rJrZHGZ"; dkim-atps=neutral Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) by gabe.freedesktop.org (Postfix) with ESMTPS id 9A12310EC42; Fri, 28 Jun 2024 13:06:09 +0000 (UTC) From: Sebastian Andrzej Siewior DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1719579968; 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=QUcBODj2VIRg16LXBIJ8ojuGJ2urgHUrPlIjEZ4VwqM=; b=oHVctR6crCWokMLNVI9bgLImu74S5x8bddjOSVcVwQ8+BkrsK2EgBCrWeX0CME2wePYpI2 feS6uRWD+19Sclq4rKlzeXK+yy5h0gI1F2d4tySckkcIbCdFzrVD/J+BKezYcTM9EFJV1X Jf0QsNQL977f+q18SKreuD1+PJiZsrv9R4bNNh8m1CjD07QdqKOnA820xRPOB4aGNRWg13 j93L4AQOYIj5AXwRpfpccFI/KlNuldi9xW5/U7ZViPU+t29EOK/YnZSNH1jdze+w84X/UL dJSxWcujoamFHhrDdLps81RAd88xDezKP738WzZImi0jW2aSqALG4ZXRUYYdiQ== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1719579968; 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=QUcBODj2VIRg16LXBIJ8ojuGJ2urgHUrPlIjEZ4VwqM=; b=8rJrZHGZdGCcZIF9Y5ht+Cu3gSiRTeaOrOcc+xTvgbVn/FnuGJz3UQbx/6j/EHRayn2dJ+ RItX8IET1Xn9owAQ== 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 v3 7/8] drm/i915/guc: Consider also RCU depth in busy loop. Date: Fri, 28 Jun 2024 14:58:06 +0200 Message-ID: <20240628130601.1772849-8-bigeasy@linutronix.de> In-Reply-To: <20240628130601.1772849-1-bigeasy@linutronix.de> References: <20240628130601.1772849-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 Fri Jun 28 12:58:07 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: 13716102 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 CF6DFC3064D for ; Fri, 28 Jun 2024 13:06:26 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id E57E410EC57; Fri, 28 Jun 2024 13:06:25 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; secure) header.d=linutronix.de header.i=@linutronix.de header.b="qhMxQlk+"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="jhZjdyq2"; dkim-atps=neutral Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) by gabe.freedesktop.org (Postfix) with ESMTPS id BF29310EC48; Fri, 28 Jun 2024 13:06:09 +0000 (UTC) From: Sebastian Andrzej Siewior DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1719579968; 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=HGsGwym1/3E6Eo02B1P43v8CIhCKh8E4WzxEDKWbJAQ=; b=qhMxQlk+bxQ1lfF9UlJnkt1Ohk4hRU8tenGI+8HNKXYVz0pWu9iOCE/PXUatP1+7CcyWts S7YgkMVZrxTdZD/lBcdaNf6fEbSM9eViwzPIWyM7DX7HO6UDWJs9yyIc0LI5LslF4kyGeS q9gZTTmSydTiI5I2VHKpexPb+m8969Sq05btPQuVBXan6x/pzFX3+MuanNrXkkf/mJzJxZ BM7WTbCCx3OARus8/lXx3YOFTHk/CqRYazCBLvUXRRMrzdI/CqS9cLnIrlzywjI0Tut8/A IEg878s3aNg4WsWbNrjAmiPGLWNRwWVEhLfEgigaHSj+A2S62KRJMNAcQq9p0Q== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1719579968; 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=HGsGwym1/3E6Eo02B1P43v8CIhCKh8E4WzxEDKWbJAQ=; b=jhZjdyq2sXqoYAPfJLYkPcgbvVaN5j4SzyV2HU8+BXPwRXvW3hYq0ExtfDcqvZAfBTIzCu BXEqngK1Mg1ikjDA== 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 , Tvrtko Ursulin Subject: [PATCH v3 8/8] Revert "drm/i915: Depend on !PREEMPT_RT." Date: Fri, 28 Jun 2024 14:58:07 +0200 Message-ID: <20240628130601.1772849-9-bigeasy@linutronix.de> In-Reply-To: <20240628130601.1772849-1-bigeasy@linutronix.de> References: <20240628130601.1772849-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. Acked-by: Tvrtko Ursulin Signed-off-by: Sebastian Andrzej Siewior --- 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