From nobody Tue Apr 7 12:55:16 2026 Received: from mail-oi1-f181.google.com (mail-oi1-f181.google.com [209.85.167.181]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id D52AA3BC699 for ; Fri, 13 Mar 2026 13:25:09 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.167.181 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773408311; cv=none; b=DMDJnLEWBqAmdlZ//Q3w7HYEzyBqk6UuvABik+jkFk6Dv4Le7+hyxJRd+NniJKIrvh1EHR1W+6s8n58IeIyspZ6nss+YSoKr5mYMhmnTgEDcA+vgh6Fnhn6Hlm3bE5Wgot6cicz+KxGPiklnnbVRcWAyVHP9HqupICepmj/9pTc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773408311; c=relaxed/simple; bh=5SK2vrQTmGsYJ2XPIk7j97VipujdQktv5uWLjBlVfRg=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=Rb799da1Zk884gdhaFFU+6XBG2/jsJd6i+qbWrY8wxE2TahslFdPfi7O8VSZfKr1wGS2diF7kbtRKuagZz9I6dkUIVgjvfc9ag4peFaxs5QNzFSFGYUg5Cqysj3v7fJZyYxmE+vFZccHtsJSp8TKXSax1HKZIUAca3JepQexjGQ= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=bbKkbrQ9; arc=none smtp.client-ip=209.85.167.181 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="bbKkbrQ9" Received: by mail-oi1-f181.google.com with SMTP id 5614622812f47-466f1c3c627so1553989b6e.1 for ; Fri, 13 Mar 2026 06:25:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1773408309; x=1774013109; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=Vn6BBWYTc8CIB4CSHYkkNij4NNRuRZw5Ruqls3nbhKU=; b=bbKkbrQ9dX+S5q0So6Ifr8504nlJjAftnjE0SSNwDZmHr27YvihXue4D3oFcNqYyyX evgVsCtqLSIjTmMLGKluTviR5Cof0WQn3eV/NFjT8g3sAbNfW2U7O1Ip2FtzEyjNTuDK zNg7BBA6Nl/2j2R1jjPYXBHG8YOA1JcalcZF+QdrCqsF5HtYgbMVOYuM7wcDRMgDiLpJ WMx3ZkvS5NckEyx+YfUhTSnvyLAi0iLMzlgCNRMs5o6J8KXuCjyozuC3RTT8ZE9hM5Hm tcgKO1yCvTkaRgS1Q/RfOvpvZSQKZBCJAjg3UM5S6uP8L6cBTIokPT+jdwAuymavCcv3 9Kjw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1773408309; x=1774013109; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=Vn6BBWYTc8CIB4CSHYkkNij4NNRuRZw5Ruqls3nbhKU=; b=iWF8cuzt5fp3BCQf7ETIhr+DCMExyyMCZZVQDqOGwtM8SYh4mD+ZyRC3n79eUmkRo0 xdkWzc0O+37lp5pmhm0l0fwP38iLmhhdULMJ3moHx5lNkLyicQ+wKzpPj4LAiyqD/5l9 hnFUUppoqH0NBWd9m0h1NRsOt1Vtvq6jri79i7ya3f2OjMt0g/gjpi2PXMJyqJr0mSRc GasWxfMq51Ba/8qYPooGKSBZDCrX06xqBJMtpxAIgCHLvR7t5eqfzUYO3v4FtICavijf 3mAzB7SuSZMst7w0xXEw3J6MvN1yKcJUnwgfbGd7N88kw93T94HbtQyWmOTElR62XRHF b8/A== X-Forwarded-Encrypted: i=1; AJvYcCV30qvYqaKIaYcyD/3ZGwiI8HdSULyWxhgHwznnL9q565VU3kvasCsA7ldotT/gHIEX001+i3TNKxL6/8I=@vger.kernel.org X-Gm-Message-State: AOJu0YzQJXxtYtjIsQCYzUigza9n+4WmdeuSgxyvVCDpNyh7SYCOoZ1p VwyXb7fcaojZ/3c7yBsyQgvXhYLLM89MX4JeRb1stwrfIlEFvba4tCTG X-Gm-Gg: ATEYQzyFwXQZ4wivq+GKxcOVOqiQbJL/Qi0oygrHlOSYptW0gHYP7c9Arz72TsHUHPm Ey3eQmOJHD1DXFOgsI9nA95zZQ4kdtiVLbqdVPJ4kaMH1gFjP6I/wzRQOpBcHXB+yJpKuW9PdN3 ipsocL4xctPr36dwxLz0zgx7UlGQK0xnL+2df1zeSX2UiRSqWyK9gDqtZ8KJLpYTDmEdjlzafhc Vc8wZ2V97ypwPHs6OVVIK5fb5AL76MS6k6R8k8v7F1XQm+IutkzpGHlJKnFwP4w7a5Mlko5URJE +rkJj93KCujr5khZMk/hKixUCoFy6dSU+1+QG/jBDl7I8eQ6kma0BjGOV8SdTFlH1H/iUpTc5GQ bAq/qqsHq7+t2MVEMK8ByJbpGI1JVrW6l+0nVQJquliA8y5o3szCOpCKOVtaNnxTfdc9w4qvDca Xx683i39sQ7WF1NRwhChck/IJT1aPa1bXEpfLTvn3FYOKY7KrG X-Received: by 2002:a05:6808:1302:b0:467:17f3:68bb with SMTP id 5614622812f47-467576d3042mr1687190b6e.59.1773408308527; Fri, 13 Mar 2026 06:25:08 -0700 (PDT) Received: from frodo (c-98-38-17-99.hsd1.co.comcast.net. [98.38.17.99]) by smtp.googlemail.com with ESMTPSA id 5614622812f47-4673434a35csm4795987b6e.20.2026.03.13.06.25.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 13 Mar 2026 06:25:08 -0700 (PDT) From: Jim Cromie To: airlied@gmail.com, simona@ffwll.ch, jbaron@akamai.com, gregkh@linuxfoundation.org, Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , Luca Coelho , Jani Nikula , dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org Cc: Jim Cromie , ville.syrjala@linux.intel.com, christian.koenig@amd.com, matthew.auld@intel.com, arunpravin.paneerselvam@amd.com, louis.chauvet@bootlin.com, skhan@linuxfoundation.org, pmladek@suse.com, ukaszb@chromium.org, intel-gfx@lists.freedesktop.org, amd-gfx@lists.freedesktop.org Subject: [PATCH v11 64/65] drm_print: fix drm_printer dynamic debug bypass Date: Fri, 13 Mar 2026 07:20:29 -0600 Message-ID: <20260313132103.2529746-65-jim.cromie@gmail.com> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260313132103.2529746-1-jim.cromie@gmail.com> References: <20260313132103.2529746-1-jim.cromie@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" drm_debug_enabled([1]) is the canonical bit-test for drm.debug. Commit 6ce6fae84536 ("drm_print: optimize drm_debug_enabled for jump-label") did several things: A- renamed [1] to drm_debug_enabled_raw() B- introduced __drm_debug_enabled(), which evald to either 'true' or _raw([A]), depending upon [2] CONFIG_DRM_USE_DYNAMIC_DEBUG=3Dy/n. C- altered *dev_dbg() to call __drm_debug_enabled(). D- redefined [1] to drm_debug_enabled_instrumented(). This called _raw(), but added a pr_debug() too. This allowed us to see how where and often remaining callsites were called. When [2]=3Dy, [B] short-circuited the bit-test, since dyndbg's wrapper macro had already set the callsite reachable/unreachable. Later, commit 9fd6f61a297e ("drm/print: add drm_dbg_printer() for drm device specific printer") added __drm_printfn_dbg(), but mistakenly used the internal bypass __drm_debug_enabled() instead of the canonical drm_debug_enabled(). This went unnoticed because at the time, [2]=3Dy was marked BROKEN. Because __drm_printfn_dbg() is a shared callback where the callpath is not directly guarded by dyndbg's static-key, checking the bypass macro caused it to evaluate to 'true' and always print, ignoring the drm.debug bit-mask entirely. This results in a flood of messages in environments with slow serial consoles, as seen in DRM-CI on i915 CML devices. When IGT causes a mismatch in intel_pipe_config_compare(), the resulting UART storm causes a hard timeout after 20 minutes (see below the snip). To fix this, change __drm_printfn_dbg() to use the explicit drm_debug_enabled_instrumented() instead. This ensures the bit-test is performed at runtime for this unguarded helper, stopping the UART storm. [1] drm_debug_enabled [2] CONFIG_DRM_USE_DYNAMIC_DEBUG Fixes: 9fd6f61a297e ("drm/print: add drm_dbg_printer() for drm device speci= fic printer") Signed-off-by: Jim Cromie --- some of the many: i915 0000:00:02.0: [drm:intel_pipe_config_compare [i915]] [CRTC:57:pipe A]= fastset requirement not met in hw.adjusted_mode.crtc_vsync_start (expected= 0, found 1083) i915 0000:00:02.0: [drm:intel_pipe_config_compare [i915]] [CRTC:57:pipe A]= fastset requirement not met in hw.adjusted_mode.crtc_vsync_end (expected 0= , found 1097) i915 0000:00:02.0: [drm:intel_pipe_config_compare [i915]] [CRTC:57:pipe A]= fastset requirement not met in hw.adjusted_mode.crtc_vtotal (expected 0, f= ound 1116) i915 0000:00:02.0: [drm:intel_pipe_config_compare [i915]] [CRTC:57:pipe A]= fastset requirement not met in hw.adjusted_mode.crtc_vblank_end (expected = 0, found 1116) i915 0000:00:02.0: [drm:intel_pipe_config_compare [i915]] [CRTC:82:pipe B]= fastset requirement not met in hw.adjusted_mode.crtc_clock (expected 0, fo= und 112800) i915 0000:00:02.0: [drm:intel_pipe_config_compare [i915]] [CRTC:82:pipe B]= fastset requirement not met in hw.adjusted_mode.crtc_clock (expected 0, fo= und 141000) i915 0000:00:02.0: [drm:intel_pipe_config_compare [i915]] [CRTC:82:pipe B]= fastset requirement not met in hw.adjusted_mode.crtc_clock (expected 0, fo= und 141000) i915 0000:00:02.0: [drm:intel_pipe_config_compare [i915]] [CRTC:82:pipe B]= fastset requirement not met in hw.adjusted_mode.crtc_clock (expected 0, fo= und 61040) i915 0000:00:02.0: [drm:intel_pipe_config_compare [i915]] [CRTC:82:pipe B]= fastset requirement not met in hw.adjusted_mode.crtc_clock (expected 0, fo= und 76300) i915 0000:00:02.0: [drm:intel_pipe_config_compare [i915]] [CRTC:82:pipe B]= fastset requirement not met in hw.adjusted_mode.crtc_clock (expected 0, fo= und 76300) i915 0000:00:02.0: [drm:intel_pipe_config_compare [i915]] [CRTC:82:pipe B]= fastset requirement not met in port_clock (expected 0, found 216000) i915 0000:00:02.0: [drm:intel_pipe_config_compare [i915]] [CRTC:82:pipe B]= fastset requirement not met in port_clock (expected 0, found 216000) i915 0000:00:02.0: [drm:intel_pipe_config_compare [i915]] [CRTC:82:pipe B]= fastset requirement not met in port_clock (expected 0, found 270000) i915 0000:00:02.0: [drm:intel_pipe_config_compare [i915]] [CRTC:82:pipe B]= fastset requirement not met in port_clock (expected 0, found 270000) --- drivers/gpu/drm/drm_print.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/drm_print.c b/drivers/gpu/drm/drm_print.c index ceede094ff13..b431881de2c1 100644 --- a/drivers/gpu/drm/drm_print.c +++ b/drivers/gpu/drm/drm_print.c @@ -214,7 +214,7 @@ void __drm_printfn_dbg(struct drm_printer *p, struct va= _format *vaf) const struct drm_device *drm =3D p->arg; const struct device *dev =3D drm ? drm->dev : NULL; =20 - if (!__drm_debug_enabled(p->category)) + if (!drm_debug_enabled_instrumented(p->category)) return; =20 __drm_dev_vprintk(dev, KERN_DEBUG, p->origin, p->prefix, vaf); --=20 2.53.0