From nobody Thu Apr 9 14:58:04 2026 Received: from mail-ot1-f44.google.com (mail-ot1-f44.google.com [209.85.210.44]) (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 6B40F35A3B0 for ; Sun, 8 Mar 2026 22:35:55 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.44 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773009356; cv=none; b=O1CKHPPQlEUchqCwNfm828WpMdplBPYoO5UZsDcwC+jq8DmpZ/lnYE1kdr0ZU9HnMup4y2eErO68q1SBR5K/BPx9qu7AbL/h9biwo1O5CBxgsiDu9/FOxeLpjK1DKZZNE+FSWHp9tAEGU2zG6optkZfiYCrOy4ZKeFUk4Mm3i8M= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773009356; c=relaxed/simple; bh=Ay/WNBlWeZWbkjSgly8nxNlBi5X2XX/8rQLhXfG1YU8=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=MFnlQ/vXAzXHrCwfnVTO4m9qPUyjIXlxLGVHMgzQnkiQBb/rIU+eUS7dmPbuRr8qDxn+YQeqGoQE/rRAvtCwDLEXwwlyrXZPBRwr7klN1EwDevAPTqBr8QjPgjMEdBFM9V/WfcPzK3j0PsejSSOiTsaBQKeFidaAexclfX7oP+A= 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=lNKdkB4M; arc=none smtp.client-ip=209.85.210.44 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="lNKdkB4M" Received: by mail-ot1-f44.google.com with SMTP id 46e09a7af769-7d73ccee442so1173817a34.1 for ; Sun, 08 Mar 2026 15:35:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1773009354; x=1773614154; 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=kMKCTB0JgA7UPGciIJUTWbaxDO5eSFF+/kzpE0aUa0Y=; b=lNKdkB4MwLZT4UR2P5gcN7a6eZrMDUIzC3eCnlrUH/OaJTnwJjFgMfavI3LpO4W0Eq uHRCDHjHYLUUK7d/2jDeOlQEZ85v5NQ43UW36sot3laQ3Cu6H92OlEW5hatC4u0/E14d 5XCYnxXxSyQFWmXXmlr7Jp6TQnICEDLO6O6IR1kuSocUS22NCUqpznH2h15GlwtXbDku 7MZEOpaHsRsN8NWa0X0AsFaU29oI+kr9S/ggQkSv8tJywokGbo0KrOvz+mCGmAmerQRI 6K69D2Xx35p8NiFiaVFUKccM4JezCywjq2DI2PQc4LWSvhwQ0OkQ3yD0GTbsdcS2QZjM gnRQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1773009354; x=1773614154; 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=kMKCTB0JgA7UPGciIJUTWbaxDO5eSFF+/kzpE0aUa0Y=; b=FxUz/oT9qwo2o7cHou7Sme+VzXd0LafdZb8XNDKBiGqmmKKD4L32C07kcmV92rin3y c9C/XB91HpzA0e5e0lhHdQSJl0viq6F9DfbFyDate2JLP+e/e0G+5Qn4QRfGTbdToX7Y 52cL7L6G9V8Ro+YYtH7fDcE3pGt/QNP9biUb1ruzRvbXOw4dSAUy7GRpSGBXN0FZzttp qQFLu/YXoi0CjavjqNGIU3zQGUAcIs+YMoEaac6J6qD6zL5e03azks+6+Qy51Vg4TSx5 /hdWcmFcIIP1jGkoO+IY+Zgn+vasD2+fwvdYk1xaExWvdv2GDqnFbaV0Cld1lJxzW8HI M1jw== X-Gm-Message-State: AOJu0YzpZY78Mv0+7UlTpS7iu4QeySzkezYlq6HQxq0UTkFUK5MJ0Q8S tK8wdA3yS/tlPjpqS2Z8j1A6GvtYzzqEhz4i1VvzdQpB9PVSKRW2B2ZWXXEYAg== X-Gm-Gg: ATEYQzwO3LLZlQrPS1JNh4tBbcJfDHquea7fDUMrHxJyzVmztGppt6pu9dPdvtmbEq4 kXCYneguEhAxvD7RatZlkSFy8BM1FeUYzh6f2D5HKHx782V71RQr80j7RXYvIwBlbHZL1nIw3Qz ktfGX1IUwmH1XUzjY5vUdyRID52KSTzp8xZ7Fjyo3IwGwMclOSbmvsQpn5ZVZUtfbn89eXMeCXX g1QZcmnvWaF7gk2g4rpHLmPSfz5G5x54POaj5m+uZPKB5CfT/OrqwhQ7r7S0FSdniolE91Ic8GJ o5suWDU+gNJeBC20T5bmGJaLGLzM3353HMtwO73knwkuLsj1pFL74ROeLQEYYRfdvYBOC7C83Zm DGWgdo8KTh5wcZXOGYJUgrH5dIyaM5IFWCV+IQ0T1Gf1iL3lvpvHS09AuFNV8s0959aLCLvs23t VCrtWqOHpIM1HMYmXEw8lUGCBJDl6DlvI0KuOuJslKRvO6hnN64KCQd9unqG8= X-Received: by 2002:a05:6808:6b8a:b0:45e:e173:f9ac with SMTP id 5614622812f47-466dcb9baffmr5337559b6e.55.1773009354099; Sun, 08 Mar 2026 15:35:54 -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-466df93ce67sm4529016b6e.1.2026.03.08.15.35.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 08 Mar 2026 15:35:53 -0700 (PDT) From: Jim Cromie To: linux-kernel@vger.kernel.org Cc: Jim Cromie , Matthew Auld , Arun Pravin , Christian Koenig , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Simona Vetter , Luca Coelho , Jani Nikula , dri-devel@lists.freedesktop.org Subject: [PATCH 2/2] drivers/gpu/drm/drm_print: fix drm_printer dynamic debug bypass Date: Sun, 8 Mar 2026 16:35:37 -0600 Message-ID: <20260308223538.96729-3-jim.cromie@gmail.com> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260308223538.96729-1-jim.cromie@gmail.com> References: <20260308223538.96729-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() is the canonical bit-test for drm.debug. Commit 6ce6fae84536 ("drm_print: optimize drm_debug_enabled for jump-label") renamed the original bit-test to drm_debug_enabled_raw() and introduced an internal bypass for dyndbg. When [1]=3Dy, it defined __drm_debug_enabled() to evaluate to 'true', allowing dyndbg's static-key to handle the filtering at the callsite. It also provided drm_debug_enabled() for cases where an explicit bit-mask check is still required. 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, [1]=3Dy was marked BROKEN. Because __drm_printfn_dbg() is a shared helper where the callsite is not directly guarded by dyndbg's static-key, this caused it to hit the 'true' bypass and always print, ignoring the drm.debug bit-mask. 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. To fix this, change __drm_printfn_dbg() to use drm_debug_enabled_instrumented() instead. This ensures the bit-test is performed at runtime even when dyndbg is enabled. It also adds a pr_debug() to help track the frequency of this bit-test. Additionally, update __drm_dev_dbg() to use the canonical drm_debug_enabled() instead of the internal __drm_debug_enabled(). While __drm_dev_dbg() is wrapped by a dyndbg factory and thus safe, this change ensures consistency and clarifies the intended usage. [1] CONFIG_DRM_USE_DYNAMIC_DEBUG Fixes: 9fd6f61a297e ("drm/print: add drm_dbg_printer() for drm device speci= fic printer") Signed-off-by: Jim Cromie --- drivers/gpu/drm/drm_print.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/drm_print.c b/drivers/gpu/drm/drm_print.c index ded9461df5f2..9b622345e2eb 100644 --- a/drivers/gpu/drm/drm_print.c +++ b/drivers/gpu/drm/drm_print.c @@ -218,7 +218,7 @@ void __drm_printfn_dbg(struct drm_printer *p, struct va= _format *vaf) const struct device *dev =3D drm ? drm->dev : NULL; enum drm_debug_category category =3D p->category; =20 - if (!__drm_debug_enabled(category)) + if (!drm_debug_enabled_instrumented(category)) return; =20 __drm_dev_vprintk(dev, KERN_DEBUG, p->origin, p->prefix, vaf); @@ -335,7 +335,7 @@ void __drm_dev_dbg(struct _ddebug *desc, const struct d= evice *dev, struct va_format vaf; va_list args; =20 - if (!__drm_debug_enabled(category)) + if (!drm_debug_enabled(category)) return; =20 /* we know we are printing for either syslog, tracefs, or both */ --=20 2.53.0