public inbox for intel-gfx@lists.freedesktop.org
 help / color / mirror / Atom feed
From: yu.dai@intel.com
To: intel-gfx@lists.freedesktop.org
Subject: [PATCH v1] drm/i915/guc: Fix a potential issue during driver unload
Date: Fri, 18 Dec 2015 12:38:59 -0800	[thread overview]
Message-ID: <1450471139-7628-1-git-send-email-yu.dai@intel.com> (raw)
In-Reply-To: <1450315926-30894-1-git-send-email-yu.dai@intel.com>

From: Alex Dai <yu.dai@intel.com>

The device struct_mutex needs to be held before releasing any GEM
objects allocated by GuC.

    WARNING: CPU: 0 PID: 1575 at include/drm/drm_gem.h:217 gem_release_guc_obj+0x5f/0x70 [i915]()
    Call Trace:
     [<ffffffff813c8b64>] dump_stack+0x44/0x60
     [<ffffffff8107d642>] warn_slowpath_common+0x82/0xc0
     [<ffffffff8107d78a>] warn_slowpath_null+0x1a/0x20
     [<ffffffffc02369ef>] gem_release_guc_obj+0x5f/0x70 [i915]
     [<ffffffffc02380ba>] i915_guc_submission_fini+0x1a/0x70 [i915]
     [<ffffffffc0235d09>] intel_guc_ucode_fini+0x29/0xa0 [i915]
     [<ffffffffc029595d>] i915_driver_unload+0x14d/0x290 [i915]
     [<ffffffffc00912a9>] drm_dev_unregister+0x29/0xb0 [drm]
     [<ffffffffc00919d3>] drm_put_dev+0x23/0x60 [drm]
     [<ffffffffc01d51b5>] i915_pci_remove+0x15/0x20 [i915]
     [<ffffffff81419b49>] pci_device_remove+0x39/0xc0
     [<ffffffff81527f51>] __device_release_driver+0xa1/0x150
     [<ffffffff81528a85>] driver_detach+0xb5/0xc0
     [<ffffffff815279b5>] bus_remove_driver+0x55/0xd0
     [<ffffffff8152921c>] driver_unregister+0x2c/0x50
     [<ffffffff814181e9>] pci_unregister_driver+0x29/0x90
     [<ffffffffc0093174>] drm_pci_exit+0x94/0xb0 [drm]
     [<ffffffffc02960c4>] i915_exit+0x20/0xf5c [i915]
     [<ffffffff81102bc5>] SyS_delete_module+0x1b5/0x210
     [<ffffffff817fc2b6>] entry_SYSCALL_64_fastpath+0x16/0x75
    ---[ end trace f711c4eb63588bb7 ]---

v1: Add backtrace log.

Signed-off-by: Alex Dai <yu.dai@intel.com>

diff --git a/drivers/gpu/drm/i915/intel_guc_loader.c b/drivers/gpu/drm/i915/intel_guc_loader.c
index 625272f4..4748651 100644
--- a/drivers/gpu/drm/i915/intel_guc_loader.c
+++ b/drivers/gpu/drm/i915/intel_guc_loader.c
@@ -631,10 +631,10 @@ void intel_guc_ucode_fini(struct drm_device *dev)
 	struct drm_i915_private *dev_priv = dev->dev_private;
 	struct intel_guc_fw *guc_fw = &dev_priv->guc.guc_fw;
 
+	mutex_lock(&dev->struct_mutex);
 	direct_interrupts_to_host(dev_priv);
 	i915_guc_submission_fini(dev);
 
-	mutex_lock(&dev->struct_mutex);
 	if (guc_fw->guc_fw_obj)
 		drm_gem_object_unreference(&guc_fw->guc_fw_obj->base);
 	guc_fw->guc_fw_obj = NULL;
-- 
2.5.0

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx

  parent reply	other threads:[~2015-12-18 20:42 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-12-17  1:32 [PATCH] drm/i915/guc: Fix a warning message problem during driver unload yu.dai
2015-12-18  9:55 ` Jani Nikula
2015-12-18 20:06   ` Yu Dai
2015-12-18 20:38 ` yu.dai [this message]
2015-12-21 12:03   ` [PATCH v1] drm/i915/guc: Fix a potential issue " Daniel Vetter
2015-12-19  9:20 ` ✗ warning: Fi.CI.BAT Patchwork

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=1450471139-7628-1-git-send-email-yu.dai@intel.com \
    --to=yu.dai@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