From patchwork Thu Jan 19 09:05:13 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chris Wilson X-Patchwork-Id: 9525307 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 5A2E760437 for ; Thu, 19 Jan 2017 09:05:21 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3DF9228529 for ; Thu, 19 Jan 2017 09:05:21 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 32C2028531; Thu, 19 Jan 2017 09:05:21 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.1 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED, T_DKIM_INVALID autolearn=unavailable version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 09E2C28529 for ; Thu, 19 Jan 2017 09:05:20 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id D83F76E117; Thu, 19 Jan 2017 09:05:18 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-wm0-x242.google.com (mail-wm0-x242.google.com [IPv6:2a00:1450:400c:c09::242]) by gabe.freedesktop.org (Postfix) with ESMTPS id F2A796E083; Thu, 19 Jan 2017 09:05:16 +0000 (UTC) Received: by mail-wm0-x242.google.com with SMTP id r144so10437721wme.0; Thu, 19 Jan 2017 01:05:16 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id; bh=srtpPBr/6bnedJheysRQHRo+ec5QaiLy9JjFpKCLP9o=; b=OFp54Og6O3N1g1xGJVpQMjD0fnvmJGyT9+Apw5Mzoj+0hensXKq78M9E8tJ1qYYD0x 4g2pSCzA4AXlD19kFnd+t+cXWsbh7voO7diGczlR3ODPccPzuLkxVWHmjiFVHhEAbX3g lwehL3YAnb9Fy55nsGnCL43QgvJLn2n0oKWZF0bmcmzX2CPt+7BHVEHe3/7vPA84iued J9CmySCoj4wdK+AsP2DKjtToQo6hTRKDEzrUpxNV1gEOxclN6Bj0eGWMA1WB29E+PjQF G/FeaLByTkAm57TL2VZoAZGb2aGIwgcVMNJWu86wr6L/u9bzzg9aneC0YlsjkV/ReX0b kz2A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id; bh=srtpPBr/6bnedJheysRQHRo+ec5QaiLy9JjFpKCLP9o=; b=b+guVm/dXFIGG+lTFS9sIWuXikuySGpdZ/6vLI3f1i3vWtDvJs4cP7+UkBxOt9QSN7 /CMx9NEnDJL/eJFdVlkoQe40+gVpN5qibe2i4bDj/QEDG+V5EYzzcCLf6qmh8Ldev7jt V3xVM4aFt+rAO78GKhsDiVwogml/vRXst3P4O7zgQqg5UvYpg71fn0iIfseuR8Tbux4b BnKJS5qHvInyG54q13bxvBYfYhxjvP36c/hDU5M7DbC/5HpQOJyJJp1BaSjwzGjx8ZZU l4kLFweoSC6CqMz0zROTvFAQbg59SAhRgqHLXg3XbQZYHCp4vtZflegS666+vmsxgg4b uswA== X-Gm-Message-State: AIkVDXL1eITTfsk+VJlUj7JhMlJD+PiRIALW/cwgtBTe5SdmUbFbTupXSXnqKUoZBDVbDQ== X-Received: by 10.223.173.232 with SMTP id w95mr6369772wrc.165.1484816715613; Thu, 19 Jan 2017 01:05:15 -0800 (PST) Received: from haswell.alporthouse.com ([78.156.65.138]) by smtp.gmail.com with ESMTPSA id r6sm11346790wmd.4.2017.01.19.01.05.14 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 19 Jan 2017 01:05:15 -0800 (PST) From: Chris Wilson To: dri-devel@lists.freedesktop.org Subject: [PATCH] drm: Show leaked connectors upon unload Date: Thu, 19 Jan 2017 09:05:13 +0000 Message-Id: <20170119090513.4154-1-chris@chris-wilson.co.uk> X-Mailer: git-send-email 2.11.0 Cc: intel-gfx@lists.freedesktop.org X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP After warning that the connector list is not empty on device unregistration (i.e. module unload) also print out which connectors are still hanging around to aide finding the leak. Signed-off-by: Chris Wilson Reviewed-by: Joonas Lahtinen --- drivers/gpu/drm/drm_mode_config.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/drm_mode_config.c b/drivers/gpu/drm/drm_mode_config.c index ed1ee5a44a7b..884cc4d26fb5 100644 --- a/drivers/gpu/drm/drm_mode_config.c +++ b/drivers/gpu/drm/drm_mode_config.c @@ -421,7 +421,12 @@ void drm_mode_config_cleanup(struct drm_device *dev) drm_connector_unreference(connector); } drm_connector_list_iter_put(&conn_iter); - WARN_ON(!list_empty(&dev->mode_config.connector_list)); + if (WARN_ON(!list_empty(&dev->mode_config.connector_list))) { + drm_connector_list_iter_get(dev, &conn_iter); + drm_for_each_connector_iter(connector, &conn_iter) + DRM_ERROR("connector %s leaked!\n", connector->name); + drm_connector_list_iter_put(&conn_iter); + } list_for_each_entry_safe(property, pt, &dev->mode_config.property_list, head) {