From: "Ville Syrjälä" <ville.syrjala@linux.intel.com>
To: Ashutosh Dixit <ashutosh.dixit@intel.com>
Cc: intel-gfx@lists.freedesktop.org, Badal Nilawar <badal.nilawar@intel.com>
Subject: Re: [PATCH] drm/i915: Don't enable hwmon for selftests
Date: Wed, 10 Apr 2024 14:42:46 +0300 [thread overview]
Message-ID: <ZhZ7NsyBtQjnE8HE@intel.com> (raw)
In-Reply-To: <20240410042855.130262-1-ashutosh.dixit@intel.com>
On Tue, Apr 09, 2024 at 09:28:55PM -0700, Ashutosh Dixit wrote:
> There are no hwmon selftests so there is no need to enable hwmon for
> selftests. So enable hwmon only for real driver load.
>
> Closes: https://gitlab.freedesktop.org/drm/intel/-/issues/10366
> Signed-off-by: Ashutosh Dixit <ashutosh.dixit@intel.com>
Why are we adding duct tape instead of fixing it properly?
> ---
> drivers/gpu/drm/i915/i915_driver.c | 16 ++++++++++++++--
> 1 file changed, 14 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/i915_driver.c b/drivers/gpu/drm/i915/i915_driver.c
> index 9ee902d5b72c..6fa6d2c8109f 100644
> --- a/drivers/gpu/drm/i915/i915_driver.c
> +++ b/drivers/gpu/drm/i915/i915_driver.c
> @@ -94,6 +94,7 @@
> #include "i915_memcpy.h"
> #include "i915_perf.h"
> #include "i915_query.h"
> +#include "i915_selftest.h"
> #include "i915_suspend.h"
> #include "i915_switcheroo.h"
> #include "i915_sysfs.h"
> @@ -589,6 +590,15 @@ static void i915_driver_hw_remove(struct drm_i915_private *dev_priv)
> pci_disable_msi(pdev);
> }
>
> +static bool is_selftest(void)
> +{
> +#if IS_ENABLED(CONFIG_DRM_I915_SELFTEST)
> + return i915_selftest.live || i915_selftest.perf || i915_selftest.mock;
> +#else
> + return false;
> +#endif
> +}
> +
> /**
> * i915_driver_register - register the driver with the rest of the system
> * @dev_priv: device private
> @@ -624,7 +634,8 @@ static void i915_driver_register(struct drm_i915_private *dev_priv)
>
> intel_pxp_debugfs_register(dev_priv->pxp);
>
> - i915_hwmon_register(dev_priv);
> + if (!is_selftest())
> + i915_hwmon_register(dev_priv);
>
> intel_display_driver_register(dev_priv);
>
> @@ -660,7 +671,8 @@ static void i915_driver_unregister(struct drm_i915_private *dev_priv)
> for_each_gt(gt, dev_priv, i)
> intel_gt_driver_unregister(gt);
>
> - i915_hwmon_unregister(dev_priv);
> + if (!is_selftest())
> + i915_hwmon_unregister(dev_priv);
>
> i915_perf_unregister(dev_priv);
> i915_pmu_unregister(dev_priv);
> --
> 2.41.0
--
Ville Syrjälä
Intel
next prev parent reply other threads:[~2024-04-10 11:42 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-04-10 4:28 [PATCH] drm/i915: Don't enable hwmon for selftests Ashutosh Dixit
2024-04-10 4:37 ` Dixit, Ashutosh
2024-04-10 4:56 ` Nilawar, Badal
2024-04-10 5:26 ` ✗ Fi.CI.BAT: failure for " Patchwork
2024-04-10 11:42 ` Ville Syrjälä [this message]
2024-04-11 5:09 ` [PATCH] " Dixit, Ashutosh
2024-04-11 10:47 ` Ville Syrjälä
2024-04-13 0:35 ` Dixit, Ashutosh
2024-04-13 0:37 ` Dixit, Ashutosh
-- strict thread matches above, loose matches on Subject: below --
2024-04-10 4:58 Ashutosh Dixit
2024-04-10 5:17 ` Nilawar, Badal
2024-04-10 6:06 ` Dixit, Ashutosh
2024-04-10 6:05 Ashutosh Dixit
2024-04-10 6:45 ` Nilawar, Badal
2024-04-10 13:53 ` Andi Shyti
2024-04-11 4:59 ` Dixit, Ashutosh
2024-04-10 20:07 Ashutosh Dixit
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=ZhZ7NsyBtQjnE8HE@intel.com \
--to=ville.syrjala@linux.intel.com \
--cc=ashutosh.dixit@intel.com \
--cc=badal.nilawar@intel.com \
--cc=intel-gfx@lists.freedesktop.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox