intel-gfx.lists.freedesktop.org archive mirror
 help / color / mirror / Atom feed
From: Chris Wilson <chris@chris-wilson.co.uk>
To: intel-gfx@lists.freedesktop.org
Subject: [PATCH] drm/i915: Release the forgotten connector reference
Date: Wed,  1 Feb 2017 19:58:31 +0000	[thread overview]
Message-ID: <20170201195831.18514-1-chris@chris-wilson.co.uk> (raw)

The reference was gained in
intel_modeset_update_connector_atomic_state() [called from
intel_modeset_setup_hw_state()] and is never lost if no client ever
performs a modeset.

[  649.836069] WARNING: CPU: 6 PID: 8865 at drivers/gpu/drm/drm_mode_config.c:424 drm_mode_config_cleanup+0x21b/0x290 [drm]
[  649.836078] Modules linked in: i915(-) intel_gtt drm_kms_helper cfbfillrect syscopyarea cfbimgblt sysfillrect sysimgblt fb_sys_fops cfbcopyarea drm
[  649.836099] CPU: 6 PID: 8865 Comm: drv_selftest Not tainted 4.10.0-rc6+ #908
[  649.836106] Hardware name: Intel Corporation 2012 Client Platform/Emerald Lake 2, BIOS ACRVMBY1.86C.0078.P00.1201161002 01/16/2012
[  649.836114] Call Trace:
[  649.836125]  dump_stack+0x4d/0x6f
[  649.836136]  __warn+0xc1/0xe0
[  649.836144]  warn_slowpath_null+0x18/0x20
[  649.836163]  drm_mode_config_cleanup+0x21b/0x290 [drm]
[  649.836213]  intel_modeset_cleanup+0x59/0xa0 [i915]
[  649.836242]  i915_driver_unload+0x84/0x170 [i915]
[  649.836277]  i915_pci_remove+0x14/0x20 [i915]
[  649.836287]  pci_device_remove+0x28/0x60
[  649.836301]  device_release_driver_internal+0x132/0x1d0
[  649.836313]  driver_detach+0x3a/0x80
[  649.836324]  bus_remove_driver+0x47/0xa0
[  649.836335]  driver_unregister+0x27/0x50
[  649.836344]  pci_unregister_driver+0x34/0xa0
[  649.836387]  i915_exit+0x1a/0x71 [i915]
[  649.836401]  SyS_delete_module+0x173/0x1c0
[  649.836413]  entry_SYSCALL_64_fastpath+0x17/0x98
[  649.836422] RIP: 0033:0x7f8d5a841ee7
[  649.836432] RSP: 002b:00007fff89161a28 EFLAGS: 00000206 ORIG_RAX: 00000000000000b0
[  649.836448] RAX: ffffffffffffffda RBX: 000055f6cd1db5c0 RCX: 00007f8d5a841ee7
[  649.836458] RDX: 0000000000000000 RSI: 0000000000000800 RDI: 000055f6cd1da7b8
[  649.836467] RBP: 00007f8d5aaee440 R08: 0000000000000000 R09: 00007fff89161a58
[  649.836476] R10: 0000000000000062 R11: 0000000000000206 R12: 0000000000000000
[  649.836486] R13: 000055f6cd1d9010 R14: 000000000000003a R15: 00007fff891609f0
[  649.836514] ---[ end trace 0e529da316e2a3d1 ]---
[  649.836536] [drm:drm_mode_config_cleanup [drm]] *ERROR* connector VGA-1 leaked!

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
---
 drivers/gpu/drm/i915/intel_display.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
index b44e9466d394..801ff845a2f3 100644
--- a/drivers/gpu/drm/i915/intel_display.c
+++ b/drivers/gpu/drm/i915/intel_display.c
@@ -17301,10 +17301,18 @@ void intel_connector_unregister(struct drm_connector *connector)
 void intel_modeset_cleanup(struct drm_device *dev)
 {
 	struct drm_i915_private *dev_priv = to_i915(dev);
+	struct intel_connector *connector;
 
 	flush_work(&dev_priv->atomic_helper.free_work);
 	WARN_ON(!llist_empty(&dev_priv->atomic_helper.free_list));
 
+	for_each_intel_connector(dev, connector) {
+		if (connector->base.state->crtc) {
+			drm_connector_unreference(&connector->base);
+			connector->base.state->crtc = NULL;
+		}
+	}
+
 	intel_disable_gt_powersave(dev_priv);
 
 	/*
-- 
2.11.0

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

             reply	other threads:[~2017-02-01 19:58 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-02-01 19:58 Chris Wilson [this message]
2017-02-01 20:23 ` ✓ Fi.CI.BAT: success for drm/i915: Release the forgotten connector reference Patchwork
2017-02-02  8:08 ` [PATCH] " Joonas Lahtinen
2017-02-02  8:16   ` Chris Wilson
2017-02-02 11:35     ` Daniel Vetter
2017-02-02 12:28       ` Chris Wilson
2017-02-02  8:20 ` Chris Wilson

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=20170201195831.18514-1-chris@chris-wilson.co.uk \
    --to=chris@chris-wilson.co.uk \
    --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;
as well as URLs for NNTP newsgroup(s).