Re: [PATCH 05/15] drm/i915/guc: Log runtime should consist of both mapping and relay

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, 27 Feb 2018 13:52:20 +0100, Michał Winiarski <michal.winiarski@xxxxxxxxx> wrote:

Currently, we're treating relay and mapping of GuC log as a separate
concepts. We're also using inconsistent locking, sometimes using
relay_lock, sometimes using struct mutex.
Let's correct that. Anything touching the runtime is now serialized
using runtime.lock, while we're still using struct mutex as inner lock
for mapping.
We're still racy in setting the log level - but we'll take care of that
in the following patches.

Signed-off-by: Michał Winiarski <michal.winiarski@xxxxxxxxx>
Cc: Chris Wilson <chris@xxxxxxxxxxxxxxxxxx>
Cc: Daniele Ceraolo Spurio <daniele.ceraolospurio@xxxxxxxxx>
Cc: Sagar Arun Kamble <sagar.a.kamble@xxxxxxxxx>
Cc: Michal Wajdeczko <michal.wajdeczko@xxxxxxxxx>
---

/snip/

diff --git a/drivers/gpu/drm/i915/intel_uc.c b/drivers/gpu/drm/i915/intel_uc.c
index e9aba3c35264..55a9b5b673e0 100644
--- a/drivers/gpu/drm/i915/intel_uc.c
+++ b/drivers/gpu/drm/i915/intel_uc.c
@@ -221,18 +221,24 @@ static void guc_free_load_err_log(struct intel_guc *guc)
int intel_uc_log_register(struct drm_i915_private *dev_priv)
 {
-	if (!USES_GUC(dev_priv) || !i915_modparams.guc_log_level)
+	int ret = 0;
+
+	if (!USES_GUC(dev_priv))
 		return 0;
-	return intel_guc_log_register(&dev_priv->guc);
+	if (i915_modparams.guc_log_level)
+		ret = intel_guc_log_register(&dev_priv->guc);
+
+	return ret;
 }
void intel_uc_log_unregister(struct drm_i915_private *dev_priv)
 {
-	if (!USES_GUC(dev_priv) || !i915_modparams.guc_log_level)
+	if (!USES_GUC(dev_priv))
 		return;
-	intel_guc_log_unregister(&dev_priv->guc);
+	if (i915_modparams.guc_log_level)
+		intel_guc_log_unregister(&dev_priv->guc);
 }
static int guc_enable_communication(struct intel_guc *guc)

this chunk can be done in patch 2/15
_______________________________________________
Intel-gfx mailing list
Intel-gfx@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/intel-gfx




[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]
  Powered by Linux