From patchwork Fri Apr 22 13:03:02 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chris Wilson X-Patchwork-Id: 8911721 Return-Path: X-Original-To: patchwork-intel-gfx@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 6D470BF29F for ; Fri, 22 Apr 2016 13:03:19 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 8ECB62020F for ; Fri, 22 Apr 2016 13:03:18 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id A3E50201F2 for ; Fri, 22 Apr 2016 13:03:16 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 6DB446EEC8; Fri, 22 Apr 2016 13:03:14 +0000 (UTC) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@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 6B5856EEC8 for ; Fri, 22 Apr 2016 13:03:13 +0000 (UTC) Received: by mail-wm0-x242.google.com with SMTP id n3so4645597wmn.1 for ; Fri, 22 Apr 2016 06:03:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:from:to:cc:subject:date:message-id; bh=tEuJLXgAeym3rF6Lft2eqGbUWGK/LrdAcz+2GlrwwwQ=; b=x9iQjHPjLsHrzr5TuAIifpBrg1CuXnKw9acRuiRyMTSAeMiGUDYJKEHbiNMomPuDTR FrPbtHFZqlIPeY6i5TzwKqp34kBk/0I/AnxFgvD3NIHxHKLoHbQPMLtZEvrnmd+ubXlH v4P+fIDOj7y4x3eSvcSYWC36/JDBPuRkDMjk4tL/Ttt5i2MTXtO4PVaxw0m2+vka9IKh t/U2hoSV382NJCFjtKhv7/y11oxsHgxyZp/1Xxd/asY+1qoTKuUnH2+MUsghV702ljMe JWfovwfYJUkrktziTV08Okuqql/L3XHimcb9G4S1LsmjkrGFhDOHovXwUpASWS5PL6L9 uO1w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id; bh=tEuJLXgAeym3rF6Lft2eqGbUWGK/LrdAcz+2GlrwwwQ=; b=Rbu4uQ2ga3/2wUA1pamkDO9AiR/0N25MwvaOPexU+Wn2B0Smu4Ji6TaUFfW4PpuT5h 3ppKGPiYkwk6Y31C53v4EOxAe74KzoTBVkEBIaCpE9yG8dIpgrB9AC2MqoXHCtZMVard RceoMZT8/RLVG34vfZoO3Md6if+vYM+XL1zcQtKdyhqic12Zn7S31A0ZAwlUAYqcoAbn p5YMnHn0sDYx/Tm71AgcI/MMnzqqWjsBFGTT4NlG6F5x83HrxsXqNA7NrlsKfqwmp5rn EuPq5/F/51bNYrco2JTikw8ef/JLbDYM8wpXLHYJFE5lBfTZ3Gslae9nKAhaEZqKZw3I ZezQ== X-Gm-Message-State: AOPr4FVsi2zaCPdrBdycdmCl9lK8/+KzPSMEltTEsX5a+DyuH4Tq0eLnzZsJITUfIK9wjg== X-Received: by 10.28.24.80 with SMTP id 77mr3683360wmy.16.1461330191795; Fri, 22 Apr 2016 06:03:11 -0700 (PDT) Received: from haswell.alporthouse.com ([78.156.65.138]) by smtp.gmail.com with ESMTPSA id us3sm7998400wjc.41.2016.04.22.06.03.09 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 22 Apr 2016 06:03:09 -0700 (PDT) From: Chris Wilson To: intel-gfx@lists.freedesktop.org Date: Fri, 22 Apr 2016 14:03:02 +0100 Message-Id: <1461330182-17205-1-git-send-email-chris@chris-wilson.co.uk> X-Mailer: git-send-email 2.8.1 Cc: Mika Kuoppala Subject: [Intel-gfx] [PATCH] drm/i915: Warn there are any unfreed contexts when we shutdown X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" X-Spam-Status: No, score=-5.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED,RP_MATCHES_RCVD,T_DKIM_INVALID,UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP When tearing down the device, emit a warning if there are any contexts remaining, as they all should be freed by this point. Signed-off-by: Chris Wilson Cc: Mika Kuoppala Cc: Tvrtko Ursulin Cc: Joonas Lahtinen Reviewed-by: Daniel Vetter Reviewed-by: Joonas Lahtinen --- drivers/gpu/drm/i915/i915_gem_context.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/gpu/drm/i915/i915_gem_context.c b/drivers/gpu/drm/i915/i915_gem_context.c index e5acc3916f75..82339b45cc9b 100644 --- a/drivers/gpu/drm/i915/i915_gem_context.c +++ b/drivers/gpu/drm/i915/i915_gem_context.c @@ -437,6 +437,8 @@ void i915_gem_context_fini(struct drm_device *dev) i915_gem_context_unreference(dctx); dev_priv->kernel_context = NULL; + + WARN_ON(!list_empty(&dev_priv->context_list)); } int i915_gem_context_enable(struct drm_i915_gem_request *req)