From patchwork Tue Aug 6 13:38:30 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jani Nikula X-Patchwork-Id: 13754873 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 ACA27C3DA64 for ; Tue, 6 Aug 2024 13:38:56 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 506F110E364; Tue, 6 Aug 2024 13:38:56 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=intel.com header.i=@intel.com header.b="Wt82ZlIj"; dkim-atps=neutral Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.14]) by gabe.freedesktop.org (Postfix) with ESMTPS id CEABB10E364 for ; Tue, 6 Aug 2024 13:38:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1722951535; x=1754487535; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=AGeQDE+5rNekvHiaIRobZhsGbrmwdv/NNtvM36qo2Yw=; b=Wt82ZlIjpwbCAhtlwj14wTcZrDX9T/uh8Y03lybiBHIOT83FgDbT4QL7 OxVf9HmSPvyY1QTYY4X/RfNnrIR8loKC2Cz0D9nMXMkt20jJqp7EOSM3W eMJrUnIT39A+cJXbHtKEFcdkooFlR97fkSdWMv6UXMqrAuPfiAc6wzIee /jQIPOjTH7NjDk6HEyrfrOJDQNWHvscOZv0zZ+XG3Y9TCnN8drHfqkNhy aVWItXdbQHvhLXwd+2K1FTVeutRPnJxFlk5L58CyNo+a2+YPEYa5TXNI8 et3ONBkiKbyyhSObR35TxvspFhUwKpVHl7Tuq2VMqzn/mofdIIE5hb7yk Q==; X-CSE-ConnectionGUID: csIB+cFHTkWhVfOYgwr9Tg== X-CSE-MsgGUID: TLxYooigRlapKD6dxYEXDA== X-IronPort-AV: E=McAfee;i="6700,10204,11156"; a="24756952" X-IronPort-AV: E=Sophos;i="6.09,267,1716274800"; d="scan'208";a="24756952" Received: from orviesa007.jf.intel.com ([10.64.159.147]) by orvoesa106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 06 Aug 2024 06:38:55 -0700 X-CSE-ConnectionGUID: eGQo/WPJTPqU1UiCyVs6xQ== X-CSE-MsgGUID: Po4k/93eR+evyaFIpjzZrw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.09,267,1716274800"; d="scan'208";a="57090115" Received: from mwiniars-desk2.ger.corp.intel.com (HELO localhost) ([10.245.246.4]) by orviesa007-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 06 Aug 2024 06:38:53 -0700 From: Jani Nikula To: intel-gfx@lists.freedesktop.org Cc: jani.nikula@intel.com Subject: [PATCH 1/3] drm/i915: remove a few __i915_printk() uses Date: Tue, 6 Aug 2024 16:38:30 +0300 Message-Id: <82857a0c04d3c11ca6758f05c13a3cec4f1a2f01.1722951405.git.jani.nikula@intel.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: References: MIME-Version: 1.0 Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo 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" __i915_printk() does nothing for notice/info levels. Just use the regular drm_notice() and drm_info() calls. Signed-off-by: Jani Nikula Reviewed-by: Jonathan Cavitt Reviewed-by: Andi Shyti --- drivers/gpu/drm/i915/i915_utils.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/gpu/drm/i915/i915_utils.c b/drivers/gpu/drm/i915/i915_utils.c index 6f9e7b354b54..bee32222f0fd 100644 --- a/drivers/gpu/drm/i915/i915_utils.c +++ b/drivers/gpu/drm/i915/i915_utils.c @@ -54,8 +54,8 @@ __i915_printk(struct drm_i915_private *dev_priv, const char *level, void add_taint_for_CI(struct drm_i915_private *i915, unsigned int taint) { - __i915_printk(i915, KERN_NOTICE, "CI tainted:%#x by %pS\n", - taint, (void *)_RET_IP_); + drm_notice(&i915->drm, "CI tainted: %#x by %pS\n", + taint, __builtin_return_address(0)); /* Failures that occur during fault injection testing are expected */ if (!i915_error_injected()) @@ -74,9 +74,9 @@ int __i915_inject_probe_error(struct drm_i915_private *i915, int err, if (++i915_probe_fail_count < i915_modparams.inject_probe_failure) return 0; - __i915_printk(i915, KERN_INFO, - "Injecting failure %d at checkpoint %u [%s:%d]\n", - err, i915_modparams.inject_probe_failure, func, line); + drm_info(&i915->drm, "Injecting failure %d at checkpoint %u [%s:%d]\n", + err, i915_modparams.inject_probe_failure, func, line); + i915_modparams.inject_probe_failure = 0; return err; } From patchwork Tue Aug 6 13:38:31 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jani Nikula X-Patchwork-Id: 13754874 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 EB316C3DA64 for ; Tue, 6 Aug 2024 13:39:00 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 63F5D10E369; Tue, 6 Aug 2024 13:39:00 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=intel.com header.i=@intel.com header.b="EUAN3SPd"; dkim-atps=neutral Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.14]) by gabe.freedesktop.org (Postfix) with ESMTPS id 5C66310E367 for ; Tue, 6 Aug 2024 13:38:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1722951540; x=1754487540; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=WLvKBvQWw7jlffHL6Bd/5Xz30J6iZ2a+5/GzoxwF8R4=; b=EUAN3SPd9Ll/v18TkQ7qj6Urnu7R/A00kT9DF4cSSO5gmUTDWlHwUurJ 4eLw+SU3HjuT7lITkhI5Ti+EkGkkBXl5pNnS5CnA71f6zcGGEXVxlX83a WV9lDNlJO3WceNTuum3/WGM869TdZg7WetqGnVkEhrk7PiUGClV3usYMd wgVNxiTskqcBIzkshM1/OlyILa8/p4vAYvuvPuaf82924Dqs5uBRYHVwh bDk2kfEyrX/t5h6HgW3SDBX7cckB83FZipDlw28x2Z6QneWkYMhqF4DUw e6QZt3Ba7+c98n/BX30Wy+tZ1SawEpAlpCEt8PUFBFbd15XZu3wZYKWCf g==; X-CSE-ConnectionGUID: E1k0wsDHR3+U9WuTwYTmhw== X-CSE-MsgGUID: eBL9scacTTOAELmaHuMJ/Q== X-IronPort-AV: E=McAfee;i="6700,10204,11156"; a="24756965" X-IronPort-AV: E=Sophos;i="6.09,267,1716274800"; d="scan'208";a="24756965" Received: from orviesa007.jf.intel.com ([10.64.159.147]) by orvoesa106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 06 Aug 2024 06:38:59 -0700 X-CSE-ConnectionGUID: jB0xr6n9ScOL5k2CKMBulg== X-CSE-MsgGUID: hV+AbXznTnC3Q5eTQ8sHJQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.09,267,1716274800"; d="scan'208";a="57090118" Received: from mwiniars-desk2.ger.corp.intel.com (HELO localhost) ([10.245.246.4]) by orviesa007-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 06 Aug 2024 06:38:57 -0700 From: Jani Nikula To: intel-gfx@lists.freedesktop.org Cc: jani.nikula@intel.com Subject: [PATCH 2/3] drm/i915: remove i915_report_error() Date: Tue, 6 Aug 2024 16:38:31 +0300 Message-Id: <19eab020c57c0fa45acacf4e4a8077e57cd4d561.1722951405.git.jani.nikula@intel.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: References: MIME-Version: 1.0 Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo 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" i915_report_error() has only two users, both in driver probe. I doubt these cases are worth having a dedicated wrapper to also print bug reporting info. Just switch them to regular drm_err() and remove the wrapper. Signed-off-by: Jani Nikula Reviewed-by: Jonathan Cavitt Reviewed-by: Tvrtko Ursulin Reviewed-by: Andi Shyti --- drivers/gpu/drm/i915/i915_driver.c | 8 ++++---- drivers/gpu/drm/i915/i915_utils.h | 3 --- 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/drivers/gpu/drm/i915/i915_driver.c b/drivers/gpu/drm/i915/i915_driver.c index fb8e9c2fcea5..94dca1d8bb15 100644 --- a/drivers/gpu/drm/i915/i915_driver.c +++ b/drivers/gpu/drm/i915/i915_driver.c @@ -451,8 +451,8 @@ static int i915_driver_hw_probe(struct drm_i915_private *dev_priv) if (HAS_PPGTT(dev_priv)) { if (intel_vgpu_active(dev_priv) && !intel_vgpu_has_full_ppgtt(dev_priv)) { - i915_report_error(dev_priv, - "incompatible vGPU found, support for isolated ppGTT required\n"); + drm_err(&dev_priv->drm, + "incompatible vGPU found, support for isolated ppGTT required\n"); return -ENXIO; } } @@ -465,8 +465,8 @@ static int i915_driver_hw_probe(struct drm_i915_private *dev_priv) */ if (intel_vgpu_active(dev_priv) && !intel_vgpu_has_hwsp_emulation(dev_priv)) { - i915_report_error(dev_priv, - "old vGPU host found, support for HWSP emulation required\n"); + drm_err(&dev_priv->drm, + "old vGPU host found, support for HWSP emulation required\n"); return -ENXIO; } } diff --git a/drivers/gpu/drm/i915/i915_utils.h b/drivers/gpu/drm/i915/i915_utils.h index 06ec6ceb61d5..feb078ae246f 100644 --- a/drivers/gpu/drm/i915/i915_utils.h +++ b/drivers/gpu/drm/i915/i915_utils.h @@ -49,9 +49,6 @@ void __printf(3, 4) __i915_printk(struct drm_i915_private *dev_priv, const char *level, const char *fmt, ...); -#define i915_report_error(dev_priv, fmt, ...) \ - __i915_printk(dev_priv, KERN_ERR, fmt, ##__VA_ARGS__) - #if IS_ENABLED(CONFIG_DRM_I915_DEBUG) int __i915_inject_probe_error(struct drm_i915_private *i915, int err, From patchwork Tue Aug 6 13:38:32 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jani Nikula X-Patchwork-Id: 13754875 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 8446EC49EA1 for ; Tue, 6 Aug 2024 13:39:05 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 16AA310E367; Tue, 6 Aug 2024 13:39:05 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=intel.com header.i=@intel.com header.b="S7e7pSU9"; dkim-atps=neutral Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.14]) by gabe.freedesktop.org (Postfix) with ESMTPS id A338310E367 for ; Tue, 6 Aug 2024 13:39:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1722951544; x=1754487544; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=YM3iHkMiYrD9tT7HYE+CTisHIAwzrkNRcqfWFhZlokg=; b=S7e7pSU9QZqboMHbgkGIjlOLvRW/NyZv9M1TzgOnP2rzHIovAvASTnPq kJGZTp6KvtpuJ4pUd2pTkeNvD0I8uvDCDLphZb6Wp3Kq3XwGd6A2/4G8G X2CR+J4OzlmX386wvticd2jv35KBnM/009dQI78RVNzKvssfnguqq97ZP K2zxfoSNEL9sEaMHajuv5k6Ts+tqBIy6FtFl5E9KiVHhuQIAeRmfhvL51 yq5J2uTV2sW5ltu5OGR426LdhcJdJ3nens4lxR/C7NrGhmZeJiB8vy2Rs Lwt2jL8jW4nAuWaK1qlYmhHYIoltKvgcAU+M7KpCiDtH27uNNDITp0M1r A==; X-CSE-ConnectionGUID: s3kEg5TjQHul3nz/9BtOLA== X-CSE-MsgGUID: n2DoTfIEQ8+jdTyjksq2Bg== X-IronPort-AV: E=McAfee;i="6700,10204,11156"; a="24756990" X-IronPort-AV: E=Sophos;i="6.09,267,1716274800"; d="scan'208";a="24756990" Received: from orviesa007.jf.intel.com ([10.64.159.147]) by orvoesa106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 06 Aug 2024 06:39:04 -0700 X-CSE-ConnectionGUID: a6mSD29KQOCm59qW57tWOQ== X-CSE-MsgGUID: QW1f9BNXTTWXVZvIOjNyJQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.09,267,1716274800"; d="scan'208";a="57090123" Received: from mwiniars-desk2.ger.corp.intel.com (HELO localhost) ([10.245.246.4]) by orviesa007-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 06 Aug 2024 06:39:02 -0700 From: Jani Nikula To: intel-gfx@lists.freedesktop.org Cc: jani.nikula@intel.com Subject: [PATCH 3/3] drm/i915: remove __i915_printk() Date: Tue, 6 Aug 2024 16:38:32 +0300 Message-Id: X-Mailer: git-send-email 2.39.2 In-Reply-To: References: MIME-Version: 1.0 Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo 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" With the previous cleanups, the last remaining user of __i915_printk() is i915_probe_error(). Switch that to use drm_dbg() and drm_err() instead, dropping the request to report bugs in the few remaining specific cases. Signed-off-by: Jani Nikula Reviewed-by: Jonathan Cavitt Acked-by: Tvrtko Ursulin Reviewed-by: Andi Shyti --- drivers/gpu/drm/i915/i915_utils.c | 41 ------------------------------- drivers/gpu/drm/i915/i915_utils.h | 13 +++++----- 2 files changed, 6 insertions(+), 48 deletions(-) diff --git a/drivers/gpu/drm/i915/i915_utils.c b/drivers/gpu/drm/i915/i915_utils.c index bee32222f0fd..b34a2d3d331d 100644 --- a/drivers/gpu/drm/i915/i915_utils.c +++ b/drivers/gpu/drm/i915/i915_utils.c @@ -11,47 +11,6 @@ #include "i915_reg.h" #include "i915_utils.h" -#define FDO_BUG_MSG "Please file a bug on drm/i915; see " FDO_BUG_URL " for details." - -void -__i915_printk(struct drm_i915_private *dev_priv, const char *level, - const char *fmt, ...) -{ - static bool shown_bug_once; - struct device *kdev = dev_priv->drm.dev; - bool is_error = level[1] <= KERN_ERR[1]; - bool is_debug = level[1] == KERN_DEBUG[1]; - struct va_format vaf; - va_list args; - - if (is_debug && !drm_debug_enabled(DRM_UT_DRIVER)) - return; - - va_start(args, fmt); - - vaf.fmt = fmt; - vaf.va = &args; - - if (is_error) - dev_printk(level, kdev, "%pV", &vaf); - else - dev_printk(level, kdev, "[" DRM_NAME ":%ps] %pV", - __builtin_return_address(0), &vaf); - - va_end(args); - - if (is_error && !shown_bug_once) { - /* - * Ask the user to file a bug report for the error, except - * if they may have caused the bug by fiddling with unsafe - * module parameters. - */ - if (!test_taint(TAINT_USER)) - dev_notice(kdev, "%s", FDO_BUG_MSG); - shown_bug_once = true; - } -} - void add_taint_for_CI(struct drm_i915_private *i915, unsigned int taint) { drm_notice(&i915->drm, "CI tainted: %#x by %pS\n", diff --git a/drivers/gpu/drm/i915/i915_utils.h b/drivers/gpu/drm/i915/i915_utils.h index feb078ae246f..71bdc89bd621 100644 --- a/drivers/gpu/drm/i915/i915_utils.h +++ b/drivers/gpu/drm/i915/i915_utils.h @@ -45,10 +45,6 @@ struct timer_list; #define MISSING_CASE(x) WARN(1, "Missing case (%s == %ld)\n", \ __stringify(x), (long)(x)) -void __printf(3, 4) -__i915_printk(struct drm_i915_private *dev_priv, const char *level, - const char *fmt, ...); - #if IS_ENABLED(CONFIG_DRM_I915_DEBUG) int __i915_inject_probe_error(struct drm_i915_private *i915, int err, @@ -66,9 +62,12 @@ bool i915_error_injected(void); #define i915_inject_probe_failure(i915) i915_inject_probe_error((i915), -ENODEV) -#define i915_probe_error(i915, fmt, ...) \ - __i915_printk(i915, i915_error_injected() ? KERN_DEBUG : KERN_ERR, \ - fmt, ##__VA_ARGS__) +#define i915_probe_error(i915, fmt, ...) ({ \ + if (i915_error_injected()) \ + drm_dbg(&(i915)->drm, fmt, ##__VA_ARGS__); \ + else \ + drm_err(&(i915)->drm, fmt, ##__VA_ARGS__); \ +}) #define range_overflows(start, size, max) ({ \ typeof(start) start__ = (start); \